diff --git a/src/dmd/expression.d b/src/dmd/expression.d index 185e6a112c17..a2cc903af92e 100644 --- a/src/dmd/expression.d +++ b/src/dmd/expression.d @@ -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) diff --git a/src/dmd/expression.h b/src/dmd/expression.h index f41e26a303e7..e957ae2c7e99 100644 --- a/src/dmd/expression.h +++ b/src/dmd/expression.h @@ -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(); diff --git a/src/dmd/identifier.h b/src/dmd/identifier.h index 8c47572e389b..a985af6b0a26 100644 --- a/src/dmd/identifier.h +++ b/src/dmd/identifier.h @@ -16,6 +16,7 @@ #endif /* __DMC__ */ #include "root.h" +#include "rmem.h" #include "stringtable.h" class Identifier : public RootObject @@ -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) { diff --git a/src/tests/cxxfrontend.c b/src/tests/cxxfrontend.c index 255771fff6dc..eb05b895a566 100644 --- a/src/tests/cxxfrontend.c +++ b/src/tests/cxxfrontend.c @@ -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);