[llvm] r325959 - Simplify a DEBUG statement to remove a set but not used variable in release builds.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 13:14:47 PST 2018


Author: echristo
Date: Fri Feb 23 13:14:47 2018
New Revision: 325959

URL: http://llvm.org/viewvc/llvm-project?rev=325959&view=rev
Log:
Simplify a DEBUG statement to remove a set but not used variable in release builds.

Modified:
    llvm/trunk/lib/MC/WasmObjectWriter.cpp

Modified: llvm/trunk/lib/MC/WasmObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/WasmObjectWriter.cpp?rev=325959&r1=325958&r2=325959&view=diff
==============================================================================
--- llvm/trunk/lib/MC/WasmObjectWriter.cpp (original)
+++ llvm/trunk/lib/MC/WasmObjectWriter.cpp Fri Feb 23 13:14:47 2018
@@ -1181,15 +1181,12 @@ void WasmObjectWriter::writeObject(MCAss
       DEBUG(dbgs() << "  -> segment index: " << Ref.Segment);
     } else {
       // A "true" Wasm global (currently just __stack_pointer)
-      unsigned WasmIndex;
-      if (WS.isDefined()) {
+      if (WS.isDefined())
         report_fatal_error("don't yet support defined globals");
-      } else {
-        // An import; the index was assigned above
-        WasmIndex = WasmIndices.find(&WS)->second;
-      }
 
-      DEBUG(dbgs() << "  -> global index: " << WasmIndex << "\n");
+      // An import; the index was assigned above
+      DEBUG(dbgs() << "  -> global index: " << WasmIndices.find(&WS)->second
+                   << "\n");
     }
 
     if (WS.isDefined())




More information about the llvm-commits mailing list