aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
committerOwen Anderson <resistor@mac.com>2009-07-29 22:17:13 +0000
commitdebcb01b0f0a15f568ca69e8f288fade4bfc7297 (patch)
tree22a274838cf6c55205a8a3f0a80262b09b63b069 /lib/Transforms/Utils/LowerAllocations.cpp
parent37c4a2d6f15ff32c9ae91e333d655a349e195993 (diff)
Move types back to the 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--lib/Transforms/Utils/LowerAllocations.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp
index 522166d6f2..305897c8ff 100644
--- a/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/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();