[llvm] r262144 - CodeGen: Assert valid MI in AntiDepBreaker::UpdateDbgValue
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 27 11:23:35 PST 2016
Author: dexonsmith
Date: Sat Feb 27 13:23:34 2016
New Revision: 262144
URL: http://llvm.org/viewvc/llvm-project?rev=262144&view=rev
Log:
CodeGen: Assert valid MI in AntiDepBreaker::UpdateDbgValue
This already assumes a valid MI, since it dereferences the MI in an
assertion before checking for null. At an explicit assert.
Modified:
llvm/trunk/lib/CodeGen/AntiDepBreaker.h
Modified: llvm/trunk/lib/CodeGen/AntiDepBreaker.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AntiDepBreaker.h?rev=262144&r1=262143&r2=262144&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AntiDepBreaker.h (original)
+++ llvm/trunk/lib/CodeGen/AntiDepBreaker.h Sat Feb 27 13:23:34 2016
@@ -56,8 +56,9 @@ public:
/// Update DBG_VALUE if dependency breaker is updating
/// other machine instruction to use NewReg.
void UpdateDbgValue(MachineInstr *MI, unsigned OldReg, unsigned NewReg) {
+ assert(MI && "Expected valid instruction");
assert (MI->isDebugValue() && "MI is not DBG_VALUE!");
- if (MI && MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == OldReg)
+ if (MI->getOperand(0).isReg() && MI->getOperand(0).getReg() == OldReg)
MI->getOperand(0).setReg(NewReg);
}
};
More information about the llvm-commits
mailing list