[llvm-commits] [poolalloc] r57581 - in /poolalloc/trunk/lib/PoolAllocate: AccessTrace.cpp PASimple.cpp PointerCompress.cpp TransformFunctionBody.cpp

John Criswell criswell at uiuc.edu
Wed Oct 15 09:03:52 PDT 2008


Author: criswell
Date: Wed Oct 15 11:03:51 2008
New Revision: 57581

URL: http://llvm.org/viewvc/llvm-project?rev=57581&view=rev
Log:
Updated to new post LLVM 2.4 API.

Modified:
    poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp
    poolalloc/trunk/lib/PoolAllocate/PASimple.cpp
    poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp
    poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/AccessTrace.cpp Wed Oct 15 11:03:51 2008
@@ -86,10 +86,10 @@
   if (Node == 0) return;
 
   Value *PD = FI->PoolDescriptors[Node];
-  Ptr = CastInst::createPointerCast (Ptr, VoidPtrTy, Ptr->getName(), I);
+  Ptr = CastInst::CreatePointerCast (Ptr, VoidPtrTy, Ptr->getName(), I);
 
   if (PD)
-    PD = CastInst::createPointerCast (PD, VoidPtrTy, PD->getName(), I);
+    PD = CastInst::CreatePointerCast (PD, VoidPtrTy, PD->getName(), I);
   else
     PD = Constant::getNullValue(VoidPtrTy);
 

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PASimple.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PASimple.cpp Wed Oct 15 11:03:51 2008
@@ -68,7 +68,7 @@
   //
   // Otherwise, insert a cast instruction.
   //
-  return CastInst::createZExtOrBitCast (V, Ty, Name, InsertPt);
+  return CastInst::CreateZExtOrBitCast (V, Ty, Name, InsertPt);
 }
 
 void PoolAllocateSimple::getAnalysisUsage(AnalysisUsage &AU) const {
@@ -180,7 +180,7 @@
           Value * NumElements = MI->getArraySize();
           Value * ElementSize = ConstantInt::get (Type::Int32Ty,
                                                   TD.getABITypeSize(MI->getAllocatedType()));
-          AllocSize = BinaryOperator::create (Instruction::Mul,
+          AllocSize = BinaryOperator::Create (Instruction::Mul,
                                               ElementSize,
                                               NumElements,
                                               "sizetmp",
@@ -192,7 +192,7 @@
 
         Value* args[] = {TheGlobalPool, AllocSize};
         Instruction* x = CallInst::Create(PoolAlloc, &args[0], &args[2], MI->getName(), ii);
-        ii->replaceAllUsesWith(CastInst::createPointerCast(x, ii->getType(), "", ii));
+        ii->replaceAllUsesWith(CastInst::CreatePointerCast(x, ii->getType(), "", ii));
       } else if (CallInst * CI = dyn_cast<CallInst>(ii)) {
         CallSite CS(CI);
         Function *CF = CS.getCalledFunction();
@@ -215,7 +215,7 @@
 
           // Ensure the size and pointer arguments are of the correct type
           if (Size->getType() != Type::Int32Ty)
-            Size = CastInst::createIntegerCast (Size,
+            Size = CastInst::CreateIntegerCast (Size,
                                                 Type::Int32Ty,
                                                 false,
                                                 Size->getName(),
@@ -223,7 +223,7 @@
 
           static Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
           if (OldPtr->getType() != VoidPtrTy)
-            OldPtr = CastInst::createPointerCast (OldPtr,
+            OldPtr = CastInst::CreatePointerCast (OldPtr,
                                                   VoidPtrTy,
                                                   OldPtr->getName(),
                                                   InsertPt);
@@ -237,7 +237,7 @@
                                          InsertPt);
           Instruction *Casted = V;
           if (V->getType() != CI->getType())
-            Casted = CastInst::createPointerCast (V, CI->getType(), V->getName(), InsertPt);
+            Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
 
           // Update def-use info
           CI->replaceAllUsesWith(Casted);
@@ -256,14 +256,14 @@
 
           // Ensure the size and pointer arguments are of the correct type
           if (Size->getType() != Type::Int32Ty)
-            Size = CastInst::createIntegerCast (Size,
+            Size = CastInst::CreateIntegerCast (Size,
                                                 Type::Int32Ty,
                                                 false,
                                                 Size->getName(),
                                                 InsertPt);
 
           if (NumElements->getType() != Type::Int32Ty)
-            NumElements = CastInst::createIntegerCast (Size,
+            NumElements = CastInst::CreateIntegerCast (Size,
                                                 Type::Int32Ty,
                                                 false,
                                                 NumElements->getName(),
@@ -279,7 +279,7 @@
 
           Instruction *Casted = V;
           if (V->getType() != CI->getType())
-            Casted = CastInst::createPointerCast (V, CI->getType(), V->getName(), InsertPt);
+            Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
 
           // Update def-use info
           CI->replaceAllUsesWith(Casted);
@@ -298,7 +298,7 @@
           // Ensure the size and pointer arguments are of the correct type
           static Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
           if (OldPtr->getType() != VoidPtrTy)
-            OldPtr = CastInst::createPointerCast (OldPtr,
+            OldPtr = CastInst::CreatePointerCast (OldPtr,
                                                   VoidPtrTy,
                                                   OldPtr->getName(),
                                                   InsertPt);
@@ -312,7 +312,7 @@
                                          InsertPt);
           Instruction *Casted = V;
           if (V->getType() != CI->getType())
-            Casted = CastInst::createPointerCast (V, CI->getType(), V->getName(), InsertPt);
+            Casted = CastInst::CreatePointerCast (V, CI->getType(), V->getName(), InsertPt);
 
           // Update def-use info
           CI->replaceAllUsesWith(Casted);

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/PointerCompress.cpp Wed Oct 15 11:03:51 2008
@@ -714,7 +714,7 @@
         uint64_t FieldOffs = TD.getStructLayout(cast<StructType>(NTy))
           ->getElementOffset(Field);
         Constant *FieldOffsCst = ConstantInt::get(SCALARUINTTYPE, FieldOffs);
-        Val = BinaryOperator::createAdd(Val, FieldOffsCst,
+        Val = BinaryOperator::CreateAdd(Val, FieldOffsCst,
                                         GEPI.getName(), &GEPI);
       }
 
@@ -730,12 +730,12 @@
         // Add Idx*sizeof(NewElementType) to the index.
         const Type *ElTy = cast<SequentialType>(NTy)->getElementType();
         if (Idx->getType() != SCALARUINTTYPE)
-          Idx = CastInst::createSExtOrBitCast(Idx, SCALARUINTTYPE, Idx->getName(), &GEPI);
+          Idx = CastInst::CreateSExtOrBitCast(Idx, SCALARUINTTYPE, Idx->getName(), &GEPI);
 
         Constant *Scale = ConstantInt::get(SCALARUINTTYPE,
                                             TD.getABITypeSize(ElTy));
-        Idx = BinaryOperator::createMul(Idx, Scale, "fieldidx", &GEPI);
-        Val = BinaryOperator::createAdd(Val, Idx, GEPI.getName(), &GEPI);
+        Idx = BinaryOperator::CreateMul(Idx, Scale, "fieldidx", &GEPI);
+        Val = BinaryOperator::CreateAdd(Val, Idx, GEPI.getName(), &GEPI);
       }
 
       // If this is a one element array type, NTy may not reflect the array.
@@ -756,7 +756,7 @@
     // type.
     if (getPoolInfo(&LI)) {
       Value *NLI = new LoadInst(LI.getOperand(0), LI.getName()+".cp", &LI);
-      Value *NC = CastInst::createZExtOrBitCast(NLI, SCALARUINTTYPE, NLI->getName(), &LI);
+      Value *NC = CastInst::CreateZExtOrBitCast(NLI, SCALARUINTTYPE, NLI->getName(), &LI);
       setTransformedValue(LI, NC);
     }
     return;
@@ -772,11 +772,11 @@
   // Get the pointer to load from.
   Value* Ops = getTransformedValue(LI.getOperand(0));
   if (Ops->getType() == Type::Int16Ty)
-    Ops = CastInst::createZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &LI);
+    Ops = CastInst::CreateZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &LI);
   Value *SrcPtr = GetElementPtrInst::Create(BasePtr, Ops,
                                         LI.getOperand(0)->getName()+".pp", &LI);
   const Type *DestTy = LoadingCompressedPtr ? MEMUINTTYPE : LI.getType();
-  SrcPtr = CastInst::createPointerCast(SrcPtr, PointerType::getUnqual(DestTy),
+  SrcPtr = CastInst::CreatePointerCast(SrcPtr, PointerType::getUnqual(DestTy),
                                       SrcPtr->getName(), &LI);
   std::string OldName = LI.getName(); LI.setName("");
   Value *NewLoad = new LoadInst(SrcPtr, OldName, &LI);
@@ -784,7 +784,7 @@
   if (LoadingCompressedPtr) {
     // Convert from MEMUINTTYPE to SCALARUINTTYPE if different.
     if (MEMUINTTYPE != SCALARUINTTYPE)
-      NewLoad = CastInst::createZExtOrBitCast(NewLoad, SCALARUINTTYPE, NewLoad->getName(), &LI);
+      NewLoad = CastInst::CreateZExtOrBitCast(NewLoad, SCALARUINTTYPE, NewLoad->getName(), &LI);
 
     setTransformedValue(LI, NewLoad);
   } else {
@@ -803,7 +803,7 @@
     // cast the index to a pointer type and store that.
     if (getPoolInfo(SI.getOperand(0))) {
       Value *SrcVal = getTransformedValue(SI.getOperand(0));
-      SrcVal = CastInst::createPointerCast(SrcVal, SI.getOperand(0)->getType(),
+      SrcVal = CastInst::CreatePointerCast(SrcVal, SI.getOperand(0)->getType(),
                                            SrcVal->getName(), &SI);
       SI.setOperand(0, SrcVal);
     }
@@ -824,7 +824,7 @@
 
       // If SCALAR type is not the MEM type, reduce it now.
       if (SrcVal->getType() != MEMUINTTYPE)
-        SrcVal = CastInst::createZExtOrBitCast(SrcVal, MEMUINTTYPE, SrcVal->getName(), &SI);
+        SrcVal = CastInst::CreateZExtOrBitCast(SrcVal, MEMUINTTYPE, SrcVal->getName(), &SI);
     }
   } else {
     // FIXME: This assumes that all null pointers are compressed!
@@ -837,12 +837,12 @@
   // Get the pointer to store to.
   Value* Ops = getTransformedValue(SI.getOperand(1));
   if (Ops->getType() == Type::Int16Ty)
-    Ops = CastInst::createZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &SI);
+    Ops = CastInst::CreateZExtOrBitCast(Ops, Type::Int32Ty, "extend_idx", &SI);
 
   Value *DestPtr = GetElementPtrInst::Create(BasePtr, Ops,
                                          SI.getOperand(1)->getName()+".pp",
                                          &SI);
-  DestPtr = CastInst::createPointerCast(DestPtr,
+  DestPtr = CastInst::CreatePointerCast(DestPtr,
                                         PointerType::getUnqual(SrcVal->getType()),
                                         DestPtr->getName(), &SI);
   new StoreInst(SrcVal, DestPtr, &SI);
@@ -904,11 +904,11 @@
       Value *OldSize = ConstantInt::get(Type::Int32Ty, OldSizeV);
       Value *NewSize = ConstantInt::get(Type::Int32Ty, PI->getNewSize());
 
-      Size = BinaryOperator::createAdd(Size,
+      Size = BinaryOperator::CreateAdd(Size,
                                   ConstantInt::get(Type::Int32Ty, OldSizeV-1),
                                        "roundup", &CI);
-      Size = BinaryOperator::createUDiv(Size, OldSize, "numnodes", &CI);
-      Size = BinaryOperator::createMul(Size, NewSize, "newbytes", &CI);
+      Size = BinaryOperator::CreateUDiv(Size, OldSize, "numnodes", &CI);
+      Size = BinaryOperator::CreateMul(Size, NewSize, "newbytes", &CI);
     }
 
   Value *Opts[2] = {CI.getOperand(1), Size};
@@ -971,7 +971,7 @@
         Value *BasePtr = DestPI->EmitPoolBaseLoad(CI);
         Value *SrcPtr = GetElementPtrInst::Create(BasePtr, getTransformedValue(CI.getOperand(2)),
                                        CI.getOperand(2)->getName()+".pp", &CI);
-        SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI);
+        SrcPtr = CastInst::CreatePointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI);
         CI.setOperand(2, SrcPtr);
         return;
       }
@@ -980,7 +980,7 @@
         Value *BasePtr = DestPI->EmitPoolBaseLoad(CI);
         Value *SrcPtr = GetElementPtrInst::Create(BasePtr, getTransformedValue(CI.getOperand(1)),
                                        CI.getOperand(1)->getName()+".pp", &CI);
-        SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
+        SrcPtr = CastInst::CreatePointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
         CI.setOperand(1, SrcPtr);
         return;
       }
@@ -991,7 +991,7 @@
         Value *BasePtr = DestPI->EmitPoolBaseLoad(CI);
         Value *SrcPtr = GetElementPtrInst::Create(BasePtr, getTransformedValue(CI.getOperand(1)),
                                        CI.getOperand(1)->getName()+".pp", &CI);
-        SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
+        SrcPtr = CastInst::CreatePointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
         CI.setOperand(1, SrcPtr);
         return;
       }
@@ -1003,7 +1003,7 @@
         Value *BasePtr = DestPI->EmitPoolBaseLoad(CI);
         Value *SrcPtr = GetElementPtrInst::Create(BasePtr, getTransformedValue(CI.getOperand(1)),
                                        CI.getOperand(1)->getName()+".pp", &CI);
-        SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
+        SrcPtr = CastInst::CreatePointerCast(SrcPtr, CI.getOperand(1)->getType(), "", &CI);
         CI.setOperand(1, SrcPtr);
         doret = true;
       }
@@ -1011,7 +1011,7 @@
         Value *BasePtr = DestPI->EmitPoolBaseLoad(CI);
         Value *SrcPtr = GetElementPtrInst::Create(BasePtr, getTransformedValue(CI.getOperand(2)),
                                        CI.getOperand(2)->getName()+".pp", &CI);
-        SrcPtr = CastInst::createPointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI);
+        SrcPtr = CastInst::CreatePointerCast(SrcPtr, CI.getOperand(2)->getType(), "", &CI);
         CI.setOperand(2, SrcPtr);
         doret = true;
       }

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

==============================================================================
--- poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp (original)
+++ poolalloc/trunk/lib/PoolAllocate/TransformFunctionBody.cpp Wed Oct 15 11:03:51 2008
@@ -155,7 +155,7 @@
   std::string Name = I->getName(); I->setName("");
 
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
+    Size = CastInst::CreateIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
 
   // Insert a call to poolalloc
   Value *PH = getPoolHandle(I);
@@ -172,7 +172,7 @@
   // Cast to the appropriate type if necessary
   Instruction *Casted = V;
   if (V->getType() != I->getType())
-    Casted = CastInst::createPointerCast(V, I->getType(), V->getName(), I);
+    Casted = CastInst::CreatePointerCast(V, I->getType(), V->getName(), I);
     
   // Update def-use info
   I->replaceAllUsesWith(Casted);
@@ -210,7 +210,7 @@
     ConstantInt::get(Type::Int32Ty, TD.getABITypeSize(MI.getAllocatedType()));
 
   if (MI.isArrayAllocation())
-    AllocSize = BinaryOperator::create(Instruction::Mul, AllocSize,
+    AllocSize = BinaryOperator::Create(Instruction::Mul, AllocSize,
                                        MI.getOperand(0), "sizetmp", &MI);
   //
   // NOTE:
@@ -239,7 +239,7 @@
       Value *Casted = AI;
       Instruction *aiNext = AI->getNext();
       if (AI->getType() != PointerType::getUnqual(Type::Int8Ty))
-        Casted = CastInst::createPointerCast(AI, PointerType::getUnqual(Type::Int8Ty),
+        Casted = CastInst::CreatePointerCast(AI, PointerType::getUnqual(Type::Int8Ty),
               AI->getName()+".casted",aiNext);
       
       Instruction *V = CallInst::Create(PAInfo.PoolRegister,
@@ -268,13 +268,13 @@
       ConstantInt::get(Type::Int32Ty, TD.getABITypeSize(MI.getAllocatedType()));
     
     if (MI.isArrayAllocation())
-      AllocSize = BinaryOperator::create(Instruction::Mul, AllocSize,
+      AllocSize = BinaryOperator::Create(Instruction::Mul, AllocSize,
 					 MI.getOperand(0), "sizetmp", &MI);
     
     //  TransformAllocationInstr(&MI, AllocSize);
     BasicBlock::iterator InsertPt(MI);
     ++InsertPt;
-    Instruction *Casted = CastInst::createPointerCast(&MI, PointerType::getUnqual(Type::Int8Ty),
+    Instruction *Casted = CastInst::CreatePointerCast(&MI, PointerType::getUnqual(Type::Int8Ty),
 				       MI.getName()+".casted", InsertPt);
     std::vector<Value *> args;
     args.push_back (PH);
@@ -294,7 +294,7 @@
   // Insert a cast and a call to poolfree...
   Value *Casted = Arg;
   if (Arg->getType() != PointerType::getUnqual(Type::Int8Ty)) {
-    Casted = CastInst::createPointerCast(Arg, PointerType::getUnqual(Type::Int8Ty),
+    Casted = CastInst::CreatePointerCast(Arg, PointerType::getUnqual(Type::Int8Ty),
 				 Arg->getName()+".casted", Where);
     G.getScalarMap()[Casted] = G.getScalarMap()[Arg];
   }
@@ -333,14 +333,14 @@
   Value *V1 = CS.getArgument(0);
   Value *V2 = CS.getArgument(1);
   if (V1->getType() != V2->getType()) {
-    V1 = CastInst::createZExtOrBitCast(V1, useLong ? Type::Int64Ty : Type::Int32Ty, V1->getName(), CS.getInstruction());
-    V2 = CastInst::createZExtOrBitCast(V2, useLong ? Type::Int64Ty : Type::Int32Ty, V2->getName(), CS.getInstruction());
+    V1 = CastInst::CreateZExtOrBitCast(V1, useLong ? Type::Int64Ty : Type::Int32Ty, V1->getName(), CS.getInstruction());
+    V2 = CastInst::CreateZExtOrBitCast(V2, useLong ? Type::Int64Ty : Type::Int32Ty, V2->getName(), CS.getInstruction());
   }
 
-  V2 = BinaryOperator::create(Instruction::Mul, V1, V2, "size",
+  V2 = BinaryOperator::Create(Instruction::Mul, V1, V2, "size",
                               CS.getInstruction());
   if (V2->getType() != (useLong ? Type::Int64Ty : Type::Int32Ty))
-    V2 = CastInst::createZExtOrBitCast(V2, useLong ? Type::Int64Ty : Type::Int32Ty, V2->getName(), CS.getInstruction());
+    V2 = CastInst::CreateZExtOrBitCast(V2, useLong ? Type::Int64Ty : Type::Int32Ty, V2->getName(), CS.getInstruction());
 
   BasicBlock::iterator BBI =
     TransformAllocationInstr(CS.getInstruction(), V2);
@@ -355,7 +355,7 @@
                                              Type::Int32Ty, NULL);
 
   if (Ptr->getType() != PointerType::getUnqual(Type::Int8Ty))
-    Ptr = CastInst::createPointerCast(Ptr, PointerType::getUnqual(Type::Int8Ty), Ptr->getName(),
+    Ptr = CastInst::CreatePointerCast(Ptr, PointerType::getUnqual(Type::Int8Ty), Ptr->getName(),
                        BBI);
   
   // We know that the memory returned by poolalloc is at least 4 byte aligned.
@@ -376,18 +376,18 @@
   if (PH == 0 || isa<ConstantPointerNull>(PH)) return;
 
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
+    Size = CastInst::CreateIntegerCast(Size, Type::Int32Ty, false, Size->getName(), I);
 
   static Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
   if (OldPtr->getType() != VoidPtrTy)
-    OldPtr = CastInst::createPointerCast(OldPtr, VoidPtrTy, OldPtr->getName(), I);
+    OldPtr = CastInst::CreatePointerCast(OldPtr, VoidPtrTy, OldPtr->getName(), I);
 
   std::string Name = I->getName(); I->setName("");
   Value* Opts[3] = {PH, OldPtr, Size};
   Instruction *V = CallInst::Create(PAInfo.PoolRealloc, Opts, Opts + 3, Name, I);
   Instruction *Casted = V;
   if (V->getType() != I->getType())
-    Casted = CastInst::createPointerCast(V, I->getType(), V->getName(), I);
+    Casted = CastInst::CreatePointerCast(V, I->getType(), V->getName(), I);
 
   // Update def-use info
   I->replaceAllUsesWith(Casted);
@@ -442,13 +442,13 @@
 
     static const Type *PtrPtr=PointerType::getUnqual(PointerType::getUnqual(Type::Int8Ty));
     if (ResultDest->getType() != PtrPtr)
-      ResultDest = CastInst::createPointerCast(ResultDest, PtrPtr, ResultDest->getName(), I);
+      ResultDest = CastInst::CreatePointerCast(ResultDest, PtrPtr, ResultDest->getName(), I);
   }
 
   if (Align->getType() != Type::Int32Ty)
-    Align = CastInst::createIntegerCast(Align, Type::Int32Ty, false, Align->getName(), I);
+    Align = CastInst::CreateIntegerCast(Align, Type::Int32Ty, false, Align->getName(), I);
   if (Size->getType() != Type::Int32Ty)
-    Size = CastInst::createIntegerCast(Size, Type::Int32Ty, false, 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};
@@ -456,7 +456,7 @@
 
   Instruction *Casted = V;
   if (V->getType() != I->getType())
-    Casted = CastInst::createPointerCast(V, I->getType(), V->getName(), I);
+    Casted = CastInst::CreatePointerCast(V, I->getType(), V->getName(), I);
 
   if (ResultDest)
     new StoreInst(V, ResultDest, I);
@@ -503,14 +503,14 @@
 
   static Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
   if (OldPtr->getType() != VoidPtrTy)
-    OldPtr = CastInst::createPointerCast(OldPtr, VoidPtrTy, OldPtr->getName(), I);
+    OldPtr = CastInst::CreatePointerCast(OldPtr, VoidPtrTy, OldPtr->getName(), I);
 
   std::string Name = I->getName(); I->setName("");
   Value* Opts[3] = {PH, OldPtr, 0};
   Instruction *V = CallInst::Create(PAInfo.PoolStrdup, Opts, Opts + 2, Name, I);
   Instruction *Casted = V;
   if (V->getType() != I->getType())
-    Casted = CastInst::createPointerCast(V, I->getType(), V->getName(), I);
+    Casted = CastInst::CreatePointerCast(V, I->getType(), V->getName(), I);
 
   // Update def-use info
   I->replaceAllUsesWith(Casted);
@@ -649,7 +649,7 @@
     PointerType *PFTy = PointerType::getUnqual(FTy);
     
     // If there are any pool arguments cast the func ptr to the right type.
-    NewCallee = CastInst::createPointerCast(CS.getCalledValue(), PFTy, "tmp", TheCall);
+    NewCallee = CastInst::CreatePointerCast(CS.getCalledValue(), PFTy, "tmp", TheCall);
   }
 
   Function::const_arg_iterator FAI = CF->arg_begin(), E = CF->arg_end();





More information about the llvm-commits mailing list