summaryrefslogtreecommitdiff
path: root/lib/Analysis/AliasSetTracker.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-06-26 19:20:48 +0000
committerChris Lattner <sabre@nondot.org>2006-06-26 19:20:48 +0000
commit959e321a1b41e70cfb2c67cebb3a8c1f79cbf3d3 (patch)
treeef7854dd53f892f67456284c50800607afdaba57 /lib/Analysis/AliasSetTracker.cpp
parent69fd7a3973a5c4ba4fb883b836fd0b84c046d10c (diff)
downloadllvm-959e321a1b41e70cfb2c67cebb3a8c1f79cbf3d3.tar.gz
llvm-959e321a1b41e70cfb2c67cebb3a8c1f79cbf3d3.tar.bz2
llvm-959e321a1b41e70cfb2c67cebb3a8c1f79cbf3d3.tar.xz
Fix a stale pointer issue that caused 300.twolf to fail to build on zion
last night. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28916 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/AliasSetTracker.cpp')
-rw-r--r--lib/Analysis/AliasSetTracker.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp
index 3f6aa2c9b9..83ba69a69d 100644
--- a/lib/Analysis/AliasSetTracker.cpp
+++ b/lib/Analysis/AliasSetTracker.cpp
@@ -435,6 +435,17 @@ void AliasSetTracker::deleteValue(Value *PtrVal) {
// Notify the alias analysis implementation that this value is gone.
AA.deleteValue(PtrVal);
+ // If this is a call instruction, remove the callsite from the appropriate
+ // AliasSet.
+ CallSite CS = CallSite::get(PtrVal);
+ if (CS.getInstruction()) {
+ Function *F = CS.getCalledFunction();
+ if (!F || !AA.doesNotAccessMemory(F)) {
+ if (AliasSet *AS = findAliasSetForCallSite(CS))
+ AS->removeCallSite(CS);
+ }
+ }
+
// First, look up the PointerRec for this pointer.
hash_map<Value*, AliasSet::PointerRec>::iterator I = PointerMap.find(PtrVal);
if (I == PointerMap.end()) return; // Noop