00001 /* 00002 * File: CustomFilteredCFG.h 00003 * Author: rahman2 00004 * 00005 * Created on July 20, 2011, 3:41 PM 00006 */ 00007 00008 #ifndef CUSTOMFILTEREDCFG_H 00009 #define CUSTOMFILTEREDCFG_H 00010 00011 #include "staticCFG.h" 00012 00013 namespace StaticCFG 00014 { 00016 template <typename _Filter> 00017 class CustomFilteredCFG : public CFG { 00018 00019 public: 00020 CustomFilteredCFG(SgNode *node) : CFG(node, true) { 00021 } 00022 ~CustomFilteredCFG() { 00023 } 00024 virtual void buildFilteredCFG(); 00025 00026 00027 protected: 00029 virtual void printEdge(std::ostream & o, SgDirectedGraphEdge* edge, bool isInEdge) { 00030 00031 AstAttribute* attr = edge->getAttribute("info"); 00032 00033 if (CFGEdgeAttribute<VirtualCFG::FilteredCFGEdge<_Filter> >* edge_attr = dynamic_cast<CFGEdgeAttribute<VirtualCFG::FilteredCFGEdge<_Filter> >*>(attr)) { 00034 VirtualCFG::FilteredCFGEdge<_Filter> e = edge_attr->getEdge(); 00035 o << e.source().id() << " -> " << e.target().id() << " [label=\"" << escapeString(e.toString()) << 00036 "\", style=\"" << (isInEdge ? "dotted" : "solid") << "\"];\n"; 00037 } 00038 else 00039 ROSE_ASSERT(false); 00040 00041 } 00042 private: 00043 template <class NodeT, class EdgeT> 00044 void buildTemplatedCFG(NodeT n, std::map<NodeT, SgGraphNode*>& all_nodes, std::set<NodeT>& explored); 00045 00046 }; 00047 00048 } 00049 #endif /* CUSTOMFILTEREDCFG_H */ 00050
1.4.7