diff options
author | Chris Lattner <sabre@nondot.org> | 2004-08-11 04:08:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-08-11 04:08:36 +0000 |
commit | 9302ba416b4b5291f4b3f123a47d47c9268573f9 (patch) | |
tree | 63bbf5825812b66447b2ee3e01949e0d33438ee5 /utils/TableGen/AsmWriterEmitter.cpp | |
parent | 8d963e602b752f6c071063a5e769f6058018c733 (diff) | |
download | llvm-9302ba416b4b5291f4b3f123a47d47c9268573f9.tar.gz llvm-9302ba416b4b5291f4b3f123a47d47c9268573f9.tar.bz2 llvm-9302ba416b4b5291f4b3f123a47d47c9268573f9.tar.xz |
Fix minor bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15649 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/AsmWriterEmitter.cpp')
-rw-r--r-- | utils/TableGen/AsmWriterEmitter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index faecc9fdc6..b2e2125f82 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -75,15 +75,16 @@ void AsmWriterEmitter::run(std::ostream &O) { // 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; } |