Split register class "Methods" into MethodProtos and MethodBodies
authorChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 19:12:51 +0000 (19:12 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 19 Aug 2005 19:12:51 +0000 (19:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22928 91177308-0d34-0410-b5e6-96231b3b80d8

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

index bf0187a1e65090469c8bdfaab411aa64156dd749..e45311373498fd06b4c32e723003653dc01ca715 100644 (file)
@@ -36,7 +36,7 @@ namespace llvm {
     std::vector<Record*> Elements;
     unsigned SpillSize;
     unsigned SpillAlignment;
-    std::string MethodDefinitions;
+    std::string MethodProtos, MethodBodies;
 
     const std::string &getName() const;
 
index ffc5194738561cc9567f129bd0b567f9557a5182..8e7cbdc9093730a468c269174d69dcda81f1ffcb 100644 (file)
@@ -153,12 +153,18 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
   SpillSize = R->getValueAsInt("Size");
   SpillAlignment = R->getValueAsInt("Alignment");
 
-  if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("Methods")))
-    MethodDefinitions = CI->getValue();
+  if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("MethodBodies")))
+    MethodBodies = CI->getValue();
   else
-    throw "Expected 'code' fragment for 'Methods' value in register class '"+
-          getName() + "'!";
+    throw "Expected 'code' fragment for 'MethodBodies' value in register "
+          "class '" + getName() + "'!";
 
+  if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("MethodProtos")))
+    MethodProtos = CI->getValue();
+  else
+    throw "Expected 'code' fragment for 'MethodProtos' value in register "
+      "class '" + getName() + "'!";
+  
   ListInit *RegList = R->getValueAsListInit("MemberList");
   for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
     DefInit *RegDef = dynamic_cast<DefInit*>(RegList->getElement(i));
index b69c7b7b93254815c5e47a7f56ac62a0de3c13dc..3b5789f9a621bb882240705aa87c27eb8b150d62 100644 (file)
@@ -126,7 +126,8 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
        << "    " << Name << "Class() : TargetRegisterClass("
        << RC.SpillSize/8 << ", " << RC.SpillAlignment/8 << ", " << Name << ", "
        << Name << " + " << RC.Elements.size() << ") {}\n"
-       << RC.MethodDefinitions << "  };\n\n";
+       << RC.MethodProtos << "  };\n";
+    OS << RC.MethodBodies << "\n";
   }
   OS << "}  // end anonymous namespace\n\n";