This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Remove special handling of entry point export. NFC
ClosedPublic

Authored by sbc100 on Jan 19 2018, 3:01 PM.

Details

Summary

Its much easier to export it via setHidden(false), now that we have that mechanism.

As a side effect the start function is not longer always exports first (becuase
its being exported just like all the other function).

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

sbc100 created this revision.Jan 19 2018, 3:01 PM
sbc100 updated this revision to Diff 130704.Jan 19 2018, 3:12 PM

Split out unrelated change

sbc100 updated this revision to Diff 130705.Jan 19 2018, 3:12 PM
  • clang-format
sbc100 edited the summary of this revision. (Show Details)
Harbormaster completed remote builds in B14048: Diff 130705.
sbc100 retitled this revision from [WebAssembly] Remove special handling of entry point export to [WebAssembly] Remove special handling of entry point export. NFC.Jan 19 2018, 3:17 PM
sbc100 edited the summary of this revision. (Show Details)
ncw accepted this revision.Jan 19 2018, 4:49 PM

You've removed the check for CtorSymbol == EntrySym, I guess because you can't think of a reason why anyone would want to do --entry=__wasm_init_ctors? But if we do ever make the entry-point be treated as the "start" function, then that might be what we want.

This is good, because it gives --entry a clear reason to exist, but maybe it's not generic enough. Apart for the setHidden(false) call, is --entry identical to --export? So really --entry is redundant now, maybe it should actually go away.

Go ahead though and merge, I'm just musing here.

This revision is now accepted and ready to land.Jan 19 2018, 4:49 PM
In D42321#982653, @ncw wrote:

You've removed the check for CtorSymbol == EntrySym, I guess because you can't think of a reason why anyone would want to do --entry=__wasm_init_ctors? But if we do ever make the entry-point be treated as the "start" function, then that might be what we want.

This is good, because it gives --entry a clear reason to exist, but maybe it's not generic enough. Apart for the setHidden(false) call, is --entry identical to --export? So really --entry is redundant now, maybe it should actually go away.

Go ahead though and merge, I'm just musing here.

Oh.. maybe you are right.. let me right a test for that. I though that wasn't needed anymore.

sbc100 updated this revision to Diff 130732.Jan 19 2018, 5:27 PM
  • and check for -entry=__wasm_call_ctors
sbc100 updated this revision to Diff 130735.Jan 19 2018, 5:42 PM
  • rebase
This revision was automatically updated to reflect the committed changes.