]> git.lizzy.rs Git - rust.git/commit
Avoid unnecessary codegen in with_cond()
authorBjörn Steinbrink <bsteinbr@gmail.com>
Thu, 4 Sep 2014 11:36:39 +0000 (13:36 +0200)
committerBjörn Steinbrink <bsteinbr@gmail.com>
Wed, 4 Feb 2015 19:06:17 +0000 (20:06 +0100)
commitdb8f2d590385786c176b5f7d9e887814d31db9ad
tree586849a7359a13d49397dcf4ba56baf8808abda5
parentac134f7ca435551964996ee88319241cd3c7c110
Avoid unnecessary codegen in with_cond()

Currently "k / 2" generates one (k: uint) or two (k: int) "br false,
..." instructions and the corresponding basic blocks, producing quite
some noise and making the code unnecessarily hard to read.

Additionally we can skip translation if the code would end up
unreachable anyway.
src/librustc_trans/trans/_match.rs
src/librustc_trans/trans/base.rs