This is an archive of the discontinued LLVM Phabricator instance.

[lld][WebAssembly] Cleanup duplicate fields in Symbols.h. NFC
ClosedPublic

Authored by sbc100 on Jul 14 2021, 5:18 PM.

Details

Summary

This avoids duplication and simplifies the code in several places
without increasing the size of the symbol union (at least not
above the assert'd limit of 120 bytes).

Diff Detail

Event Timeline

sbc100 created this revision.Jul 14 2021, 5:18 PM
sbc100 requested review of this revision.Jul 14 2021, 5:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2021, 5:18 PM
sbc100 updated this revision to Diff 358788.Jul 14 2021, 5:25 PM

revert part

dschuff accepted this revision.Jul 15 2021, 10:53 AM
This revision is now accepted and ready to land.Jul 15 2021, 10:53 AM
fitzgen added inline comments.
lld/wasm/Symbols.h
177

Are you concerned about growing the size of Symbol by 6 words, even though the majority of symbols aren't imported and won't use these fields?

fitzgen added inline comments.Jul 16 2021, 10:43 AM
lld/wasm/Symbols.h
177

Ah okay I see what you mean about this not growing the size of SymbolUnion which I guess is more important than Symbol itself.

sbc100 added inline comments.Jul 16 2021, 10:43 AM
lld/wasm/Symbols.h
177

Its only the sizeof SymbolUnion that actually makes any difference here since all symbols are allocated at that size. This change didn't effect the sizeof SymbolUnion, at least no enough to cause the static assert to fail. I can take a look at weather it changed at all.

sbc100 added inline comments.Jul 16 2021, 10:53 AM
lld/wasm/Symbols.h
177

Confirms that SymbolUnion size if unchanged by this PR (120 bytes before and after).

sbc100 updated this revision to Diff 359918.Jul 19 2021, 2:31 PM
  • rebase
This revision was landed with ongoing or failed builds.Jul 19 2021, 2:31 PM
This revision was automatically updated to reflect the committed changes.