================
@@ -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;
----------------
kateinoigakukun wrote:

Right, wasm-ld doesn't support it today, but IMO it's worth to use `MCExpr` 
here today for some reasons:
1. It makes the future link-time relocations on init-expr significantly 
straightforward. It should simplify things around GOT if we can make 
extended-const mandatory in the future.
2. If we adopt 
https://github.com/llvm/llvm-project/pull/212007#discussion_r4244815731 
https://github.com/llvm/llvm-project/pull/212007#discussion_r4244815734, we can 
reuse existing infra to convert text format to `MCExpr`
3. Changing the representation later will require reworking almost the all 
things again, so better to use flexible representation from day 1 while 
restricting the expression to be very subset for the first land.

https://github.com/llvm/llvm-project/pull/212007
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to