tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h 
into ir
URL: https://github.com/apache/incubator-tvm/pull/4701#discussion_r366118128
 
 

 ##########
 File path: include/tvm/ir/error.h
 ##########
 @@ -18,62 +18,79 @@
  */
 
 /*!
- * \file error.h
- * \brief The set of errors raised by Relay.
+ * \file tvm/ir/error.h
+ * \brief Utilities for error tracking and reporting.
  */
-#ifndef TVM_RELAY_ERROR_H_
-#define TVM_RELAY_ERROR_H_
+#ifndef TVM_IR_ERROR_H_
+#define TVM_IR_ERROR_H_
 
+#include <tvm/ir/span.h>
 #include <tvm/ir/module.h>
 
 #include <string>
 #include <vector>
 #include <sstream>
 #include <unordered_map>
 
-#include "./base.h"
-#include "./expr.h"
-
-
 namespace tvm {
-namespace relay {
-
-#define RELAY_ERROR(msg) (RelayErrorStream() << msg)
-
-// Forward declaratio for RelayErrorStream.
-struct Error;
-
-/*! \brief A wrapper around std::stringstream.
+/*!
+ * \brief A wrapper around std::stringstream to build error.
  *
- * This is designed to avoid platform specific
- * issues compiling and using std::stringstream
- * for error reporting.
+ * Can be consumed by Error to construct an error.
+ *
+ * \code
+ *
+ * void ReportError(const Error& err);
+ *
+ * void Test(int number) {
+ *   // Use error reporter to construct an error.
+ *   ReportError(ErrorBuilder() << "This is an error number=" << number);
 
 Review comment:
   hmm printer usually makes people think of printing to stdout, so I think the 
builder name might be more precise, as Error can be built from the object.
   
   So in this case I still think ErrorBuilder might be a better name.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to