MLIR
20.0.0git
|
A variant type that holds a single argument for a diagnostic. More...
#include "mlir/IR/Diagnostics.h"
Public Types | |
enum class | DiagnosticArgumentKind { Attribute , Double , Integer , String , Type , Unsigned } |
Enum that represents the different kinds of diagnostic arguments supported. More... | |
Public Member Functions | |
DiagnosticArgument (Attribute attr) | |
Note: The constructors below are only exposed due to problems accessing constructors from type traits, they should not be used directly by users. More... | |
DiagnosticArgument (double val) | |
DiagnosticArgument (float val) | |
template<typename T > | |
DiagnosticArgument (T val, std::enable_if_t< std::is_signed< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(int64_t)> *=nullptr) | |
template<typename T > | |
DiagnosticArgument (T val, std::enable_if_t< std::is_unsigned< T >::value &&std::numeric_limits< T >::is_integer &&sizeof(T)<=sizeof(uint64_t)> *=nullptr) | |
DiagnosticArgument (StringRef val) | |
DiagnosticArgument (Type val) | |
Construct from a Type. More... | |
void | print (raw_ostream &os) const |
Outputs this argument to a stream. More... | |
DiagnosticArgumentKind | getKind () const |
Returns the kind of this argument. More... | |
Attribute | getAsAttribute () const |
Returns this argument as an Attribute. More... | |
double | getAsDouble () const |
Returns this argument as a double. More... | |
int64_t | getAsInteger () const |
Returns this argument as a signed integer. More... | |
StringRef | getAsString () const |
Returns this argument as a string. More... | |
Type | getAsType () const |
Returns this argument as a Type. More... | |
uint64_t | getAsUnsigned () const |
Returns this argument as an unsigned integer. More... | |
Friends | |
class | Diagnostic |
A variant type that holds a single argument for a diagnostic.
Definition at line 52 of file Diagnostics.h.
|
strong |
Enum that represents the different kinds of diagnostic arguments supported.
Enumerator | |
---|---|
Attribute | |
Double | |
Integer | |
String | |
Type | |
Unsigned |
Definition at line 84 of file Diagnostics.h.
|
explicit |
Note: The constructors below are only exposed due to problems accessing constructors from type traits, they should not be used directly by users.
Construct from an Attribute.
Definition at line 35 of file Diagnostics.cpp.
|
inlineexplicit |
Definition at line 59 of file Diagnostics.h.
|
inlineexplicit |
Definition at line 61 of file Diagnostics.h.
|
inlineexplicit |
Definition at line 64 of file Diagnostics.h.
|
inlineexplicit |
Definition at line 71 of file Diagnostics.h.
|
inlineexplicit |
Definition at line 77 of file Diagnostics.h.
References mlir::String.
|
explicit |
Construct from a Type.
Definition at line 40 of file Diagnostics.cpp.
Attribute DiagnosticArgument::getAsAttribute | ( | ) | const |
Returns this argument as an Attribute.
Definition at line 45 of file Diagnostics.cpp.
References Attribute, mlir::Attribute::getFromOpaquePointer(), getKind(), and opaqueVal.
Referenced by print().
|
inline |
|
inline |
|
inline |
Type DiagnosticArgument::getAsType | ( | ) | const |
Returns this argument as a Type.
Definition at line 52 of file Diagnostics.cpp.
References mlir::Type::getFromOpaquePointer(), getKind(), opaqueVal, and Type.
Referenced by print().
|
inline |
|
inline |
Returns the kind of this argument.
Definition at line 97 of file Diagnostics.h.
Referenced by getAsAttribute(), getAsDouble(), getAsInteger(), getAsString(), getAsType(), and getAsUnsigned().
void DiagnosticArgument::print | ( | raw_ostream & | os | ) | const |
Outputs this argument to a stream.
Definition at line 58 of file Diagnostics.cpp.
References Attribute, Double, getAsAttribute(), getAsDouble(), getAsInteger(), getAsString(), getAsType(), getAsUnsigned(), Integer, String, Type, and Unsigned.
Referenced by mlir::operator<<().
|
friend |
Definition at line 130 of file Diagnostics.h.
double mlir::DiagnosticArgument::doubleVal |
Definition at line 137 of file Diagnostics.h.
Referenced by getAsDouble().
intptr_t mlir::DiagnosticArgument::opaqueVal |
Definition at line 138 of file Diagnostics.h.
Referenced by getAsAttribute(), getAsInteger(), getAsType(), and getAsUnsigned().
StringRef mlir::DiagnosticArgument::stringVal |
Definition at line 139 of file Diagnostics.h.
Referenced by getAsString().