This is an archive of the discontinued LLVM Phabricator instance.

[WebAssebmly][MC] Support .import_name/.import_field asm directives
ClosedPublic

Authored by sbc100 on Dec 1 2019, 10:55 AM.

Details

Summary

Convert the MC test to use asm rather than bitcode.

This is a precursor to https://reviews.llvm.org/D70520.

Diff Detail

Event Timeline

sbc100 created this revision.Dec 1 2019, 10:55 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 1 2019, 10:55 AM
dschuff added inline comments.Dec 4 2019, 11:10 PM
llvm/test/MC/WebAssembly/import-module.s
14

What should happen if there's a directive that refers to a symbol that doesn't exist in the asm file?

sbc100 marked an inline comment as done.Dec 5 2019, 2:23 PM
sbc100 added inline comments.
llvm/test/MC/WebAssembly/import-module.s
14

I seems that it does the same thing we do for .functype above, basically nothing.

sbc100 marked an inline comment as done.Dec 5 2019, 2:30 PM
sbc100 added inline comments.
llvm/test/MC/WebAssembly/import-module.s
14

To be a little more specific it seems that for these kind of attributes we call Ctx.getOrCreateSymbol then set a propoerty of the symbol, but if that symbol isn't used elsewhere it isn't included in the output.

dschuff accepted this revision.Dec 6 2019, 2:56 PM
This revision is now accepted and ready to land.Dec 6 2019, 2:56 PM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp