From ead2aa7098cfd693ed1842a88346ba67cfccd7df Mon Sep 17 00:00:00 2001 From: Adrian Kuegel Date: Thu, 15 Oct 2020 12:48:35 +0200 Subject: [PATCH] Fix unused variable warning when compiling with asserts disabled. Differential Revision: https://reviews.llvm.org/D89454 --- llvm/lib/CodeGen/MachineFunction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp index 60af65834947..2568448f3c92 100644 --- a/llvm/lib/CodeGen/MachineFunction.cpp +++ b/llvm/lib/CodeGen/MachineFunction.cpp @@ -967,11 +967,10 @@ void MachineFunction::substituteDebugValuesForInst(const MachineInstr &Old, // MIR output. for (unsigned int I = 0; I < Old.getNumOperands(); ++I) { const auto &OldMO = Old.getOperand(I); - auto &NewMO = Old.getOperand(I); if (!OldMO.isReg() || !OldMO.isDef()) continue; - assert(NewMO.isDef()); + assert(Old.getOperand(I).isDef()); unsigned NewInstrNum = New.getDebugInstrNum(); makeDebugValueSubstitution(std::make_pair(OldInstrNum, I),