mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Add a new Record::getValueAsCode method to mirror the other getValueAs*
methods. Use it to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23336 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -154,17 +154,8 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
|
||||
SpillAlignment = R->getValueAsInt("Alignment");
|
||||
VT = getValueType(R->getValueAsDef("RegType"));
|
||||
|
||||
if (CodeInit *CI = dynamic_cast<CodeInit*>(R->getValueInit("MethodBodies")))
|
||||
MethodBodies = CI->getValue();
|
||||
else
|
||||
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() + "'!";
|
||||
MethodBodies = R->getValueAsCode("MethodBodies");
|
||||
MethodProtos = R->getValueAsCode("MethodProtos");
|
||||
|
||||
ListInit *RegList = R->getValueAsListInit("MemberList");
|
||||
for (unsigned i = 0, e = RegList->getSize(); i != e; ++i) {
|
||||
|
Reference in New Issue
Block a user