[PATCH] D74109: [WebAssembly] Use llvm::Optional to store optional symbol attributes.

Sam Clegg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 5 23:27:26 PST 2020


sbc100 created this revision.
Herald added subscribers: llvm-commits, rupprecht, arphaman, dexonsmith, steven_wu, sunfish, aheejin, hiraditya, jgravelle-google, mehdi_amini, dschuff.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
sbc100 edited reviewers, added: sunfish, dschuff; removed: jhenderson.
Herald added a reviewer: jhenderson.

The changes the in memory representation of wasm symbols such that their
optional ImportName and ImportModule use llvm::Optional.

ImportName is set whenever WASM_SYMBOL_EXPLICIT_NAME flag is set.
ImportField is set whenever the field in the object file is non-empty.

The default field name for imports in object files is now the empty
string rather than "env".  Any import with a non-empty module is then
assumed to have an explicy module name set.

However, for the time being, for compatability the linker still outputs
imports under the "env" module by default.  In order not to break
compatibility with older object files the linker will continue to treat
imports from the "env" module as if they did not have a custom module
name.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74109

Files:
  lld/wasm/Driver.cpp
  lld/wasm/InputFiles.cpp
  lld/wasm/LTO.cpp
  lld/wasm/SymbolTable.cpp
  lld/wasm/SymbolTable.h
  lld/wasm/Symbols.h
  lld/wasm/SyntheticSections.cpp
  llvm/include/llvm/BinaryFormat/Wasm.h
  llvm/include/llvm/MC/MCSymbolWasm.h
  llvm/lib/MC/WasmObjectWriter.cpp
  llvm/lib/Object/WasmObjectFile.cpp
  llvm/test/MC/WebAssembly/assembler-binary.ll
  llvm/test/MC/WebAssembly/comdat.ll
  llvm/test/MC/WebAssembly/custom-sections.ll
  llvm/test/MC/WebAssembly/data-section.s
  llvm/test/MC/WebAssembly/debug-info.ll
  llvm/test/MC/WebAssembly/event-section.ll
  llvm/test/MC/WebAssembly/external-func-address.ll
  llvm/test/MC/WebAssembly/global-ctor-dtor.ll
  llvm/test/MC/WebAssembly/import-module.s
  llvm/test/MC/WebAssembly/reloc-pic.s
  llvm/test/MC/WebAssembly/stack-ptr.ll
  llvm/test/MC/WebAssembly/type-index.s
  llvm/test/MC/WebAssembly/weak-alias.s
  llvm/test/tools/llvm-readobj/wasm/symbols.test
  llvm/test/tools/llvm-readobj/wasm/wasm-imports.test
  llvm/tools/llvm-readobj/WasmDumper.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74109.242810.patch
Type: text/x-patch
Size: 34619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200206/fbe86d3c/attachment.bin>


More information about the llvm-commits mailing list