Improve error message on pass registration failures to include the faulty pass name
authorMehdi Amini <joker.eph@gmail.com>
Thu, 17 Jun 2021 00:22:35 +0000 (00:22 +0000)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 17 Jun 2021 00:24:50 +0000 (00:24 +0000)
mlir/lib/Pass/PassRegistry.cpp

index 7f002ac..676f463 100644 (file)
@@ -127,7 +127,8 @@ void mlir::registerPass(const PassAllocatorFunction &function) {
   StringRef arg = pass->getArgument();
   if (arg.empty())
     llvm::report_fatal_error(
-        "Trying to register a pass that does not override `getArgument()`");
+        "Trying to register a pass that does not override `getArgument()`: " +
+        pass->getName());
   registerPass(arg, pass->getDescription(), function);
 }