diff gen/statements.cpp @ 585:fbb1a366cfbc

Complex number should now follow the D ABI on x86. They're also treated as first class values now. Big change.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Tue, 09 Sep 2008 16:49:47 -0700
parents bc0835cd3440
children 1b62222581fb
line wrap: on
line diff
--- a/gen/statements.cpp	Mon Sep 08 20:38:55 2008 +0200
+++ b/gen/statements.cpp	Tue Sep 09 16:49:47 2008 -0700
@@ -62,7 +62,7 @@
 
             if (global.params.symdebug) DtoDwarfStopPoint(loc.linnum);
 
-            DValue* rvar = new DVarValue(f->type->next, f->decl->ir.irFunc->retArg, true);
+            DValue* rvar = new DVarValue(f->type->next, f->decl->ir.irFunc->retArg);
 
             DValue* e = exp->toElem(p);
 
@@ -687,7 +687,7 @@
     {
         // give storage
         llval = DtoAlloca(DtoType(e->type), "tmp");
-        DVarValue* vv = new DVarValue(e->type, llval, true);
+        DVarValue* vv = new DVarValue(e->type, llval);
         DtoAssign(e->loc, vv, val);
     }
     else
@@ -1002,9 +1002,9 @@
     value->ir.irLocal->value = DtoGEP1(val,loadedKey);
 
     if (!value->isRef() && !value->isOut()) {
-        DValue* dst = new DVarValue(value->type, valvar, true);
-        DValue* src = new DVarValue(value->type, value->ir.irLocal->value, true);
-        DtoAssign(loc, dst, src);
+        DVarValue dst(value->type, valvar);
+        DVarValue src(value->type, value->ir.irLocal->value);
+        DtoAssign(loc, &dst, &src);
         value->ir.irLocal->value = valvar;
     }
 
@@ -1151,7 +1151,8 @@
     DValue* e = exp->toElem(p);
     assert(!wthis->ir.isSet());
     wthis->ir.irLocal = new IrLocal(wthis);
-    wthis->ir.irLocal->value = e->getRVal();
+    wthis->ir.irLocal->value = DtoAlloca(DtoType(wthis->type), wthis->toChars());
+    DtoStore(e->getRVal(), wthis->ir.irLocal->value);
 
     body->toIR(p);
 }