Ignore NumberHack and give each SubRegIndex instance a unique enum value instead.

This passes lit tests, but I'll give it a go through the buildbots to smoke out
any remaining places that depend on the old SubRegIndex numbering.

Then I'll remove NumberHack entirely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104615 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2010-05-25 17:21:04 +00:00
parent c159fba712
commit 48d0c163fb
3 changed files with 9 additions and 6 deletions
+5 -1
View File
@@ -107,7 +107,11 @@ public:
// Map a SubRegIndex Record to its number.
unsigned getSubRegIndexNo(Record *idx) const {
return idx->getValueAsInt("NumberHack");
if (SubRegIndices.empty()) ReadSubRegIndices();
std::vector<Record*>::const_iterator i =
std::find(SubRegIndices.begin(), SubRegIndices.end(), idx);
assert(i != SubRegIndices.end() && "Not a SubRegIndex");
return (i - SubRegIndices.begin()) + 1;
}
const std::vector<CodeGenRegisterClass> &getRegisterClasses() const {