This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.
ClosedPublic

Authored by ruiu on Feb 23 2018, 2:18 PM.

Details

Summary

Previously, one function adds all types of undefined symbols. That
doesn't fit to the wasm's undefined symbol semantics well because
different types of undefined symbols are very different in wasm.
As a result, separate control flows merge in this addUndefined function
and then separate again for each type. That wasn't easy to read.

This patch separates the function into three functions. Now it is pretty
clear what we are doing for each undefined symbol type.

Diff Detail

Repository
rLLD LLVM Linker

Event Timeline

ruiu created this revision.Feb 23 2018, 2:18 PM
ruiu updated this revision to Diff 135702.Feb 23 2018, 2:25 PM
  • fix typo
sbc100 accepted this revision.Feb 27 2018, 1:31 PM
sbc100 added inline comments.
lld/wasm/SymbolTable.cpp
111 ↗(On Diff #135702)

We don't need this if. The signature checking on functions is optional to allow certain C programs to link. Shouldn't be needed to wasm globals (which are not used in C).

This revision is now accepted and ready to land.Feb 27 2018, 1:31 PM
ruiu added inline comments.Feb 27 2018, 4:10 PM
lld/wasm/SymbolTable.cpp
111 ↗(On Diff #135702)

Done.

This revision was automatically updated to reflect the committed changes.