summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCRegisterInfo.h
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-25 00:21:41 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-05-25 00:21:41 +0000
commitd5ce3ffa67698b9d21f58011f370a210a214d301 (patch)
treebd11d7a43e516e5d032f80ad2ab8ebf8bbe5e414 /include/llvm/MC/MCRegisterInfo.h
parent2db0e9ebb600a2e6b8f651f66a1ef50e0d3c3c6b (diff)
downloadllvm-d5ce3ffa67698b9d21f58011f370a210a214d301.tar.gz
llvm-d5ce3ffa67698b9d21f58011f370a210a214d301.tar.bz2
llvm-d5ce3ffa67698b9d21f58011f370a210a214d301.tar.xz
Compress MCRegisterInfo register name tables.
Store (debugging) register names as offsets into a string table instead of as char pointers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157449 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC/MCRegisterInfo.h')
-rw-r--r--include/llvm/MC/MCRegisterInfo.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h
index 47f57495c1..db4164ad2a 100644
--- a/include/llvm/MC/MCRegisterInfo.h
+++ b/include/llvm/MC/MCRegisterInfo.h
@@ -106,10 +106,10 @@ public:
/// of AX.
///
struct MCRegisterDesc {
- const char *Name; // Printable name for the reg (for debugging)
- uint32_t Overlaps; // Overlapping registers, described above
- uint32_t SubRegs; // Sub-register set, described above
- uint32_t SuperRegs; // Super-register set, described above
+ uint32_t Name; // Printable name for the reg (for debugging)
+ uint32_t Overlaps; // Overlapping registers, described above
+ uint32_t SubRegs; // Sub-register set, described above
+ uint32_t SuperRegs; // Super-register set, described above
};
/// MCRegisterInfo base class - We assume that the target defines a static
@@ -143,6 +143,7 @@ private:
const MCRegisterClass *Classes; // Pointer to the regclass array
unsigned NumClasses; // Number of entries in the array
const uint16_t *RegLists; // Pointer to the reglists array
+ const char *RegStrings; // Pointer to the string table.
const uint16_t *SubRegIndices; // Pointer to the subreg lookup
// array.
unsigned NumSubRegIndices; // Number of subreg indices.
@@ -165,6 +166,7 @@ public:
void InitMCRegisterInfo(const MCRegisterDesc *D, unsigned NR, unsigned RA,
const MCRegisterClass *C, unsigned NC,
const uint16_t *RL,
+ const char *Strings,
const uint16_t *SubIndices,
unsigned NumIndices,
const uint16_t *RET) {
@@ -173,6 +175,7 @@ public:
RAReg = RA;
Classes = C;
RegLists = RL;
+ RegStrings = Strings;
NumClasses = NC;
SubRegIndices = SubIndices;
NumSubRegIndices = NumIndices;
@@ -301,7 +304,7 @@ public:
/// getName - Return the human-readable symbolic target-specific name for the
/// specified physical register.
const char *getName(unsigned RegNo) const {
- return get(RegNo).Name;
+ return RegStrings + get(RegNo).Name;
}
/// getNumRegs - Return the number of registers this target has (useful for