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/Rewrite/FixItRewriter.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/Rewrite/FixItRewriter.cpp')
-rw-r--r-- | clang/lib/Rewrite/FixItRewriter.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/FixItRewriter.cpp b/clang/lib/Rewrite/FixItRewriter.cpp index d38179dabfc..632c0de0742 100644 --- a/clang/lib/Rewrite/FixItRewriter.cpp +++ b/clang/lib/Rewrite/FixItRewriter.cpp @@ -156,4 +156,9 @@ void FixItRewriter::Diag(SourceLocation Loc, unsigned DiagID) { Diags.setClient(this); } +DiagnosticConsumer *FixItRewriter::clone(DiagnosticsEngine &Diags) const { + return new FixItRewriter(Diags, Diags.getSourceManager(), + Rewrite.getLangOpts(), FixItOpts); +} + FixItOptions::~FixItOptions() {} |