[clang] [CIR] Route MLIR diagnostics through clang::DiagnosticsEngine (PR #199297)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 22 08:42:10 PDT 2026


================
@@ -52,6 +52,11 @@ void CIRGenerator::Initialize(ASTContext &astContext) {
   this->astContext = &astContext;
 
   mlirContext = std::make_unique<mlir::MLIRContext>();
+  // Disable MLIR multithreading: clang::DiagnosticsEngine is not thread-safe,
+  // and the per-context handler installed by CIRGenAction reports diagnostics
+  // straight through it. CIR's pass pipeline is short enough that we don't
+  // miss meaningful parallelism here.
+  mlirContext->disableMultithreading();
----------------
erichkeane wrote:

I think we should, that definitely seems like a more appropriate direction.

https://github.com/llvm/llvm-project/pull/199297


More information about the cfe-commits mailing list