[Mlir-commits] [mlir] 6a071e5 - Improve error reporting on pass registration collision (NFC)

Mehdi Amini llvmlistbot at llvm.org
Wed Jun 16 19:42:53 PDT 2021


Author: Mehdi Amini
Date: 2021-06-17T02:42:43Z
New Revision: 6a071e535fa43db038ea1a9329ebdeede3db31f9

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

LOG: Improve error reporting on pass registration collision (NFC)

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

Added: 
    

Modified: 
    mlir/lib/Pass/PassRegistry.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index 676f4637393f..0d3e0590c37f 100644
--- a/mlir/lib/Pass/PassRegistry.cpp
+++ b/mlir/lib/Pass/PassRegistry.cpp
@@ -116,10 +116,11 @@ void mlir::registerPass(StringRef arg, StringRef description,
   // arg before it.
   TypeID entryTypeID = function()->getTypeID();
   auto it = passRegistryTypeIDs->try_emplace(arg, entryTypeID).first;
-  if (it->second != entryTypeID) {
-    llvm_unreachable("pass allocator creates a 
diff erent pass than previously "
-                     "registered");
-  }
+  if (it->second != entryTypeID)
+    llvm::report_fatal_error(
+        "pass allocator creates a 
diff erent pass than previously "
+        "registered for pass " +
+        arg);
 }
 
 void mlir::registerPass(const PassAllocatorFunction &function) {


        


More information about the Mlir-commits mailing list