CIRCT  19.0.0git
Public Member Functions | Private Attributes | List of all members
circt::firrtl::OwningModuleCache Struct Reference

This implements an analysis to determine which module owns a given path operation. More...

#include <OwningModuleCache.h>

Collaboration diagram for circt::firrtl::OwningModuleCache:
Collaboration graph
[legend]

Public Member Functions

 OwningModuleCache (InstanceGraph &instanceGraph)
 
FModuleOp lookup (ClassOp classOp)
 Return this operation's owning module. More...
 
FModuleOp lookup (Operation *op)
 Return this operation's owning module. More...
 

Private Attributes

DenseMap< Operation *, FModuleOp > cache
 
InstanceGraphinstanceGraph
 

Detailed Description

This implements an analysis to determine which module owns a given path operation.

The owning module of a path is a module which contains the path op, or instantiates it through children classes. A path operation is generally only allowed to have a single owning module, and must target an entity underneath that module's hierarchy.

Definition at line 23 of file OwningModuleCache.h.

Constructor & Destructor Documentation

◆ OwningModuleCache()

circt::firrtl::OwningModuleCache::OwningModuleCache ( InstanceGraph instanceGraph)
inline

Definition at line 25 of file OwningModuleCache.h.

Member Function Documentation

◆ lookup() [1/2]

FModuleOp circt::firrtl::OwningModuleCache::lookup ( ClassOp  classOp)
inline

Return this operation's owning module.

If there is none or more than one, this returns null.

Definition at line 30 of file OwningModuleCache.h.

References assert(), cache, circt::igraph::InstanceGraphNode::getModule(), instanceGraph, circt::igraph::InstanceGraph::lookup(), circt::igraph::InstanceGraphNode::usesBegin(), and circt::igraph::InstanceGraphNode::usesEnd().

Referenced by lookup().

◆ lookup() [2/2]

FModuleOp circt::firrtl::OwningModuleCache::lookup ( Operation *  op)
inline

Return this operation's owning module.

If there is none or more than one, this returns null.

Definition at line 120 of file OwningModuleCache.h.

References lookup().

Member Data Documentation

◆ cache

DenseMap<Operation *, FModuleOp> circt::firrtl::OwningModuleCache::cache
private

Definition at line 132 of file OwningModuleCache.h.

Referenced by lookup().

◆ instanceGraph

InstanceGraph& circt::firrtl::OwningModuleCache::instanceGraph
private

Definition at line 133 of file OwningModuleCache.h.

Referenced by lookup().


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