CIRCT
19.0.0git
|
An enum type. More...
#include <MooreTypes.h>
Public Member Functions | |
PackedType | getBase () const |
Get the base type of the enumeration. More... | |
bool | isBaseExplicit () const |
Returns whether the base type was explicitly specified by the user. More... | |
StringAttr | getName () const |
Get the name of the surrounding typedef, if this enum is embedded in a typedef. More... | |
Location | getLoc () const |
Get the location in the source text where the enum was declared. More... | |
void | format (llvm::raw_ostream &os) const |
Format this enum in SystemVerilog syntax. More... | |
Static Public Member Functions | |
static EnumType | get (StringAttr name, Location loc, PackedType base={}) |
Static Public Attributes | |
static constexpr StringLiteral | name = "moore.enum" |
An enum type.
Definition at line 1054 of file MooreTypes.h.
void EnumType::format | ( | llvm::raw_ostream & | os | ) | const |
Format this enum in SystemVerilog syntax.
Useful to present the enum back to the user in diagnostics.
Definition at line 1001 of file MooreTypes.cpp.
References getBase(), getName(), isBaseExplicit(), and name.
|
static |
Definition at line 988 of file MooreTypes.cpp.
References circt::calyx::direction::get(), circt::moore::IntType::getInt(), and name.
Referenced by customTypeParser(), mooreEnumTypeGet(), and mooreEnumTypeGetWithBase().
PackedType EnumType::getBase | ( | ) | const |
Get the base type of the enumeration.
Definition at line 993 of file MooreTypes.cpp.
Referenced by format().
Location EnumType::getLoc | ( | ) | const |
Get the location in the source text where the enum was declared.
This shall be the location of the enum
keyword or, if the enum is embedded in a typedef, the location of the typedef name.
Definition at line 999 of file MooreTypes.cpp.
StringAttr EnumType::getName | ( | ) | const |
Get the name of the surrounding typedef, if this enum is embedded in a typedef.
Otherwise this returns a null attribute.
Definition at line 997 of file MooreTypes.cpp.
Referenced by format().
bool EnumType::isBaseExplicit | ( | ) | const |
Returns whether the base type was explicitly specified by the user.
This allows us to distinguish enum
from enum int
.
Definition at line 995 of file MooreTypes.cpp.
Referenced by format().
|
staticconstexpr |
Definition at line 1076 of file MooreTypes.h.