This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Inline accessor functions that are called only once.
ClosedPublic

Authored by ruiu on Feb 23 2018, 8:08 PM.

Details

Summary

Looks like these accessor functions are a bit overly defensive, and
due to the amount of code, that part isn't easy to read. We have
code to log translation results in writeTo and writeRelocations, so
I don't think we need to log it again in these functions.
I think the new function is much easier to understand.

Event Timeline

ruiu created this revision.Feb 23 2018, 8:08 PM
sbc100 accepted this revision.Feb 27 2018, 1:23 PM

Agreed. This is mostly a historical legacy since these used to be public method used elsewhere. I've been meaning to do something like this myself.

lld/wasm/InputFiles.cpp
68

I think this assert is useful. It ensures the type is valid and part of the output.

This revision is now accepted and ready to land.Feb 27 2018, 1:23 PM
ruiu added inline comments.Feb 27 2018, 4:27 PM
lld/wasm/InputFiles.cpp
68

Done.

This revision was automatically updated to reflect the committed changes.