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
This commit is contained in:
Chris Lattner 2006-06-26 19:20:48 +00:00
parent 69fd7a3973
commit 959e321a1b

View File

@ -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