Skip to content

Commit c549268

Browse files
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 c76fc3d, 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”.)
2 parents a21c31b + 042fd8c commit c549268

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

Diff for: compiler/rustc_codegen_llvm/src/lib.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,9 @@ mod debuginfo;
7171
mod declare;
7272
mod errors;
7373
mod intrinsic;
74-
75-
// The following is a workaround that replaces `pub mod llvm;` and that fixes issue 53912.
76-
#[path = "llvm/mod.rs"]
77-
mod llvm_;
78-
pub mod llvm {
79-
pub use super::llvm_::*;
80-
}
81-
74+
// FIXME(Zalathar): Fix all the unreachable-pub warnings that would occur if
75+
// this isn't pub, then make it not pub.
76+
pub mod llvm;
8277
mod llvm_util;
8378
mod mono_item;
8479
mod type_;

Diff for: compiler/rustc_codegen_llvm/src/llvm/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,9 @@ use libc::c_uint;
1010
use rustc_abi::{Align, Size, WrappingRange};
1111
use rustc_llvm::RustString;
1212

13-
pub use self::AtomicRmwBinOp::*;
1413
pub use self::CallConv::*;
1514
pub use self::CodeGenOptSize::*;
16-
pub use self::IntPredicate::*;
17-
pub use self::Linkage::*;
1815
pub use self::MetadataType::*;
19-
pub use self::RealPredicate::*;
2016
pub use self::ffi::*;
2117
use crate::common::AsCCharPtr;
2218

0 commit comments

Comments
 (0)