CIRCT 20.0.0git
|
#include <ExportVerilogInternals.h>
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. | |
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 |
Definition at line 123 of file ExportVerilogInternals.h.
|
inline |
Definition at line 124 of file ExportVerilogInternals.h.
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.
References circt::ExportVerilog::GlobalNameTable::getEnumPrefix(), and globalNames.
StringAttr FieldNameResolver::getRenamedFieldName | ( | StringAttr | fieldName | ) |
Definition at line 57 of file LegalizeNames.cpp.
References circt::LoweringOptions::caseInsensitiveKeywords, circt::sv::isNameValid(), circt::sv::legalizeName(), nextGeneratedNameIDs, options, renamedFieldNames, and setRenamedFieldName().
|
private |
Definition at line 51 of file LegalizeNames.cpp.
References nextGeneratedNameIDs, and renamedFieldNames.
Referenced by getRenamedFieldName().
|
private |
Definition at line 149 of file ExportVerilogInternals.h.
Referenced by getEnumFieldName().
|
private |
A map from used names to numeric suffix used as uniquification agent when resolving conflicts.
Definition at line 146 of file ExportVerilogInternals.h.
Referenced by getRenamedFieldName(), and setRenamedFieldName().
|
private |
Definition at line 152 of file ExportVerilogInternals.h.
Referenced by getRenamedFieldName().
|
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.
Referenced by getRenamedFieldName(), and setRenamedFieldName().