[clang] [lld] [llvm] [WebAssembly] Emit constant initializers for addrspace(1) globals (PR #212007)

Sam Clegg via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 10:00:08 PDT 2026


================
@@ -28,6 +28,7 @@ class MCSymbolWasm : public MCSymbol {
   wasm::WasmSignature *Signature = nullptr;
   std::optional<wasm::WasmGlobalType> GlobalType;
   std::optional<wasm::WasmTableType> TableType;
+  std::optional<uint64_t> GlobalInitValue;
----------------
sbc100 wrote:

I see, that does seems like nice way to export the value.

I do wonder if instead you could export it as C data address and then read the value from linear memory at that address?



https://github.com/llvm/llvm-project/pull/212007


More information about the cfe-commits mailing list