aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-04-15 17:59:11 +0000
committerDan Gohman <gohman@apple.com>2009-04-15 17:59:11 +0000
commit3d88001b45157c4fe9c5ada554e7ddd7fe6fbce8 (patch)
treeb7824274e45a33bc56594d89219837e5aee83952 /lib
parent9ec577302f71523df1697038a9fd6702318b4f5f (diff)
downloadexternal_llvm-3d88001b45157c4fe9c5ada554e7ddd7fe6fbce8.zip
external_llvm-3d88001b45157c4fe9c5ada554e7ddd7fe6fbce8.tar.gz
external_llvm-3d88001b45157c4fe9c5ada554e7ddd7fe6fbce8.tar.bz2
Fix MachineInstr::getNumExplicitOperands to count
variadic operands correctly. Patch by Jakob Stoklund Olesen! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineInstr.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/MachineInstr.cpp b/lib/CodeGen/MachineInstr.cpp
index a934b76..4e5229f 100644
--- a/lib/CodeGen/MachineInstr.cpp
+++ b/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++;
}