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

John Criswell criswell at uiuc.edu
Wed Jul 15 14:31:11 PDT 2009


Author: criswell
Date: Wed Jul 15 16:31:11 2009
New Revision: 75837

URL: http://llvm.org/viewvc/llvm-project?rev=75837&view=rev
Log:
Update to the new LLVM API.
This adds an LLVMContext parameter to the AllocaInst and MallocInst
constructors.

Modified:
    poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp
    poolalloc/trunk/lib/PoolAllocate/PoolOptimize.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=75837&r1=75836&r2=75837&view=diff

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolAllocate.cpp Wed Jul 15 16:31:11 2009
@@ -668,7 +668,7 @@
       // Create a pool descriptor for the pool.  The poolinit will be inserted
       // later.
       if (!IsMain) {
-        PoolDesc = new AllocaInst(PoolDescType, 0, "PD", InsertPoint);
+        PoolDesc = new AllocaInst(*Context, PoolDescType, 0, "PD", InsertPoint);
 
         // Create a node in DSG to represent the new alloca.
         DSNode *NewNode = DSG->addObjectToGraph(PoolDesc);

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PoolOptimize.cpp Wed Jul 15 16:31:11 2009
@@ -151,7 +151,7 @@
     // poolalloc(null, X) -> malloc(X)
     if (isa<Constant>(CI->getOperand(1)) && 
         cast<Constant>(CI->getOperand(1))->isNullValue()) {
-      Value *New = new MallocInst(Type::Int8Ty, CI->getOperand(2),
+      Value *New = new MallocInst(*Context, Type::Int8Ty, CI->getOperand(2),
                                   CI->getName(), CI);
       CI->replaceAllUsesWith(New);
       CI->eraseFromParent();

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Jul 15 16:31:11 2009
@@ -739,7 +739,11 @@
           // Dinakar: We need pooldescriptors for allocas in the callee if it
           //          escapes
           BasicBlock::iterator InsertPt = TheCall->getParent()->getParent()->front().begin();
-          ArgVal =  new AllocaInst(PAInfo.getPoolType(), 0, "PD", InsertPt);
+          ArgVal =  new AllocaInst(getGlobalContext(),
+                                   PAInfo.getPoolType(),
+                                   0,
+                                   "PD",
+                                   InsertPt);
           Value *ElSize = getGlobalContext().getConstantInt(Type::Int32Ty,0);
           Value *Align  = getGlobalContext().getConstantInt(Type::Int32Ty,0);
           Value* Opts[3] = {ArgVal, ElSize, Align};





More information about the llvm-commits mailing list