Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/dmd/expression.d
Original file line number Diff line number Diff line change
Expand Up @@ -2561,6 +2561,11 @@ extern (C++) final class IntegerExp : Expression
return new IntegerExp(loc, value, type);
}

static IntegerExp createi(Loc loc, int value, Type type)
{
return new IntegerExp(loc, value, type);
}

override bool equals(RootObject o)
{
if (this == o)
Expand Down
1 change: 1 addition & 0 deletions src/dmd/expression.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ class IntegerExp : public Expression
dinteger_t value;

static IntegerExp *create(Loc loc, dinteger_t value, Type *type);
static IntegerExp *createi(Loc loc, int value, Type *type);
bool equals(RootObject *o);
dinteger_t toInteger();
real_t toReal();
Expand Down
3 changes: 2 additions & 1 deletion src/dmd/identifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#endif /* __DMC__ */

#include "root.h"
#include "rmem.h"
#include "stringtable.h"

class Identifier : public RootObject
Expand All @@ -38,7 +39,7 @@ class Identifier : public RootObject
static StringTable stringtable;
static Identifier *generateId(const char *prefix);
static Identifier *generateId(const char *prefix, size_t i);
static Identifier *idPool(const char *s, size_t len);
static Identifier *idPool(const char *s, d_size_t len);

static inline Identifier *idPool(const char *s)
{
Expand Down
2 changes: 1 addition & 1 deletion src/tests/cxxfrontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void test_visitors()
Loc loc;
Identifier *ident = Identifier::idPool("test");

IntegerExp *ie = IntegerExp::create(loc, 42, Type::tint32);
IntegerExp *ie = IntegerExp::createi(loc, 42, Type::tint32);
ie->accept(&tv);
assert(tv.expr == true);

Expand Down