[lld] r325537 - Removed a variable that is used only once.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 14:39:52 PST 2018


Author: ruiu
Date: Mon Feb 19 14:39:52 2018
New Revision: 325537

URL: http://llvm.org/viewvc/llvm-project?rev=325537&view=rev
Log:
Removed a variable that is used only once.

Modified:
    lld/trunk/wasm/InputChunks.cpp

Modified: lld/trunk/wasm/InputChunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/InputChunks.cpp?rev=325537&r1=325536&r2=325537&view=diff
==============================================================================
--- lld/trunk/wasm/InputChunks.cpp (original)
+++ lld/trunk/wasm/InputChunks.cpp Mon Feb 19 14:39:52 2018
@@ -48,16 +48,16 @@ static void applyRelocation(uint8_t *Buf
   DEBUG(dbgs() << "write reloc: type=" << Reloc.Reloc.Type
                << " index=" << Reloc.Reloc.Index << " value=" << Reloc.Value
                << " offset=" << Reloc.Reloc.Offset << "\n");
+
   Buf += Reloc.Reloc.Offset;
-  int64_t ExistingValue;
+
   switch (Reloc.Reloc.Type) {
   case R_WEBASSEMBLY_TYPE_INDEX_LEB:
   case R_WEBASSEMBLY_FUNCTION_INDEX_LEB:
   case R_WEBASSEMBLY_GLOBAL_INDEX_LEB:
-    ExistingValue = decodeULEB128(Buf);
     // Additional check to verify that the existing value that the location
     // matches our expectations.
-    if (ExistingValue != Reloc.Reloc.Index) {
+    if (decodeULEB128(Buf) != Reloc.Reloc.Index) {
       DEBUG(dbgs() << "existing value: " << decodeULEB128(Buf) << "\n");
       assert(decodeULEB128(Buf) == Reloc.Reloc.Index);
     }




More information about the llvm-commits mailing list