This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Improve libObject support for reading/writing wasm imports and exports
ClosedPublic

Authored by sbc100 on May 9 2017, 11:10 AM.

Details

Summary

Previously we had only supported reading/writing certain
types of imports and exports (functions and global).

Also add usefull overload of getWasmSymbol() and
getNumberOfSymbols() in support of lld port.

Event Timeline

sbc100 created this revision.May 9 2017, 11:10 AM
dschuff accepted this revision.May 9 2017, 12:41 PM
dschuff added inline comments.
include/llvm/Object/Wasm.h
85

I'm surprised there's not some method for this purpose on ObjectFile... but I don't see one...

lib/Object/WasmObjectFile.cpp
512–513

I think table is the only one left, right?

This revision is now accepted and ready to land.May 9 2017, 12:41 PM
sbc100 updated this revision to Diff 98355.May 9 2017, 2:57 PM
  • handle all import and export types
sbc100 retitled this revision from [WebAssembly] Handle parsing of exported memories to [WebAssembly] Add support for importing and exporting of different types.May 9 2017, 2:59 PM
sbc100 edited the summary of this revision. (Show Details)
sbc100 added inline comments.
lib/Object/WasmObjectFile.cpp
512–513

OK, I made this a more complete change so now we can support all external types.

Cool, looks good. Maybe just clarify in the commit description that this really just applies to reading and writing the sections rather than e.g. codegen.

sbc100 retitled this revision from [WebAssembly] Add support for importing and exporting of different types to [WebAssembly] Improve support to libObject for reading/writing wasm imports and exports.May 9 2017, 4:51 PM
sbc100 edited the summary of this revision. (Show Details)
sbc100 retitled this revision from [WebAssembly] Improve support to libObject for reading/writing wasm imports and exports to [WebAssembly] Improve libObject support for reading/writing wasm imports and exports.
This revision was automatically updated to reflect the committed changes.