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:
David Nadlinger
2013-06-11 23:30:38 +02:00
parent e0d78ef0e3
commit 28f39cbdad
2 changed files with 7 additions and 14 deletions

View File

@@ -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

View File

@@ -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)
//////////////////////////////////////////////////////////////////////////////////////////