diff gen/toir.cpp @ 460:3a5d6ff8c70f

Automated merge with http://hg.dsource.org/projects/llvmdc
author Christian Kamm <kamm incasoftware de>
date Sat, 02 Aug 2008 22:54:46 +0200
parents 121624c14053 9db9099583ca
children e381e082d5cb
line wrap: on
line diff
--- a/gen/toir.cpp	Sat Aug 02 22:35:24 2008 +0200
+++ b/gen/toir.cpp	Sat Aug 02 22:54:46 2008 +0200
@@ -847,6 +847,17 @@
     return new DFieldValue(type, v->getLVal(), false);
 }
 
+LLConstant* AddrExp::toConstElem(IRState* p)
+{
+    assert(e1->op == TOKvar);
+    VarExp* vexp = (VarExp*)e1;
+    VarDeclaration* vd = vexp->var->isVarDeclaration();
+    assert(vd);
+    LLConstant* llc = llvm::dyn_cast<LLConstant>(vd->ir.getIrValue());
+    assert(llc);
+    return llc;
+}
+
 //////////////////////////////////////////////////////////////////////////////////////////
 
 DValue* PtrExp::toElem(IRState* p)