PathDiagnosticClients now retain ownership of passed PathDiagnostics, requiring
them to not be stack-allocated.
HTMLDiagnostics now batches PathDiagnostics before emitting HTML in its dtor.
This is a workaround for a problem when we trampled the Preprocessor state
when highlighting macros (sometimes resulting in an assertion failure).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50102 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index e4228c7..28b76b3 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -31,7 +31,7 @@
// Create a PathDiagnostic with a single piece.
- PathDiagnostic D;
+ PathDiagnostic* D = new PathDiagnostic();
// Ripped from TextDiagnostics::FormatDiagnostic. Perhaps we should
// centralize it somewhere?
@@ -68,7 +68,7 @@
++Ranges;
}
- D.push_front(P);
+ D->push_front(P);
HandlePathDiagnostic(D);
}