diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2015-06-04 14:04:37 +1200 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2015-06-08 11:41:48 +1200 |
| commit | 79b0c89d509d673ee34097b5dcb0d609fea6619d (patch) | |
| tree | 36bb8abad318f3a425ed9c7ebda1e8f31fc704cc | |
| parent | e9db5fb20239d9343c17e3216297df489115d416 (diff) | |
| download | rust-79b0c89d509d673ee34097b5dcb0d609fea6619d.tar.gz rust-79b0c89d509d673ee34097b5dcb0d609fea6619d.zip | |
Don't visit items in removed branches
Note that they will be visited anyway by base::trans_item, this just duplicates the items.
| -rw-r--r-- | src/librustc_trans/trans/controlflow.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/librustc_trans/trans/controlflow.rs b/src/librustc_trans/trans/controlflow.rs index ab8cfa0ce3b..d203aeca0a7 100644 --- a/src/librustc_trans/trans/controlflow.rs +++ b/src/librustc_trans/trans/controlflow.rs @@ -30,7 +30,6 @@ use syntax::ast; use syntax::ast_util; use syntax::parse::token::InternedString; use syntax::parse::token; -use syntax::visit::Visitor; pub fn trans_stmt<'blk, 'tcx>(cx: Block<'blk, 'tcx>, s: &ast::Stmt) @@ -171,16 +170,7 @@ pub fn trans_if<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, // if true { .. } [else { .. }] bcx = trans_block(bcx, &*thn, dest); trans::debuginfo::clear_source_location(bcx.fcx); - - if let Some(elexpr) = els { - let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx }; - trans.visit_expr(&*elexpr); - } } else { - // if false { .. } [else { .. }] - let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx }; - trans.visit_block(&*thn); - if let Some(elexpr) = els { bcx = expr::trans_into(bcx, &*elexpr, dest); trans::debuginfo::clear_source_location(bcx.fcx); |
