1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

Split register class "Methods" into MethodProtos and MethodBodies

llvm-svn: 22928
This commit is contained in:
Chris Lattner 2005-08-19 19:12:51 +00:00
parent 78107cb342
commit 20c1c4cf07
3 changed files with 13 additions and 6 deletions

View File

@ -36,7 +36,7 @@ namespace llvm {
std::vector<Record*> Elements; std::vector<Record*> Elements;
unsigned SpillSize; unsigned SpillSize;
unsigned SpillAlignment; unsigned SpillAlignment;
std::string MethodDefinitions; std::string MethodProtos, MethodBodies;
const std::string &getName() const; const std::string &getName() const;

View File

@ -153,11 +153,17 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
SpillSize = R->getValueAsInt("Size"); SpillSize = R->getValueAsInt("Size");
SpillAlignment = R->getValueAsInt("Alignment"); SpillAlignment = R->getValueAsInt("Alignment");
if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("Methods"))) if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("MethodBodies")))
MethodDefinitions = CI->getValue(); MethodBodies = CI->getValue();
else else
throw "Expected 'code' fragment for 'Methods' value in register class '"+ throw "Expected 'code' fragment for 'MethodBodies' value in register "
getName() + "'!"; "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"); ListInit *RegList = R->getValueAsListInit("MemberList");
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) { for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {

View File

@ -126,7 +126,8 @@ void RegisterInfoEmitter::run(std::ostream &OS) {
<< " " << Name << "Class() : TargetRegisterClass(" << " " << Name << "Class() : TargetRegisterClass("
<< RC.SpillSize/8 << ", " << RC.SpillAlignment/8 << ", " << Name << ", " << RC.SpillSize/8 << ", " << RC.SpillAlignment/8 << ", " << Name << ", "
<< Name << " + " << RC.Elements.size() << ") {}\n" << Name << " + " << RC.Elements.size() << ") {}\n"
<< RC.MethodDefinitions << " };\n\n"; << RC.MethodProtos << " };\n";
OS << RC.MethodBodies << "\n";
} }
OS << "} // end anonymous namespace\n\n"; OS << "} // end anonymous namespace\n\n";