Only avoid the check if we're the last operand before the variable
authorEric Christopher <echristo@apple.com>
Wed, 17 Nov 2010 00:55:36 +0000 (00:55 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 17 Nov 2010 00:55:36 +0000 (00:55 +0000)
operands in a variadic instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119446 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineVerifier.cpp

index 47a94b35c76ad3e9ab313ac83da6215f464d8e2f..f92b7fe5ac7ef093a5a447ab14285206907882d3 100644 (file)
@@ -558,9 +558,9 @@ MachineVerifier::visitMachineOperand(const MachineOperand *MO, unsigned MONum) {
     else if (MO->isImplicit())
       report("Explicit definition marked as implicit", MO, MONum);
   } else if (MONum < TI.getNumOperands()) {
-    // Don't check if it's a variadic instruction. See, e.g., LDM_RET in the arm
-    // back end.
-    if (MO->isReg() && MONum != TI.getNumOperands()-1) {
+    // Don't check if it's the last operand in a variadic instruction. See,
+    // e.g., LDM_RET in the arm back end.
+    if (MO->isReg() && !(TI.isVariadic() && MONum == TI.getNumOperands()-1)) {
       if (MO->isDef())
         report("Explicit operand marked as def", MO, MONum);
       if (MO->isImplicit())