aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehdi Amini <joker.eph@gmail.com>2021-06-17 01:28:17 +0000
committerMehdi Amini <joker.eph@gmail.com>2021-06-17 02:42:43 +0000
commit6a071e535fa43db038ea1a9329ebdeede3db31f9 (patch)
tree65d7e9bc0eb368f91101b9c6636db9269030cbb4
parent01cb9c5fc52bf7978fe8e1b1dba98b0e1d304402 (diff)
downloadllvm-6a071e535fa43db038ea1a9329ebdeede3db31f9.zip
llvm-6a071e535fa43db038ea1a9329ebdeede3db31f9.tar.gz
llvm-6a071e535fa43db038ea1a9329ebdeede3db31f9.tar.bz2
Improve error reporting on pass registration collision (NFC)
Differential Revision: https://reviews.llvm.org/D104430
-rw-r--r--mlir/lib/Pass/PassRegistry.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp
index 676f463..0d3e059 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 different pass than previously "
- "registered");
- }
+ if (it->second != entryTypeID)
+ llvm::report_fatal_error(
+ "pass allocator creates a different pass than previously "
+ "registered for pass " +
+ arg);
}
void mlir::registerPass(const PassAllocatorFunction &function) {