Move register class name strings to a single array in MCRegisterInfo to reduce static...
[oota-llvm.git] / include / llvm / MC / MCRegisterInfo.h
index 766f631829255eadec1857554f489bbd9f778305..df556e7e50f0d12002ef2b589d79aae9d485c1b4 100644 (file)
@@ -32,9 +32,9 @@ public:
   typedef const MCPhysReg* iterator;
   typedef const MCPhysReg* const_iterator;
 
-  const char *Name;
   const iterator RegsBegin;
   const uint8_t *const RegSet;
+  const uint32_t NameIdx;
   const uint16_t RegsSize;
   const uint16_t RegSetSize;
   const uint16_t ID;
@@ -46,10 +46,6 @@ public:
   ///
   unsigned getID() const { return ID; }
 
-  /// getName() - Return the register class name for debugging.
-  ///
-  const char *getName() const { return Name; }
-
   /// begin/end - Return all of the registers in this class.
   ///
   iterator       begin() const { return RegsBegin; }
@@ -162,6 +158,7 @@ private:
   const MCPhysReg (*RegUnitRoots)[2];         // Pointer to regunit root table.
   const MCPhysReg *DiffLists;                 // Pointer to the difflists array
   const char *RegStrings;                     // Pointer to the string table.
+  const char *RegClassStrings;                // Pointer to the class strings.
   const uint16_t *SubRegIndices;              // Pointer to the subreg lookup
                                               // array.
   const SubRegCoveredBits *SubRegIdxRanges;   // Pointer to the subreg covered
@@ -243,6 +240,7 @@ public:
                           unsigned NRU,
                           const MCPhysReg *DL,
                           const char *Strings,
+                          const char *ClassStrings,
                           const uint16_t *SubIndices,
                           unsigned NumIndices,
                           const SubRegCoveredBits *SubIdxRanges,
@@ -254,6 +252,7 @@ public:
     Classes = C;
     DiffLists = DL;
     RegStrings = Strings;
+    RegClassStrings = ClassStrings;
     NumClasses = NC;
     RegUnitRoots = RURoots;
     NumRegUnits = NRU;
@@ -401,6 +400,10 @@ public:
     return Classes[i];
   }
 
+  const char *getRegClassName(const MCRegisterClass *Class) const {
+    return RegClassStrings + Class->NameIdx;
+  }
+
    /// \brief Returns the encoding for RegNo
   uint16_t getEncodingValue(unsigned RegNo) const {
     assert(RegNo < NumRegs &&