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 | d0e9e3a6a5b241d0f84e54694a10a26b1369e42a (patch) | |
tree | fcd2d73fdc825b237f2b8dac0cf871989236e35f /clang/lib/Frontend/VerifyDiagnosticConsumer.cpp | |
parent | 6de48ee8606428d4abab270ac9f8a9d0dd9d4bc4 (diff) | |
download | bcm5719-llvm-d0e9e3a6a5b241d0f84e54694a10a26b1369e42a.tar.gz bcm5719-llvm-d0e9e3a6a5b241d0f84e54694a10a26b1369e42a.zip |
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.
llvm-svn: 140743
Diffstat (limited to 'clang/lib/Frontend/VerifyDiagnosticConsumer.cpp')
-rw-r--r-- | clang/lib/Frontend/VerifyDiagnosticConsumer.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp index 983dc8eebb4..cf35c8edc31 100644 --- a/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp +++ b/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp @@ -525,6 +525,14 @@ void VerifyDiagnosticConsumer::CheckDiagnostics() { Buffer.reset(new TextDiagnosticBuffer()); } +DiagnosticConsumer * +VerifyDiagnosticConsumer::clone(DiagnosticsEngine &Diags) const { + if (!Diags.getClient()) + Diags.setClient(PrimaryClient->clone(Diags)); + + return new VerifyDiagnosticConsumer(Diags); +} + Directive* Directive::Create(bool RegexKind, const SourceLocation &Location, const std::string &Text, unsigned Count) { if (RegexKind) |