Class IntraProcAliasAnalysis#

Inheritance Relationships#

Base Type#

Class Documentation#

class IntraProcAliasAnalysis : public IntraProcDataFlowAnalysis<SgGraphNode, CompReprPtr>#

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

Public Functions

IntraProcAliasAnalysis(SgNode *head, ClassHierarchyWrapper *_classHierarchy, CallGraphBuilder *_cgB, std::unordered_map<SgFunctionDeclaration*, IntraProcAliasAnalysis*> &mapping, std::unordered_map<SgExpression*, std::vector<SgFunctionDeclaration*>> &resolver)#
inline CompReprPtr getFunctionEntry()#

Get the Entry CompactRepresentation Graph for the function.

inline CompReprPtr getFunctionExit()#

Get the Exit CompactRepresentation Graph for the function.

inline std::vector<AliasRelationNode> getReturnStmts()#

Get the return statements.

void setFunctionEntry(CompReprPtr &n)#

Set Function Entry CompactRepresentation.

void setFunctionExit(CompReprPtr &n)#

Set Function Exit CompactRepresentation.

bool runCheck()#

run and check whether any changes have been made

virtual void run()#

Perform the intra procedural analysis.

inline void init()#

Initialized the Analysis.

virtual ~IntraProcAliasAnalysis()#

Destructor.

virtual CompReprPtr meet_data(const CompReprPtr &d1, const CompReprPtr &d2)#

Meet_data for intra procedural dataflow analysis. This function is called when two path merges in CFG.

inline virtual std::vector<SgGraphNode*> getAllNodes()#

Get all the CFG Nodes.

virtual std::vector<SgGraphNode*> getPredecessors(SgGraphNode *n)#

Get all the Predecessors of a CFG Node.

inline virtual CompReprPtr getCFGInData(SgGraphNode *a)#

Get the IN data of a CFG Node.

inline virtual CompReprPtr getCFGOutData(SgGraphNode *a)#

Get the OUT data of a CFG Node.

inline virtual void setCFGInData(SgGraphNode *a, CompReprPtr &b)#

Set the IN data of a CFG Node.

virtual void applyCFGTransferFunction(SgGraphNode *s)#

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);.

Protected Functions

virtual void buildCFG()#

Constructs the CFG.

void getFunctionParametersAliasRelations(SgFunctionCallExp *f_exp, SgFunctionDeclaration *funcDecl, std::vector<std::pair<AliasRelationNode, AliasRelationNode>> &arg_relations, std::vector<std::pair<AliasRelationNode, AliasRelationNode>> &return_relations)#

Retrieve Alias Relations from Function Parameters. Map data between actual and formal parameters. Handles return values as well.

void getConstructorParametersAliasRelations(SgConstructorInitializer *f_exp, SgFunctionDeclaration *funcDecl, std::vector<std::pair<AliasRelationNode, AliasRelationNode>> &arg_relations)#

Retrieve Alias Relations from Constructor Parameters.

bool addVirtualFunction(SgType *type, SgFunctionCallExp *funcExp)#

Given a callSite and type of object add appropriate virtual function declaration.

bool updateVirtualFunctionInCallGraph(SgFunctionCallExp *funcCall, CompReprPtr &callSiteIN)#

Given a CallSite update with all the virtual function calls.

void getAliases(CompReprPtr &ptr, AliasRelationNode &node, std::vector<SgVariableSymbol*> &aliases)#

Protected Attributes

StaticCFG::CustomFilteredCFG<AliasCfgFilter> *cfg#

The CFG for the function.

CallGraphBuilder *cgBuilder#

The Call Graph Builder for interation computatoin.

vector<SgGraphNode*> cfgNodes#

List of all the CFGNodes in topological order.

CompReprPtr entry#

Entry CompactRepresentation of the function.

CompReprPtr exit#

Exit CompactRepresentation of the function.

unsigned long checkPointHash#
std::unordered_map<SgFunctionDeclaration*, IntraProcAliasAnalysis*> &mapping#

A mapping to hold SgFunctionDeclaration to IntraProcAliasAnalysis.

std::unordered_map<SgExpression*, std::vector<SgFunctionDeclaration*>> &resolver#

A mapping to hold function resolve data.