summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/Andersens.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-10-24 04:23:03 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-10-24 04:23:03 +0000
commit66284e063a1e46500acae48bdc0e4a00652021d1 (patch)
tree7326efcf20c334046c044082a205dc2eb1f17466 /lib/Analysis/IPA/Andersens.cpp
parent5a850beb2e3032e6ff3474ce5317f5454060328c (diff)
downloadllvm-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/Analysis/IPA/Andersens.cpp')
-rw-r--r--lib/Analysis/IPA/Andersens.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index b5129a7d3b..e37a9dbb7a 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/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;
}