[clang] [CIR] Don't generate ClangIR after an unrecoverable error occured (PR #130971)

Morris Hafner via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 12 07:42:49 PDT 2025


================
@@ -43,6 +43,8 @@ void CIRGenerator::Initialize(ASTContext &astContext) {
 mlir::ModuleOp CIRGenerator::getModule() const { return cgm->getModule(); }
 
 bool CIRGenerator::HandleTopLevelDecl(DeclGroupRef group) {
+  if (diags.hasUnrecoverableErrorOccurred())
+    return true;
----------------
mmha wrote:

I chose to let parsing continue here mostly because this is what's being done in other ASTConsumers, but is there a reason to do so?

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


More information about the cfe-commits mailing list