================
@@ -63,6 +63,20 @@ bool CIRGenerator::HandleTopLevelDecl(DeclGroupRef group) {
   return true;
 }
 
+void CIRGenerator::HandleTranslationUnit(ASTContext &astContext) {
+  // Release the Builder when there is no error.
+  if (!diags.hasErrorOccurred() && cgm)
+    cgm->release();
+
+  // If there are errors before or when releasing the CGM, reset the module to
+  // stop here before invoking the backend.
+  if (diags.hasErrorOccurred()) {
+    if (cgm)
+      // TODO: cgm->clear();
----------------
andykaylor wrote:

Yeah... I'm not really sure what's needed here. This TODO comment is in the 
incubator code. I think the idea is that "something" probably needs to happen 
to clean up after an error, but it isn't clear what that something should be. I 
should have replaced this with a MissingFeature.

https://github.com/llvm/llvm-project/pull/142496
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to