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

PtrAliasAnalysis computes Alias Information, which is used for Virtual Function Resolving. More...

#include <PtrAliasAnalysis.h>

Inheritance diagram for PtrAliasAnalysis:
Collaboration diagram for PtrAliasAnalysis:

Public Types

enum  COLOR {
  WHITE =0,
  GREY,
  BLACK
}
 Enum used for Topological sorting. More...
 
enum  TRAVERSAL_TYPE {
  TOPOLOGICAL =0,
  REVERSE_TOPOLOGICAL
}
 Enum used for identifying traversal type. More...
 

Public Member Functions

 PtrAliasAnalysis (SgProject *__project)
 
 ~PtrAliasAnalysis ()
 
void run ()
 Function which actually performs the DataFlowAnalyis. More...
 
void getFunctionDeclarations (std::vector< SgFunctionDeclaration * > &)
 Get the list of function declarations to perform interprocedural DataFlowAnalysis. More...
 
bool runAndCheckIntraProcAnalysis (SgFunctionDeclaration *)
 Execute IntraProc Analysis and check whether something changed. More...
 
- Public Member Functions inherited from InterProcDataFlowAnalysis
 InterProcDataFlowAnalysis (SgProject *_project)
 

Protected Attributes

SgIncidenceDirectedGraphcallGraph
 The stored callGraph for internal processing. More...
 
boost::unordered_map
< SgFunctionDeclaration
*, IntraProcAliasAnalysis * > 
intraAliases
 A map from SgFunctionDeclaration to IntraProcAliasAnalysis. More...
 
boost::unordered_map
< SgExpression *, std::vector
< SgFunctionDeclaration * > > 
resolver
 A map which stores the function call resolve information. More...
 
ClassHierarchyWrapperclassHierarchy
 ClassHierarchy of the project. More...
 
CallGraphBuildercgBuilder
 
- Protected Attributes inherited from InterProcDataFlowAnalysis
SgProjectproject
 Stored the Project Object. More...
 

Private Member Functions

void SortCallGraphRecursive (SgFunctionDeclaration *targetFunction, SgIncidenceDirectedGraph *callGraph, boost::unordered_map< SgFunctionDeclaration *, SgGraphNode * > &graphNodeToFunction, boost::unordered_map< SgGraphNode *, PtrAliasAnalysis::COLOR > &colors, std::vector< SgFunctionDeclaration * > &processingOrder, PtrAliasAnalysis::TRAVERSAL_TYPE order)
 
void SortCallGraphNodes (SgFunctionDeclaration *targetFunction, SgIncidenceDirectedGraph *callGraph, boost::unordered_map< SgFunctionDeclaration *, SgGraphNode * > &graphNodeToFunction, std::vector< SgFunctionDeclaration * > &processingOrder, PtrAliasAnalysis::TRAVERSAL_TYPE order)
 
void computeCallGraphNodes (SgFunctionDeclaration *targetFunction, SgIncidenceDirectedGraph *callGraph, std::vector< SgFunctionDeclaration * > &processingOrder, PtrAliasAnalysis::TRAVERSAL_TYPE order)
 

Private Attributes

TRAVERSAL_TYPE order
 

Detailed Description

PtrAliasAnalysis computes Alias Information, which is used for Virtual Function Resolving.

Definition at line 13 of file PtrAliasAnalysis.h.

Member Enumeration Documentation

Enum used for Topological sorting.

Enumerator
WHITE 
GREY 
BLACK 

Definition at line 31 of file PtrAliasAnalysis.h.

Enum used for identifying traversal type.

Enumerator
TOPOLOGICAL 
REVERSE_TOPOLOGICAL 

Definition at line 33 of file PtrAliasAnalysis.h.

Constructor & Destructor Documentation

PtrAliasAnalysis::PtrAliasAnalysis ( SgProject __project)
PtrAliasAnalysis::~PtrAliasAnalysis ( )

Member Function Documentation

void PtrAliasAnalysis::run ( )
virtual

Function which actually performs the DataFlowAnalyis.

Reimplemented from InterProcDataFlowAnalysis.

Reimplemented in VirtualFunctionAnalysis.

void PtrAliasAnalysis::getFunctionDeclarations ( std::vector< SgFunctionDeclaration * > &  )
virtual

Get the list of function declarations to perform interprocedural DataFlowAnalysis.

Implements InterProcDataFlowAnalysis.

bool PtrAliasAnalysis::runAndCheckIntraProcAnalysis ( SgFunctionDeclaration )
virtual

Execute IntraProc Analysis and check whether something changed.

Implements InterProcDataFlowAnalysis.

void PtrAliasAnalysis::SortCallGraphRecursive ( SgFunctionDeclaration targetFunction,
SgIncidenceDirectedGraph callGraph,
boost::unordered_map< SgFunctionDeclaration *, SgGraphNode * > &  graphNodeToFunction,
boost::unordered_map< SgGraphNode *, PtrAliasAnalysis::COLOR > &  colors,
std::vector< SgFunctionDeclaration * > &  processingOrder,
PtrAliasAnalysis::TRAVERSAL_TYPE  order 
)
private
void PtrAliasAnalysis::SortCallGraphNodes ( SgFunctionDeclaration targetFunction,
SgIncidenceDirectedGraph callGraph,
boost::unordered_map< SgFunctionDeclaration *, SgGraphNode * > &  graphNodeToFunction,
std::vector< SgFunctionDeclaration * > &  processingOrder,
PtrAliasAnalysis::TRAVERSAL_TYPE  order 
)
private
void PtrAliasAnalysis::computeCallGraphNodes ( SgFunctionDeclaration targetFunction,
SgIncidenceDirectedGraph callGraph,
std::vector< SgFunctionDeclaration * > &  processingOrder,
PtrAliasAnalysis::TRAVERSAL_TYPE  order 
)
private

Member Data Documentation

SgIncidenceDirectedGraph* PtrAliasAnalysis::callGraph
protected

The stored callGraph for internal processing.

Definition at line 17 of file PtrAliasAnalysis.h.

boost::unordered_map<SgFunctionDeclaration *, IntraProcAliasAnalysis *> PtrAliasAnalysis::intraAliases
protected

A map from SgFunctionDeclaration to IntraProcAliasAnalysis.

Definition at line 20 of file PtrAliasAnalysis.h.

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

A map which stores the function call resolve information.

Definition at line 23 of file PtrAliasAnalysis.h.

ClassHierarchyWrapper* PtrAliasAnalysis::classHierarchy
protected

ClassHierarchy of the project.

Definition at line 26 of file PtrAliasAnalysis.h.

CallGraphBuilder* PtrAliasAnalysis::cgBuilder
protected

Definition at line 28 of file PtrAliasAnalysis.h.

TRAVERSAL_TYPE PtrAliasAnalysis::order
private

Definition at line 57 of file PtrAliasAnalysis.h.


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