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/Scalar/SCCP.cpp | |
parent | 5a850beb2e3032e6ff3474ce5317f5454060328c (diff) | |
download | llvm-66284e063a1e46500acae48bdc0e4a00652021d1.tar.gz llvm-66284e063a1e46500acae48bdc0e4a00652021d1.tar.bz2 llvm-66284e063a1e46500acae48bdc0e4a00652021d1.tar.xz |
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/Scalar/SCCP.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SCCP.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index e3dd54e8bc..1bb5f4ae7f 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -30,6 +30,7 @@ #include "llvm/LLVMContext.h" #include "llvm/Pass.h" #include "llvm/Analysis/ConstantFolding.h" +#include "llvm/Analysis/MallocHelper.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/Transforms/Utils/Local.h" #include "llvm/Support/CallSite.h" @@ -400,7 +401,9 @@ private: void visitStoreInst (Instruction &I); void visitLoadInst (LoadInst &I); void visitGetElementPtrInst(GetElementPtrInst &I); - void visitCallInst (CallInst &I) { + void visitCallInst (CallInst &I) { + if (isFreeCall(&I)) + return; visitCallSite(CallSite::get(&I)); } void visitInvokeInst (InvokeInst &II) { |