[Mlir-commits] [mlir] ecf4585 - [MLIR] Improve error message on missing getArgument() override on pass

Uday Bondhugula llvmlistbot at llvm.org
Fri Dec 3 17:27:09 PST 2021


Author: Uday Bondhugula
Date: 2021-12-04T06:54:52+05:30
New Revision: ecf458507e03b16077dba66ba1e5f873d4adfa23

URL: https://github.com/llvm/llvm-project/commit/ecf458507e03b16077dba66ba1e5f873d4adfa23
DIFF: https://github.com/llvm/llvm-project/commit/ecf458507e03b16077dba66ba1e5f873d4adfa23.diff

LOG: [MLIR] Improve error message on missing getArgument() override on pass

Improve error message while registering a pass with a missing getArgument() override.

Differential Revision: https://reviews.llvm.org/D114744

Added: 
    

Modified: 
    mlir/lib/Pass/PassRegistry.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index 0530ec7f48296..a7fb9ec4ee0bf 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -111,8 +111,9 @@ void mlir::registerPass(const PassAllocatorFunction &function) {
   std::unique_ptr<Pass> pass = function();
   StringRef arg = pass->getArgument();
   if (arg.empty())
-    llvm::report_fatal_error(
-        "Trying to register a pass that does not override `getArgument()`");
+    llvm::report_fatal_error(llvm::Twine("Trying to register '") +
+                             pass->getName() +
+                             "' pass that does not override `getArgument()`");
   StringRef description = pass->getDescription();
   PassInfo passInfo(arg, description, function);
   passRegistry->try_emplace(arg, passInfo);


        


More information about the Mlir-commits mailing list