aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/CodeGenTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/CodeGenTarget.cpp')
-rw-r--r--utils/TableGen/CodeGenTarget.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp
index 61e237f1bd..7c153ece92 100644
--- a/utils/TableGen/CodeGenTarget.cpp
+++ b/utils/TableGen/CodeGenTarget.cpp
@@ -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) {