# HG changeset patch # User Christian Kamm # Date 1229583543 -3600 # Node ID 7edce7e58ab1937a3b35355300985aebb366a9bf # Parent a719f2ca3e927147a99995418fde8a8574dceb07 Add more toConstElem stubs to get better error messages. diff -r a719f2ca3e92 -r 7edce7e58ab1 dmd/expression.h --- a/dmd/expression.h Wed Dec 17 21:24:17 2008 +0100 +++ b/dmd/expression.h Thu Dec 18 07:59:03 2008 +0100 @@ -1036,6 +1036,9 @@ 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 @@ void scanForNestedRef(Scope *sc); elem *toElem(IRState *irs); + // LDC + virtual llvm::Constant *toConstElem(IRState *irs); }; /* For both i++ and i-- @@ -1516,6 +1521,7 @@ Expression *toLvalue(Scope *sc, Expression *e); elem *toElem(IRState *irs); + llvm::Constant *toConstElem(IRState *irs); }; #endif diff -r a719f2ca3e92 -r 7edce7e58ab1 gen/toir.cpp --- a/gen/toir.cpp Wed Dec 17 21:24:17 2008 +0100 +++ b/gen/toir.cpp Thu Dec 18 07:59:03 2008 +0100 @@ -2714,6 +2714,9 @@ #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; }