mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-13 11:23:14 +01:00
Remove superfluous Expression::toConstElem overrides.
The error message can be printed by the non-overridden Expression::toConstElem just as well.
This commit is contained in:
@@ -562,7 +562,6 @@ struct AssocArrayLiteralExp : Expression
|
||||
|
||||
#if IN_LLVM
|
||||
DValue* toElem(IRState* irs);
|
||||
llvm::Constant *toConstElem(IRState *irs);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -1398,7 +1397,6 @@ struct SliceExp : UnaExp
|
||||
|
||||
#if IN_LLVM
|
||||
DValue* toElem(IRState* irs);
|
||||
llvm::Constant *toConstElem(IRState *irs);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -1501,7 +1499,6 @@ struct IndexExp : BinExp
|
||||
elem *toElem(IRState *irs);
|
||||
#elif IN_LLVM
|
||||
DValue* toElem(IRState* irs);
|
||||
llvm::Constant *toConstElem(IRState *irs);
|
||||
void cacheLvalue(IRState* irs);
|
||||
#endif
|
||||
};
|
||||
@@ -2127,7 +2124,6 @@ struct GEPExp : UnaExp
|
||||
Expression *toLvalue(Scope *sc, Expression *e);
|
||||
|
||||
DValue* toElem(IRState* irs);
|
||||
llvm::Constant *toConstElem(IRState *irs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
17
gen/toir.cpp
17
gen/toir.cpp
@@ -3206,17 +3206,14 @@ STUB(SymbolExp)
|
||||
STUB(PowExp)
|
||||
STUB(PowAssignExp)
|
||||
|
||||
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) { \
|
||||
error("expression '%s' is not a constant", toChars()); \
|
||||
if (!global.gag) \
|
||||
fatal(); \
|
||||
return NULL; \
|
||||
llvm::Constant* Expression::toConstElem(IRState * p)
|
||||
{
|
||||
error("expression '%s' is not a constant", toChars());
|
||||
if (!global.gag)
|
||||
fatal();
|
||||
return NULL;
|
||||
}
|
||||
CONSTSTUB(Expression)
|
||||
CONSTSTUB(GEPExp)
|
||||
CONSTSTUB(SliceExp)
|
||||
CONSTSTUB(IndexExp)
|
||||
CONSTSTUB(AssocArrayLiteralExp)
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user