[llvm-commits] [llvm] r69190 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Dan Gohman gohman at apple.com
Wed Apr 15 10:59:12 PDT 2009


Author: djg
Date: Wed Apr 15 12:59:11 2009
New Revision: 69190

URL: http://llvm.org/viewvc/llvm-project?rev=69190&view=rev
Log:
Fix MachineInstr::getNumExplicitOperands to count
variadic operands correctly. Patch by Jakob Stoklund Olesen!

Modified:
    llvm/trunk/lib/CodeGen/MachineInstr.cpp

Modified: llvm/trunk/lib/CodeGen/MachineInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineInstr.cpp?rev=69190&r1=69189&r2=69190&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineInstr.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Wed Apr 15 12:59:11 2009
@@ -623,8 +623,8 @@
   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++;
   }





More information about the llvm-commits mailing list