26 #ifndef TVM_IR_DIAGNOSTIC_H_ 27 #define TVM_IR_DIAGNOSTIC_H_ 72 v->Visit(
"level", &level);
73 v->Visit(
"span", &span);
74 v->Visit(
"message", &message);
82 static constexpr
const char* _type_key =
"Diagnostic";
130 template <
typename T>
139 : level(builder.level), source_name(builder.source_name), span(builder.span) {}
148 std::stringstream stream_;
173 static constexpr
const char* _type_key =
"DiagnosticRenderer";
186 ICHECK(
get() !=
nullptr);
205 v->Visit(
"module", &module);
206 v->Visit(
"diagnostics", &diagnostics);
213 static constexpr
const char* _type_key =
"DiagnosticContext";
220 TVM_DLL
static DiagnosticContext Default(
const IRModule& source_map);
240 ICHECK(
get() !=
nullptr);
250 #endif // TVM_IR_DIAGNOSTIC_H_ Display diagnostics in a given display format.
Definition: diagnostic.h:166
A compiler diagnostic message.
Definition: diagnostic.h:53
DiagnosticLevel level
The level.
Definition: diagnostic.h:56
Span span
The span at which to report an error.
Definition: diagnostic.h:58
Definition: diagnostic.h:86
DiagnosticContextNode * operator->()
Definition: diagnostic.h:239
void VisitAttrs(AttrVisitor *v)
Definition: diagnostic.h:171
A Reducer class to reduce the structural equality result of two objects.
Definition: structural_equal.h:124
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
SourceName source_name
The source name.
Definition: diagnostic.h:120
DiagnosticBuilder()
Definition: diagnostic.h:136
PrimExpr equal(PrimExpr a, PrimExpr b, Span span=Span())
equal
DiagnosticLevel level
The level.
Definition: diagnostic.h:117
Definition: diagnostic.h:193
DiagnosticBuilder(DiagnosticLevel level, Span span)
Definition: diagnostic.h:141
ObjectRef loc
The object location at which to report an error.
Definition: diagnostic.h:66
base class of all object containers.
Definition: object.h:167
DiagnosticRendererNode * operator->()
Definition: diagnostic.h:185
ObjectRef loc
The object location at which to report an error.
Definition: diagnostic.h:128
Definition: diagnostic.h:177
DiagnosticBuilder & operator<<(const T &val)
Definition: diagnostic.h:131
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Definition: source_map.h:120
A wrapper around std::stringstream to build a diagnostic.
Definition: diagnostic.h:114
String message
The diagnostic message.
Definition: diagnostic.h:68
The source name of a file span.
Definition: source_map.h:67
IRModule module
The Module to report against.
Definition: diagnostic.h:196
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
DiagnosticRenderer TerminalRenderer(std::ostream &ostream)
DiagnosticLevel
The diagnostic level, controls the printing of the message.
Definition: diagnostic.h:39
Definition: diagnostic.h:217
Reference to string objects.
Definition: string.h:98
Please refer to TypedPackedFunc<R(Args..)>.
Definition: packed_func.h:60
Array< Diagnostic > diagnostics
The set of diagnostics to report.
Definition: diagnostic.h:199
Base class of all object reference.
Definition: object.h:511
DiagnosticRenderer renderer
The renderer set for the context.
Definition: diagnostic.h:202
#define TVM_DECLARE_FINAL_OBJECT_INFO(TypeName, ParentType)
helper macro to declare type information in a final class.
Definition: object.h:671
Managed reference class to IRModuleNode.
Definition: module.h:348
Span span
The span of the diagnostic.
Definition: diagnostic.h:123
DiagnosticBuilder(const DiagnosticBuilder &builder)
Definition: diagnostic.h:138
bool SEqualReduce(const DiagnosticContextNode *other, SEqualReducer equal) const
Definition: diagnostic.h:209
void VisitAttrs(AttrVisitor *v)
Definition: diagnostic.h:204
void VisitAttrs(AttrVisitor *v)
Definition: diagnostic.h:71
bool SEqualReduce(const DiagnosticNode *other, SEqualReducer equal) const
Definition: diagnostic.h:77
DiagnosticRenderer()
Definition: diagnostic.h:180
TypedPackedFunc< void(DiagnosticContext ctx)> renderer
Definition: diagnostic.h:168
DiagnosticBuilder(DiagnosticLevel level, ObjectRef loc)
Definition: diagnostic.h:143
#define TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:728