Add more toConstElem stubs to get better error messages.

This commit is contained in:
Christian Kamm
2008-12-18 07:59:03 +01:00
parent 7069073f75
commit 8f62c080e2
2 changed files with 9 additions and 0 deletions

View File

@@ -1036,6 +1036,9 @@ struct SliceExp : UnaExp
int inlineCost(InlineCostState *ics);
Expression *doInline(InlineDoState *ids);
Expression *inlineScan(InlineScanState *iss);
// LDC
virtual llvm::Constant *toConstElem(IRState *irs);
};
struct ArrayLengthExp : UnaExp
@@ -1107,6 +1110,8 @@ struct IndexExp : BinExp
void scanForNestedRef(Scope *sc);
elem *toElem(IRState *irs);
// LDC
virtual llvm::Constant *toConstElem(IRState *irs);
};
/* For both i++ and i--
@@ -1516,6 +1521,7 @@ struct GEPExp : UnaExp
Expression *toLvalue(Scope *sc, Expression *e);
elem *toElem(IRState *irs);
llvm::Constant *toConstElem(IRState *irs);
};
#endif

View File

@@ -2714,6 +2714,9 @@ STUB(SymbolExp);
#define CONSTSTUB(x) LLConstant* x::toConstElem(IRState * p) {error("const Exp type "#x" not implemented: '%s' type: '%s'", toChars(), type->toChars()); fatal(); return NULL; }
CONSTSTUB(Expression);
CONSTSTUB(GEPExp);
CONSTSTUB(SliceExp);
CONSTSTUB(IndexExp);
CONSTSTUB(AssocArrayLiteralExp);
unsigned Type::totym() { return 0; }