diff gen/nested.cpp @ 1350:15e9762bb620

Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Thu, 14 May 2009 13:26:40 +0200
parents 919fafcc505c
children 630fc54f7c1e
line wrap: on
line diff
--- a/gen/nested.cpp	Wed May 13 18:08:40 2009 +0200
+++ b/gen/nested.cpp	Thu May 14 13:26:40 2009 +0200
@@ -167,7 +167,7 @@
     if (nestedCtx == NCArray) {
         // alloca as usual if no value already
         if (!vd->ir.irLocal->value)
-            vd->ir.irLocal->value = DtoAlloca(DtoType(vd->type), vd->toChars());
+            vd->ir.irLocal->value = DtoAlloca(vd->type, vd->toChars());
         
         // store the address into the nested vars array
         assert(vd->ir.irLocal->nestedIndex >= 0);
@@ -324,7 +324,8 @@
             const LLType* nestedVarsTy = LLArrayType::get(getVoidPtrType(), nelems);
         
             // alloca it
-            LLValue* nestedVars = DtoAlloca(nestedVarsTy, ".nested_vars");
+            // FIXME align ?
+            LLValue* nestedVars = DtoRawAlloca(nestedVarsTy, 0, ".nested_vars");
             
             IrFunction* irfunction = fd->ir.irFunc;
             
@@ -459,7 +460,8 @@
             // FIXME: For D2, this should be a gc_malloc (or similar) call, not alloca
             //        (Note that it'd also require more aggressive copying of
             //        by-value parameters instead of just alloca'd ones)
-            LLValue* frame = DtoAlloca(frameType, ".frame");
+            // FIXME: alignment ?
+            LLValue* frame = DtoRawAlloca(frameType, 0, ".frame");
             
             // copy parent frames into beginning
             if (depth != 0) {