[all-commits] [llvm/llvm-project] 881d87: [WebAssembly] Add new `export_name` clang attribut...

Sam Clegg via All-commits all-commits at lists.llvm.org
Wed Dec 11 11:55:49 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 881d877846e2904c731d616731969421ce8cc825
      https://github.com/llvm/llvm-project/commit/881d877846e2904c731d616731969421ce8cc825
  Author: Sam Clegg <sbc at chromium.org>
  Date:   2019-12-11 (Wed, 11 Dec 2019)

  Changed paths:
    M clang/include/clang/Basic/Attr.td
    M clang/include/clang/Basic/AttrDocs.td
    M clang/lib/CodeGen/TargetInfo.cpp
    M clang/lib/Sema/SemaDeclAttr.cpp
    A clang/test/CodeGen/wasm-export-name.c
    M clang/test/Misc/pragma-attribute-supported-attributes-list.test
    M lld/docs/WebAssembly.rst
    A lld/test/wasm/export-name.ll
    M lld/wasm/InputChunks.h
    M lld/wasm/Writer.cpp
    M llvm/include/llvm/BinaryFormat/Wasm.h
    M llvm/include/llvm/MC/MCSymbolWasm.h
    M llvm/include/llvm/Object/Wasm.h
    M llvm/lib/MC/WasmObjectWriter.cpp
    M llvm/lib/Object/WasmObjectFile.cpp
    M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
    M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.h
    M llvm/lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp
    A llvm/test/CodeGen/WebAssembly/export-name.ll
    A llvm/test/MC/WebAssembly/export-name.s

  Log Message:
  -----------
  [WebAssembly] Add new `export_name` clang attribute for controlling wasm export names

This is equivalent to the existing `import_name` and `import_module`
attributes which control the import names in the final wasm binary
produced by lld.

This maps the existing

This attribute currently requires a string rather than using the
symbol name for a couple of reasons:

1. Avoid confusion with static and dynamic linking which is
   based on symbol name.  Exporting a function from a wasm module using
   this directive is orthogonal to both static and dynamic linking.
2. Avoids name mangling.

Differential Revision: https://reviews.llvm.org/D70520




More information about the All-commits mailing list