[lld] [llvm] [Object][Wasm] Move WasmSymbolInfo directly into WasmSymbol (NFC) (PR #80219)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 17:02:23 PST 2024


sbc100 wrote:

> @sbc100 this is a prototype PR to move the `WasmSymbolInfo`s from their own vector on the `WasmLinkingData` directly into the `WasmSymbol` object. Removing the const-ref to an external object allows the vector of `WasmSymbol`s to be safely expanded/reallocated (which we'd need to do if we want to synthesize symbols from export and name sections together). It can maybe be further refined, but mostly I'm wondering if you recall why the organization was this way in the first place. The `WasymSymbolInfo`s never seem to be accessed other than via the `WasmSymbol` itself, so this ended up being a very minimal change.

I think it as just so that the `WasmLinkingData` struct could contain all the stuff in the linking metadata section.. trying to keep the stuf in Wasm.h as direct a mapping to the binary file as possible.  I guess that has not proved very useful so this change seems reasonable.    Do we need `WasmLinkingData` at all anymore?

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


More information about the llvm-commits mailing list