Attempt to fix a crash on WIN32.
authorEvan Cheng <evan.cheng@apple.com>
Thu, 22 Dec 2005 02:35:21 +0000 (02:35 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Thu, 22 Dec 2005 02:35:21 +0000 (02:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24936 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 510f41cfd9bf2ab89aafeac2fdc2dc174c080561..62581eea1d1c8992a02c2cc2c4a34c67e845a8e4 100644 (file)
@@ -1124,22 +1124,23 @@ void DAGISelEmitter::ParseInstructions() {
       
       CodeGenInstruction &InstInfo =Target.getInstruction(Instrs[i]->getName());
 
-      // Note: Removed if (InstInfo.OperandList.size() == 0) continue;
-      // It's possible for some instruction, e.g. RET for X86 that only has an
-      // implicit flag operand.
-      // FIXME: temporary hack...
-      if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
-          InstInfo.isStore) {
-        // These produce no results
-        for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
-          Operands.push_back(InstInfo.OperandList[j].Rec);
-      } else {
-        // Assume the first operand is the result.
-        Results.push_back(InstInfo.OperandList[0].Rec);
+      if (InstInfo.OperandList.size() != 0) {
+        // It's possible for some instruction, e.g. RET for X86 that only has an
+        // implicit flag operand.
+        // FIXME: temporary hack...
+        if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
+            InstInfo.isStore) {
+          // These produce no results
+          for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
+            Operands.push_back(InstInfo.OperandList[j].Rec);
+        } else {
+          // Assume the first operand is the result.
+          Results.push_back(InstInfo.OperandList[0].Rec);
       
-        // The rest are inputs.
-        for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
-          Operands.push_back(InstInfo.OperandList[j].Rec);
+          // The rest are inputs.
+          for (unsigned j = 1, e = InstInfo.OperandList.size(); j < e; ++j)
+            Operands.push_back(InstInfo.OperandList[j].Rec);
+        }
       }
       
       // Create and insert the instruction.