[llvm-commits] [poolalloc] r47133 - in /poolalloc/trunk/lib/PoolAllocate: PoolAllocate.cpp TransformFunctionBody.cpp

John Criswell criswell at uiuc.edu
Thu Feb 14 12:24:15 PST 2008


Author: criswell
Date: Thu Feb 14 14:24:14 2008
New Revision: 47133

URL: http://llvm.org/viewvc/llvm-project?rev=47133&view=rev
Log:
Use getPoolType() to determine the type of the pool descriptor.

Modified:
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

Modified: poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp?rev=47133&r1=47132&r2=47133&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Thu Feb 14 14:24:14 2008
@@ -183,11 +183,7 @@
   if (VoidPtrTy == 0) {
     // NOTE: If these are changed, make sure to update PoolOptimize.cpp as well!
     VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
-#ifdef SAFECODE    
-    PoolDescType = ArrayType::get(VoidPtrTy, 50);
-#else
-    PoolDescType = ArrayType::get(VoidPtrTy, 16);
-#endif    
+    PoolDescType = getPoolType();
     PoolDescPtrTy = PointerType::getUnqual(PoolDescType);
   }
 

Modified: poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp?rev=47133&r1=47132&r2=47133&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Thu Feb 14 14:24:14 2008
@@ -665,7 +665,7 @@
 	  //Dinakar we need pooldescriptors for allocas in the callee if it escapes
 	  BasicBlock::iterator InsertPt = TheCall->getParent()->getParent()->front().begin();
 	  Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
-	  ArgVal =  new AllocaInst(ArrayType::get(VoidPtrTy, 16), 0, "PD", InsertPt);
+	  ArgVal =  new AllocaInst(PAInfo.getPoolType(), 0, "PD", InsertPt);
 	  Value *ElSize = ConstantInt::get(Type::Int32Ty,0);
 	  Value *Align  = ConstantInt::get(Type::Int32Ty,0);
           Value* Opts[3] = {ArgVal, ElSize, Align};





More information about the llvm-commits mailing list