Lines Matching defs:CFG

1 //===--- CFG.h - Classes for representing and building CFGs------*- C++ -*-===//
10 // This file defines the CFG and CFGBuilder classes for representing and
43 class CFG;
328 /// CFGBlock - Represents a single basic block in a source-level CFG.
413 /// of the CFG.
417 /// This class represents a potential adjacent block in the CFG. It encodes
472 /// CFG blocks.
488 /// Parent - The parent CFG that owns this CFGBlock.
489 CFG *Parent;
492 explicit CFGBlock(unsigned blockid, BumpVectorContext &C, CFG *parent)
522 // CFG iterators
642 CFG *getParent() const { return Parent; }
646 void dump(const CFG *cfg, const LangOptions &LO, bool ShowColors = false) const;
647 void print(raw_ostream &OS, const CFG* cfg, const LangOptions &LO,
706 /// operator error is found when building the CFG.
716 /// CFG - Represents a source-level, intra-procedural CFG that represents the
718 /// or a single expression. A CFG will always contain one empty block that
719 /// represents the Exit point of the CFG. A CFG will also contain a designated
720 /// Entry block. The CFG solely represents control-flow; it consists of
721 /// CFGBlocks which are simply containers of Stmt*'s in the AST the CFG
723 class CFG {
726 // CFG Construction & Manipulation.
814 /// buildCFG - Builds a CFG from an AST. The responsibility to free the
815 /// constructed CFG belongs to the caller.
816 static CFG* buildCFG(const Decl *D, Stmt *AST, ASTContext *C,
819 /// createBlock - Create a new block in the CFG. The CFG owns the block;
823 /// setEntry - Set the entry block of the CFG. This is typically used
824 /// only during CFG construction. Most CFG clients expect that the
829 /// This is typically used only during CFG construction.
886 /// The CFG uses synthetic DeclStmts when a single AST DeclStmt contains
899 /// Iterates over synthetic DeclStmts in the CFG.
928 // CFG Introspection.
935 /// size - Return the total number of CFGBlocks within the CFG
941 // CFG Debugging: Pretty-Printing and Visualization.
952 CFG()
976 /// This is the collection of such blocks present in the CFG.
979 /// Collects DeclStmts synthesized for this CFG and maps each one back to its
986 // GraphTraits specializations for CFG basic block graphs (source-level CFGs)
1058 // Traits for: CFG
1060 template <> struct GraphTraits< ::clang::CFG* >
1063 typedef ::clang::CFG::graph_iterator nodes_iterator;
1065 static NodeType *getEntryNode(::clang::CFG* F) { return &F->getEntry(); }
1066 static nodes_iterator nodes_begin(::clang::CFG* F) { return F->nodes_begin();}
1067 static nodes_iterator nodes_end(::clang::CFG* F) { return F->nodes_end(); }
1068 static unsigned size(::clang::CFG* F) { return F->size(); }
1071 template <> struct GraphTraits<const ::clang::CFG* >
1074 typedef ::clang::CFG::const_graph_iterator nodes_iterator;
1076 static NodeType *getEntryNode( const ::clang::CFG* F) {
1079 static nodes_iterator nodes_begin( const ::clang::CFG* F) {
1082 static nodes_iterator nodes_end( const ::clang::CFG* F) {
1085 static unsigned size(const ::clang::CFG* F) {
1090 template <> struct GraphTraits<Inverse< ::clang::CFG*> >
1093 typedef ::clang::CFG::graph_iterator nodes_iterator;
1095 static NodeType *getEntryNode( ::clang::CFG* F) { return &F->getExit(); }
1096 static nodes_iterator nodes_begin( ::clang::CFG* F) {return F->nodes_begin();}
1097 static nodes_iterator nodes_end( ::clang::CFG* F) { return F->nodes_end(); }
1100 template <> struct GraphTraits<Inverse<const ::clang::CFG*> >
1103 typedef ::clang::CFG::const_graph_iterator nodes_iterator;
1105 static NodeType *getEntryNode(const ::clang::CFG* F) { return &F->getExit(); }
1106 static nodes_iterator nodes_begin(const ::clang::CFG* F) {
1109 static nodes_iterator nodes_end(const ::clang::CFG* F) {