diff gen/statements.cpp @ 479:672eb4893b55

Move AllocaInst creation into DtoAlloca helper. Will enable special zero-init of fp80 reals' padding.
author Christian Kamm <kamm incasoftware de>
date Tue, 05 Aug 2008 19:28:19 +0200
parents 0e6b4d65d3f8
children a34078905d01
line wrap: on
line diff
--- a/gen/statements.cpp	Tue Aug 05 08:08:00 2008 +0200
+++ b/gen/statements.cpp	Tue Aug 05 19:28:19 2008 +0200
@@ -144,7 +144,7 @@
 
     if (match)
     {
-        LLValue* allocainst = new llvm::AllocaInst(DtoType(match->type), "._tmp_if_var", p->topallocapoint());
+        LLValue* allocainst = DtoAlloca(DtoType(match->type), "._tmp_if_var");
         match->ir.irLocal = new IrLocal(match);
         match->ir.irLocal->value = allocainst;
     }
@@ -675,7 +675,7 @@
     if (DSliceValue* sval = val->isSlice())
     {
         // give storage
-        llval = new llvm::AllocaInst(DtoType(e->type), "tmp", gIR->topallocapoint());
+        llval = DtoAlloca(DtoType(e->type), "tmp");
         DVarValue* vv = new DVarValue(e->type, llval, true);
         DtoAssign(e->loc, vv, val);
     }
@@ -913,7 +913,7 @@
 
     // key
     const LLType* keytype = key ? DtoType(key->type) : DtoSize_t();
-    LLValue* keyvar = new llvm::AllocaInst(keytype, "foreachkey", p->topallocapoint());
+    LLValue* keyvar = DtoAlloca(keytype, "foreachkey");
     if (key)
     {
         //key->llvmValue = keyvar;
@@ -928,7 +928,7 @@
     const LLType* valtype = DtoType(value->type);
     LLValue* valvar = NULL;
     if (!value->isRef() && !value->isOut())
-        valvar = new llvm::AllocaInst(valtype, "foreachval", p->topallocapoint());
+        valvar = DtoAlloca(valtype, "foreachval");
     if (!value->ir.irLocal)
         value->ir.irLocal = new IrLocal(value);
 
@@ -1248,7 +1248,7 @@
     llvm::AllocaInst* alloc = gIR->func()->srcfileArg;
     if (!alloc)
     {
-        alloc = new llvm::AllocaInst(c->getType(), ".srcfile", gIR->topallocapoint());
+        alloc = DtoAlloca(c->getType(), ".srcfile");
         gIR->func()->srcfileArg = alloc;
     }
     LLValue* ptr = DtoGEPi(alloc, 0,0, "tmp");