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

#include <ExportVerilogInternals.h>

Collaboration diagram for circt::ExportVerilog::FieldNameResolver:

Public Member Functions

 FieldNameResolver (const GlobalNameTable &globalNames, const LoweringOptions &options)
StringAttr getRenamedFieldName (StringAttr fieldName)
std::string getEnumFieldName (hw::EnumFieldAttr attr, Operation *currentPackage=nullptr)
 Returns the field name for an enum field of a given enum field attr.

Private Member Functions

void setRenamedFieldName (StringAttr fieldName, StringAttr newFieldName)

Private Attributes

DenseMap< StringAttr, StringAttr > renamedFieldNames
 Those contain entries for field names and types respectively.
llvm::StringMap< size_t > nextGeneratedNameIDs
 A map from used names to numeric suffix used as uniquification agent when resolving conflicts.
const GlobalNameTable & globalNames
const LoweringOptions & options

Detailed Description

Definition at line 131 of file ExportVerilogInternals.h.

Constructor & Destructor Documentation

◆ FieldNameResolver()

circt::ExportVerilog::FieldNameResolver::FieldNameResolver ( const GlobalNameTable & globalNames,
const LoweringOptions & options )
inline

Definition at line 132 of file ExportVerilogInternals.h.

References globalNames, and options.

Member Function Documentation

◆ getEnumFieldName()

std::string FieldNameResolver::getEnumFieldName ( hw::EnumFieldAttr attr,
Operation * currentPackage = nullptr )

Returns the field name for an enum field of a given enum field attr.

In case a prefix can be inferred for the provided enum type (the enum type is a type alias), the prefix will be applied. If not, the raw field name is returned.

Definition at line 95 of file LegalizeNames.cpp.

References circt::ExportVerilog::getSymOpName(), and globalNames.

◆ getRenamedFieldName()

StringAttr FieldNameResolver::getRenamedFieldName ( StringAttr fieldName)

◆ setRenamedFieldName()

void FieldNameResolver::setRenamedFieldName ( StringAttr fieldName,
StringAttr newFieldName )
private

Definition at line 64 of file LegalizeNames.cpp.

References nextGeneratedNameIDs, and renamedFieldNames.

Referenced by getRenamedFieldName().

Member Data Documentation

◆ globalNames

const GlobalNameTable& circt::ExportVerilog::FieldNameResolver::globalNames
private

Definition at line 158 of file ExportVerilogInternals.h.

Referenced by FieldNameResolver(), and getEnumFieldName().

◆ nextGeneratedNameIDs

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

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

Definition at line 155 of file ExportVerilogInternals.h.

Referenced by getRenamedFieldName(), and setRenamedFieldName().

◆ options

const LoweringOptions& circt::ExportVerilog::FieldNameResolver::options
private

Definition at line 161 of file ExportVerilogInternals.h.

Referenced by FieldNameResolver(), and getRenamedFieldName().

◆ renamedFieldNames

DenseMap<StringAttr, StringAttr> circt::ExportVerilog::FieldNameResolver::renamedFieldNames
private

Those contain entries for field names and types respectively.

Struct types have names as field names, which must be renamed if they conflict with verilog keywords.

Definition at line 151 of file ExportVerilogInternals.h.

Referenced by getRenamedFieldName(), and setRenamedFieldName().


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