Skip to content

Commit 6a071e5

Browse files
committed
Improve error reporting on pass registration collision (NFC)
Differential Revision: https://reviews.llvm.org/D104430
1 parent 01cb9c5 commit 6a071e5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

mlir/lib/Pass/PassRegistry.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,11 @@ void mlir::registerPass(StringRef arg, StringRef description,
116116
// arg before it.
117117
TypeID entryTypeID = function()->getTypeID();
118118
auto it = passRegistryTypeIDs->try_emplace(arg, entryTypeID).first;
119-
if (it->second != entryTypeID) {
120-
llvm_unreachable("pass allocator creates a different pass than previously "
121-
"registered");
122-
}
119+
if (it->second != entryTypeID)
120+
llvm::report_fatal_error(
121+
"pass allocator creates a different pass than previously "
122+
"registered for pass " +
123+
arg);
123124
}
124125

125126
void mlir::registerPass(const PassAllocatorFunction &function) {

0 commit comments

Comments
 (0)