Fix MachineInstr::getNumExplicitOperands to count

variadic operands correctly. Patch by Jakob Stoklund Olesen!

llvm-svn: 69190
This commit is contained in:
Dan Gohman 2009-04-15 17:59:11 +00:00
parent e20a2e5fa3
commit 37608532c4
1 changed files with 2 additions and 2 deletions

View File

@ -623,8 +623,8 @@ unsigned MachineInstr::getNumExplicitOperands() const {
if (!TID->isVariadic())
return NumOperands;
for (unsigned e = getNumOperands(); NumOperands != e; ++NumOperands) {
const MachineOperand &MO = getOperand(NumOperands);
for (unsigned i = NumOperands, e = getNumOperands(); i != e; ++i) {
const MachineOperand &MO = getOperand(i);
if (!MO.isReg() || !MO.isImplicit())
NumOperands++;
}