CIRCT  18.0.0git
Public Member Functions | Static Public Member Functions | List of all members
circt::moore::EnumType Class Reference

An enum type. More...

#include <MooreTypes.h>

Inheritance diagram for circt::moore::EnumType:
Inheritance graph
[legend]
Collaboration diagram for circt::moore::EnumType:
Collaboration graph
[legend]

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={})
 

Detailed Description

An enum type.

Definition at line 1002 of file MooreTypes.h.

Member Function Documentation

◆ format()

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().

◆ get()

EnumType EnumType::get ( StringAttr  name,
Location  loc,
PackedType  base = {} 
)
static

◆ getBase()

PackedType EnumType::getBase ( ) const

Get the base type of the enumeration.

Definition at line 983 of file MooreTypes.cpp.

Referenced by format().

◆ getLoc()

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.

◆ getName()

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().

◆ isBaseExplicit()

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().


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