Classes | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | Friends

OA::Alias::SymAliasSets Class Reference

#include <SymAliasSets.hpp>

Inheritance diagram for OA::Alias::SymAliasSets:
Inheritance graph
[legend]
Collaboration diagram for OA::Alias::SymAliasSets:
Collaboration graph
[legend]

List of all members.

Classes

class  SymSet
class  SymSetIterator

Public Member Functions

 SymAliasSets ()
 SymAliasSets (const SymAliasSets &other)
 copy constructor
 ~SymAliasSets ()
OA_ptr< SymHandleIteratorgetSymIterator (SymHandle sym)
bool operator== (DataFlow::DataFlowSet &other) const
bool operator!= (DataFlow::DataFlowSet &other) const
OA_ptr< DataFlow::DataFlowSetclone ()
void dump (std::ostream &os, OA_ptr< IRHandlesIRInterface >)
void dump (std::ostream &os)
OA_ptr< SymAliasSetsmeet (SymAliasSets &other)
void mergeSyms (SymHandle sym1, SymHandle sym2)

Static Public Attributes

static const int SET_ID_NONE = -1

Private Member Functions

void insertSet (OA_ptr< SymSet > pSet)
void replaceSet (int oldSetId, OA_ptr< SymSet > pSet)
 replace the set with the given set id with the given set
int getAliasSetId (SymHandle sym)
 Get unique set id for set that the given symbol maps to.

Private Attributes

std::map< int, OA_ptr< SymSet > > mIdToSymSetMap
std::map< SymHandle, int > mSymToIdMap
int mNextSetId

Friends

class SymSetIterator

Detailed Description

This class can be used to store information about the mapping of symbols to invisible symbols. It can be used as a DataFlowSet. If a symbol is not indicated as mapping to the same invisible as another symbol then the default mapping is that the symbol maps to itself.

This class also stores information about which calls contribute to the mapping.

Definition at line 42 of file SymAliasSets.hpp.


Constructor & Destructor Documentation

OA::Alias::SymAliasSets::SymAliasSets (  )  [inline]

Definition at line 48 of file SymAliasSets.hpp.

Referenced by clone().

OA::Alias::SymAliasSets::SymAliasSets ( const SymAliasSets other  ) 

copy constructor

Definition at line 29 of file SymAliasSets.cpp.

References OA::Alias::debug, mIdToSymSetMap, mNextSetId, mSymToIdMap, and OA_DEBUG_CTRL_MACRO.

OA::Alias::SymAliasSets::~SymAliasSets (  )  [inline]

Definition at line 50 of file SymAliasSets.hpp.


Member Function Documentation

OA_ptr< DataFlow::DataFlowSet > OA::Alias::SymAliasSets::clone (  )  [virtual]

Implements OA::DataFlow::DataFlowSet.

Definition at line 92 of file SymAliasSets.cpp.

References SymAliasSets().

Here is the call graph for this function:

void OA::Alias::SymAliasSets::dump ( std::ostream &  os,
OA_ptr< IRHandlesIRInterface ir 
) [virtual]

Implements OA::DataFlow::DataFlowSet.

Definition at line 99 of file SymAliasSets.cpp.

References OA::OA_ptr< T >::dump(), and mIdToSymSetMap.

Here is the call graph for this function:

void OA::Alias::SymAliasSets::dump ( std::ostream &  os  )  [virtual]

Implements OA::DataFlow::DataFlowSet.

Definition at line 111 of file SymAliasSets.cpp.

References OA::OA_ptr< T >::dump(), mIdToSymSetMap, and mSymToIdMap.

Here is the call graph for this function:

int OA::Alias::SymAliasSets::getAliasSetId ( SymHandle  sym  )  [private]

Get unique set id for set that the given symbol maps to.

Definition at line 39 of file SymAliasSets.cpp.

References mSymToIdMap, and SET_ID_NONE.

Referenced by mergeSyms().

OA_ptr< SymHandleIterator > OA::Alias::SymAliasSets::getSymIterator ( SymHandle  sym  ) 

Returns iterator over all formal ref params and globals that are in the same set as the given SymHandle

Definition at line 51 of file SymAliasSets.cpp.

References mIdToSymSetMap, mSymToIdMap, and SymSetIterator.

void OA::Alias::SymAliasSets::insertSet ( OA_ptr< SymSet pSet  )  [private]

insert set into datastructure and map all symbols it contains to the set

insert set into datastructure and map all symbols it contains to the set, only used in this code so assuming that pSet doesn't overlap with any existing sets

Definition at line 203 of file SymAliasSets.cpp.

References mIdToSymSetMap, mNextSetId, mSymToIdMap, and SymSetIterator.

Referenced by mergeSyms().

OA_ptr< SymAliasSets > OA::Alias::SymAliasSets::meet ( SymAliasSets other  ) 

If two symbols map to the same invisible symbol in even one of the SymAliasSets then they map to the same symbol in the result Does a union of calls that contribute to the two maps.

If there are any SymSets that overlap between the two SymAliasSets then merge those SymSets in the new SymAliasSets data structure.

Definition at line 139 of file SymAliasSets.cpp.

References OA::Alias::debug, OA::DataFlow::IRHandleDataFlowSet< T >::empty(), mIdToSymSetMap, and OA::DataFlow::IRHandleDataFlowSet< T >::setIntersect().

Here is the call graph for this function:

void OA::Alias::SymAliasSets::mergeSyms ( SymHandle  sym1,
SymHandle  sym2 
)

indicate the two formal params and/or globals may alias each other and therefore should map to same set

indicate the two formal params and/or globals may alias each other at a particular call therefore should be in same map

Definition at line 235 of file SymAliasSets.cpp.

References getAliasSetId(), insertSet(), mIdToSymSetMap, mSymToIdMap, SET_ID_NONE, and SymSetIterator.

Here is the call graph for this function:

bool OA::Alias::SymAliasSets::operator!= ( DataFlow::DataFlowSet other  )  const [virtual]

Implements OA::DataFlow::DataFlowSet.

Definition at line 87 of file SymAliasSets.cpp.

bool OA::Alias::SymAliasSets::operator== ( DataFlow::DataFlowSet other  )  const [virtual]

Implements OA::DataFlow::DataFlowSet.

Definition at line 75 of file SymAliasSets.cpp.

References mSymToIdMap.

void OA::Alias::SymAliasSets::replaceSet ( int  oldSetId,
OA_ptr< SymSet pSet 
) [private]

replace the set with the given set id with the given set

Definition at line 219 of file SymAliasSets.cpp.

References mIdToSymSetMap, mSymToIdMap, and SymSetIterator.


Friends And Related Function Documentation

friend class SymSetIterator [friend]

Definition at line 44 of file SymAliasSets.hpp.

Referenced by getSymIterator(), insertSet(), mergeSyms(), and replaceSet().


Member Data Documentation

Definition at line 93 of file SymAliasSets.hpp.

Referenced by dump(), getSymIterator(), insertSet(), meet(), mergeSyms(), replaceSet(), and SymAliasSets().

Definition at line 96 of file SymAliasSets.hpp.

Referenced by insertSet(), and SymAliasSets().

const int OA::Alias::SymAliasSets::SET_ID_NONE = -1 [static]

Definition at line 52 of file SymAliasSets.hpp.

Referenced by getAliasSetId(), and mergeSyms().


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