]> git.lizzy.rs Git - rust.git/commit
rustc: selectively trans branches for `if <literal-bool>`.
authorHuon Wilson <dbau.pp+github@gmail.com>
Wed, 17 Jul 2013 08:13:41 +0000 (03:13 -0500)
committerHuon Wilson <dbau.pp+github@gmail.com>
Tue, 16 Jul 2013 17:13:41 +0000 (03:13 +1000)
commit4797dd4087104246b5d5c2d3edf1623acfbc06e5
tree197e9278accfb30a18fc860420c8ba5ce6aaa845
parente252277fe9b44ed9a913aeeb9f55dc85eaadace4
rustc: selectively trans branches for `if <literal-bool>`.

That is, the `b` branch in `if true { a } else { b }` will not be
trans'd, and that expression will be exactly the same as `a`. This
means that, for example, macros conditionally expanding to `if false
{ .. }` (like debug!) will not waste time in LLVM (or trans).
src/librustc/middle/trans/controlflow.rs