CIRCT
19.0.0git
|
A namespace that is used to store existing names and generate new names in some scope within the IR. More...
#include <Namespace.h>
Public Member Functions | |
Namespace () | |
Namespace (const Namespace &other)=default | |
Namespace (Namespace &&other) | |
Namespace & | operator= (const Namespace &other)=default |
Namespace & | operator= (Namespace &&other) |
void | add (SymbolCache &symCache) |
SymbolCache initializer; initialize from every key that is convertible to a StringAttr in the SymbolCache. More... | |
void | clear () |
Empty the namespace. More... | |
StringRef | newName (const Twine &name) |
Return a unique name, derived from the input name , and add the new name to the internal namespace. More... | |
StringRef | newName (const Twine &name, const Twine &suffix) |
Return a unique name, derived from the input name and ensure the returned name has the input suffix . More... | |
Protected Attributes | |
llvm::StringMap< size_t > | nextIndex |
A namespace that is used to store existing names and generate new names in some scope within the IR.
This exists to work around limitations of SymbolTables. This acts as a base class providing facilities common to all namespaces implementations.
Definition at line 29 of file Namespace.h.
|
inline |
Definition at line 31 of file Namespace.h.
References nextIndex.
|
default |
|
inline |
Definition at line 37 of file Namespace.h.
|
inline |
SymbolCache initializer; initialize from every key that is convertible to a StringAttr in the SymbolCache.
Definition at line 47 of file Namespace.h.
References nextIndex.
Referenced by circt::FirMemLowering::FirMemLowering(), and circt::ExportVerilog::lowerHWInstanceChoices().
|
inline |
|
inline |
Return a unique name, derived from the input name
, and add the new name to the internal namespace.
There are two possible outcomes for the returned name:
_<n>
suffix where <n>
is a number starting from 0
and incrementing by one each time (_0
, ...). Definition at line 63 of file Namespace.h.
References nextIndex.
Referenced by circt::firrtl::applyGCTMemTaps(), circt::FirMemLowering::createMemoryModule(), createModuleForCut(), circt::ExportVerilog::lowerHWInstanceChoices(), ModuleNameSanitizer::rewrite(), and LowerLayersPass::runOnOperation().
|
inline |
Return a unique name, derived from the input name
and ensure the returned name has the input suffix
.
Also add the new name to the internal namespace. There are two possible outcomes for the returned name:
_<suffix>
is returned._<n>_<suffix>
where <n>
is a number starting from 0
and incrementing by one each time. Definition at line 96 of file Namespace.h.
Definition at line 40 of file Namespace.h.
References nextIndex.
|
protected |
Definition at line 135 of file Namespace.h.
Referenced by circt::firrtl::CircuitNamespace::add(), circt::hw::InnerSymbolNamespace::add(), add(), clear(), Namespace(), newName(), and operator=().