force all instruction operands to be named.
authorChris Lattner <sabre@nondot.org>
Wed, 14 Sep 2005 21:13:50 +0000 (21:13 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 14 Sep 2005 21:13:50 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23358 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/CodeGenTarget.cpp
utils/TableGen/DAGISelEmitter.cpp

index c18dff351f1082bee4b925fbfbe247e0536226f0..f0fdeae94566ac55da941a1cd44dca2f36b3b9b4 100644 (file)
@@ -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!";
     
index 0093e50f82184cf46fa8c5953fdb30ff34dc7717..085f7d2dae5ef4671682fc6e0d7289ea96eae6f6 100644 (file)
@@ -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];