From 8f62c080e2f35bae8ff594664cf095a8984d3591 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 18 Dec 2008 07:59:03 +0100 Subject: [PATCH] Add more toConstElem stubs to get better error messages. --- dmd/expression.h | 6 ++++++ gen/toir.cpp | 3 +++ 2 files changed, 9 insertions(+) diff --git a/dmd/expression.h b/dmd/expression.h index 50b56d5d..b2316219 100644 --- a/dmd/expression.h +++ b/dmd/expression.h @@ -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 diff --git a/gen/toir.cpp b/gen/toir.cpp index f266f7b5..d6edaade 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -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; }