diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-18 20:50:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-18 20:50:52 +0000 |
commit | 5f418eafdc61f16335f2249ce2d31a6a4da75ea8 (patch) | |
tree | 2265434130104519c8a6b69d6e1c6b2492ce8031 /llvm/utils/TableGen/CodeGenInstruction.cpp | |
parent | 0204bc3de1bdebfa4a91693b1e5e1e826f191675 (diff) | |
download | bcm5719-llvm-5f418eafdc61f16335f2249ce2d31a6a4da75ea8.tar.gz bcm5719-llvm-5f418eafdc61f16335f2249ce2d31a6a4da75ea8.zip |
remove some code that was working around old sparc v9 backend bugs.
Add checking that the input/output operand list in spelled right.
llvm-svn: 98865
Diffstat (limited to 'llvm/utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenInstruction.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp index f5b52ecefb3..37ed84658a8 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/CodeGenInstruction.cpp @@ -127,27 +127,27 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) if (neverHasSideEffects + hasSideEffects > 1) throw R->getName() + ": multiple conflicting side-effect flags set!"; - DagInit *DI; - try { - DI = R->getValueAsDag("OutOperandList"); - } catch (...) { - // Error getting operand list, just ignore it (sparcv9). - AsmString.clear(); - OperandList.clear(); - return; - } + DagInit *DI = R->getValueAsDag("OutOperandList"); + + if (DefInit *Init = dynamic_cast<DefInit*>(DI->getOperator())) { + if (Init->getDef()->getName() != "ops" && + Init->getDef()->getName() != "outs") + throw R->getName() + ": invalid def name for output list: use 'outs'"; + } else + throw R->getName() + ": invalid output list: use 'outs'"; + NumDefs = DI->getNumArgs(); - - DagInit *IDI; - try { - IDI = R->getValueAsDag("InOperandList"); - } catch (...) { - // Error getting operand list, just ignore it (sparcv9). - AsmString.clear(); - OperandList.clear(); - return; - } - DI = (DagInit*)(new BinOpInit(BinOpInit::CONCAT, DI, IDI, new DagRecTy))->Fold(R, 0); + + DagInit *IDI = R->getValueAsDag("InOperandList"); + if (DefInit *Init = dynamic_cast<DefInit*>(IDI->getOperator())) { + if (Init->getDef()->getName() != "ops" && + Init->getDef()->getName() != "ins") + throw R->getName() + ": invalid def name for input list: use 'ins'"; + } else + throw R->getName() + ": invalid input list: use 'ins'"; + + DI = (DagInit*)(new BinOpInit(BinOpInit::CONCAT, + DI, IDI, new DagRecTy))->Fold(R, 0); unsigned MIOperandNo = 0; std::set<std::string> OperandNames; |