diff options
| author | bors <bors@rust-lang.org> | 2024-10-08 11:27:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-08 11:27:18 +0000 |
| commit | 84a16c49d4c23a3c2c16d058ce542ca52e07112a (patch) | |
| tree | 9d5b39941405bec4b7c4571606df8b88850325e9 /compiler/rustc_codegen_llvm/src/llvm/ffi.rs | |
| parent | 76fc27a178d999358ac2105b8868cc8a45a2513f (diff) | |
| parent | 4316afffd9390bdac1d3bd5e5398c65d6e9bb150 (diff) | |
| download | rust-84a16c49d4c23a3c2c16d058ce542ca52e07112a.tar.gz rust-84a16c49d4c23a3c2c16d058ce542ca52e07112a.zip | |
Auto merge of #18267 - lnicola:sync-from-rust, r=lnicola
minor: Sync from downstream
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 9aabfd794ba..661debbb9f1 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 { @@ -1603,7 +1614,6 @@ unsafe extern "C" { pub fn LLVMRustGetInstrProfIncrementIntrinsic(M: &Module) -> &Value; pub fn LLVMRustGetInstrProfMCDCParametersIntrinsic(M: &Module) -> &Value; pub fn LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(M: &Module) -> &Value; - pub fn LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(M: &Module) -> &Value; pub fn LLVMRustBuildCall<'a>( B: &Builder<'a>, |
