diff options
author | Dan Gohman <gohman@apple.com> | 2009-04-15 17:59:11 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-04-15 17:59:11 +0000 |
commit | 37608532c4361569a7342e1a2c0bae044952b806 (patch) | |
tree | 5e1155519c676e667a4f2291c58bf9935a63a3f1 /llvm/lib/CodeGen/MachineInstr.cpp | |
parent | e20a2e5fa34259cf545ea8830d1f93a889953dd6 (diff) | |
download | bcm5719-llvm-37608532c4361569a7342e1a2c0bae044952b806.tar.gz bcm5719-llvm-37608532c4361569a7342e1a2c0bae044952b806.zip |
Fix MachineInstr::getNumExplicitOperands to count
variadic operands correctly. Patch by Jakob Stoklund Olesen!
llvm-svn: 69190
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineInstr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstr.cpp b/llvm/lib/CodeGen/MachineInstr.cpp index a934b76b6d5..4e5229fad0e 100644 --- a/llvm/lib/CodeGen/MachineInstr.cpp +++ b/llvm/lib/CodeGen/MachineInstr.cpp @@ -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++; } |