Static Value-Flow Analysis
|
AliasCFLGraphBuilder: a CFLGraphBuilder specialized for handling aliasing. More...
#include <CFLGraphBuilder.h>
Public Member Functions | |
CFLGraph * | buildBigraph (ConstraintGraph *graph, Kind startKind, GrammarBase *grammar) |
Builds a bidirectional CFL graph by copying nodes and edges from a const graph that inherits from GenericGraph. | |
CFLGraph * | buildBiPEGgraph (ConstraintGraph *graph, Kind startKind, GrammarBase *grammar, SVFIR *pag) |
Public Member Functions inherited from SVF::CFLGraphBuilder | |
template<class N , class E > | |
CFLGraph * | build (GenericGraph< N, E > *graph, GrammarBase *grammar, BuildDirection direction=BuildDirection::plain) |
CFLGraph * | build (std::string fileName, GrammarBase *grammar, BuildDirection direction=BuildDirection::plain) |
Method to build a CFL graph from external file. | |
Map< std::string, Kind > & | getLabelToKindMap () |
Returns a reference to the map that associates string labels with their corresponding Kind. | |
Map< Kind, std::string > & | getKindToLabelMap () |
Returns a reference to the map that associates Kinds with their corresponding string labels. | |
Map< CFGrammar::Kind, Set< CFGrammar::Attribute > > & | getKindToAttrsMap () |
Returns a reference to the map that associates Kinds with their corresponding attributes. | |
Private Member Functions | |
void | connectVGep (CFLGraph *cflGraph, ConstraintGraph *graph, ConstraintNode *src, ConstraintNode *dst, u32_t level, SVFIR *pag) |
Connects VGep (Variable GEP) | |
void | addBiCFLEdge (CFLGraph *cflGraph, ConstraintNode *src, ConstraintNode *dst, CFGrammar::Kind label) |
Handles edges, with the exception of the GEP. | |
void | addBiGepCFLEdge (CFLGraph *cflGraph, ConstraintNode *src, ConstraintNode *dst, CFGrammar::Attribute attri) |
Adds bidirectional GEP edges with attributes. | |
Additional Inherited Members | |
Protected Types inherited from SVF::CFLGraphBuilder | |
typedef CFGrammar::Kind | Kind |
typedef CFGrammar::Symbol | Symbol |
Protected Member Functions inherited from SVF::CFLGraphBuilder | |
void | addAttribute (CFGrammar::Kind kind, CFGrammar::Attribute attribute) |
Method to add an attribute to a specific kind. | |
void | buildlabelToKindMap (GrammarBase *grammar) |
build label and kind connect from the grammar | |
CFLNode * | addGNode (u32_t NodeID) |
add src and dst node from file | |
CFLGraph * | buildFromText (std::string fileName, GrammarBase *grammar, BuildDirection direction=BuildDirection::plain) |
Method to build a CFL graph from a Text file. | |
CFLGraph * | buildFromDot (std::string filename, GrammarBase *grammar, BuildDirection direction=BuildDirection::plain) |
Method to build a CFL graph from a Dot file. | |
CFLGraph * | buildFromJson (std::string filename, GrammarBase *grammar, BuildDirection direction=BuildDirection::plain) |
Method to build a CFL graph from a Json file. | |
Protected Attributes inherited from SVF::CFLGraphBuilder | |
Map< std::string, Kind > | labelToKindMap |
Maps to maintain mapping between labels and kinds. | |
Map< Kind, std::string > | kindToLabelMap |
Map< CFGrammar::Kind, Set< CFGrammar::Attribute > > | kindToAttrsMap |
Map to maintain attributes associated with each kind. | |
Kind | current |
CFLGraph * | cflGraph |
AliasCFLGraphBuilder: a CFLGraphBuilder specialized for handling aliasing.
Definition at line 120 of file CFLGraphBuilder.h.
|
private |
Handles edges, with the exception of the GEP.
Definition at line 462 of file CFLGraphBuilder.cpp.
|
private |
Adds bidirectional GEP edges with attributes.
Definition at line 471 of file CFLGraphBuilder.cpp.
CFLGraph * SVF::AliasCFLGraphBuilder::buildBigraph | ( | ConstraintGraph * | graph, |
Kind | startKind, | ||
GrammarBase * | grammar | ||
) |
Builds a bidirectional CFL graph by copying nodes and edges from a const graph that inherits from GenericGraph.
Definition at line 280 of file CFLGraphBuilder.cpp.
CFLGraph * SVF::AliasCFLGraphBuilder::buildBiPEGgraph | ( | ConstraintGraph * | graph, |
Kind | startKind, | ||
GrammarBase * | grammar, | ||
SVFIR * | pag | ||
) |
Builds a bidirectional CFL graph by copying nodes and edges from any graph that inherits from GenericGraph Transfers Load and Store to copy edge and address edge to construct PEG style CFLGraph
Process Store
Check Dst of Store Dereference Node
Add Addr Edge
Add Copy Edge
Process Load
Check Src of Load Dereference Node
Add Addr Edge
Add Copy Edge
Handle VGep normalize to Normal Gep by connecting all geps' srcs to vgep dest Example: In Test Case: Ctest field-ptr-arith-varIdx.c.bc BFS Search the 8 LEVEL up to find the ValueNode, and the number of level search is arbitrary the more the level search the more valueNode and the Vgep Dst will possibly connect
Definition at line 322 of file CFLGraphBuilder.cpp.
|
private |
Connects VGep (Variable GEP)