From ac46893e246748876d1155bb0c9e8892e52acab7 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 19 Aug 2005 19:12:51 +0000 Subject: [PATCH] Split register class "Methods" into MethodProtos and MethodBodies git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22928 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/TableGen/CodeGenRegisters.h | 2 +- utils/TableGen/CodeGenTarget.cpp | 14 ++++++++++---- utils/TableGen/RegisterInfoEmitter.cpp | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) 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"; -- 2.34.1