CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::firrtl::AnnoTargetCache Struct Reference

Cache AnnoTargets for a module's named things. More...

#include <FIRRTLAnnotationHelper.h>

Collaboration diagram for circt::firrtl::AnnoTargetCache:

Public Member Functions

 AnnoTargetCache ()=delete
 AnnoTargetCache (const AnnoTargetCache &other)=default
 AnnoTargetCache (AnnoTargetCache &&other)
 AnnoTargetCache (FModuleLike mod)
AnnoTarget getTargetForName (StringRef name) const
 Lookup the target for 'name', empty if not found.
void insertOp (Operation *op)
void replaceOp (Operation *oldOp, Operation *newOp)
 Replace oldOp with newOp in the target cache.
void insertPort (FModuleLike mod, size_t portNo)
 Add a new module port to the target cache.

Private Member Functions

void gatherTargets (FModuleLike mod)
 Walk the module and add named things to 'targets'.

Private Attributes

llvm::DenseMap< StringRef, AnnoTarget > targets

Detailed Description

Cache AnnoTargets for a module's named things.

Definition at line 147 of file FIRRTLAnnotationHelper.h.

Constructor & Destructor Documentation

◆ AnnoTargetCache() [1/4]

circt::firrtl::AnnoTargetCache::AnnoTargetCache ( )
delete

Referenced by AnnoTargetCache(), and AnnoTargetCache().

◆ AnnoTargetCache() [2/4]

circt::firrtl::AnnoTargetCache::AnnoTargetCache ( const AnnoTargetCache & other)
default

References AnnoTargetCache().

◆ AnnoTargetCache() [3/4]

circt::firrtl::AnnoTargetCache::AnnoTargetCache ( AnnoTargetCache && other)
inline

Definition at line 150 of file FIRRTLAnnotationHelper.h.

References AnnoTargetCache(), and targets.

◆ AnnoTargetCache() [4/4]

circt::firrtl::AnnoTargetCache::AnnoTargetCache ( FModuleLike mod)
inline

Definition at line 153 of file FIRRTLAnnotationHelper.h.

References gatherTargets().

Member Function Documentation

◆ gatherTargets()

void AnnoTargetCache::gatherTargets ( FModuleLike mod)
private

Walk the module and add named things to 'targets'.

Definition at line 352 of file FIRRTLAnnotationHelper.cpp.

References insertOp(), and insertPort().

Referenced by AnnoTargetCache().

◆ getTargetForName()

AnnoTarget circt::firrtl::AnnoTargetCache::getTargetForName ( StringRef name) const
inline

Lookup the target for 'name', empty if not found.

(check for validity using operator bool()).

Definition at line 157 of file FIRRTLAnnotationHelper.h.

References targets.

Referenced by circt::firrtl::CircuitTargetCache::lookup().

◆ insertOp()

void circt::firrtl::AnnoTargetCache::insertOp ( Operation * op)
inline

Definition at line 161 of file FIRRTLAnnotationHelper.h.

References targets.

Referenced by gatherTargets(), and replaceOp().

◆ insertPort()

void circt::firrtl::AnnoTargetCache::insertPort ( FModuleLike mod,
size_t portNo )
inline

Add a new module port to the target cache.

Definition at line 182 of file FIRRTLAnnotationHelper.h.

References targets.

Referenced by gatherTargets().

◆ replaceOp()

void circt::firrtl::AnnoTargetCache::replaceOp ( Operation * oldOp,
Operation * newOp )
inline

Replace oldOp with newOp in the target cache.

The new and old ops can have different names.

Definition at line 174 of file FIRRTLAnnotationHelper.h.

References insertOp(), and targets.

Member Data Documentation

◆ targets

llvm::DenseMap<StringRef, AnnoTarget> circt::firrtl::AnnoTargetCache::targets
private

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