diff options
| author | David Lattimore <dvdlttmr@gmail.com> | 2024-10-01 08:55:10 +1000 |
|---|---|---|
| committer | David Lattimore <dvdlttmr@gmail.com> | 2024-10-01 22:32:13 +1000 |
| commit | f48194ea5578802c786edff59dd72388da0e6305 (patch) | |
| tree | fb280fda1a2a239517ef9d5b224f8f508ff143fb /compiler/rustc_codegen_llvm/src/llvm/ffi.rs | |
| parent | fb4aebddd18d258046ddb51fd41589295259a0fa (diff) | |
| download | rust-f48194ea5578802c786edff59dd72388da0e6305.tar.gz rust-f48194ea5578802c786edff59dd72388da0e6305.zip | |
Replace -Z default-hidden-visibility with -Z default-visibility
MCP: https://github.com/rust-lang/compiler-team/issues/782 Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 9aabfd794ba..d3950df91fb 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -4,6 +4,7 @@ use std::marker::PhantomData; use libc::{c_char, c_int, c_uint, c_ulonglong, c_void, size_t}; +use rustc_target::spec::SymbolVisibility; use super::RustString; use super::debuginfo::{ @@ -133,6 +134,16 @@ pub enum Visibility { Protected = 2, } +impl Visibility { + pub fn from_generic(visibility: SymbolVisibility) -> Self { + match visibility { + SymbolVisibility::Hidden => Visibility::Hidden, + SymbolVisibility::Protected => Visibility::Protected, + SymbolVisibility::Interposable => Visibility::Default, + } + } +} + /// LLVMUnnamedAddr #[repr(C)] pub enum UnnamedAddr { |
