vinx13 commented on a change in pull request #9306:
URL: https://github.com/apache/tvm/pull/9306#discussion_r731377441



##########
File path: src/printer/tvmscript_printer.cc
##########
@@ -1279,12 +1279,106 @@ Doc TVMScriptPrinter::PrintLoopStack() {
   return res;
 }
 
+/*!
+ * \brief The printer for TVMScript with diagnostic
+ * \details The printer obtain the precedence of the top-level operation when 
printing each
+ *          subexpression to decide whether or not parentheses is needed.
+ */
+class TVMScriptPrinterWithDiagnostic : public TVMScriptPrinter {
+ public:
+  explicit TVMScriptPrinterWithDiagnostic(const String& tir_prefix, bool 
show_meta,
+                                          
runtime::TypedPackedFunc<String(ObjectRef)> annotate)
+      : TVMScriptPrinter(tir_prefix, show_meta), 
annotate_(std::move(annotate)) {}
+
+ protected:
+  /*! \brief additional comment function */
+  runtime::TypedPackedFunc<String(ObjectRef)> annotate_;

Review comment:
       let's change `TVMScriptWithDiagnostic` to take 
`TypePackedFunc<std::string(Stmt)>,` instead




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to