Add function to clear all virtual->physical mappings but not assigned
stack slots. This is in preparation for the iterative linear scan.
llvm-svn: 15032
diff --git a/llvm/lib/CodeGen/VirtRegMap.h b/llvm/lib/CodeGen/VirtRegMap.h
index e9bfe76..c76a222 100644
--- a/llvm/lib/CodeGen/VirtRegMap.h
+++ b/llvm/lib/CodeGen/VirtRegMap.h
@@ -87,6 +87,11 @@
v2pMap_[virtReg] = NO_PHYS_REG;
}
+ void clearAllVirt() {
+ v2pMap_.clear();
+ grow();
+ }
+
bool hasStackSlot(unsigned virtReg) const {
return getStackSlot(virtReg) != NO_STACK_SLOT;
}