diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-29 00:38:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-29 00:38:00 +0000 |
commit | aee526e77657afd1600276450e9c346953ad51d7 (patch) | |
tree | c21f821b09625211f00cbb5018546edb013a23b6 /lib/Frontend/TextDiagnosticPrinter.cpp | |
parent | 4213df3b5da21ce25a4541ca5c447eeb28b515a3 (diff) |
Introduce a pure virtual clone() method to DiagnosticConsumer, so that
we have the ability to create a new, distict diagnostic consumer when
we go off and build a module. This avoids the currently horribleness
where the same diagnostic consumer sees diagnostics for multiple
translation units (and multiple SourceManagers!) causing all sorts of havok.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/TextDiagnosticPrinter.cpp')
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 64a5c1bc9c..378e673812 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -1264,3 +1264,8 @@ void TextDiagnosticPrinter::HandleDiagnostic(DiagnosticsEngine::Level Level, OS.flush(); } + +DiagnosticConsumer * +TextDiagnosticPrinter::clone(DiagnosticsEngine &Diags) const { + return new TextDiagnosticPrinter(OS, *DiagOpts, /*OwnsOutputStream=*/false); +} |