This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Pre-symtab tidy of LLVM globals. NFC.
ClosedPublic

Authored by ncw on Jan 31 2018, 11:00 AM.

Details

Summary
  • Remove dead code for handling the .global_variables section in WasmObjectWriter, which is unused and won't work anyway because it doesn't generate relocations for the variables
  • Factored out common struct WasmGlobalType, which matches the name for that tuple in the Wasm spec
  • Renamed some methods to "isBindingGlobal", "isTypeGlobal" to avoid ambiguity

Diff Detail

Repository
rL LLVM

Event Timeline

ncw created this revision.Jan 31 2018, 11:00 AM
sbc100 added inline comments.Jan 31 2018, 11:39 AM
lib/MC/WasmObjectWriter.cpp
728 ↗(On Diff #132212)

I would revert to encodeSLEB128, not that its just a uint32_t.

1141 ↗(On Diff #132212)

I would change PtrType .. since both uses now have a type cast.

sbc100 accepted this revision.Jan 31 2018, 11:41 AM

LGTM with a couple of comment.

I guess we can bring back the global handling later, but for now its essentially dead code.

This revision is now accepted and ready to land.Jan 31 2018, 11:41 AM
This revision was automatically updated to reflect the committed changes.