1
Fork 0

Remove Linkage::Private

This is the same as Linkage::Internal except that it doesn't emit any
symbol. Some backends may not support it and it isn't all that useful
anyway.
This commit is contained in:
bjorn3 2025-02-07 14:47:21 +00:00
parent 550e035a59
commit 382e4031c2
10 changed files with 4 additions and 19 deletions

View file

@ -159,7 +159,6 @@ pub(crate) fn linkage_to_llvm(linkage: Linkage) -> llvm::Linkage {
Linkage::WeakODR => llvm::Linkage::WeakODRLinkage,
Linkage::Appending => llvm::Linkage::AppendingLinkage,
Linkage::Internal => llvm::Linkage::InternalLinkage,
Linkage::Private => llvm::Linkage::PrivateLinkage,
Linkage::ExternalWeak => llvm::Linkage::ExternalWeakLinkage,
Linkage::Common => llvm::Linkage::CommonLinkage,
}

View file

@ -71,10 +71,7 @@ impl<'tcx> PreDefineCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
// compiler-rt, then we want to implicitly compile everything with hidden
// visibility as we're going to link this object all over the place but
// don't want the symbols to get exported.
if linkage != Linkage::Internal
&& linkage != Linkage::Private
&& self.tcx.is_compiler_builtins(LOCAL_CRATE)
{
if linkage != Linkage::Internal && self.tcx.is_compiler_builtins(LOCAL_CRATE) {
llvm::set_visibility(lldecl, llvm::Visibility::Hidden);
} else {
llvm::set_visibility(lldecl, base::visibility_to_llvm(visibility));