CIRCT  19.0.0git
Typedefs | Functions
PrefixModules.cpp File Reference
#include "PassDetails.h"
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLInstanceGraph.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/NLATable.h"
#include "circt/Dialect/FIRRTL/Passes.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Support/LLVM.h"
#include "mlir/IR/AttrTypeSubElements.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/StringMap.h"
Include dependency graph for PrefixModules.cpp:

Go to the source code of this file.

Typedefs

using PrefixMap = llvm::DenseMap< StringRef, std::vector< std::string > >
 This maps a FModuleOp to a list of all prefixes that need to be applied. More...
 

Functions

static void recordPrefix (PrefixMap &prefixMap, StringRef moduleName, std::string prefix)
 Insert a string into the end of vector if the string is not already present. More...
 
static PrefixInfo getPrefixInfo (Operation *module)
 Get the PrefixInfo for a module from a NestedPrefixModulesAnnotation on a module. More...
 
static StringRef getPrefix (Operation *module)
 If there is an inclusive prefix attached to the module, return it. More...
 

Typedef Documentation

◆ PrefixMap

using PrefixMap = llvm::DenseMap<StringRef, std::vector<std::string> >

This maps a FModuleOp to a list of all prefixes that need to be applied.

When a module has multiple prefixes, it will be cloned for each one. Usually there is only a single prefix applied to each module, although there could be many.

Definition at line 34 of file PrefixModules.cpp.

Function Documentation

◆ getPrefix()

static StringRef getPrefix ( Operation *  module)
static

If there is an inclusive prefix attached to the module, return it.

Definition at line 81 of file PrefixModules.cpp.

References getPrefixInfo().

◆ getPrefixInfo()

static PrefixInfo getPrefixInfo ( Operation *  module)
static

Get the PrefixInfo for a module from a NestedPrefixModulesAnnotation on a module.

If the module is not annotated, the prefix returned will be empty.

Definition at line 59 of file PrefixModules.cpp.

References circt::firrtl::AnnotationSet::getAnnotation(), and circt::firrtl::prefixModulesAnnoClass.

Referenced by getPrefix().

◆ recordPrefix()

static void recordPrefix ( PrefixMap prefixMap,
StringRef  moduleName,
std::string  prefix 
)
static

Insert a string into the end of vector if the string is not already present.

Definition at line 37 of file PrefixModules.cpp.