[cfe-commits] r96204 - /cfe/trunk/lib/CodeGen/CGExpr.cpp

John McCall rjmccall at apple.com
Sun Feb 14 17:23:36 PST 2010


Author: rjmccall
Date: Sun Feb 14 19:23:36 2010
New Revision: 96204

URL: http://llvm.org/viewvc/llvm-project?rev=96204&view=rev
Log:
When emitting an aggregate into a temporary, make sure we set the alignment
on the alloca.

The fact that codegen makes this class of bug so wonderfully easy to make is
embarrassing.


Modified:
    cfe/trunk/lib/CodeGen/CGExpr.cpp

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=96204&r1=96203&r2=96204&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Feb 14 19:23:36 2010
@@ -95,7 +95,7 @@
 
   if (hasAggregateLLVMType(E->getType()) &&
       !E->getType()->isAnyComplexType())
-    AggLoc = CreateTempAlloca(ConvertTypeForMem(E->getType()), "agg.tmp");
+    AggLoc = CreateMemTemp(E->getType(), "agg.tmp");
   return EmitAnyExpr(E, AggLoc, IsAggLocVolatile, /*IgnoreResult=*/false,
                      IsInitializer);
 }





More information about the cfe-commits mailing list