[cfe-commits] r95401 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CGExpr.cpp CGExprCXX.cpp CGObjC.cpp

Daniel Dunbar daniel at zuster.org
Fri Feb 5 10:56:50 PST 2010


Author: ddunbar
Date: Fri Feb  5 12:56:49 2010
New Revision: 95401

URL: http://llvm.org/viewvc/llvm-project?rev=95401&view=rev
Log:
IRgen: Fix some CreateTempAlloca calls to use ConvertTypeForMem when that is
conceptually correct. Review appreciated (Chris, Eli, Anders).

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGExprCXX.cpp
    cfe/trunk/lib/CodeGen/CGObjC.cpp

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Fri Feb  5 12:56:49 2010
@@ -657,7 +657,8 @@
 
   // Unknown builtin, for now just dump it out and return undef.
   if (hasAggregateLLVMType(E->getType()))
-    return RValue::getAggregate(CreateTempAlloca(ConvertType(E->getType())));
+    return RValue::getAggregate(CreateTempAlloca(ConvertTypeForMem(
+                                                   E->getType())));
   return RValue::get(llvm::UndefValue::get(ConvertType(E->getType())));
 }
 

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Feb  5 12:56:49 2010
@@ -1359,7 +1359,8 @@
     llvm::Value *Vec = EmitScalarExpr(E->getBase());
     
     // Store the vector to memory (because LValue wants an address).
-    llvm::Value *VecMem =CreateTempAlloca(ConvertType(E->getBase()->getType()));
+    llvm::Value *VecMem = CreateTempAlloca(ConvertTypeForMem(
+                                             E->getBase()->getType()));
     Builder.CreateStore(Vec, VecMem);
     Base = LValue::MakeAddr(VecMem, Qualifiers());
   }

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprCXX.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprCXX.cpp Fri Feb  5 12:56:49 2010
@@ -163,7 +163,7 @@
 
   // Get the member function pointer.
   llvm::Value *MemFnPtr = 
-    CreateTempAlloca(ConvertType(MemFnExpr->getType()), "mem.fn");
+    CreateTempAlloca(ConvertTypeForMem(MemFnExpr->getType()), "mem.fn");
   EmitAggExpr(MemFnExpr, MemFnPtr, /*VolatileDest=*/false);
 
   // Emit the 'this' pointer.

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

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjC.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjC.cpp Fri Feb  5 12:56:49 2010
@@ -450,8 +450,8 @@
 
   // Fast enumeration state.
   QualType StateTy = getContext().getObjCFastEnumerationStateType();
-  llvm::AllocaInst *StatePtr = CreateTempAlloca(ConvertType(StateTy),
-                                                "state.ptr");
+  llvm::AllocaInst *StatePtr = CreateTempAlloca(ConvertTypeForMem(
+                                                  StateTy), "state.ptr");
   StatePtr->setAlignment(getContext().getTypeAlign(StateTy) >> 3);
   EmitMemSetToZero(StatePtr, StateTy);
 
@@ -470,7 +470,8 @@
     getContext().getConstantArrayType(getContext().getObjCIdType(),
                                       llvm::APInt(32, NumItems),
                                       ArrayType::Normal, 0);
-  llvm::Value *ItemsPtr = CreateTempAlloca(ConvertType(ItemsTy), "items.ptr");
+  llvm::Value *ItemsPtr = CreateTempAlloca(ConvertTypeForMem(
+                                             ItemsTy), "items.ptr");
 
   llvm::Value *Collection = EmitScalarExpr(S.getCollection());
 





More information about the cfe-commits mailing list