[PATCH] D92620: [lld][WebAssembly] Add suppport for PIC + passive data initialization

Thomas Lively via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 3 17:18:12 PST 2020


tlively added a comment.

Looks good so far!



================
Comment at: lld/wasm/Writer.cpp:933
+      //
+      // In the case we are building with PIC the calculate the
+      // flag location using:
----------------



================
Comment at: lld/wasm/Writer.cpp:956-961
+      if (config->isPic) {
+        writeU8(os, WASM_OPCODE_LOCAL_GET, "local.get");
+        writeUleb128(os, 0, "local 0");
+      } else {
+        writeI32Const(os, flagAddress, "flag address");
+      }
----------------
This repeated code chunk could be extracted into a small lambda to reduce repetition.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92620/new/

https://reviews.llvm.org/D92620



More information about the llvm-commits mailing list