[lld][WebAssembly] Add `--export-if-defined`
authorSam Clegg <sbc@chromium.org>
Mon, 5 Apr 2021 15:00:30 +0000 (08:00 -0700)
committerSam Clegg <sbc@chromium.org>
Thu, 29 Apr 2021 17:58:45 +0000 (10:58 -0700)
commita6f406480a223068875602fb46e7b1db74873564
treec81122f1567e660ed3a59e37e03a670ecc67d3c8
parent9393060f908b95f30267f2122b3a2aadb698aadb
[lld][WebAssembly] Add `--export-if-defined`

Unlike the existing `--export` option this will not causes errors
or warnings if the specified symbol is not defined.

See: https://github.com/emscripten-core/emscripten/issues/13736

Differential Revision: https://reviews.llvm.org/D99887
lld/docs/WebAssembly.rst
lld/test/wasm/export-if-defined.s [new file with mode: 0644]
lld/wasm/Config.h
lld/wasm/Driver.cpp
lld/wasm/Options.td
lld/wasm/Writer.cpp