Silence 'warning: unused variable' when compiling with Clang 10.0
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Tue, 22 Sep 2020 16:05:11 +0000 (12:05 -0400)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Tue, 22 Sep 2020 16:17:40 +0000 (12:17 -0400)
llvm/lib/CodeGen/PeepholeOptimizer.cpp

index ca9e3cd..4f05468 100644 (file)
@@ -1413,7 +1413,9 @@ bool PeepholeOptimizer::foldRedundantCopy(
 
   MachineInstr *PrevCopy = CopyMIs.find(SrcPair)->second;
 
+#ifndef NDEBUG
   unsigned PrevSrcSubReg = PrevCopy->getOperand(1).getSubReg();
+#endif
   assert(SrcSubReg == PrevSrcSubReg && "Unexpected mismatching subreg!");
 
   Register PrevDstReg = PrevCopy->getOperand(0).getReg();