]> granicus.if.org Git - clang/commitdiff
When emitting an aggregate into a temporary, make sure we set the alignment
authorJohn McCall <rjmccall@apple.com>
Mon, 15 Feb 2010 01:23:36 +0000 (01:23 +0000)
committerJohn McCall <rjmccall@apple.com>
Mon, 15 Feb 2010 01:23:36 +0000 (01:23 +0000)
on the alloca.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96204 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGExpr.cpp

index ad4fd63cbf6299751b37311bd0418dda4d44ba68..830954fd10cc550a55168538dff1cb899ce35c4c 100644 (file)
@@ -95,7 +95,7 @@ RValue CodeGenFunction::EmitAnyExprToTemp(const Expr *E,
 
   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);
 }