changeset 860:7edce7e58ab1

Add more toConstElem stubs to get better error messages.
author Christian Kamm <kamm incasoftware de>
date Thu, 18 Dec 2008 07:59:03 +0100
parents a719f2ca3e92
children fa019f0ce718
files dmd/expression.h gen/toir.cpp
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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; }