CIRCT  20.0.0git
Public Member Functions | Private Member Functions | Private Attributes | List of all members
circt::ExportVerilog::FieldNameResolver Struct Reference

#include <ExportVerilogInternals.h>

Collaboration diagram for circt::ExportVerilog::FieldNameResolver:
Collaboration graph
[legend]

Public Member Functions

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

Private Member Functions

void setRenamedFieldName (StringAttr fieldName, StringAttr newFieldName)
 

Private Attributes

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

Detailed Description

Definition at line 123 of file ExportVerilogInternals.h.

Constructor & Destructor Documentation

◆ FieldNameResolver()

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

Definition at line 124 of file ExportVerilogInternals.h.

Member Function Documentation

◆ getEnumFieldName()

std::string FieldNameResolver::getEnumFieldName ( hw::EnumFieldAttr  attr)

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 82 of file LegalizeNames.cpp.

◆ getRenamedFieldName()

StringAttr FieldNameResolver::getRenamedFieldName ( StringAttr  fieldName)

◆ setRenamedFieldName()

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

Definition at line 51 of file LegalizeNames.cpp.

Member Data Documentation

◆ globalNames

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

Definition at line 149 of file ExportVerilogInternals.h.

◆ 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 146 of file ExportVerilogInternals.h.

◆ options

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

Definition at line 152 of file ExportVerilogInternals.h.

◆ 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 142 of file ExportVerilogInternals.h.


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