Use report_fatal_error instead of llvm::errs() + abort() (NFC)

This is making the error reporting in line with other fatal errors.
This commit is contained in:
Mehdi Amini
2020-08-29 00:34:59 +00:00
parent 90166c2563
commit 9f2fbfab8d

View File

@@ -495,13 +495,12 @@ MLIRContext::getOrLoadDialect(StringRef dialectNamespace, TypeID dialectID,
LLVM_DEBUG(llvm::dbgs()
<< "Load new dialect in Context" << dialectNamespace);
#ifndef NDEBUG
if (impl.multiThreadedExecutionContext != 0) {
llvm::errs() << "Loading a dialect (" << dialectNamespace
<< ") while in a multi-threaded execution context (maybe "
"the PassManager): this can indicate a "
"missing `dependentDialects` in a pass for example.";
abort();
}
if (impl.multiThreadedExecutionContext != 0)
llvm::report_fatal_error(
"Loading a dialect (" + dialectNamespace +
") while in a multi-threaded execution context (maybe "
"the PassManager): this can indicate a "
"missing `dependentDialects` in a pass for example.");
#endif
dialect = ctor();
assert(dialect && "dialect ctor failed");