[llvm-commits] CVS: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp TransformFunctionBody.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Thu Apr 26 12:55:11 PDT 2007



Changes in directory llvm-poolalloc/lib/PoolAllocate:

Heuristic.cpp updated: 1.18 -> 1.19
TransformFunctionBody.cpp updated: 1.64 -> 1.65
---
Log message:

fix memalign casting

---
Diffs of the changes:  (+6 -6)

 Heuristic.cpp             |    2 +-
 TransformFunctionBody.cpp |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.18 llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.19
--- llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp:1.18	Wed Apr 11 12:27:53 2007
+++ llvm-poolalloc/lib/PoolAllocate/Heuristic.cpp	Thu Apr 26 14:54:49 2007
@@ -78,7 +78,7 @@
       return true;
   }
 
-  if (Ty->isPrimitiveType() || isa<PointerType>(Ty))
+  if (Ty->isFirstClassType())
     return false;
 
   if (const StructType *STy = dyn_cast<StructType>(Ty)) {


Index: llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp
diff -u llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.64 llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.65
--- llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp:1.64	Tue Apr 17 19:29:02 2007
+++ llvm-poolalloc/lib/PoolAllocate/TransformFunctionBody.cpp	Thu Apr 26 14:54:49 2007
@@ -150,7 +150,7 @@
   std::string Name = I->getName(); I->setName("");
 
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createZExtOrBitCast(Size, Type::Int32Ty, Size->getName(), I);
+    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
 
   // Insert a call to poolalloc
   Value *PH = getPoolHandle(I);
@@ -341,7 +341,7 @@
   Value *Size = CS.getArgument(1);
 
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createZExtOrBitCast(Size, Type::Int32Ty, Size->getName(), I);
+    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
 
   static Type *VoidPtrTy = PointerType::get(Type::Int8Ty);
   if (OldPtr->getType() != VoidPtrTy)
@@ -411,9 +411,9 @@
   }
 
   if (Align->getType() != Type::Int32Ty)
-    Align = CastInst::createZExtOrBitCast(Align, Type::Int32Ty, Align->getName(), I);
+    Align = CastInst::createIntegerCast(Align, Type::Int32Ty, false, Align->getName(), I);
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createZExtOrBitCast(Size, Type::Int32Ty, Size->getName(), I);
+    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
 
   std::string Name = I->getName(); I->setName("");
   Value* Opts[3] = {PH, Align, Size};
@@ -615,7 +615,7 @@
   //assert(AI == AE && "Varargs calls not handled yet!");
 
   // Map the return value as well...
-  if (DS::isPointerType(TheCall->getType()))
+  if (isa<PointerType>(TheCall->getType()))
     DSGraph::computeNodeMapping(CalleeGraph->getReturnNodeFor(*CF),
                                 getDSNodeHFor(TheCall), NodeMapping, false);
 






More information about the llvm-commits mailing list