[PATCH] D25260: [CUDA] Destroy deferred diagnostics before destroying the ASTContext's PartialDiagnostic allocator.

Reid Kleckner via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 4 16:26:00 PDT 2016


rnk added inline comments.


> CodeGenModule.cpp:512-513
>    }
> +  // Clear the deferred diags so they don't outlive the ASTContext from whence
> +  // they're allocated.
> +  DeferredDiags.clear();

The ASTContext outlives CodeGenModule, but the diagnostic allocator in the ASTContext does not. As written, this suggests that CGM outlives ASTContext, which isn't right.

https://reviews.llvm.org/D25260





More information about the cfe-commits mailing list