From ece02cd5829cea836e9365b0845a8ef042d17b0a Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Jun 2011 15:42:51 +0000 Subject: Vendor import of llvm trunk r132879: http://llvm.org/svn/llvm-project/llvm/trunk@132879 --- utils/TableGen/CodeGenTarget.h | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) (limited to 'utils/TableGen/CodeGenTarget.h') diff --git a/utils/TableGen/CodeGenTarget.h b/utils/TableGen/CodeGenTarget.h index 4e04154..1f1c34c 100644 --- a/utils/TableGen/CodeGenTarget.h +++ b/utils/TableGen/CodeGenTarget.h @@ -65,12 +65,9 @@ class CodeGenTarget { Record *TargetRec; mutable DenseMap Instructions; - mutable std::vector Registers; - mutable std::vector SubRegIndices; + mutable CodeGenRegBank *RegBank; mutable std::vector RegisterClasses; mutable std::vector LegalValueTypes; - void ReadRegisters() const; - void ReadSubRegIndices() const; void ReadRegisterClasses() const; void ReadInstructions() const; void ReadLegalValueTypes() const; @@ -98,29 +95,17 @@ public: /// Record *getAsmWriter() const; + /// getRegBank - Return the register bank description. + CodeGenRegBank &getRegBank() const; + const std::vector &getRegisters() const { - if (Registers.empty()) ReadRegisters(); - return Registers; + return getRegBank().getRegisters(); } /// getRegisterByName - If there is a register with the specific AsmName, /// return it. const CodeGenRegister *getRegisterByName(StringRef Name) const; - const std::vector &getSubRegIndices() const { - if (SubRegIndices.empty()) ReadSubRegIndices(); - return SubRegIndices; - } - - // Map a SubRegIndex Record to its number. - unsigned getSubRegIndexNo(Record *idx) const { - 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 { if (RegisterClasses.empty()) ReadRegisterClasses(); return RegisterClasses; -- cgit v1.1