[llvm] r184065 - MachineOperand::setIsDebug should ensure the register is /not/ a definition

David Blaikie dblaikie at gmail.com
Sun Jun 16 13:34:09 PDT 2013


Author: dblaikie
Date: Sun Jun 16 15:34:09 2013
New Revision: 184065

URL: http://llvm.org/viewvc/llvm-project?rev=184065&view=rev
Log:
MachineOperand::setIsDebug should ensure the register is /not/ a definition

This currently unused function appeared to be asserting in the wrong
direction - DebugValues are never definitions of registers, only uses.
Curiously we don't perform any of these checks for the more common (&
actually used) case of MachineOperand::CreateReg (or other Create
functions).

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineOperand.h

Modified: llvm/trunk/include/llvm/CodeGen/MachineOperand.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineOperand.h?rev=184065&r1=184064&r2=184065&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineOperand.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineOperand.h Sun Jun 16 15:34:09 2013
@@ -391,7 +391,7 @@ public:
   }
 
   void setIsDebug(bool Val = true) {
-    assert(isReg() && IsDef && "Wrong MachineOperand accessor");
+    assert(isReg() && !IsDef && "Wrong MachineOperand accessor");
     IsDebug = Val;
   }
 





More information about the llvm-commits mailing list