From: Alp Toker Date: Mon, 23 Dec 2013 07:47:48 +0000 (+0000) Subject: TextDiagnosticBuffer: Fix copy-paste mistake in r197856 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e8da95f84fdf12ee2dae4506877dc7a4446ef081;p=clang TextDiagnosticBuffer: Fix copy-paste mistake in r197856 The TextDiagnosticBuffer is meant to scrub SourceLocations as the input/output SourceManagers may be different. To be safe this commit restores the original behaviour though in practice all current users seem to share a single SM. Would be nice to replace TextDiagnosticBuffer now that more capable interfaces like CaptureDiagnosticConsumer / StoredDiagnosticConsumer exist. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197902 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/TextDiagnosticBuffer.cpp b/lib/Frontend/TextDiagnosticBuffer.cpp index 31fb665cbc..b1c793a970 100644 --- a/lib/Frontend/TextDiagnosticBuffer.cpp +++ b/lib/Frontend/TextDiagnosticBuffer.cpp @@ -45,16 +45,13 @@ void TextDiagnosticBuffer::HandleDiagnostic(DiagnosticsEngine::Level Level, void TextDiagnosticBuffer::FlushDiagnostics(DiagnosticsEngine &Diags) const { // FIXME: Flush the diagnostics in order. for (const_iterator it = err_begin(), ie = err_end(); it != ie; ++it) - Diags.Report(it->first, - Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) + Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) << it->second; for (const_iterator it = warn_begin(), ie = warn_end(); it != ie; ++it) - Diags.Report(it->first, - Diags.getCustomDiagID(DiagnosticsEngine::Warning, "%0")) + Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Warning, "%0")) << it->second; for (const_iterator it = note_begin(), ie = note_end(); it != ie; ++it) - Diags.Report(it->first, - Diags.getCustomDiagID(DiagnosticsEngine::Note, "%0")) + Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Note, "%0")) << it->second; }