From 48d0c163fb60f7da7ef3657df242bf11dbdb0617 Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 25 May 2010 17:21:04 +0000 Subject: 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 --- utils/TableGen/CodeGenTarget.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'utils/TableGen/CodeGenTarget.h') diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index 5b2587f3b7..6b06b66c29 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -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::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 &getRegisterClasses() const { -- cgit v1.2.3