aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/VirtRegMap.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-05-01 22:03:24 +0000
committerChris Lattner <sabre@nondot.org>2006-05-01 22:03:24 +0000
commit229924a79f9a3b33b767527b9d4249e1133ceeda (patch)
treeb70a8ba15cc599b055f52a1bff91b4f6e3e285b5 /lib/CodeGen/VirtRegMap.h
parent8a18c13fa5d226e60a875eff5ae66cefe4093bc9 (diff)
downloadexternal_llvm-229924a79f9a3b33b767527b9d4249e1133ceeda.tar.gz
external_llvm-229924a79f9a3b33b767527b9d4249e1133ceeda.tar.bz2
external_llvm-229924a79f9a3b33b767527b9d4249e1133ceeda.zip
Fix a latent bug that my spiller patch last week exposed: we were leaving
instructions in the virtregfolded map that were deleted. Because they were deleted, newly allocated instructions could end up at the same address, magically finding themselves in the map. The solution is to remove entries from the map when we delete the instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28041 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.h')
-rw-r--r--lib/CodeGen/VirtRegMap.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h
index 898677e8f9..83d5aada47 100644
--- a/lib/CodeGen/VirtRegMap.h
+++ b/lib/CodeGen/VirtRegMap.h
@@ -137,11 +137,10 @@ namespace llvm {
return MI2VirtMap.equal_range(MI);
}
- /// RemoveFromFoldedVirtMap - Given a machine instruction in the folded
- /// instruction map, remove the entry in the folded instruction map.
+ /// RemoveFromFoldedVirtMap - If the specified machine instruction is in
+ /// the folded instruction map, remove its entry from the map.
void RemoveFromFoldedVirtMap(MachineInstr *MI) {
- bool ErasedAny = MI2VirtMap.erase(MI);
- assert(ErasedAny && "Machine instr not in folded vreg map!");
+ MI2VirtMap.erase(MI);
}
void print(std::ostream &OS) const;