Skip to content

Commit

Permalink
Replace -Z default-hidden-visibility with -Z default-visibility
Browse files Browse the repository at this point in the history
MCP: rust-lang/compiler-team#782

Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
  • Loading branch information
davidlattimore and bjorn3 committed Oct 1, 2024
1 parent ce09fbf commit b235273
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,17 @@ fn create_wrapper_function(
false,
);

if tcx.sess.default_hidden_visibility() {
#[cfg(feature = "master")]
func.add_attribute(FnAttribute::Visibility(gccjit::Visibility::Hidden));
#[cfg(feature = "master")]
match tcx.sess.default_visibility() {
rustc_target::spec::SymbolVisibility::Hidden => {
func.add_attribute(FnAttribute::Visibility(gccjit::Visibility::Hidden))
}
rustc_target::spec::SymbolVisibility::Protected => {
func.add_attribute(FnAttribute::Visibility(gccjit::Visibility::Protected))
}
rustc_target::spec::SymbolVisibility::Interposable => {}
}

if tcx.sess.must_emit_unwind_tables() {
// TODO(antoyo): emit unwind tables.
}
Expand Down

0 comments on commit b235273

Please sign in to comment.