CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::ExportVerilog::NameCollisionResolver Struct Reference

#include <ExportVerilogInternals.h>

Collaboration diagram for circt::ExportVerilog::NameCollisionResolver:

Public Member Functions

 NameCollisionResolver (const LoweringOptions &options)
StringRef getLegalName (StringRef originalName)
 Given a name that may have collisions or invalid symbols, return a replacement name to use, or the original name if it was ok.
StringRef getLegalName (StringAttr originalName)
void insertUsedName (StringRef name)
 Insert a string as an already-used name.

Public Attributes

const LoweringOptions & options
 Handle to LoweringOptions.

Private Member Functions

 NameCollisionResolver (const NameCollisionResolver &)=delete
void operator= (const NameCollisionResolver &)=delete

Private Attributes

llvm::StringMap< size_t > nextGeneratedNameIDs
 A map from used names to numeric suffix used as uniquification agent when resolving conflicts.

Detailed Description

Definition at line 100 of file ExportVerilogInternals.h.

Constructor & Destructor Documentation

◆ NameCollisionResolver() [1/2]

circt::ExportVerilog::NameCollisionResolver::NameCollisionResolver ( const LoweringOptions & options)
inline

Definition at line 101 of file ExportVerilogInternals.h.

References options.

Referenced by NameCollisionResolver(), and operator=().

◆ NameCollisionResolver() [2/2]

circt::ExportVerilog::NameCollisionResolver::NameCollisionResolver ( const NameCollisionResolver & )
privatedelete

Member Function Documentation

◆ getLegalName() [1/2]

StringRef circt::ExportVerilog::NameCollisionResolver::getLegalName ( StringAttr originalName)
inline

Definition at line 106 of file ExportVerilogInternals.h.

References getLegalName().

◆ getLegalName() [2/2]

StringRef NameCollisionResolver::getLegalName ( StringRef originalName)

Given a name that may have collisions or invalid symbols, return a replacement name to use, or the original name if it was ok.

Given a name that may have collisions or invalid symbols, return a replacement name to use, or null if the original name was ok.

Definition at line 55 of file LegalizeNames.cpp.

References legalizeName(), nextGeneratedNameIDs, and options.

Referenced by getLegalName(), circt::ExportVerilog::GlobalNameResolver::legalizeInterfaceNames(), legalizeModuleLocalNames(), circt::ExportVerilog::GlobalNameResolver::legalizeModuleNames(), and circt::ExportVerilog::GlobalNameResolver::legalizePackageNames().

◆ insertUsedName()

void circt::ExportVerilog::NameCollisionResolver::insertUsedName ( StringRef name)
inline

Insert a string as an already-used name.

Definition at line 111 of file ExportVerilogInternals.h.

References nextGeneratedNameIDs.

Referenced by circt::ExportVerilog::GlobalNameTable::addReservedNames(), and legalizeModuleLocalNames().

◆ operator=()

void circt::ExportVerilog::NameCollisionResolver::operator= ( const NameCollisionResolver & )
privatedelete

Member Data Documentation

◆ nextGeneratedNameIDs

llvm::StringMap<size_t> circt::ExportVerilog::NameCollisionResolver::nextGeneratedNameIDs
private

A map from used names to numeric suffix used as uniquification agent when resolving conflicts.

Definition at line 121 of file ExportVerilogInternals.h.

Referenced by getLegalName(), and insertUsedName().

◆ options

const LoweringOptions& circt::ExportVerilog::NameCollisionResolver::options

Handle to LoweringOptions.

Definition at line 116 of file ExportVerilogInternals.h.

Referenced by getLegalName(), and NameCollisionResolver().


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