This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Added a .globaltype directive to .s output.
ClosedPublic

Authored by aardappel on Nov 1 2018, 4:56 PM.

Details

Summary

Assembly output can use globals like __stack_pointer implicitly,
but has no way of indicating the type of such a global, which makes
it hard for tools processing it (such as the MC Assembler) to
reconstruct this information.

The improved assembler directives parsing (in progress in
https://reviews.llvm.org/D53842) will make use of this information.

Also deleted code for the .import_global directive which was unused.

New test case in userstack.ll

Diff Detail

Event Timeline

aardappel created this revision.Nov 1 2018, 4:56 PM
dschuff accepted this revision.Nov 1 2018, 5:00 PM
dschuff added inline comments.
lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
46

update comment.

This revision is now accepted and ready to land.Nov 1 2018, 5:00 PM
sbc100 accepted this revision.Nov 1 2018, 5:00 PM

Nice!

lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
87

I like newline between these top loops, but perhaps thats just a personal preference.

aardappel marked 2 inline comments as done.Nov 1 2018, 5:45 PM
aardappel updated this revision to Diff 172287.Nov 1 2018, 5:46 PM

Code review fixes.

This revision was automatically updated to reflect the committed changes.

Is the parsing side of this .globaltype directive is going to be added separately, or is it already being handled?

Is the parsing side of this .globaltype directive is going to be added separately, or is it already being handled?

It is being added here: https://reviews.llvm.org/D53842