1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Module that constructs a control-flow graph representing an item.
12 //! Uses `Graph` as the underlying representation.
17 use util::nodemap::NodeMap;
23 pub exit_map: NodeMap<CFGIndex>,
29 pub struct CFGNodeData {
33 pub struct CFGEdgeData {
34 pub exiting_scopes: Vec<ast::NodeId>
37 pub type CFGIndex = graph::NodeIndex;
39 pub type CFGGraph = graph::Graph<CFGNodeData, CFGEdgeData>;
41 pub type CFGNode = graph::Node<CFGNodeData>;
43 pub type CFGEdge = graph::Edge<CFGEdgeData>;
46 pub fn new(tcx: &ty::ctxt,
47 blk: &ast::Block) -> CFG {
48 construct::construct(tcx, blk)