about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.cc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-16 11:19:20 -0700
committerbors <bors@rust-lang.org>2013-07-16 11:19:20 -0700
commitad212ecee47e8f9126c9fa4ea1679435136e854e (patch)
treef17032be22f93517c8a682486eece167ea313fb5 /src/test/codegen/stack-alloc-string-slice.cc
parenta317584e4f7643c862e94138eb210ce154974d0e (diff)
parent4797dd4087104246b5d5c2d3edf1623acfbc06e5 (diff)
downloadrust-ad212ecee47e8f9126c9fa4ea1679435136e854e.tar.gz
rust-ad212ecee47e8f9126c9fa4ea1679435136e854e.zip
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.
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.cc')
0 files changed, 0 insertions, 0 deletions