Skip to content

Commit 92189bc

Browse files
committed
Remove redundant -Zdebug-llvm option
The same effect can be achieved using -Cllvm-args=-debug Refs #46437 as it removes LLVMRustSetDebug()
1 parent 6828cf9 commit 92189bc

File tree

6 files changed

+1
-23
lines changed

6 files changed

+1
-23
lines changed

src/librustc/session/config.rs

-4
Original file line numberDiff line numberDiff line change
@@ -1084,8 +1084,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
10841084
"omit landing pads for unwinding"),
10851085
fewer_names: bool = (false, parse_bool, [TRACKED],
10861086
"reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR)"),
1087-
debug_llvm: bool = (false, parse_bool, [UNTRACKED],
1088-
"enable debug output from LLVM"),
10891087
meta_stats: bool = (false, parse_bool, [UNTRACKED],
10901088
"gather metadata statistics"),
10911089
print_link_args: bool = (false, parse_bool, [UNTRACKED],
@@ -2747,8 +2745,6 @@ mod tests {
27472745
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
27482746
opts.debugging_opts.borrowck_stats = true;
27492747
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
2750-
opts.debugging_opts.debug_llvm = true;
2751-
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
27522748
opts.debugging_opts.meta_stats = true;
27532749
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
27542750
opts.debugging_opts.print_link_args = true;

src/librustc_driver/lib.rs

-5
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ mod rustc_trans {
167167
pub use rustc_trans_utils::trans_crate::TranslatedCrate as CrateTranslation;
168168

169169
pub fn init(_sess: &Session) {}
170-
pub fn enable_llvm_debug() {}
171170
pub fn print_version() {}
172171
pub fn print_passes() {}
173172
pub fn print(_req: PrintRequest, _sess: &Session) {}
@@ -205,10 +204,6 @@ pub fn run_compiler<'a>(args: &[String],
205204

206205
let (sopts, cfg) = config::build_session_options_and_crate_config(&matches);
207206

208-
if sopts.debugging_opts.debug_llvm {
209-
rustc_trans::enable_llvm_debug();
210-
}
211-
212207
let descriptions = diagnostics_registry();
213208

214209
do_or_return!(callbacks.early_callback(&matches,

src/librustc_llvm/ffi.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1315,9 +1315,6 @@ extern "C" {
13151315
ElementCount: c_uint,
13161316
Packed: Bool);
13171317

1318-
/// Enables LLVM debug output.
1319-
pub fn LLVMRustSetDebug(Enabled: c_int);
1320-
13211318
/// Prepares inline assembly.
13221319
pub fn LLVMRustInlineAsm(Ty: TypeRef,
13231320
AsmString: *const c_char,

src/librustc_trans/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub use base::trans_crate;
6969
use back::bytecode::RLIB_BYTECODE_EXTENSION;
7070

7171
pub use metadata::LlvmMetadataLoader;
72-
pub use llvm_util::{init, target_features, print_version, print_passes, print, enable_llvm_debug};
72+
pub use llvm_util::{init, target_features, print_version, print_passes, print};
7373

7474
use std::any::Any;
7575
use std::path::PathBuf;

src/librustc_trans/llvm_util.rs

-4
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,3 @@ pub fn print(req: PrintRequest, sess: &Session) {
140140
}
141141
}
142142
}
143-
144-
pub fn enable_llvm_debug() {
145-
unsafe { llvm::LLVMRustSetDebug(1); }
146-
}

src/rustllvm/RustWrapper.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,6 @@ LLVMRustBuildAtomicFence(LLVMBuilderRef B, LLVMAtomicOrdering Order,
384384
return wrap(unwrap(B)->CreateFence(fromRust(Order), fromRust(Scope)));
385385
}
386386

387-
extern "C" void LLVMRustSetDebug(int Enabled) {
388-
#ifndef NDEBUG
389-
DebugFlag = Enabled;
390-
#endif
391-
}
392-
393387
enum class LLVMRustAsmDialect {
394388
Other,
395389
Att,

0 commit comments

Comments
 (0)