[WebAssembly] Support COMDAT sections in assembly syntax
authorDerek Schuff <dschuff@chromium.org>
Mon, 7 Dec 2020 19:54:44 +0000 (11:54 -0800)
committerDerek Schuff <dschuff@chromium.org>
Thu, 10 Dec 2020 22:46:24 +0000 (14:46 -0800)
commit4564553b8d8ab81dc21431a35275581cb42329c8
tree7f2770b51959db435e689092fc37fd769ecbe2fc
parentb1dd1a099771543cf0ca133b6342af1b3ce61a44
[WebAssembly] Support COMDAT sections in assembly syntax

This CL changes the asm syntax for section flags, making them more like ELF
(previously "passive" was the only option). Now we also allow "G" to designate
COMDAT group sections. In these sections we set the appropriate comdat flag on
function symbols, and also avoid auto-creating a new section for them.

This also adds asm-based tests for the changes D92691 to go along with
the direct-to-object tests.

Differential Revision: https://reviews.llvm.org/D92952
llvm/lib/MC/MCParser/WasmAsmParser.cpp
llvm/lib/MC/MCSectionWasm.cpp
llvm/lib/MC/WasmObjectWriter.cpp
llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
llvm/test/MC/WebAssembly/comdat-sections.ll
llvm/test/MC/WebAssembly/comdat-sections.s [new file with mode: 0644]
llvm/test/MC/WebAssembly/comdat.ll