CIRCT  20.0.0git
Classes | Public Types | Public Member Functions | List of all members
circt::SymbolCacheBase Class Referenceabstract

Base symbol cache class to allow for cache lookup through a pointer to some abstract cache. More...

#include <SymCache.h>

Inheritance diagram for circt::SymbolCacheBase:
Inheritance graph
[legend]

Classes

struct  CacheIteratorImpl
 
struct  Iterator
 

Public Types

using CacheItem = std::pair< mlir::Attribute, mlir::Operation * >
 Iterator support through a pointer to some abstract cache. More...
 

Public Member Functions

virtual ~SymbolCacheBase ()
 Virtual method anchor. More...
 
virtual void addDefinition (mlir::Attribute symbol, mlir::Operation *op)=0
 Defines 'op' as associated with the 'symbol' in the cache. More...
 
void addSymbol (mlir::SymbolOpInterface op)
 Adds the symbol-defining 'op' to the cache. More...
 
void addDefinitions (mlir::Operation *top)
 Populate the symbol cache with all symbol-defining operations within the 'top' operation. More...
 
virtual mlir::Operation * getDefinition (mlir::Attribute symbol) const =0
 Lookup a definition for 'symbol' in the cache. More...
 
mlir::Operation * getDefinition (mlir::FlatSymbolRefAttr symbol) const
 Lookup a definition for 'symbol' in the cache. More...
 
virtual Iterator begin ()=0
 
virtual Iterator end ()=0
 

Detailed Description

Base symbol cache class to allow for cache lookup through a pointer to some abstract cache.

A symbol cache stores lookup tables to make manipulating and working with the IR more efficient.

Definition at line 25 of file SymCache.h.

Member Typedef Documentation

◆ CacheItem

using circt::SymbolCacheBase::CacheItem = std::pair<mlir::Attribute, mlir::Operation *>

Iterator support through a pointer to some abstract cache.

The implementing cache must provide an iterator that carries values on the form of <mlir::Attribute, mlir::Operation*>.

Definition at line 52 of file SymCache.h.

Constructor & Destructor Documentation

◆ ~SymbolCacheBase()

circt::SymbolCacheBase::~SymbolCacheBase ( )
virtual

Virtual method anchor.

Definition at line 21 of file SymCache.cpp.

Member Function Documentation

◆ addDefinition()

virtual void circt::SymbolCacheBase::addDefinition ( mlir::Attribute  symbol,
mlir::Operation *  op 
)
pure virtual

Defines 'op' as associated with the 'symbol' in the cache.

Implemented in circt::SymbolCache, and circt::hw::HWSymbolCache.

Referenced by addSymbol().

◆ addDefinitions()

void circt::SymbolCacheBase::addDefinitions ( mlir::Operation *  top)

Populate the symbol cache with all symbol-defining operations within the 'top' operation.

Definition at line 23 of file SymCache.cpp.

Referenced by circt::SMTGlobalsHandler::create(), circt::FirMemLowering::FirMemLowering(), and circt::SMTGlobalsHandler::SMTGlobalsHandler().

◆ addSymbol()

void circt::SymbolCacheBase::addSymbol ( mlir::SymbolOpInterface  op)
inline

Adds the symbol-defining 'op' to the cache.

Definition at line 33 of file SymCache.h.

References addDefinition().

Referenced by circt::ExportVerilog::lowerHWInstanceChoices().

◆ begin()

virtual Iterator circt::SymbolCacheBase::begin ( )
pure virtual

◆ end()

virtual Iterator circt::SymbolCacheBase::end ( )
pure virtual

◆ getDefinition() [1/2]

virtual mlir::Operation* circt::SymbolCacheBase::getDefinition ( mlir::Attribute  symbol) const
pure virtual

Lookup a definition for 'symbol' in the cache.

Implemented in circt::SymbolCache, and circt::hw::HWSymbolCache.

Referenced by getDefinition().

◆ getDefinition() [2/2]

mlir::Operation* circt::SymbolCacheBase::getDefinition ( mlir::FlatSymbolRefAttr  symbol) const
inline

Lookup a definition for 'symbol' in the cache.

Definition at line 45 of file SymCache.h.

References getDefinition().


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