|
CIRCT 22.0.0git
|
A format descriptor, to be given to arcRuntimeFormat. More...
#include <FmtDescriptor.h>

Classes | |
| struct | IntFmt |
| Integer formatting options. More... | |
| struct | LiteralFmt |
| Literal string formatting options. More... | |
| struct | SmallLiteral |
| Literal string (small string optimization). More... | |
Public Types | |
| enum | Action : uint64_t { Action_End = 0 , Action_Literal , Action_LiteralSmall , Action_Int , Action_Char } |
| The action to take for this descriptor. More... | |
Public Member Functions | |
| FmtDescriptor () | |
| Default construction creates an end of string descriptor. | |
Static Public Member Functions | |
| static FmtDescriptor | createLiteral (int64_t width) |
| Creates a literal string descriptor. | |
| static FmtDescriptor | createSmallLiteral (std::string_view str) |
| Creates a small literal string descriptor. | |
| static FmtDescriptor | createInt (int32_t bitwidth, int8_t radix, bool isLeftAligned, int32_t specifierWidth, bool isUpperCase, bool isSigned) |
| Creates an integer descriptor. | |
| static FmtDescriptor | createChar () |
| Creates a char descriptor. | |
Public Attributes | ||
| Action | action | |
| union { | ||
| LiteralFmt literal | ||
| IntFmt intFmt | ||
| SmallLiteral smallLiteral | ||
| }; | ||
A format descriptor, to be given to arcRuntimeFormat.
arcRuntimeFormat takes an array of FmtDescriptor and a variadic argument list. Each FmtDescriptor describes how to format the corresponding argument. The array is terminated by a FmtDescriptor with action Action_End.
Definition at line 37 of file FmtDescriptor.h.
| enum circt::arc::runtime::FmtDescriptor::Action : uint64_t |
The action to take for this descriptor.
We use uint64_t to ensure that the descriptor is always 16 bytes in size with zero padding.
Definition at line 104 of file FmtDescriptor.h.
|
inline |
Default construction creates an end of string descriptor.
Definition at line 39 of file FmtDescriptor.h.
References action, and Action_End.
|
inlinestatic |
Creates a char descriptor.
The character value will be passed as a variadic argument by value.
Definition at line 94 of file FmtDescriptor.h.
References action, and Action_Char.
|
inlinestatic |
Creates an integer descriptor.
bitwidth: The bitwidth of the integer value. radix: The radix to use for formatting. Must be one of {2, 8, 10, 16}. isLeftAligned: Whether the value is left aligned. specifierWidth: The minumum width of the output in characters. isUpperCase: Whether to use uppercase hex letters. isSigned: Whether to treat the value as signed.
The integer value will be passed as a variadic argument by pointer.
Definition at line 77 of file FmtDescriptor.h.
References action, Action_Int, circt::arc::runtime::FmtDescriptor::IntFmt::bitwidth, intFmt, circt::arc::runtime::FmtDescriptor::IntFmt::isLeftAligned, circt::arc::runtime::FmtDescriptor::IntFmt::isSigned, circt::arc::runtime::FmtDescriptor::IntFmt::isUpperCase, circt::arc::runtime::FmtDescriptor::IntFmt::radix, and circt::arc::runtime::FmtDescriptor::IntFmt::specifierWidth.
|
inlinestatic |
Creates a literal string descriptor.
width: The width of the literal string in characters.
The string itself will be passed as a variadic argument (const char*).
Definition at line 49 of file FmtDescriptor.h.
References action, Action_Literal, literal, and circt::arc::runtime::FmtDescriptor::LiteralFmt::width.
|
inlinestatic |
Creates a small literal string descriptor.
Definition at line 57 of file FmtDescriptor.h.
References action, Action_LiteralSmall, assert(), circt::arc::runtime::FmtDescriptor::SmallLiteral::data, and smallLiteral.
| union { ... } circt::arc::runtime::FmtDescriptor |
| Action circt::arc::runtime::FmtDescriptor::action |
Definition at line 116 of file FmtDescriptor.h.
Referenced by arcRuntimeIR_format(), createChar(), createInt(), createLiteral(), createSmallLiteral(), and FmtDescriptor().
| IntFmt circt::arc::runtime::FmtDescriptor::intFmt |
Definition at line 151 of file FmtDescriptor.h.
Referenced by arcRuntimeIR_format(), and createInt().
| LiteralFmt circt::arc::runtime::FmtDescriptor::literal |
Definition at line 150 of file FmtDescriptor.h.
Referenced by arcRuntimeIR_format(), and createLiteral().
| SmallLiteral circt::arc::runtime::FmtDescriptor::smallLiteral |
Definition at line 152 of file FmtDescriptor.h.
Referenced by arcRuntimeIR_format(), and createSmallLiteral().