summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/LowerAllocations.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-10-06 15:40:36 +0000
committerDuncan Sands <baldrick@free.fr>2009-10-06 15:40:36 +0000
commit9ed7b16bf33d191c4f58f41b128aded092cc4ea0 (patch)
tree5a1196d794ebba33ff7470d5b0b8abfa948a0e04 /llvm/lib/Transforms/Utils/LowerAllocations.cpp
parentfa21fe7c3d40396ab5c37e087e8b8d02167aee99 (diff)
downloadbcm5719-llvm-9ed7b16bf33d191c4f58f41b128aded092cc4ea0.tar.gz
bcm5719-llvm-9ed7b16bf33d191c4f58f41b128aded092cc4ea0.zip
Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
Diffstat (limited to 'llvm/lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LowerAllocations.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
index 2df953c1499..f26d7c146ee 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::getUnqual(Type::getInt8Ty(M.getContext()));
+ const Type *BPTy = Type::getInt8PtrTy(M.getContext());
FreeFunc = M.getOrInsertFunction("free" , Type::getVoidTy(M.getContext()),
BPTy, (Type *)0);
return true;
@@ -123,7 +123,7 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) {
} else if (FreeInst *FI = dyn_cast<FreeInst>(I)) {
Value *PtrCast =
new BitCastInst(FI->getOperand(0),
- PointerType::getUnqual(Type::getInt8Ty(BB.getContext())), "", I);
+ Type::getInt8PtrTy(BB.getContext()), "", I);
// Insert a call to the free function...
CallInst::Create(FreeFunc, PtrCast, "", I)->setTailCall();
OpenPOWER on IntegriCloud