diff --git a/utils/TableGen/CodeGenRegisters.h b/utils/TableGen/CodeGenRegisters.h index bf0187a1e65..e4531137349 100644 --- a/utils/TableGen/CodeGenRegisters.h +++ b/utils/TableGen/CodeGenRegisters.h @@ -36,7 +36,7 @@ namespace llvm { std::vector Elements; unsigned SpillSize; unsigned SpillAlignment; - std::string MethodDefinitions; + std::string MethodProtos, MethodBodies; const std::string &getName() const; diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index ffc51947385..8e7cbdc9093 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -153,12 +153,18 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) { SpillSize = R->getValueAsInt("Size"); SpillAlignment = R->getValueAsInt("Alignment"); - if (CodeInit *CI = dynamic_cast(R->getValueInit("Methods"))) - MethodDefinitions = CI->getValue(); + if (CodeInit *CI = dynamic_cast(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(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(RegList->getElement(i)); diff --git a/utils/TableGen/RegisterInfoEmitter.cpp b/utils/TableGen/RegisterInfoEmitter.cpp index b69c7b7b932..3b5789f9a62 100644 --- a/utils/TableGen/RegisterInfoEmitter.cpp +++ b/utils/TableGen/RegisterInfoEmitter.cpp @@ -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";