ROSE  0.11.98.0
customFilteredCFG.h
1 /*
2  * File: CustomFilteredCFG.h
3  * Author: rahman2
4  *
5  * Created on July 20, 2011, 3:41 PM
6  */
7 
8 #ifndef CUSTOMFILTEREDCFG_H
9 #define CUSTOMFILTEREDCFG_H
10 
11 #include "staticCFG.h"
12 
13 namespace StaticCFG
14 {
16 template <typename _Filter>
17 class ROSE_DLL_API CustomFilteredCFG : public CFG {
18 
19 public:
20  CustomFilteredCFG(SgNode *node) : CFG(node, true) {
21  }
23  }
24  virtual void buildFilteredCFG();
25 
26 
27 protected:
29  virtual void printEdge(std::ostream & o, SgDirectedGraphEdge* edge, bool isInEdge) {
30 
31  AstAttribute* attr = edge->getAttribute("info");
32 
34  VirtualCFG::FilteredCFGEdge<_Filter> e = edge_attr->getEdge();
35  o << e.source().id() << " -> " << e.target().id() << " [label=\"" << escapeString(e.toString()) <<
36  "\", style=\"" << (isInEdge ? "dotted" : "solid") << "\"];\n";
37  }
38  else
39  ROSE_ABORT();
40 
41  }
42 private:
43  template <class NodeT, class EdgeT>
44  void buildTemplatedCFG(NodeT n, std::map<NodeT, SgGraphNode*>& all_nodes, std::set<NodeT>& explored);
45 
46  };
47 
48 }
49 #endif /* CUSTOMFILTEREDCFG_H */
50 
virtual AstAttribute * getAttribute(std::string s) const override
Returns attribute of name 's'.
Base class for all IR node attribute values.
This class represents the base class for all IR nodes within Sage III.
Definition: Cxx_Grammar.h:9559
A CFG implementation with Custom filters.
virtual void printEdge(std::ostream &o, SgDirectedGraphEdge *edge, bool isInEdge)
Virtual function Overloaded to print the Custom Filtered CFG Edges.