[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:56:05 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGead2aa7098cf: Fix unused variable warning when compiling with asserts disabled. (authored by akuegel).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89454/new/

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.298345.patch
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201015/7826b190/attachment.bin>


More information about the llvm-commits mailing list