24 #ifndef TVM_IR_ERROR_H_ 25 #define TVM_IR_ERROR_H_ 32 #include <unordered_map> 61 std::stringstream stream_;
76 explicit CompileError(
const std::string& msg) : Error(msg), span(nullptr) {}
129 this->errors_.push_back(err);
145 std::string err_msg = err.str();
174 void RenderErrors(
const IRModule& module,
bool use_color =
true);
179 std::vector<CompileError> errors_;
181 std::unordered_map<ObjectRef, GlobalVar, ObjectPtrHash, ObjectPtrEqual> node_to_gv_;
185 #endif // TVM_IR_ERROR_H_ ObjectRef equal functor.
Definition: object.h:634
Custom Error class to be thrown during compilation.
Definition: error.h:68
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
An abstraction around how errors are stored and reported. Designed to be opaque to users...
Definition: error.h:112
A wrapper around std::stringstream to build error.
Definition: error.h:52
Span information for debugging purposes.
bool defined() const
Definition: object.h:544
ErrorBuilder & operator<<(const T &val)
Definition: error.h:55
CompileError(const ErrorBuilder &err)
construct error from error builder.
Definition: error.h:81
ObjectRef hash functor.
Definition: object.h:624
Managed reference to GlobalVarNode.
Definition: expr.h:475
Span span
Location of the error.
Definition: error.h:71
friend class CompileError
Definition: error.h:62
Base class of all object reference.
Definition: object.h:511
void Report(const CompileError &err)
Report a CompileError.
Definition: error.h:124
CompileError(const std::string &msg)
construct error from message.
Definition: error.h:76
void ReportAt(const GlobalVar &global, const ObjectRef &node, std::stringstream &err)
Report an error against a program, using the full program error reporting strategy.
Definition: error.h:144
CompileError(const CompileError &other)
copy constructor.
Definition: error.h:86
Managed reference class to IRModuleNode.
Definition: module.h:352
CompileError()
default constructor.
Definition: error.h:89
ErrorReporter()
default constructor.
Definition: error.h:115
bool AnyErrors()
Definition: error.h:176