Be picky


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15400 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index 319fe4f..ea81795 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -75,8 +75,12 @@
 
           // If this is a two-address instruction and we are not accessing the
           // 0th operand, remove an operand.
-          if (I->second.isTwoAddress && OpNo != 0)
+          if (I->second.isTwoAddress && OpNo != 0) {
+            if (OpNo == 1)
+              throw "Should refer to operand #0 instead of #1 for two-address"
+                    " instruction '" + I->first + "'!";
             --OpNo;
+          }
 
           O << ";  printOperand(MI->getOperand(" << OpNo << "), MVT::"
             << getName(I->second.OperandList[OpNo].Ty) << "); O ";