jroesch commented on a change in pull request #6274:
URL: https://github.com/apache/incubator-tvm/pull/6274#discussion_r477119237



##########
File path: src/ir/module.cc
##########
@@ -174,46 +174,28 @@ tvm::Array<GlobalTypeVar> 
IRModuleNode::GetGlobalTypeVars() const {
   return tvm::Array<GlobalTypeVar>(global_type_vars);
 }
 
-template <typename T>
-tvm::Array<T> concat(const tvm::Array<T>& l, const tvm::Array<T>& r) {
-  tvm::Array<T> ret(l);
-  for (const T& t : r) {
-    ret.push_back(t);
-  }
-  return ret;
-}
-
-// helper function to run type check
-relay::Function RunTypeCheck(const IRModule& mod, const GlobalVar& var, 
relay::Function f) {
-  auto func = Downcast<relay::Function>(relay::DeDup(std::move(f)));
+void WarnIfMalformed(const IRModule& mod, relay::Function func) {
+  func = Downcast<relay::Function>(relay::DeDup(func));
   // Type check the item before we add it to the module.
   auto fv = relay::FreeVars(func);
   auto ftv = relay::FreeTypeVars(func, mod);
+  // TODO(@jroesch): refactor to use diagnostic context
   CHECK_EQ(fv.size(), 0) << "There are free variables: " << fv
-                         << " in function: " << AsText(func, false);

Review comment:
       We should rewrite all the checkers to use diagnostic context so that we 
can report against the actual source program. 




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


Reply via email to