Skip to content

IntraProcAliasAnalysis

IntraProcedurial DataFlow Analysis to compute exit and entry from all the function which

Synopsis

Declared in <src/midend/programAnalysis/VirtualFunctionAnalysis/IntraProcAliasAnalysis.h>

class IntraProcAliasAnalysis
    : public IntraProcDataFlowAnalysis<SgGraphNode, CompReprPtr>

Base Classes

Name Description
IntraProcDataFlowAnalysis<SgGraphNode, CompReprPtr>

Member Functions

Name Description
IntraProcAliasAnalysis
IntraProcAliasAnalysis( SgNode* head, ClassHierarchyWrapper* _classHierarchy, CallGraphBuilder* _cgB, std::unordered_map<SgFunctionDeclaration*, IntraProcAliasAnalysis*>& mapping, std::unordered_map<SgExpression*, std::vector<SgFunctionDeclaration*>>& resolver); [constructor]
~IntraProcAliasAnalysis
virtual ~IntraProcAliasAnalysis(); [destructor] [virtual]
Destructor
applyCFGTransferFunction
virtual void applyCFGTransferFunction(SgGraphNode* s); [virtual]
Apply the Transfer function to a node For an expression “pi = qj” OutC =TransferFunction(InC) = (InC – Must(Alias(p,i)) U (*a, b) where a ε Alias(p,i) and b ε Alias(q,j);
getAllNodes
virtual std::vector<SgGraphNode*> getAllNodes(); [virtual]
Get all the CFG Nodes
getCFGInData
virtual CompReprPtr getCFGInData(SgGraphNode* a); [virtual]
Get the IN data of a CFG Node
getCFGOutData
virtual CompReprPtr getCFGOutData(SgGraphNode* a); [virtual]
Get the OUT data of a CFG Node
getFunctionEntry
CompReprPtr getFunctionEntry();
Get the Entry CompactRepresentation Graph for the function
getFunctionExit
CompReprPtr getFunctionExit();
Get the Exit CompactRepresentation Graph for the function
getPredecessors
virtual std::vector<SgGraphNode*> getPredecessors(SgGraphNode* n); [virtual]
Get all the Predecessors of a CFG Node
getReturnStmts
std::vector<AliasRelationNode> getReturnStmts();
Get the return statements
init
void init();
Initialized the Analysis
meet_data
virtual CompReprPtr meet_data( CompReprPtr const& d1, CompReprPtr const& d2); [virtual]
Meet_data for intra procedural dataflow analysis. This function is called when two path merges in CFG
run
virtual void run(); [virtual]
Perform the intra procedural analysis
runCheck
bool runCheck();
run and check whether any changes have been made
setCFGInData
virtual void setCFGInData( SgGraphNode* a, CompReprPtr& b); [virtual]
Set the IN data of a CFG Node
setFunctionEntry
void setFunctionEntry(CompReprPtr& n);
Set Function Entry CompactRepresentation
setFunctionExit
void setFunctionExit(CompReprPtr& n);
Set Function Exit CompactRepresentation

Protected Member Functions

Name Description
addVirtualFunction
bool addVirtualFunction( SgType* type, SgFunctionCallExp* funcExp);
Given a callSite and type of object add appropriate virtual function declaration
buildCFG
virtual void buildCFG(); [virtual]
Constructs the CFG
getAliases
void getAliases( CompReprPtr& ptr, AliasRelationNode& node, std::vector<SgType*>& aliases);
getConstructorParametersAliasRelations
void getConstructorParametersAliasRelations( SgConstructorInitializer* f_exp, SgFunctionDeclaration* funcDecl, std::vector<std::pair<AliasRelationNode, AliasRelationNode>>& arg_relations);
Retrieve Alias Relations from Constructor Parameters.
getFunctionParametersAliasRelations
void getFunctionParametersAliasRelations( SgFunctionCallExp* f_exp, SgFunctionDeclaration* funcDecl, std::vector<std::pair<AliasRelationNode, AliasRelationNode>>& arg_relations);
Retrieve Alias Relations from Function Parameters. Map data between actual and formal parameters.
updateVirtualFunctionInCallGraph
bool updateVirtualFunctionInCallGraph( SgFunctionCallExp* funcCall, CompReprPtr& callSiteIN);
Given a CallSite update with all the virtual function calls

Protected Data Members

Name Description
cfg The CFG for the function
cfgNodes List of all the CFGNodes in topological order
cgBuilder The Call Graph Builder for interation computatoin
exit Exit CompactRepresentation of the function
mapping A mapping to hold SgFunctionDeclaration to IntraProcAliasAnalysis
resolver A mapping to hold function resolve data

Private Data Members

Name Description
classHierarchy Class Hierarchy Instance
gen AliasInfoGenerator to hold Alias Information

Created with MrDocs