This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Move code and data sectiion generation to finalizeContent. NFC.
ClosedPublic

Authored by sbc100 on May 15 2019, 5:33 PM.

Details

Summary

Previously these sections were being generated during their
constructors. This moves the work to finalizeContent, and also does
the same for the relocation sections because their contents depends
on the final layout too.

This change is smaller part of a larger refactor to how we deal
with synthetic sections: https://reviews.llvm.org/D61811

Event Timeline

sbc100 created this revision.May 15 2019, 5:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2019, 5:33 PM
sbc100 updated this revision to Diff 199705.May 15 2019, 5:36 PM
  • remove isNeeded
sbc100 added a reviewer: ruiu.May 15 2019, 5:36 PM
sbc100 updated this revision to Diff 199874.May 16 2019, 11:46 AM
  • reduce diff
sbc100 updated this revision to Diff 199876.May 16 2019, 11:47 AM
  • whitespace
dschuff accepted this revision.May 16 2019, 1:14 PM
This revision is now accepted and ready to land.May 16 2019, 1:14 PM
This revision was automatically updated to reflect the committed changes.
ruiu added a comment.May 17 2019, 5:14 AM

LGTM

lld/trunk/wasm/OutputSections.h
72 ↗(On Diff #199906)

Could you add a comment as to what this function is supposed to do? E.g.

writeBody writes section contents to Body string. You need to call this function before fixing section layout because otherwise section size is not known.