diff options
author | Victor Hernandez <vhernandez@apple.com> | 2009-10-24 04:23:03 +0000 |
---|---|---|
committer | Victor Hernandez <vhernandez@apple.com> | 2009-10-24 04:23:03 +0000 |
commit | 66284e063a1e46500acae48bdc0e4a00652021d1 (patch) | |
tree | 7326efcf20c334046c044082a205dc2eb1f17466 /lib/Transforms/Utils/LowerAllocations.cpp | |
parent | 5a850beb2e3032e6ff3474ce5317f5454060328c (diff) |
Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LowerAllocations.cpp')
-rw-r--r-- | lib/Transforms/Utils/LowerAllocations.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Transforms/Utils/LowerAllocations.cpp b/lib/Transforms/Utils/LowerAllocations.cpp index 9c9113daa9..f64a30f5e8 100644 --- a/lib/Transforms/Utils/LowerAllocations.cpp +++ b/lib/Transforms/Utils/LowerAllocations.cpp @@ -102,12 +102,8 @@ bool LowerAllocations::runOnBasicBlock(BasicBlock &BB) { // Loop over all of the instructions, looking for free instructions for (BasicBlock::iterator I = BB.begin(), E = BB.end(); I != E; ++I) { if (FreeInst *FI = dyn_cast<FreeInst>(I)) { - Value *PtrCast = - new BitCastInst(FI->getOperand(0), - Type::getInt8PtrTy(BB.getContext()), "", I); - // Insert a call to the free function... - CallInst::Create(FreeFunc, PtrCast, "", I)->setTailCall(); + CallInst::CreateFree(FI->getOperand(0), I); // Delete the old free instruction I = --BBIL.erase(I); |