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 | e297149e267e05159db4dc490493fddcb3784d95 (patch) | |
tree | 4f49152e0dfd1305070ba4ab33c516f5fe31ebab /llvm/lib/Analysis/IPA/Andersens.cpp | |
parent | 46ed1f83414d1e93e5af6a8145526c0d216861c1 (diff) | |
download | bcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.tar.gz bcm5719-llvm-e297149e267e05159db4dc490493fddcb3784d95.zip |
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.
llvm-svn: 84987
Diffstat (limited to 'llvm/lib/Analysis/IPA/Andersens.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/Andersens.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/IPA/Andersens.cpp b/llvm/lib/Analysis/IPA/Andersens.cpp index b5129a7d3ba..e37a9dbb7ac 100644 --- a/llvm/lib/Analysis/IPA/Andersens.cpp +++ b/llvm/lib/Analysis/IPA/Andersens.cpp @@ -1017,6 +1017,8 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) { } } else if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(*UI)) { if (AnalyzeUsesOfFunction(GEP)) return true; + } else if (isa<FreeInst>(*UI) || isFreeCall(*UI)) { + return false; } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) { // Make sure that this is just the function being called, not that it is // passing into the function. @@ -1038,8 +1040,6 @@ bool Andersens::AnalyzeUsesOfFunction(Value *V) { } else if (ICmpInst *ICI = dyn_cast<ICmpInst>(*UI)) { if (!isa<ConstantPointerNull>(ICI->getOperand(1))) return true; // Allow comparison against null. - } else if (isa<FreeInst>(*UI)) { - return false; } else { return true; } |