diff --git a/src/librustc/middle/cfg/construct.rs b/src/librustc/middle/cfg/construct.rs index e8df9dfa1b17..4b06eecaffec 100644 --- a/src/librustc/middle/cfg/construct.rs +++ b/src/librustc/middle/cfg/construct.rs @@ -16,11 +16,9 @@ use middle::ty; use syntax::ast; use syntax::ast_util; use syntax::ptr::P; -use util::nodemap::NodeMap; struct CFGBuilder<'a, 'tcx: 'a> { tcx: &'a ty::ctxt<'tcx>, - exit_map: NodeMap, graph: CFGGraph, fn_exit: CFGIndex, loop_scopes: Vec, @@ -46,7 +44,6 @@ pub fn construct(tcx: &ty::ctxt, let block_exit; let mut cfg_builder = CFGBuilder { - exit_map: NodeMap(), graph: graph, fn_exit: fn_exit, tcx: tcx, @@ -54,9 +51,8 @@ pub fn construct(tcx: &ty::ctxt, }; block_exit = cfg_builder.block(blk, entry); cfg_builder.add_contained_edge(block_exit, fn_exit); - let CFGBuilder {exit_map, graph, ..} = cfg_builder; - CFG {exit_map: exit_map, - graph: graph, + let CFGBuilder {graph, ..} = cfg_builder; + CFG {graph: graph, entry: entry, exit: fn_exit} } @@ -512,7 +508,6 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { } fn add_ast_node(&mut self, id: ast::NodeId, preds: &[CFGIndex]) -> CFGIndex { - assert!(!self.exit_map.contains_key(&id)); assert!(id != ast::DUMMY_NODE_ID); self.add_node(CFGNodeData::AST(id), preds) } @@ -523,10 +518,6 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> { fn add_node(&mut self, data: CFGNodeData, preds: &[CFGIndex]) -> CFGIndex { let node = self.graph.add_node(data); - if let CFGNodeData::AST(id) = data { - assert!(!self.exit_map.contains_key(&id)); - self.exit_map.insert(id, node); - } for &pred in preds { self.add_contained_edge(pred, node); } diff --git a/src/librustc/middle/cfg/mod.rs b/src/librustc/middle/cfg/mod.rs index 71f6c738522a..e8a99f59b1e9 100644 --- a/src/librustc/middle/cfg/mod.rs +++ b/src/librustc/middle/cfg/mod.rs @@ -14,13 +14,11 @@ use middle::graph; use middle::ty; use syntax::ast; -use util::nodemap::NodeMap; mod construct; pub mod graphviz; pub struct CFG { - pub exit_map: NodeMap, pub graph: CFGGraph, pub entry: CFGIndex, pub exit: CFGIndex,