OpenASIP  2.0
Public Member Functions | Private Attributes | List of all members
InterPassData Class Reference

#include <InterPassData.hh>

Collaboration diagram for InterPassData:
Collaboration graph

Public Member Functions

 InterPassData ()
 
virtual ~InterPassData ()
 
InterPassDatumdatum (const std::string &key)
 
bool hasDatum (const std::string &key) const
 
void setDatum (const std::string &key, InterPassDatum *datum)
 
void removeDatum (const std::string &key)
 

Private Attributes

std::map< std::string, InterPassDatum * > data_
 container for the data More...
 

Detailed Description

Class for storing inter-pass data of any type.

Provides a generic "key-value" interface and shortcut methods for accessing the most frequently used data.

Definition at line 48 of file InterPassData.hh.

Constructor & Destructor Documentation

◆ InterPassData()

InterPassData::InterPassData ( )

Constructor.

Definition at line 40 of file InterPassData.cc.

40  {
41 }

◆ ~InterPassData()

InterPassData::~InterPassData ( )
virtual

Destructor.

Deletes all added InterPassDatum objects.

Definition at line 48 of file InterPassData.cc.

48  {
50 }

References data_, and MapTools::deleteAllValues().

Here is the call graph for this function:

Member Function Documentation

◆ datum()

InterPassDatum & InterPassData::datum ( const std::string &  key)

Returns a reference to the datum associated with the given key.

It is allowed to modify the returned object directly.

Parameters
keyThe key.
Returns
The datum.
Exceptions
KeyNotFoundthrown if the key is not found.

Definition at line 62 of file InterPassData.cc.

62  {
63  if (!MapTools::containsKey(data_, key))
64  throw KeyNotFound(__FILE__, __LINE__, __func__);
65 
66  return *data_[key];
67 }

References __func__, MapTools::containsKey(), and data_.

Referenced by RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), DataDependenceGraphBuilder::DataDependenceGraphBuilder(), ProgramPass::executeProcedurePass(), BF2Scheduler::possibleTempRegRFs(), and setDatum().

Here is the call graph for this function:

◆ hasDatum()

bool InterPassData::hasDatum ( const std::string &  key) const

Returns true if there is a datum for the given key.

Returns
True if there is a datum for the given key.

Definition at line 75 of file InterPassData.cc.

75  {
76  return MapTools::containsKey(data_, key);
77 }

References MapTools::containsKey(), and data_.

Referenced by RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), DataDependenceGraphBuilder::DataDependenceGraphBuilder(), ProgramPass::executeProcedurePass(), and BBSchedulerController::handleBasicBlock().

Here is the call graph for this function:

◆ removeDatum()

void InterPassData::removeDatum ( const std::string &  key)

Definition at line 97 of file InterPassData.cc.

97  {
98  if (MapTools::containsKey(data_, key)) {
99  delete data_[key];
100  data_.erase(key);
101  }
102 }

References MapTools::containsKey(), and data_.

Here is the call graph for this function:

◆ setDatum()

void InterPassData::setDatum ( const std::string &  key,
InterPassDatum datum 
)

Sets a datum for the given key.

Ownership of the datum is transferred. Possible previously existing datum at the given key is deleted.

Parameters
keyThe key of the datum.
datumThe datum object.

Definition at line 89 of file InterPassData.cc.

89  {
90 
91  if (MapTools::containsKey(data_, key))
92  delete data_[key];
93  data_[key] = datum;
94 }

References MapTools::containsKey(), data_, and datum().

Referenced by LLVMBackend::compile(), and RegisterCopyAdder::findTempRegisters().

Here is the call graph for this function:

Member Data Documentation

◆ data_

std::map<std::string, InterPassDatum*> InterPassData::data_
private

container for the data

Definition at line 59 of file InterPassData.hh.

Referenced by datum(), hasDatum(), removeDatum(), setDatum(), and ~InterPassData().


The documentation for this class was generated from the following files:
MapTools::deleteAllValues
static void deleteAllValues(MapType &aMap)
__func__
#define __func__
Definition: Application.hh:67
MapTools::containsKey
static bool containsKey(const MapType &aMap, const KeyType &aKey)
KeyNotFound
Definition: Exception.hh:285
InterPassData::data_
std::map< std::string, InterPassDatum * > data_
container for the data
Definition: InterPassData.hh:59
InterPassData::datum
InterPassDatum & datum(const std::string &key)
Definition: InterPassData.cc:62