conrade-ctc wrote: > Can you take a look how cling does it -- it has one or two patches on top of > clang -- maybe we should start from there.
Thanks. I think this PR is the cling approach. On error, cling clears the Builder in `ReleaseModule()` and starts a new module. Upstream already clears it in the `HandleTranslationUnit` error branch. This PR calls that for a failed input, as #204152 did. The one addition is in `CodeGenModule::clear`: it keeps the deferred decls of earlier inputs and drops those of the failed input. I can move the clear into `ReleaseModule` if you prefer the literal cling form. https://github.com/llvm/llvm-project/pull/226285 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
