[PATCH] D89454: Fix unused variable warning when compiling with asserts disabled.

Adrian Kuegel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 15 03:50:20 PDT 2020


akuegel created this revision.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
akuegel requested review of this revision.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89454

Files:
  llvm/lib/CodeGen/MachineFunction.cpp


Index: llvm/lib/CodeGen/MachineFunction.cpp
===================================================================
--- llvm/lib/CodeGen/MachineFunction.cpp
+++ llvm/lib/CodeGen/MachineFunction.cpp
@@ -967,11 +967,10 @@
   // 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),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89454.298343.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201015/fbba70c2/attachment.bin>


More information about the llvm-commits mailing list