diff gen/toir.cpp @ 162:1856c62af24b trunk

[svn r178] Fixed codegen values for function arguments, the old approach was completely broken, amazing it even worked...
author lindquist
date Mon, 05 May 2008 00:56:53 +0200
parents ccd07d9f2ce9
children a8cd9bc1021a
line wrap: on
line diff
--- a/gen/toir.cpp	Sun May 04 21:25:48 2008 +0200
+++ b/gen/toir.cpp	Mon May 05 00:56:53 2008 +0200
@@ -253,6 +253,7 @@
         assert(sdecltype->ty == Tstruct);
         TypeStruct* ts = (TypeStruct*)sdecltype;
         assert(ts->sym);
+        DtoForceConstInitDsymbol(ts->sym);
         assert(gIR->irDsymbol[ts->sym].irStruct->init);
         return new DVarValue(type, gIR->irDsymbol[ts->sym].irStruct->init, true);
     }
@@ -2291,6 +2292,15 @@
         }
         eval = DtoDynArrayIs(op,l,r);
     }
+    else if (t1->ty == Tdelegate) {
+        if (v->isNull()) {
+            r = NULL;
+        }
+        else {
+            assert(l->getType() == r->getType());
+        }
+        eval = DtoDynArrayIs(op,l,r);
+    }
     else if (t1->isfloating())
     {
         llvm::FCmpInst::Predicate pred = (op == TOKidentity) ? llvm::FCmpInst::FCMP_OEQ : llvm::FCmpInst::FCMP_ONE;