You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/01/14 01:48:20 UTC

[GitHub] [incubator-tvm] tqchen commented on a change in pull request #4701: [REFACTOR][IR] Move error.h into ir

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

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services