From b01f06ca72362d527bb65fbf018ac53df575ded1 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Thu, 5 Nov 2009 02:17:33 +0000 Subject: [PATCH] AnalysisManager: Don't rely on PathDiagnosicClients flushing their diagnostics when they are destroyed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86110 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Analysis/PathSensitive/AnalysisManager.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/clang/Analysis/PathSensitive/AnalysisManager.h b/include/clang/Analysis/PathSensitive/AnalysisManager.h index 1a64f56ee8..488334623b 100644 --- a/include/clang/Analysis/PathSensitive/AnalysisManager.h +++ b/include/clang/Analysis/PathSensitive/AnalysisManager.h @@ -66,6 +66,8 @@ public: VisualizeEGDot(vizdot), VisualizeEGUbi(vizubi), PurgeDead(purge), EagerlyAssume(eager), TrimGraph(trim) {} + ~AnalysisManager() { FlushDiagnostics(); } + void ClearContexts() { LocCtxMgr.clear(); AnaCtxMgr.clear(); @@ -98,6 +100,11 @@ public: virtual PathDiagnosticClient *getPathDiagnosticClient() { return PD.get(); } + + void FlushDiagnostics() { + if (PD.get()) + PD->FlushDiagnostics(); + } bool shouldVisualizeGraphviz() const { return VisualizeEGDot; } -- 2.50.1