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

#include <DefUseAnalysis.h>

Inheritance diagram for DefUseAnalysis:
Collaboration diagram for DefUseAnalysis:

Public Member Functions

 DefUseAnalysis (SgProject *proj)
 
virtual ~DefUseAnalysis ()
 
std::map< SgNode *, multitypegetDefMap ()
 
std::map< SgNode *, multitypegetUseMap ()
 
void setMaps (std::map< SgNode *, multitype > def, std::map< SgNode *, multitype > use)
 
int run ()
 Run the DFA analysis without debugging. More...
 
int run (bool debug)
 
multitype getDefMultiMapFor (SgNode *node)
 get the Definition multimap of a specific SgNode. More...
 
multitype getUseMultiMapFor (SgNode *node)
 get the Usage multimap of a specific SgNode. More...
 
std::vector< SgNode * > getAnyFor (const multitype *mul, SgInitializedName *initName)
 
std::vector< SgNode * > getDefFor (SgNode *node, SgInitializedName *initName)
 get the vector of defining nodes for a specific node and a initializedName. More...
 
std::vector< SgNode * > getUseFor (SgNode *node, SgInitializedName *initName)
 get the vector of usage nodes for a specific node and a initializedName. More...
 
bool isNodeGlobalVariable (SgInitializedName *node)
 return whether a node is a global node More...
 
std::vector< SgInitializedName * > getGlobalVariables ()
 
int start_traversal_of_one_function (SgFunctionDefinition *proc)
 
bool searchMap (SgNode *node)
 
int getDefSize ()
 
int getUseSize ()
 
void printMultiMap (const multitype *type)
 
void printDefMap ()
 
void printUseMap ()
 
bool addID (SgNode *sgNode)
 
void addDefElement (SgNode *sgNode, SgInitializedName *initName, SgNode *defNode)
 
void addUseElement (SgNode *sgNode, SgInitializedName *initName, SgNode *defNode)
 
void replaceElement (SgNode *sgNode, SgInitializedName *initName)
 
void mapDefUnion (SgNode *before, SgNode *other, SgNode *current)
 
void mapUseUnion (SgNode *before, SgNode *other, SgNode *current)
 
void clearUseOfElement (SgNode *sgNode, SgInitializedName *initName)
 
int getIntForSgNode (SgNode *node)
 
void dfaToDOT ()
 
void flush ()
 
void flushHelp ()
 
void disableVisualization ()
 
void flushDefuse ()
 
- Public Member Functions inherited from DFAnalysis
 DFAnalysis ()
 
virtual ~DFAnalysis ()
 

Private Types

typedef std::vector< std::pair
< SgInitializedName *, SgNode * > > 
multitype
 
typedef std::map< SgNode
*, multitype
tabletype
 
typedef
rose_hash::unordered_map
< SgNode *, int > 
convtype
 

Private Member Functions

void find_all_global_variables ()
 
bool start_traversal_of_functions ()
 
bool searchMap (const tabletype *ltable, SgNode *node)
 
bool searchVizzMap (SgNode *node)
 
std::string getInitName (SgNode *sgNode)
 
void addAnyElement (tabletype *tabl, SgNode *sgNode, SgInitializedName *initName, SgNode *defNode)
 
void mapAnyUnion (tabletype *tabl, SgNode *before, SgNode *other, SgNode *current)
 
void printAnyMap (tabletype *tabl)
 
- Private Member Functions inherited from Support
template<typename T >
std::string ToString (T t)
 
std::string resBool (bool val)
 
template<typename T >
bool isContainedinVector (T filterNode, std::vector< T > worklist)
 
std::string getAppName (SgFunctionDeclaration *functionDeclaration)
 
std::string getFileNameString (std::string src)
 
std::string getFullName (SgFunctionDefinition *functionDef)
 

Private Attributes

SgProjectproject
 
bool DEBUG_MODE
 
bool DEBUG_MODE_EXTRA
 
std::vector< SgInitializedName * > globalVarList
 
bool visualizationEnabled
 
tabletype table
 
tabletype usetable
 
convtype vizzhelp
 
int nrOfNodesVisited
 
std::vector< FilteredCFGNode
< IsDFAFilter > > 
dfaFunctions
 

Static Private Attributes

static int sgNodeCounter
 

Detailed Description

Definition at line 59 of file DefUseAnalysis.h.

Member Typedef Documentation

typedef std::vector< std::pair<SgInitializedName* , SgNode*> > DefUseAnalysis::multitype
private

Definition at line 69 of file DefUseAnalysis.h.

typedef std::map< SgNode* , multitype > DefUseAnalysis::tabletype
private

Definition at line 72 of file DefUseAnalysis.h.

typedef rose_hash::unordered_map< SgNode* , int > DefUseAnalysis::convtype
private

Definition at line 80 of file DefUseAnalysis.h.

Constructor & Destructor Documentation

DefUseAnalysis::DefUseAnalysis ( SgProject proj)
inline

Definition at line 109 of file DefUseAnalysis.h.

virtual DefUseAnalysis::~DefUseAnalysis ( )
inlinevirtual

Definition at line 118 of file DefUseAnalysis.h.

Member Function Documentation

void DefUseAnalysis::find_all_global_variables ( )
private
bool DefUseAnalysis::start_traversal_of_functions ( )
private
bool DefUseAnalysis::searchMap ( const tabletype ltable,
SgNode node 
)
private
bool DefUseAnalysis::searchVizzMap ( SgNode node)
private
std::string DefUseAnalysis::getInitName ( SgNode sgNode)
private
void DefUseAnalysis::addAnyElement ( tabletype tabl,
SgNode sgNode,
SgInitializedName initName,
SgNode defNode 
)
private
void DefUseAnalysis::mapAnyUnion ( tabletype tabl,
SgNode before,
SgNode other,
SgNode current 
)
private
void DefUseAnalysis::printAnyMap ( tabletype tabl)
private
std::map< SgNode* , multitype > DefUseAnalysis::getDefMap ( )
inlinevirtual

Implements DFAnalysis.

Definition at line 120 of file DefUseAnalysis.h.

std::map< SgNode* , multitype > DefUseAnalysis::getUseMap ( )
inlinevirtual

Implements DFAnalysis.

Definition at line 121 of file DefUseAnalysis.h.

void DefUseAnalysis::setMaps ( std::map< SgNode *, multitype def,
std::map< SgNode *, multitype use 
)
inlinevirtual

Implements DFAnalysis.

Definition at line 122 of file DefUseAnalysis.h.

int DefUseAnalysis::run ( )
virtual

Run the DFA analysis without debugging.

Implements DFAnalysis.

int DefUseAnalysis::run ( bool  debug)
virtual

Implements DFAnalysis.

multitype DefUseAnalysis::getDefMultiMapFor ( SgNode node)
virtual

get the Definition multimap of a specific SgNode.

Implements DFAnalysis.

multitype DefUseAnalysis::getUseMultiMapFor ( SgNode node)
virtual

get the Usage multimap of a specific SgNode.

Implements DFAnalysis.

std::vector< SgNode* > DefUseAnalysis::getAnyFor ( const multitype mul,
SgInitializedName initName 
)
std::vector< SgNode* > DefUseAnalysis::getDefFor ( SgNode node,
SgInitializedName initName 
)
virtual

get the vector of defining nodes for a specific node and a initializedName.

Implements DFAnalysis.

std::vector< SgNode* > DefUseAnalysis::getUseFor ( SgNode node,
SgInitializedName initName 
)
virtual

get the vector of usage nodes for a specific node and a initializedName.

Implements DFAnalysis.

bool DefUseAnalysis::isNodeGlobalVariable ( SgInitializedName node)
virtual

return whether a node is a global node

Implements DFAnalysis.

std::vector<SgInitializedName*> DefUseAnalysis::getGlobalVariables ( )
int DefUseAnalysis::start_traversal_of_one_function ( SgFunctionDefinition proc)
bool DefUseAnalysis::searchMap ( SgNode node)
int DefUseAnalysis::getDefSize ( )
virtual

Implements DFAnalysis.

int DefUseAnalysis::getUseSize ( )
virtual

Implements DFAnalysis.

void DefUseAnalysis::printMultiMap ( const multitype type)
void DefUseAnalysis::printDefMap ( )
virtual

Implements DFAnalysis.

void DefUseAnalysis::printUseMap ( )
virtual

Implements DFAnalysis.

bool DefUseAnalysis::addID ( SgNode sgNode)
void DefUseAnalysis::addDefElement ( SgNode sgNode,
SgInitializedName initName,
SgNode defNode 
)
void DefUseAnalysis::addUseElement ( SgNode sgNode,
SgInitializedName initName,
SgNode defNode 
)
void DefUseAnalysis::replaceElement ( SgNode sgNode,
SgInitializedName initName 
)
void DefUseAnalysis::mapDefUnion ( SgNode before,
SgNode other,
SgNode current 
)
void DefUseAnalysis::mapUseUnion ( SgNode before,
SgNode other,
SgNode current 
)
void DefUseAnalysis::clearUseOfElement ( SgNode sgNode,
SgInitializedName initName 
)
int DefUseAnalysis::getIntForSgNode ( SgNode node)
virtual

Implements DFAnalysis.

void DefUseAnalysis::dfaToDOT ( )
virtual

Implements DFAnalysis.

void DefUseAnalysis::flush ( )
inline

Definition at line 163 of file DefUseAnalysis.h.

void DefUseAnalysis::flushHelp ( )
inline

Definition at line 172 of file DefUseAnalysis.h.

void DefUseAnalysis::disableVisualization ( )
inline

Definition at line 177 of file DefUseAnalysis.h.

void DefUseAnalysis::flushDefuse ( )
inline

Definition at line 181 of file DefUseAnalysis.h.

Member Data Documentation

SgProject* DefUseAnalysis::project
private

Definition at line 61 of file DefUseAnalysis.h.

bool DefUseAnalysis::DEBUG_MODE
private

Definition at line 62 of file DefUseAnalysis.h.

bool DefUseAnalysis::DEBUG_MODE_EXTRA
private

Definition at line 63 of file DefUseAnalysis.h.

std::vector<SgInitializedName*> DefUseAnalysis::globalVarList
private

Definition at line 64 of file DefUseAnalysis.h.

bool DefUseAnalysis::visualizationEnabled
private

Definition at line 66 of file DefUseAnalysis.h.

tabletype DefUseAnalysis::table
private

Definition at line 91 of file DefUseAnalysis.h.

tabletype DefUseAnalysis::usetable
private

Definition at line 92 of file DefUseAnalysis.h.

convtype DefUseAnalysis::vizzhelp
private

Definition at line 96 of file DefUseAnalysis.h.

int DefUseAnalysis::sgNodeCounter
staticprivate

Definition at line 97 of file DefUseAnalysis.h.

int DefUseAnalysis::nrOfNodesVisited
private

Definition at line 98 of file DefUseAnalysis.h.

std::vector<FilteredCFGNode < IsDFAFilter > > DefUseAnalysis::dfaFunctions
private

Definition at line 101 of file DefUseAnalysis.h.


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