[llvm] [WebAssembly] Emit i64 GOT import globals on wasm64 (PR #226326)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 10:52:00 PDT 2026


================
@@ -1430,7 +1430,9 @@ void WasmObjectWriter::prepareImports(
         Import.Module = "GOT.mem";
       Import.Field = WS.getName();
       Import.Kind = wasm::WASM_EXTERNAL_GLOBAL;
-      Import.Global = {wasm::WASM_TYPE_I32, true};
+      Import.Global = {static_cast<uint8_t>(is64Bit() ? wasm::WASM_TYPE_I64
----------------
sbc100 wrote:

How about we declare AddrType before the loop so we only need to compute this once and we don't need to use two lines here?

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


More information about the llvm-commits mailing list