OA::NamedLoc Class Reference

#include <NamedLoc.hpp>

Inheritance diagram for OA::NamedLoc:
Inheritance graph
[legend]
Collaboration diagram for OA::NamedLoc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 NamedLoc (SymHandle sh, bool isLocal)
 NamedLoc (NamedLoc &other)
 copy constructor
 ~NamedLoc ()
void addFullOverlap (SymHandle s)
void addPartOverlap (SymHandle s)
void acceptVisitor (LocationVisitor &pVisitor)
bool isaNamed ()
OA_ptr< LocationgetBaseLoc ()
 A NamedLoc returns itself as a base location.
bool isLocal ()
bool isUnique ()
SymHandle getSymHandle ()
bool staticFullOverlap (SymHandle)
bool staticPartOverlap (SymHandle)
OA_ptr< SymHandleIteratorgetPartOverlapIter ()
OA_ptr< SymHandleIteratorgetFullOverlapIter ()
bool operator< (Location &other)
bool operator== (Location &other)
 only semantically equivalent to another NamedLoc
bool mayOverlap (Location &other)
bool mustOverlap (Location &other)
bool subSetOf (Location &other)
void output (IRHandlesIRInterface &ir)
void dump (std::ostream &os)
void dump (std::ostream &os, OA_ptr< IRHandlesIRInterface > pIR)
std::string toString (OA_ptr< IRHandlesIRInterface > pIR)
virtual int getOrder ()

Private Attributes

SymHandle mSymHandle
bool mLocal
std::set< SymHandlemFullOverlap
std::set< SymHandlemPartOverlap

Static Private Attributes

static const int sOrder = 100

Detailed Description

A named location has a SymHandle associated with it. Examples include local and global variables.

Definition at line 25 of file NamedLoc.hpp.


Constructor & Destructor Documentation

OA::NamedLoc::NamedLoc ( SymHandle  sh,
bool  isLocal 
) [inline]

Definition at line 27 of file NamedLoc.hpp.

Referenced by getBaseLoc().

OA::NamedLoc::NamedLoc ( NamedLoc other  ) 

copy constructor

Definition at line 22 of file NamedLoc.cpp.

References OA::debug, mFullOverlap, mPartOverlap, and OA_DEBUG_CTRL_MACRO.

OA::NamedLoc::~NamedLoc (  )  [inline]

Definition at line 33 of file NamedLoc.hpp.


Member Function Documentation

void OA::NamedLoc::acceptVisitor ( LocationVisitor pVisitor  )  [virtual]

Implements OA::Location.

Definition at line 35 of file NamedLoc.cpp.

References OA::LocationVisitor::visitNamedLoc().

Here is the call graph for this function:

void OA::NamedLoc::addFullOverlap ( SymHandle  s  )  [inline]

Definition at line 35 of file NamedLoc.hpp.

References mFullOverlap.

void OA::NamedLoc::addPartOverlap ( SymHandle  s  )  [inline]

Definition at line 36 of file NamedLoc.hpp.

References mPartOverlap.

void OA::NamedLoc::dump ( std::ostream &  os,
OA_ptr< IRHandlesIRInterface pIR 
)

Definition at line 280 of file NamedLoc.cpp.

References OA::IRHandle::hval(), mLocal, and mSymHandle.

Here is the call graph for this function:

void OA::NamedLoc::dump ( std::ostream &  os  ) 

Definition at line 273 of file NamedLoc.cpp.

References OA::IRHandle::hval(), mLocal, and mSymHandle.

Referenced by operator<(), operator==(), and OA::DataFlow::CalleeToCallerVisitor::visitNamedLoc().

Here is the call graph for this function:

OA_ptr< Location > OA::NamedLoc::getBaseLoc (  )  [virtual]

A NamedLoc returns itself as a base location.

Implements OA::Location.

Definition at line 40 of file NamedLoc.cpp.

References NamedLoc().

Here is the call graph for this function:

OA_ptr< SymHandleIterator > OA::NamedLoc::getFullOverlapIter (  ) 

Definition at line 56 of file NamedLoc.cpp.

References mFullOverlap.

virtual int OA::NamedLoc::getOrder (  )  [inline, virtual]

Reimplemented from OA::Location.

Definition at line 84 of file NamedLoc.hpp.

References sOrder.

Referenced by operator<(), and operator==().

OA_ptr< SymHandleIterator > OA::NamedLoc::getPartOverlapIter (  ) 

Definition at line 47 of file NamedLoc.cpp.

References mPartOverlap.

SymHandle OA::NamedLoc::getSymHandle (  )  [inline]
bool OA::NamedLoc::isaNamed (  )  [inline, virtual]

Reimplemented from OA::Location.

Definition at line 43 of file NamedLoc.hpp.

bool OA::NamedLoc::isLocal (  )  [inline, virtual]

true if the location block represents a local variable that is only visible within the current procedure or an unnamed variable that is allocated in the current procedure. If the current procedure is nested and has access to local variables of a parent procedure, those variables are not considered local for the current procedure.

Reimplemented from OA::Location.

Definition at line 51 of file NamedLoc.hpp.

References mLocal.

Referenced by operator==(), and OA::DataFlow::CalleeToCallerVisitor::visitNamedLoc().

bool OA::NamedLoc::isUnique (  )  [inline, virtual]

be because there could be multiple allocations at the same statement and they maybe lumped together depending on how much context is maintained. A LocBlock for an unnamed allocated memory block could be Unique if there is a different LocBlock for each possible context of the alloc. A local variable is always unique, allocated memory blocks may

Reimplemented from OA::Location.

Definition at line 52 of file NamedLoc.hpp.

bool OA::NamedLoc::mayOverlap ( Location other  ) 

Definition at line 177 of file NamedLoc.cpp.

References OA::Location::acceptVisitor(), and OA::NamedLocMayOverlapVisitor::mMayOverlap.

Here is the call graph for this function:

bool OA::NamedLoc::mustOverlap ( Location other  ) 

Definition at line 220 of file NamedLoc.cpp.

References OA::Location::acceptVisitor(), and OA::NamedLocMustOverlapVisitor::mMustOverlap.

Referenced by subSetOf().

Here is the call graph for this function:

bool OA::NamedLoc::operator< ( Location other  ) 

Locations are ordered first between Location subclasses based on their sOrder value. Then there is an ordering within each subclass.

For NamedLoc the ordering is based on the SymHandle.

Note: this could cause a problem if consider two NamedLoc's equiv if they must overlap.

Definition at line 75 of file NamedLoc.cpp.

References OA::debug, OA::Location::dump(), dump(), OA::Location::getOrder(), getOrder(), and getSymHandle().

Here is the call graph for this function:

bool OA::NamedLoc::operator== ( Location other  ) 

only semantically equivalent to another NamedLoc

Definition at line 96 of file NamedLoc.cpp.

References OA::debug, OA::Location::dump(), dump(), OA::Location::getOrder(), getOrder(), getSymHandle(), and isLocal().

Here is the call graph for this function:

void OA::NamedLoc::output ( IRHandlesIRInterface ir  )  [virtual]

Implements OA::Annotation.

Definition at line 239 of file NamedLoc.cpp.

References OA::bool2string(), mFullOverlap, mLocal, mPartOverlap, mSymHandle, and OA::Annotation::sOutBuild.

Here is the call graph for this function:

bool OA::NamedLoc::staticFullOverlap ( SymHandle  sym  ) 
bool OA::NamedLoc::staticPartOverlap ( SymHandle  sym  ) 

Definition at line 126 of file NamedLoc.cpp.

References mPartOverlap.

Referenced by OA::NamedLocMayOverlapVisitor::visitNamedLoc().

bool OA::NamedLoc::subSetOf ( Location other  ) 

conservatively answers this question, if we may overlap with the other location but don't must overlap then we may or may not be a subset so we just return false FIXME: some analyses may want to use this conservatively the other way, in other words, checking if it is not a subset?

Definition at line 234 of file NamedLoc.cpp.

References mustOverlap().

Here is the call graph for this function:

std::string OA::NamedLoc::toString ( OA_ptr< IRHandlesIRInterface pIR  )  [virtual]

Implements OA::Location.

Definition at line 289 of file NamedLoc.cpp.

References OA::IRHandle::hval(), and mSymHandle.

Here is the call graph for this function:


Member Data Documentation

Definition at line 92 of file NamedLoc.hpp.

Referenced by addFullOverlap(), getFullOverlapIter(), NamedLoc(), output(), and staticFullOverlap().

bool OA::NamedLoc::mLocal [private]

Definition at line 89 of file NamedLoc.hpp.

Referenced by dump(), isLocal(), and output().

Definition at line 93 of file NamedLoc.hpp.

Referenced by addPartOverlap(), getPartOverlapIter(), NamedLoc(), output(), and staticPartOverlap().

Definition at line 87 of file NamedLoc.hpp.

Referenced by dump(), getSymHandle(), output(), and toString().

const int OA::NamedLoc::sOrder = 100 [static, private]

Reimplemented from OA::Location.

Definition at line 95 of file NamedLoc.hpp.

Referenced by getOrder().


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

Generated on Sat Oct 31 05:26:33 2009 for OpenAnalysis by  doxygen 1.6.1