Read the namespace field from register classes
authorChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 18:45:20 +0000 (18:45 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 18:45:20 +0000 (18:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22918 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenRegisters.h
utils/TableGen/CodeGenTarget.cpp

index 2cd312941b80aeaad0fceb31f76d4bd6fd16794a..bf0187a1e65090469c8bdfaab411aa64156dd749 100644 (file)
@@ -32,6 +32,7 @@ namespace llvm {
 
   struct CodeGenRegisterClass {
     Record *TheDef;
+    std::string Namespace;
     std::vector<Record*> Elements;
     unsigned SpillSize;
     unsigned SpillAlignment;
index 1f698c16d24c177133cc4611abd44f41ca490676..ffc5194738561cc9567f129bd0b567f9557a5182 100644 (file)
@@ -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");