]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Auto merge of #83592 - nagisa:nagisa/dso_local, r=davidtwco
authorbors <bors@rust-lang.org>
Tue, 6 Apr 2021 02:09:01 +0000 (02:09 +0000)
committerbors <bors@rust-lang.org>
Tue, 6 Apr 2021 02:09:01 +0000 (02:09 +0000)
commit0c7d4effd71f826abb9651419c316b9b57b8ac97
treef8eadbfde709194baee1cbb5979f21a166568cce
parent8e6b478a5a146ad77ae4340ce379e1674c35ad69
parent2f000a78bf615b35c4837f920fb6adcad4848351
Auto merge of #83592 - nagisa:nagisa/dso_local, r=davidtwco

Set dso_local for hidden, private and local items

This should probably have no real effect in most cases, as e.g. `hidden`
visibility already implies `dso_local` (or at least LLVM IR does not
preserve the `dso_local` setting if the item is already `hidden`), but
it should fix `-Crelocation-model=static` and improve codegen in
executables.

Note that this PR does not exhaustively port the logic in [clang], only the
portion that is necessary to fix a regression from LLVM 12 that relates to
`-Crelocation_model=static`.

Fixes #83335

[clang]: https://github.com/llvm/llvm-project/blob/3001d080c813da20b329303bf8f45451480e5905/clang/lib/CodeGen/CodeGenModule.cpp#L945-L1039
compiler/rustc_codegen_llvm/src/attributes.rs
compiler/rustc_codegen_llvm/src/llvm/ffi.rs
src/test/codegen/repr-transparent-aggregates-1.rs