[llvm-commits] CVS: llvm/utils/TableGen/AsmWriterEmitter.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Aug 10 21:08:48 PDT 2004



Changes in directory llvm/utils/TableGen:

AsmWriterEmitter.cpp updated: 1.4 -> 1.5
---
Log message:

Fix minor bug in previous checkin


---
Diffs of the changes:  (+5 -4)

Index: llvm/utils/TableGen/AsmWriterEmitter.cpp
diff -u llvm/utils/TableGen/AsmWriterEmitter.cpp:1.4 llvm/utils/TableGen/AsmWriterEmitter.cpp:1.5
--- llvm/utils/TableGen/AsmWriterEmitter.cpp:1.4	Tue Aug 10 21:23:23 2004
+++ llvm/utils/TableGen/AsmWriterEmitter.cpp	Tue Aug 10 23:08:36 2004
@@ -75,15 +75,16 @@
 
           // 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 (OpNo == 1)
+          unsigned MIOp = I->second.OperandList[OpNo].MIOperandNo;
+          if (I->second.isTwoAddress && MIOp != 0) {
+            if (MIOp == 1)
               throw "Should refer to operand #0 instead of #1 for two-address"
                     " instruction '" + I->first + "'!";
-            --OpNo;
+            --MIOp;
           }
 
           O << ";  " << I->second.OperandList[OpNo].PrinterMethodName 
-            << "(MI, " << I->second.OperandList[OpNo].MIOperandNo << ", MVT::"
+            << "(MI, " << MIOp << ", MVT::"
             << getName(I->second.OperandList[OpNo].Ty) << "); O ";
           LastEmitted = VarEnd;
         }






More information about the llvm-commits mailing list