summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
authorChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:12:55 +0000
committerChristopher Lamb <christopher.lamb@gmail.com>2007-12-17 01:12:55 +0000
commitedf0788758c1245d40c3355914ddb310117f457b (patch)
treed9a6df96cce2d9fed1ee681eb546e5a02126bbe2 /llvm/lib/Transforms/Utils/LowerAllocations.cpp
parent77560fbde7cbb2d2d6cdf39c9f3ad4feb725daaf (diff)
downloadbcm5719-llvm-edf0788758c1245d40c3355914ddb310117f457b.tar.gz
bcm5719-llvm-edf0788758c1245d40c3355914ddb310117f457b.zip
Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
llvm-svn: 45082
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerAllocations.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
index b089cd6d8b4..c5c8bd50da8 100644
--- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
@@ -87,7 +87,7 @@ Pass *llvm::createLowerAllocationsPass(bool LowerMallocArgToInteger) {
// This function is always successful.
//
bool LowerAllocations::doInitialization(Module &M) {
- const Type *BPTy = PointerType::get(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 = FunctionType::get(BPTy, std::vector<const Type*>(), true);
@@ -158,8 +158,9 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
Changed = true;
++NumLowered;
} else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
- Value *PtrCast = new BitCastInst(FI->getOperand(0),
- PointerType::get(Type::Int8Ty), "", I);
+ Value *PtrCast =
+ new BitCastInst(FI->getOperand(0),
+ PointerType::getUnqual(Type::Int8Ty), "", I);
// Insert a call to the free function...
(new CallInst(FreeFunc, PtrCast, "", I))->setTailCall();
OpenPOWER on IntegriCloud