From a86411806a9b07623d5dd697de713284a589f24e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 11 Aug 2004 04:08:36 +0000 Subject: [PATCH] Fix minor bug in previous checkin llvm-svn: 15649 --- utils/TableGen/AsmWriterEmitter.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index faecc9fdc6d..b2e2125f82a 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; }