CIRCT
18.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={}) |
An enum type.
Definition at line 1002 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 991 of file MooreTypes.cpp.
References getBase(), getName(), and isBaseExplicit().
|
static |
Definition at line 978 of file MooreTypes.cpp.
References circt::calyx::direction::get(), and circt::moore::IntType::getInt().
Referenced by customTypeParser(), mooreEnumTypeGet(), and mooreEnumTypeGetWithBase().
PackedType EnumType::getBase | ( | ) | const |
Get the base type of the enumeration.
Definition at line 983 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 989 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 987 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 985 of file MooreTypes.cpp.
Referenced by format().