diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-29 22:17:13 +0000 |
commit | 4056ca9568acd3a43a4d7ce96c4a7dec2442e071 (patch) | |
tree | 3fd54a55f4fe98f2999bad43a2cb822fd04c64df /llvm/lib/Transforms/Utils/LowerAllocations.cpp | |
parent | 9793f0e4d7f7feb746d1a54ce7ac6e311b98f7b1 (diff) | |
download | bcm5719-llvm-4056ca9568acd3a43a4d7ce96c4a7dec2442e071.tar.gz bcm5719-llvm-4056ca9568acd3a43a4d7ce96c4a7dec2442e071.zip |
Move types back to the 2.5 API.
llvm-svn: 77516
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LowerAllocations.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp index 522166d6f2d..305897c8ffb 100644 --- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp +++ b/llvm/lib/Transforms/Utils/LowerAllocations.cpp @@ -87,10 +87,10 @@ Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) { // This function is always successful. // bool LowerAllocations::doInitialization(Module &M) { - const Type *BPTy = M.getContext().getPointerTypeUnqual(Type::Int8Ty); + const Type *BPTy = PointerType::getUnqual(Type::Int8Ty); // Prototype malloc as "char* malloc(...)", because we don't know in // doInitialization whether size_t is int or long. - FunctionType *FT = M.getContext().getFunctionType(BPTy, true); + FunctionType *FT = FunctionType::get(BPTy, true); MallocFunc = M.getOrInsertFunction("malloc", FT); FreeFunc = M.getOrInsertFunction("free" , Type::VoidTy, BPTy, (Type *)0); return true; @@ -166,7 +166,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { } else if (FreeInst *FI = dyn_cast<FreeInst>(I)) { Value *PtrCast = new BitCastInst(FI->getOperand(0), - Context.getPointerTypeUnqual(Type::Int8Ty), "", I); + PointerType::getUnqual(Type::Int8Ty), "", I); // Insert a call to the free function... CallInst::Create(FreeFunc, PtrCast, "", I)->setTailCall(); |