librustc: Disable borrow check debugging even when rustc is compiled with -O0.
This improves -O0 compile times dramatically.
This commit is contained in:
parent
ca9bb2d9ac
commit
08e561ae70
|
@ -122,6 +122,10 @@ endif
|
||||||
ifdef TRACE
|
ifdef TRACE
|
||||||
CFG_RUSTC_FLAGS += -Z trace
|
CFG_RUSTC_FLAGS += -Z trace
|
||||||
endif
|
endif
|
||||||
|
ifndef DEBUG_BORROWS
|
||||||
|
RUSTFLAGS_STAGE1 += -Z no-debug-borrows
|
||||||
|
RUSTFLAGS_STAGE2 += -Z no-debug-borrows
|
||||||
|
endif
|
||||||
|
|
||||||
# platform-specific auto-configuration
|
# platform-specific auto-configuration
|
||||||
include $(CFG_SRC_DIR)mk/platform.mk
|
include $(CFG_SRC_DIR)mk/platform.mk
|
||||||
|
|
|
@ -66,6 +66,7 @@ pub static debug_info: uint = 1 << 20;
|
||||||
pub static extra_debug_info: uint = 1 << 21;
|
pub static extra_debug_info: uint = 1 << 21;
|
||||||
pub static statik: uint = 1 << 22;
|
pub static statik: uint = 1 << 22;
|
||||||
pub static print_link_args: uint = 1 << 23;
|
pub static print_link_args: uint = 1 << 23;
|
||||||
|
pub static no_debug_borrows: uint = 1 << 24;
|
||||||
|
|
||||||
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
|
pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
|
||||||
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
|
~[(~"verbose", ~"in general, enable more debug printouts", verbose),
|
||||||
|
@ -100,7 +101,10 @@ pub fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
|
||||||
extra_debug_info),
|
extra_debug_info),
|
||||||
(~"debug-info", ~"Produce debug info (experimental)", debug_info),
|
(~"debug-info", ~"Produce debug info (experimental)", debug_info),
|
||||||
(~"static", ~"Use or produce static libraries or binaries " +
|
(~"static", ~"Use or produce static libraries or binaries " +
|
||||||
"(experimental)", statik)
|
"(experimental)", statik),
|
||||||
|
(~"no-debug-borrows",
|
||||||
|
~"do not show where borrow checks fail",
|
||||||
|
no_debug_borrows),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +145,7 @@ pub struct options {
|
||||||
parse_only: bool,
|
parse_only: bool,
|
||||||
no_trans: bool,
|
no_trans: bool,
|
||||||
debugging_opts: uint,
|
debugging_opts: uint,
|
||||||
android_cross_path: Option<~str>
|
android_cross_path: Option<~str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct crate_metadata {
|
pub struct crate_metadata {
|
||||||
|
@ -271,6 +275,9 @@ pub impl Session_ {
|
||||||
fn no_monomorphic_collapse(@self) -> bool {
|
fn no_monomorphic_collapse(@self) -> bool {
|
||||||
self.debugging_opt(no_monomorphic_collapse)
|
self.debugging_opt(no_monomorphic_collapse)
|
||||||
}
|
}
|
||||||
|
fn debug_borrows(@self) -> bool {
|
||||||
|
self.opts.optimize == No && !self.debugging_opt(no_debug_borrows)
|
||||||
|
}
|
||||||
|
|
||||||
fn str_of(@self, id: ast::ident) -> @~str {
|
fn str_of(@self, id: ast::ident) -> @~str {
|
||||||
self.parse_sess.interner.get(id)
|
self.parse_sess.interner.get(id)
|
||||||
|
@ -308,7 +315,7 @@ pub fn basic_options() -> @options {
|
||||||
parse_only: false,
|
parse_only: false,
|
||||||
no_trans: false,
|
no_trans: false,
|
||||||
debugging_opts: 0u,
|
debugging_opts: 0u,
|
||||||
android_cross_path: None
|
android_cross_path: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ pub fn return_to_mut(mut bcx: block,
|
||||||
let bits_val =
|
let bits_val =
|
||||||
Load(bcx, bits_val_ref);
|
Load(bcx, bits_val_ref);
|
||||||
|
|
||||||
if bcx.tcx().sess.opts.optimize == session::No {
|
if bcx.tcx().sess.debug_borrows() {
|
||||||
bcx = callee::trans_lang_call(
|
bcx = callee::trans_lang_call(
|
||||||
bcx,
|
bcx,
|
||||||
bcx.tcx().lang_items.unrecord_borrow_fn(),
|
bcx.tcx().lang_items.unrecord_borrow_fn(),
|
||||||
|
@ -160,7 +160,7 @@ fn root(datum: &Datum,
|
||||||
],
|
],
|
||||||
expr::SaveIn(scratch_bits.val));
|
expr::SaveIn(scratch_bits.val));
|
||||||
|
|
||||||
if bcx.tcx().sess.opts.optimize == session::No {
|
if bcx.tcx().sess.debug_borrows() {
|
||||||
bcx = callee::trans_lang_call(
|
bcx = callee::trans_lang_call(
|
||||||
bcx,
|
bcx,
|
||||||
bcx.tcx().lang_items.record_borrow_fn(),
|
bcx.tcx().lang_items.record_borrow_fn(),
|
||||||
|
|
Loading…
Reference in New Issue