Skip to content

VirtualCFG

Types

Name

Description

CFGEdge

A control flow edge connecting two CFG nodes, with an edge condition to indicate edge types

CFGNode

A node in the control flow graph. Each CFG node corresponds to an AST node, but there can be several CFG nodes for a given AST node.

CFGPath

CfgToDotImpl

DataflowEdge

DataflowNode

FilteredCFGEdge

FilteredCFGNode

InterestingEdge

"Interesting" node and edge filters

InterestingNode

MakeClosure

back_dataflow

back_iterator

cfgRWTransaction

dataflow

iterator

CFGTransform

m_AST2CFG

Enums

Name

Description

EdgeConditionKind

The conditions attached to edges are marked to determine which conditions trigger control to flow along that edge (as opposed to other edges out of the same source node). For conditional branches (except eckCaseLabel and eckDefault), the conditions are implicit and depend on knowledge of the particular control structure. Fortran support for this is underdeveloped; single AST nodes representing variable‐length loops was not part of the original design of the CFG code.

Functions

Name

Description

appendToScopeStmt
void appendToScopeStmt(SgNode* target, SgNode* newNode, void* data);

cfgBeginningOfConstruct
CFGNode cfgBeginningOfConstruct(SgNode* c);

The first CFG node for a construct (before the construct starts to execute)

cfgEndOfConstruct
CFGNode cfgEndOfConstruct(SgNode* c);

The last CFG node for a construct (after the entire construct has finished executing). This node may not actually be reached if, for example, a goto causes a loop to be exited in the middle

cfgIndexForEndWrapper
unsigned int cfgIndexForEndWrapper(SgNode* n);

cfgToDot
void cfgToDot(SgNode* start, std::string const& file_name);

Dump the filtered dot graph of a virtual control flow graph starting from SgNode (start)

cfgToDotForDebugging
void cfgToDotForDebugging(SgNode* start, std::string const& file_name);

Dump the full dot graph of a virtual control flow graph starting from SgNode (start)

createFuncCallStmt
SgStatement* createFuncCallStmt(SgFunctionDeclaration* funcDecl);

createTmpVarInit
void createTmpVarInit(SgType* varType, std::string newName, bool byReference, SgName& varName, SgInitializedName*& initName, SgType*& newType, SgVariableDeclaration*& varDecl);

defaultFilter
bool defaultFilter(CFGNode cfgn);

dfaToDot
template<typename FilterFunction> std::ostream& dfaToDot(std::ostream& o, std::string graphName, std::vector<FilteredCFGNode<FilterFunction>> start, DefUseAnalysis* dfa);

getCFGTargetOfFortranLabelRef
CFGNode getCFGTargetOfFortranLabelRef(SgLabelRefExp* lRef);

getCFGTargetOfFortranLabelSymbol
CFGNode getCFGTargetOfFortranLabelSymbol(SgLabelSymbol* sym);

getFileInfo
Sg_File_Info* getFileInfo(SgNode* n);

getFileInfoString
std::string getFileInfoString(CFGNode n);

initCFGRewrite
void initCFGRewrite(SgProject* project);

insertAfterExpression
SgExpression* insertAfterExpression(SgExpression* expr, SgExpression* newNode);

insertAroundForInit
void insertAroundForInit(SgVariableDeclaration* n, SgExpression* newNode, bool before);

insertBeforeExpression
SgExpression* insertBeforeExpression(SgExpression* expr, SgExpression* newNode);

insertVarDecl
void insertVarDecl(SgStatement* anchor, SgType* varType, bool before, SgInitializedName*& initName);

interestingCfgToDot
void interestingCfgToDot(SgNode* start, std::string const& file_name);

Dump a CFG with only interesting nodes for a SgNode

isDataflowInteresting
bool isDataflowInteresting(CFGNode cn);

isNonMutatingOperator
bool isNonMutatingOperator(SgNode* n);

isNonMutatingSubTree
bool isNonMutatingSubTree(SgNode* n);

makeCfg
CFGNode makeCfg(SgNode* start);

Returns CFG node for just before start

makeClosure
template< typename FilteredEdge, typename Filter> std::vector<FilteredEdge> makeClosure(std::vector<CFGEdge> const& orig, std::vector<CFGEdge> const(CFGNode::* closure)(), CFGNode const(CFGPath::* otherSide)(), CFGPath(* merge)(CFGPath const&, CFGPath const&), Filter const& filter);

makeDataflowCfg
DataflowNode makeDataflowCfg(SgNode* start, bool(* f)(CFGNode));

makeEdge
template< class Node1T, class Node2T, class EdgeT> void makeEdge(Node1T from, Node2T to, std::vector<EdgeT>& result);

Utility function to make CFG Edges

makeInterestingCfg
InterestingNode makeInterestingCfg(SgNode* start);

mergePaths
CFGPath mergePaths(CFGPath const& hd, CFGPath const& tl);

mergePathsReversed
CFGPath mergePathsReversed(CFGPath const& tl, CFGPath const& hd);

prependToScopeStmt
void prependToScopeStmt(SgNode* target, SgNode* newNode, void* data);

* CALL‐BACK FUNCTIONS FOR cfgRWTransaction::transform() **

printEdge
template<typename EdgeT> void printEdge(std::ostream& o, EdgeT const& e, bool isInEdge);

Edge printer

printNode
template<typename NodeT> void printNode(std::ostream& o, NodeT const& n);

Helper function to print Node information

printNodePlusEdges
template< typename NodeT, typename EdgeT> void printNodePlusEdges(std::ostream& o, NodeT n);

Print out a node plus all its outgoing edges

replaceExprWithAssignOp
SgAssignOp* replaceExprWithAssignOp(SgExpression* orig, SgVarRefExp* lhsVar);

replaceExpressionChecked
void replaceExpressionChecked(SgNode* parent, SgExpression* from, SgExpression* to);

replaceStatement
void replaceStatement(SgNode* parent, SgStatement* from, SgStatement* to);

replaceStatementByBlockAfter
void replaceStatementByBlockAfter(SgStatement* stmt, SgStatement* newNode);

replaceStatementByBlockBefore
void replaceStatementByBlockBefore(SgStatement* stmt, SgStatement* newNode);

theInEdge
CFGNode theInEdge(CFGNode n);

theOutEdge
CFGNode theOutEdge(CFGNode n);

varRefFromInitName
SgVarRefExp* varRefFromInitName(SgInitializedName* initName);

varSymFromInitName
SgVariableSymbol* varSymFromInitName(SgInitializedName* initName);

Variables

Name

efgh

Created with MrDocs