CodeGenInstruction &InstInfo =
CDP.getTargetInfo().getInstruction(getOperator()->getName());
// Apply the result type to the node
- if (NumResults == 0 || InstInfo.NumDefs == 0) {
+ if (NumResults == 0 ||
+ InstInfo.NumDefs == 0) {
MadeChange = UpdateNodeType(MVT::isVoid, TP);
} else {
Record *ResultNode = Inst.getResult(0);
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;