This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Ignore explict section names for functions
ClosedPublic

Authored by sbc100 on Jun 14 2018, 9:56 AM.

Details

Summary

WebAssembly doesn't support more than one function per section
and we rely on function sections being unique. This change ignores
the section provided by the function to avoid two functions being
in the same section.

Without this change the object writer produces the following
error for this test:
LLVM ERROR: section already has a defining function: baz

Diff Detail

Repository
rL LLVM

Event Timeline

sbc100 created this revision.Jun 14 2018, 9:56 AM
sbc100 updated this revision to Diff 151371.Jun 14 2018, 9:58 AM

add comment

dschuff accepted this revision.Jun 14 2018, 11:42 AM

This does seem a little odd, but I think it makes sense given the special nature of functions in the wasm object format.

This revision is now accepted and ready to land.Jun 14 2018, 11:42 AM

I agree... if you can think of a more sensible solution please let me know.

This revision was automatically updated to reflect the committed changes.