[llvm] r372583 - Localizer - fix "variable used but never read" analyzer warning. NFCI.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 23 04:38:10 PDT 2019


Author: rksimon
Date: Mon Sep 23 04:38:10 2019
New Revision: 372583

URL: http://llvm.org/viewvc/llvm-project?rev=372583&view=rev
Log:
Localizer - fix "variable used but never read" analyzer warning. NFCI.

Simplify the code by separating the modification of the Changed variable from returning it.

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/Localizer.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/Localizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/Localizer.cpp?rev=372583&r1=372582&r2=372583&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/Localizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/Localizer.cpp Mon Sep 23 04:38:10 2019
@@ -220,5 +220,6 @@ bool Localizer::runOnMachineFunction(Mac
   LocalizedSetVecT LocalizedInstrs;
 
   bool Changed = localizeInterBlock(MF, LocalizedInstrs);
-  return Changed |= localizeIntraBlock(LocalizedInstrs);
+  Changed |= localizeIntraBlock(LocalizedInstrs);
+  return Changed;
 }




More information about the llvm-commits mailing list