diff options
-rw-r--r-- | utils/TableGen/CodeGenTarget.cpp | 7 | ||||
-rw-r--r-- | utils/TableGen/DAGISelEmitter.cpp | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/utils/TableGen/CodeGenTarget.cpp b/utils/TableGen/CodeGenTarget.cpp index c18dff351f..f0fdeae945 100644 --- a/utils/TableGen/CodeGenTarget.cpp +++ b/utils/TableGen/CodeGenTarget.cpp @@ -285,8 +285,11 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) throw "Unknown operand class '" + Rec->getName() + "' in instruction '" + R->getName() + "' instruction!"; - if (!DI->getArgName(i).empty() && - !OperandNames.insert(DI->getArgName(i)).second) + // Check that the operand has a name and that it's unique. + if (DI->getArgName(i).empty()) + throw "In instruction '" + R->getName() + "', operand #" + utostr(i) + + " has no name!"; + if (!OperandNames.insert(DI->getArgName(i)).second) throw "In instruction '" + R->getName() + "', operand #" + utostr(i) + " has the same name as a previous operand!"; diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 0093e50f82..085f7d2dae 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -788,10 +788,7 @@ void DAGISelEmitter::ParseAndResolveInstructions() { if (i == CGI.OperandList.size()) I->error("'" + InstResults.begin()->first + "' set but does not appear in operand list!"); - const std::string &OpName = CGI.OperandList[i].Name; - if (OpName.empty()) - I->error("Operand #" + utostr(i) + " in operands list has no name!"); // Check that it exists in InstResults. Record *R = InstResults[OpName]; |