aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-19 18:45:20 +0000
committerChris Lattner <sabre@nondot.org>2005-08-19 18:45:20 +0000
commitc67c18fd2378fd2394c42f12b67897e7eba02d5c (patch)
tree65460cc69d21e9ddc85c03b685831caaf9dac790
parent6096f0d4c6c4796f99c1bf8d24136b8c6b3db43d (diff)
Read the namespace field from register classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22918 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--utils/TableGen/CodeGenRegisters.h1
-rw-r--r--utils/TableGen/CodeGenTarget.cpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h
index 2cd312941b..bf0187a1e6 100644
--- a/utils/TableGen/CodeGenRegisters.h
+++ b/utils/TableGen/CodeGenRegisters.h
@@ -32,6 +32,7 @@ namespace llvm {
struct CodeGenRegisterClass {
Record *TheDef;
+ std::string Namespace;
std::vector<Record*> Elements;
unsigned SpillSize;
unsigned SpillAlignment;
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index 1f698c16d2..ffc5194738 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -143,6 +143,13 @@ void CodeGenTarget::ReadRegisterClasses() const {
}
CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
+ // Rename anonymous register classes.
+ if (R->getName().size() > 9 && R->getName()[9] == '.') {
+ static unsigned AnonCounter = 0;
+ R->setName("AnonRegClass_"+utostr(AnonCounter++));
+ }
+
+ Namespace = R->getValueAsString("Namespace");
SpillSize = R->getValueAsInt("Size");
SpillAlignment = R->getValueAsInt("Alignment");