ROSE  0.9.6a
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IntraProcAliasAnalysis Class Reference

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

#include <IntraProcAliasAnalysis.h>

Inheritance diagram for IntraProcAliasAnalysis:
Collaboration diagram for IntraProcAliasAnalysis:

Public Member Functions

 IntraProcAliasAnalysis (SgNode *head, ClassHierarchyWrapper *_classHierarchy, CallGraphBuilder *_cgB, boost::unordered_map< SgFunctionDeclaration *, IntraProcAliasAnalysis * > &mapping, boost::unordered_map< SgExpression *, std::vector< SgFunctionDeclaration * > > &resolver)
 
CompReprPtr getFunctionEntry ()
 Get the Entry CompactRepresentation Graph for the function. More...
 
CompReprPtr getFunctionExit ()
 Get the Exit CompactRepresentation Graph for the function. More...
 
std::vector< AliasRelationNodegetReturnStmts ()
 Get the return statements. More...
 
void setFunctionEntry (CompReprPtr &n)
 Set Function Entry CompactRepresentation. More...
 
void setFunctionExit (CompReprPtr &n)
 Set Function Exit CompactRepresentation. More...
 
bool runCheck ()
 run and check whether any changes have been made More...
 
virtual void run ()
 Perform the intra procedural analysis. More...
 
void init ()
 Initialized the Analysis. More...
 
 ~IntraProcAliasAnalysis ()
 Destructor. More...
 
CompReprPtr meet_data (const CompReprPtr &d1, const CompReprPtr &d2)
 Meet_data for intra procedural dataflow analysis. More...
 
virtual std::vector
< SgGraphNode * > 
getAllNodes ()
 Get all the CFG Nodes. More...
 
virtual std::vector
< SgGraphNode * > 
getPredecessors (SgGraphNode *n)
 Get all the Predecessors of a CFG Node. More...
 
CompReprPtr getCFGInData (SgGraphNode *a)
 Get the IN data of a CFG Node. More...
 
CompReprPtr getCFGOutData (SgGraphNode *a)
 Get the OUT data of a CFG Node. More...
 
void setCFGInData (SgGraphNode *a, CompReprPtr &b)
 Set the IN data of a CFG Node. More...
 
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);. More...
 
- Public Member Functions inherited from IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >
 IntraProcDataFlowAnalysis (SgNode *head)
 

Protected Member Functions

virtual void buildCFG ()
 Constructs the CFG. More...
 
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. More...
 
void getConstructorParametersAliasRelations (SgConstructorInitializer *f_exp, SgFunctionDeclaration *funcDecl, std::vector< std::pair< AliasRelationNode, AliasRelationNode > > &arg_relations)
 Retrieve Alias Relations from Constructor Parameters. More...
 
bool addVirtualFunction (SgType *type, SgFunctionCallExp *funcExp)
 Given a callSite and type of object add appropriate virtual function declaration. More...
 
bool updateVirtualFunctionInCallGraph (SgFunctionCallExp *funcCall, CompReprPtr &callSiteIN)
 Given a CallSite update with all the virtual function calls. More...
 
void getAliases (CompReprPtr &ptr, AliasRelationNode &node, std::vector< SgVariableSymbol * > &aliases)
 

Protected Attributes

StaticCFG::CustomFilteredCFG
< AliasCfgFilter > * 
cfg
 The CFG for the function. More...
 
CallGraphBuildercgBuilder
 The Call Graph Builder for interation computatoin. More...
 
vector< SgGraphNode * > cfgNodes
 List of all the CFGNodes in topological order. More...
 
CompReprPtr entry
 Entry CompactRepresentation of the function. More...
 
CompReprPtr exit
 Exit CompactRepresentation of the function. More...
 
unsigned long checkPointHash
 
boost::unordered_map
< SgFunctionDeclaration
*, IntraProcAliasAnalysis * > & 
mapping
 A mapping to hold SgFunctionDeclaration to IntraProcAliasAnalysis. More...
 
boost::unordered_map
< SgExpression *, std::vector
< SgFunctionDeclaration * > > & 
resolver
 A mapping to hold function resolve data. More...
 
- Protected Attributes inherited from IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >
SgNodehead
 

Private Attributes

AliasInfoGeneratorgen
 AliasInfoGenerator to hold Alias Information. More...
 
ClassHierarchyWrapperclassHierarchy
 Class Hierarchy Instance. More...
 

Detailed Description

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

Definition at line 289 of file IntraProcAliasAnalysis.h.

Constructor & Destructor Documentation

IntraProcAliasAnalysis::IntraProcAliasAnalysis ( SgNode head,
ClassHierarchyWrapper _classHierarchy,
CallGraphBuilder _cgB,
boost::unordered_map< SgFunctionDeclaration *, IntraProcAliasAnalysis * > &  mapping,
boost::unordered_map< SgExpression *, std::vector< SgFunctionDeclaration * > > &  resolver 
)
IntraProcAliasAnalysis::~IntraProcAliasAnalysis ( )

Destructor.

Member Function Documentation

virtual void IntraProcAliasAnalysis::buildCFG ( )
protectedvirtual
void IntraProcAliasAnalysis::getFunctionParametersAliasRelations ( SgFunctionCallExp f_exp,
SgFunctionDeclaration funcDecl,
std::vector< std::pair< AliasRelationNode, AliasRelationNode > > &  arg_relations,
std::vector< std::pair< AliasRelationNode, AliasRelationNode > > &  return_relations 
)
protected

Retrieve Alias Relations from Function Parameters.

Map data between actual and formal parameters. Handles return values as well.

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

Retrieve Alias Relations from Constructor Parameters.

bool IntraProcAliasAnalysis::addVirtualFunction ( SgType type,
SgFunctionCallExp funcExp 
)
protected

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

bool IntraProcAliasAnalysis::updateVirtualFunctionInCallGraph ( SgFunctionCallExp funcCall,
CompReprPtr callSiteIN 
)
protected

Given a CallSite update with all the virtual function calls.

void IntraProcAliasAnalysis::getAliases ( CompReprPtr ptr,
AliasRelationNode node,
std::vector< SgVariableSymbol * > &  aliases 
)
protected
CompReprPtr IntraProcAliasAnalysis::getFunctionEntry ( )
inline

Get the Entry CompactRepresentation Graph for the function.

Definition at line 354 of file IntraProcAliasAnalysis.h.

CompReprPtr IntraProcAliasAnalysis::getFunctionExit ( )
inline

Get the Exit CompactRepresentation Graph for the function.

Definition at line 357 of file IntraProcAliasAnalysis.h.

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

Get the return statements.

Definition at line 360 of file IntraProcAliasAnalysis.h.

void IntraProcAliasAnalysis::setFunctionEntry ( CompReprPtr n)
void IntraProcAliasAnalysis::setFunctionExit ( CompReprPtr n)
bool IntraProcAliasAnalysis::runCheck ( )

run and check whether any changes have been made

virtual void IntraProcAliasAnalysis::run ( )
virtual

Perform the intra procedural analysis.

Reimplemented from IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

void IntraProcAliasAnalysis::init ( )
inline

Initialized the Analysis.

Definition at line 375 of file IntraProcAliasAnalysis.h.

CompReprPtr IntraProcAliasAnalysis::meet_data ( const CompReprPtr d1,
const CompReprPtr d2 
)
virtual

Meet_data for intra procedural dataflow analysis.

This function is called when two path merges in CFG

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

virtual std::vector<SgGraphNode *> IntraProcAliasAnalysis::getAllNodes ( )
inlinevirtual

Get all the CFG Nodes.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

Definition at line 385 of file IntraProcAliasAnalysis.h.

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

Get all the Predecessors of a CFG Node.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

CompReprPtr IntraProcAliasAnalysis::getCFGInData ( SgGraphNode a)
inlinevirtual

Get the IN data of a CFG Node.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

Definition at line 391 of file IntraProcAliasAnalysis.h.

CompReprPtr IntraProcAliasAnalysis::getCFGOutData ( SgGraphNode a)
inlinevirtual

Get the OUT data of a CFG Node.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

Definition at line 394 of file IntraProcAliasAnalysis.h.

void IntraProcAliasAnalysis::setCFGInData ( SgGraphNode a,
CompReprPtr b 
)
inlinevirtual

Set the IN data of a CFG Node.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

Definition at line 397 of file IntraProcAliasAnalysis.h.

void IntraProcAliasAnalysis::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);.

Implements IntraProcDataFlowAnalysis< SgGraphNode, CompReprPtr >.

Member Data Documentation

AliasInfoGenerator* IntraProcAliasAnalysis::gen
private

AliasInfoGenerator to hold Alias Information.

Definition at line 293 of file IntraProcAliasAnalysis.h.

ClassHierarchyWrapper* IntraProcAliasAnalysis::classHierarchy
private

Class Hierarchy Instance.

Definition at line 296 of file IntraProcAliasAnalysis.h.

StaticCFG::CustomFilteredCFG<AliasCfgFilter>* IntraProcAliasAnalysis::cfg
protected

The CFG for the function.

Definition at line 300 of file IntraProcAliasAnalysis.h.

CallGraphBuilder* IntraProcAliasAnalysis::cgBuilder
protected

The Call Graph Builder for interation computatoin.

Definition at line 303 of file IntraProcAliasAnalysis.h.

vector<SgGraphNode *> IntraProcAliasAnalysis::cfgNodes
protected

List of all the CFGNodes in topological order.

Definition at line 306 of file IntraProcAliasAnalysis.h.

CompReprPtr IntraProcAliasAnalysis::entry
protected

Entry CompactRepresentation of the function.

Definition at line 312 of file IntraProcAliasAnalysis.h.

CompReprPtr IntraProcAliasAnalysis::exit
protected

Exit CompactRepresentation of the function.

Definition at line 315 of file IntraProcAliasAnalysis.h.

unsigned long IntraProcAliasAnalysis::checkPointHash
protected

Definition at line 317 of file IntraProcAliasAnalysis.h.

boost::unordered_map<SgFunctionDeclaration *, IntraProcAliasAnalysis *>& IntraProcAliasAnalysis::mapping
protected

A mapping to hold SgFunctionDeclaration to IntraProcAliasAnalysis.

Definition at line 323 of file IntraProcAliasAnalysis.h.

boost::unordered_map<SgExpression*, std::vector<SgFunctionDeclaration*> >& IntraProcAliasAnalysis::resolver
protected

A mapping to hold function resolve data.

Definition at line 326 of file IntraProcAliasAnalysis.h.


The documentation for this class was generated from the following file: