From 6a071e535fa43db038ea1a9329ebdeede3db31f9 Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Thu, 17 Jun 2021 01:28:17 +0000 Subject: [PATCH] Improve error reporting on pass registration collision (NFC) Differential Revision: https://reviews.llvm.org/D104430 --- mlir/lib/Pass/PassRegistry.cpp | 9 +++++---- 1 file 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) { -- 2.7.4