about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2025-02-05 19:53:54 -0800
committerGitHub <noreply@github.com>2025-02-05 19:53:54 -0800
commitc549268a4a64c0a2c2288c6eee74173cdd7ad37e (patch)
treed8970b58ea91e9657297aa68207d704e8fb668df /compiler/rustc_codegen_llvm
parenta21c31becac63bf1a769d3a377b35a38cb528f6e (diff)
parent042fd8c24a5e52faae9b517e3447c707b58d0cd9 (diff)
downloadrust-c549268a4a64c0a2c2288c6eee74173cdd7ad37e.tar.gz
rust-c549268a4a64c0a2c2288c6eee74173cdd7ad37e.zip
Rollup merge of #136611 - Zalathar:llvm-underscore, r=workingjubilee
cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary

This re-export was introduced in https://github.com/rust-lang/rust/commit/c76fc3d804600bc4f19382576aa53269a1ec095b, as a workaround for #53912.

In short, there was/is an assumption in some LLVM LTO code that symbol names would not contain `.llvm.`, but legacy symbol mangling would naturally produce that sequence for symbols in a module named `llvm`.

This was later “fixed” by adding a special case to the legacy symbol mangler in #61195, which detects the sequence `llvm` and emits the `m` in an escaped form. As a result, there should no longer be any need to avoid the module name `llvm` in the compiler itself.

(Symbol mangling v0 avoids this problem by not using `.` in the first place, outside of the “vendor-specific suffix”.)
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-rw-r--r--compiler/rustc_codegen_llvm/src/lib.rs11
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm/mod.rs4
2 files changed, 3 insertions, 12 deletions
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
index 4a84fd29e44..14346795fda 100644
--- a/compiler/rustc_codegen_llvm/src/lib.rs
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
@@ -71,14 +71,9 @@ mod debuginfo;
 mod declare;
 mod errors;
 mod intrinsic;
-
-// The following is a workaround that replaces `pub mod llvm;` and that fixes issue 53912.
-#[path = "llvm/mod.rs"]
-mod llvm_;
-pub mod llvm {
-    pub use super::llvm_::*;
-}
-
+// FIXME(Zalathar): Fix all the unreachable-pub warnings that would occur if
+// this isn't pub, then make it not pub.
+pub mod llvm;
 mod llvm_util;
 mod mono_item;
 mod type_;
diff --git a/compiler/rustc_codegen_llvm/src/llvm/mod.rs b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
index 2592a7df95c..707aeba22cc 100644
--- a/compiler/rustc_codegen_llvm/src/llvm/mod.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm/mod.rs
@@ -10,13 +10,9 @@ use libc::c_uint;
 use rustc_abi::{Align, Size, WrappingRange};
 use rustc_llvm::RustString;
 
-pub use self::AtomicRmwBinOp::*;
 pub use self::CallConv::*;
 pub use self::CodeGenOptSize::*;
-pub use self::IntPredicate::*;
-pub use self::Linkage::*;
 pub use self::MetadataType::*;
-pub use self::RealPredicate::*;
 pub use self::ffi::*;
 use crate::common::AsCCharPtr;