diff options
author | Chris Lattner <sabre@nondot.org> | 2003-08-01 04:46:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-08-01 04:46:24 +0000 |
commit | 6f334ad8f5c9319b334e2ba68b89d0dd46156788 (patch) | |
tree | 45f1dc9731297510db825f999a327b83a4e21a39 /utils/TableGen/CodeEmitterGen.cpp | |
parent | 1d1adea4937aa5c7b4bd0aa0463fe38fcdd22c7e (diff) |
Add new getValueAsBitsInit 'high-level' method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/CodeEmitterGen.cpp')
-rw-r--r-- | utils/TableGen/CodeEmitterGen.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/utils/TableGen/CodeEmitterGen.cpp b/utils/TableGen/CodeEmitterGen.cpp index 0619967f77..dc61f8f507 100644 --- a/utils/TableGen/CodeEmitterGen.cpp +++ b/utils/TableGen/CodeEmitterGen.cpp @@ -26,14 +26,7 @@ void CodeEmitterGen::run(std::ostream &o) { o << " case " << Namespace << R->getName() << ": {\n" << " DEBUG(std::cerr << \"Emitting " << R->getName() << "\\n\");\n"; - const RecordVal *InstVal = R->getValue("Inst"); - if (!InstVal) - throw std::string("No 'Inst' record found in target description file!"); - - Init *InitVal = InstVal->getValue(); - assert(dynamic_cast<BitsInit*>(InitVal) && - "Can only handle undefined bits<> types!"); - BitsInit *BI = (BitsInit*)InitVal; + BitsInit *BI = R->getValueAsBitsInit("Inst"); unsigned Value = 0; const std::vector<RecordVal> &Vals = R->getValues(); @@ -50,7 +43,7 @@ void CodeEmitterGen::run(std::ostream &o) { } DEBUG(o << "\n"); - DEBUG(o << " // " << *InstVal << "\n"); + DEBUG(o << " // " << *R->getValue("Inst") << "\n"); o << " Value = " << Value << "U;\n\n"; // Loop over all of the fields in the instruction adding in any |