[PATCH] D47226: [WebAssembly] Remove dead code from LEB compression pass.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 13:47:43 PDT 2018


sbc100 created this revision.
Herald added subscribers: llvm-commits, sunfish, aheejin, jgravelle-google, dschuff.

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.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D47226

Files:
  wasm/InputChunks.cpp


Index: wasm/InputChunks.cpp
===================================================================
--- wasm/InputChunks.cpp
+++ wasm/InputChunks.cpp
@@ -193,12 +193,8 @@
   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 @@
   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");
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47226.148095.patch
Type: text/x-patch
Size: 888 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180522/84596ea5/attachment.bin>


More information about the llvm-commits mailing list