rust/src/librustc/middle/trans
bors ad212ecee4 auto merge of #7822 : huonw/rust/cond-debug, r=graydon
As per @pcwalton's request, `debug!(..)` is only activated when the `debug` cfg is set; that is, for `RUST_LOG=some_module=4 ./some_program` to work, it needs to be compiled with `rustc --cfg debug some_program.rs`. (Although, there is the sneaky `__debug!(..)` macro that is always active, if you *really* need it.)

It functions by making `debug!` expand to `if false { __debug!(..) }` (expanding to an `if` like this is required to make sure `debug!` statements are typechecked and to avoid unused variable warnings), and adjusting trans to skip the pointless branches in `if true ...` and `if false ...`.

The conditional expansion change also required moving the inject-std-macros step into a new pass, and makes it actually insert them at the top of the crate; this means that the cfg stripping traverses over the macros and so filters out the unused ones.

This appears to takes an unoptimised build of `librustc` from 65s to 59s; and the full bootstrap from 18m41s to 18m26s on my computer (with general background use).

`./configure --enable-debug` will enable `debug!` statements in the bootstrap build.
2013-07-16 11:19:20 -07:00
..
_match.rs Correct merge errors 2013-07-08 13:55:11 -04:00
adt.rs Remove the global 'vec::to_owned' function 2013-07-12 16:13:51 -04:00
asm.rs auto merge of #7468 : cmr/rust/great_renaming, r=pcwalton 2013-06-30 01:19:38 -07:00
base.rs auto merge of #7822 : huonw/rust/cond-debug, r=graydon 2013-07-16 11:19:20 -07:00
build.rs rustc: handle allocas and LoadRangeAsserts in unreachable blocks correctly. 2013-07-17 03:13:23 +10:00
cabi_arm.rs Replaces the free-standing functions in f32, &c. 2013-07-08 18:05:17 +02:00
cabi_mips.rs Replaces the free-standing functions in f32, &c. 2013-07-08 18:05:17 +02:00
cabi_x86_64.rs Replaces the free-standing functions in f32, &c. 2013-07-08 18:05:17 +02:00
cabi_x86.rs
cabi.rs Make all allocas named so we can see where they originate 2013-07-08 13:55:10 -04:00
callee.rs Clean up various warnings throughout the codebase 2013-07-14 09:29:12 -07:00
closure.rs Constrain maximum lifetime of stack closures that capture variables to 2013-07-09 10:38:26 -04:00
common.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
consts.rs Drop a now unnecessary argument from maybe_instantiate_inline. 2013-07-11 15:51:10 -07:00
context.rs Make TLS keys actually take up space 2013-07-14 10:15:07 -07:00
controlflow.rs rustc: selectively trans branches for if <literal-bool>. 2013-07-17 03:13:41 +10:00
datum.rs rustc: handle allocas and LoadRangeAsserts in unreachable blocks correctly. 2013-07-17 03:13:23 +10:00
debuginfo.rs De-share ast::Ty 2013-07-07 22:51:10 +12:00
expr.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
foreign.rs Avoid empty "static_allocas" blocks 2013-07-13 13:33:48 +02:00
glue.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
inline.rs Drop a now unnecessary argument from maybe_instantiate_inline. 2013-07-11 15:51:10 -07:00
machine.rs GC static_size_of_enum, which was unused 2013-07-02 09:27:11 -07:00
macros.rs
meth.rs Silence various warnings 2013-07-11 15:21:29 -04:00
mod.rs
monomorphize.rs Get static default methods working in the non-cross-crate case. Work on #7569. 2013-07-11 15:51:09 -07:00
reflect.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
tvec.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
type_.rs Use concrete types in glue functions 2013-07-13 18:23:08 +02:00
type_of.rs remove headers from unique vectors 2013-07-15 23:57:27 -04:00
type_use.rs Drop a now unnecessary argument from maybe_instantiate_inline. 2013-07-11 15:51:10 -07:00
uniq.rs remove unused imports 2013-07-10 22:08:50 -07:00
write_guard.rs Make all allocas named so we can see where they originate 2013-07-08 13:55:10 -04:00