This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Added visibility and ident directives to WasmAsmParser.
ClosedPublic

Authored by aardappel on Jun 27 2019, 2:49 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

aardappel created this revision.Jun 27 2019, 2:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 27 2019, 2:49 PM

Reviewers: the code parsing these directives is from ELFAsmParser. We decided in the past that WASM should have its own container format parser, since it is a very different format from ELF, but copying code is never fun. Any suggestions here? Inherit from ELFAsmParser or take it as a member (may have unintended consequences). Pull into new base class for both (ELF people may not be happy with that). Or just ignore it?

dschuff added inline comments.Jun 27 2019, 4:27 PM
lib/MC/MCParser/WasmAsmParser.cpp
233 ↗(On Diff #206943)

@sbc100 do we support exactly the same set of visibility types as ELF? I think the answer is no, right? In that case it probably also answers the question of whether we can share code with ELF too.

I'm sad to see more code duplication but OK with adding along with the TODO to find a better way.

lib/MC/MCParser/WasmAsmParser.cpp
233 ↗(On Diff #206943)

Technically we don't support "protected" yet, but there is no reason why we shouldn't in the future. Even though we don't support it its not clear to me if we should generate an error here, or perhaps in EmitSymbolAttribute?

sbc100 accepted this revision.Jun 28 2019, 8:45 AM
sbc100 added inline comments.
test/MC/WebAssembly/basic-assembly.s
91 ↗(On Diff #206943)

Align second column with line above?

179 ↗(On Diff #206943)

Indentation looks great than directives below?

This revision is now accepted and ready to land.Jun 28 2019, 8:45 AM
aardappel marked 3 inline comments as done.Jun 28 2019, 9:47 AM
aardappel added inline comments.
lib/MC/MCParser/WasmAsmParser.cpp
233 ↗(On Diff #206943)

I will comment out "protected" for now, which will make it error.

test/MC/WebAssembly/basic-assembly.s
91 ↗(On Diff #206943)

File had mixed tabs and spaces, which makes it look different in code review.. removing tabs.

179 ↗(On Diff #206943)

I'll make indentation in this file more consistent..

aardappel updated this revision to Diff 207079.Jun 28 2019, 9:50 AM

Removed "protected" and fixed indentation in tests.

This revision was automatically updated to reflect the committed changes.