LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
flowgraph.hxx
Go to the documentation of this file.
1 
6 #ifndef LIVENESS_FLOWGRAPH_HXX
7 # define LIVENESS_FLOWGRAPH_HXX
8 
9 # include <map>
10 
11 # include <common.hh>
12 # include <misc/contract.hh>
13 # include <liveness/flowgraph.hh>
14 
15 namespace liveness
16 {
17 
18  template <typename EdgeLabel>
19  FlowGraph<EdgeLabel>::FlowGraph(const std::string& name,
20  const assem::Instrs& instrs)
21  {
22  precondition(!instrs.empty());
23 
24  timer_.push("8: flow graph");
25  this->name_set(name);
26 
27  // Create one node for each instruction and collect the labels in a map.
28  // (The first node of the graph must be the first instruction).
29  // FIXME: Some code was deleted here.
30 
31  // Create an edge between each branching instruction and
32  // its destination labels.
33  // FIXME: Some code was deleted here.
34  timer_.pop("8: flow graph");
35  }
36 
37  template <typename EdgeLabel>
38  const misc::timer&
40  {
41  return timer_;
42  }
43 
44  template <typename EdgeLabel>
45  std::ostream&
47  std::ostream& ostr) const
48  {
49  return ostr << *(*this)[v];
50  }
51 
52 } // namespace liveness
53 
54 #endif // !LIVENESS_FLOWGRAPH_HXX