about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorDan Gohman <dev@sunfishcode.online>2022-09-28 10:42:30 -0700
committerDan Gohman <dev@sunfishcode.online>2022-09-28 10:42:30 -0700
commit3c3bf76ce0cc9e569e04a242dfdc447131e21db9 (patch)
treed5e3c7bf8dd3b8dd9173d0060ee9dfad0ef99d1c /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent09ae7846a272a500ff7145255f0de5556c0b8949 (diff)
downloadrust-3c3bf76ce0cc9e569e04a242dfdc447131e21db9.tar.gz
rust-3c3bf76ce0cc9e569e04a242dfdc447131e21db9.zip
Declare `main` as visibility hidden on targets that default to hidden.
On targets with `default_hidden_visibility` set, which is currrently
just WebAssembly, declare the generated `main` function with visibility
hidden. This makes it consistent with clang's WebAssembly target, where
`main` is just a user function that gets the same visibility as any
other user function, which is hidden on WebAssembly unless explicitly
overridden.

This will help simplify use cases which in the future may want to
automatically wasm-export all visibility-"default" symbols. `main` isn't
intended to be wasm-exported, and marking it hidden prevents it from
being wasm-exported in that scenario.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions