Skip to content

Commit

Permalink
Remove redundant -Zdebug-llvm option
Browse files Browse the repository at this point in the history
The same effect can be achieved using -Cllvm-args=-debug

Refs rust-lang#46437 as it removes LLVMRustSetDebug()
  • Loading branch information
dotdash committed Jan 7, 2018
1 parent 6828cf9 commit 92189bc
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 23 deletions.
4 changes: 0 additions & 4 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"omit landing pads for unwinding"),
fewer_names: bool = (false, parse_bool, [TRACKED],
"reduce memory use by retaining fewer names within compilation artifacts (LLVM-IR)"),
debug_llvm: bool = (false, parse_bool, [UNTRACKED],
"enable debug output from LLVM"),
meta_stats: bool = (false, parse_bool, [UNTRACKED],
"gather metadata statistics"),
print_link_args: bool = (false, parse_bool, [UNTRACKED],
Expand Down Expand Up @@ -2747,8 +2745,6 @@ mod tests {
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
opts.debugging_opts.borrowck_stats = true;
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
opts.debugging_opts.debug_llvm = true;
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
opts.debugging_opts.meta_stats = true;
assert_eq!(reference.dep_tracking_hash(), opts.dep_tracking_hash());
opts.debugging_opts.print_link_args = true;
Expand Down
5 changes: 0 additions & 5 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ mod rustc_trans {
pub use rustc_trans_utils::trans_crate::TranslatedCrate as CrateTranslation;

pub fn init(_sess: &Session) {}
pub fn enable_llvm_debug() {}
pub fn print_version() {}
pub fn print_passes() {}
pub fn print(_req: PrintRequest, _sess: &Session) {}
Expand Down Expand Up @@ -205,10 +204,6 @@ pub fn run_compiler<'a>(args: &[String],

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

if sopts.debugging_opts.debug_llvm {
rustc_trans::enable_llvm_debug();
}

let descriptions = diagnostics_registry();

do_or_return!(callbacks.early_callback(&matches,
Expand Down
3 changes: 0 additions & 3 deletions src/librustc_llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1315,9 +1315,6 @@ extern "C" {
ElementCount: c_uint,
Packed: Bool);

/// Enables LLVM debug output.
pub fn LLVMRustSetDebug(Enabled: c_int);

/// Prepares inline assembly.
pub fn LLVMRustInlineAsm(Ty: TypeRef,
AsmString: *const c_char,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub use base::trans_crate;
use back::bytecode::RLIB_BYTECODE_EXTENSION;

pub use metadata::LlvmMetadataLoader;
pub use llvm_util::{init, target_features, print_version, print_passes, print, enable_llvm_debug};
pub use llvm_util::{init, target_features, print_version, print_passes, print};

use std::any::Any;
use std::path::PathBuf;
Expand Down
4 changes: 0 additions & 4 deletions src/librustc_trans/llvm_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,3 @@ pub fn print(req: PrintRequest, sess: &Session) {
}
}
}

pub fn enable_llvm_debug() {
unsafe { llvm::LLVMRustSetDebug(1); }
}
6 changes: 0 additions & 6 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,6 @@ LLVMRustBuildAtomicFence(LLVMBuilderRef B, LLVMAtomicOrdering Order,
return wrap(unwrap(B)->CreateFence(fromRust(Order), fromRust(Scope)));
}

extern "C" void LLVMRustSetDebug(int Enabled) {
#ifndef NDEBUG
DebugFlag = Enabled;
#endif
}

enum class LLVMRustAsmDialect {
Other,
Att,
Expand Down

0 comments on commit 92189bc

Please sign in to comment.