[clang] [clang-repl] Roll back implicit instantiations on failed PTUs to prevent JIT starvation (PR #192588)

Peiqi Li via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 00:07:32 PDT 2026


================
@@ -19061,6 +19061,15 @@ void Sema::MarkFunctionReferenced(SourceLocation Loc, FunctionDecl *Func,
         }
       }
     });
+  } else if (NeedDefinition && getLangOpts().IncrementalExtensions &&
----------------
voyager-jhk wrote:

Hi @vgvassilev, I've refactored the patch.

I've moved the fix to the Interpreter. It now tracks instantiations per-PTU and performs a physical state rollback inside CleanUpPTU when a parse error hits.

This acts as a lightweight DeclUnloader to unblock JIT starvation without polluting the core frontend. PTAL!

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


More information about the cfe-commits mailing list