[lld] r333030 - [WebAssembly] Remove dead code from LEB compression pass.

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 13:52:20 PDT 2018


Author: sbc
Date: Tue May 22 13:52:20 2018
New Revision: 333030

URL: http://llvm.org/viewvc/llvm-project?rev=333030&view=rev
Log:
[WebAssembly] Remove dead code from LEB compression pass.

There are only certain relocation types that can exist in the
wasm code section and they are all LEB types.  Remove the dead
code for handling the other (I32) reloc types.

Differential Revision: https://reviews.llvm.org/D47226

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=333030&r1=333029&r2=333030&view=diff
==============================================================================
--- lld/trunk/wasm/InputChunks.cpp (original)
+++ lld/trunk/wasm/InputChunks.cpp Tue May 22 13:52:20 2018
@@ -193,12 +193,8 @@ static unsigned writeCompressedReloc(uin
   case R_WEBASSEMBLY_TABLE_INDEX_SLEB:
   case R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
     return encodeSLEB128(static_cast<int32_t>(Value), Buf);
-  case R_WEBASSEMBLY_TABLE_INDEX_I32:
-  case R_WEBASSEMBLY_MEMORY_ADDR_I32:
-    write32le(Buf, Value);
-    return 4;
   default:
-    llvm_unreachable("unknown relocation type");
+    llvm_unreachable("unexpected relocation type");
   }
 }
 
@@ -211,11 +207,8 @@ static unsigned getRelocWidthPadded(cons
   case R_WEBASSEMBLY_TABLE_INDEX_SLEB:
   case R_WEBASSEMBLY_MEMORY_ADDR_SLEB:
     return 5;
-  case R_WEBASSEMBLY_TABLE_INDEX_I32:
-  case R_WEBASSEMBLY_MEMORY_ADDR_I32:
-    return 4;
   default:
-    llvm_unreachable("unknown relocation type");
+    llvm_unreachable("unexpected relocation type");
   }
 }
 




More information about the llvm-commits mailing list