Skip to content

Commit

Permalink
Do not use emit for declarations.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Apr 26, 2024
1 parent fd59671 commit cc4a991
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ir/expression.def
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ class Constant : Literal {
Literal(si, t), value(v), base(base) { CHECK_NULL(t); handleOverflow(noWarning); }
#emit
static Constant GetMask(unsigned width);
#end

/// @return a constant. Any constant returned here is interned. Base is always 10.
static const Constant *get(const Type *t, big_int v, Util::SourceInfo si = {});
#end

bool fitsInt() const { return value >= INT_MIN && value <= INT_MAX; }
bool fitsLong() const { return value >= LONG_MIN && value <= LONG_MAX; }
Expand Down Expand Up @@ -262,10 +262,8 @@ class BoolLiteral : Literal {
bool value;
toString{ return value ? "true" : "false"; }

#emit
/// @return a bool literal. Both booleans are interned.
static const BoolLiteral *get(bool value, const Util::SourceInfo &si = {});
#end
}

class StringLiteral : Literal {
Expand All @@ -275,10 +273,10 @@ class StringLiteral : Literal {
StringLiteral(ID v) : Literal(v.srcInfo), value(v.name) {}
#emit
operator IR::ID() const { return IR::ID(srcInfo, value); }
#end

/// @returns a string literal. The value is cached.
static const StringLiteral *get(cstring value, const Type *t = Type_String::get(), const Util::SourceInfo &si = {});
#end
}

class PathExpression : Expression {
Expand Down

0 comments on commit cc4a991

Please sign in to comment.