]> granicus.if.org Git - clang/commitdiff
TextDiagnosticBuffer: Fix copy-paste mistake in r197856
authorAlp Toker <alp@nuanti.com>
Mon, 23 Dec 2013 07:47:48 +0000 (07:47 +0000)
committerAlp Toker <alp@nuanti.com>
Mon, 23 Dec 2013 07:47:48 +0000 (07:47 +0000)
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

lib/Frontend/TextDiagnosticBuffer.cpp

index 31fb665cbc17ebaae1416daa984d73e04cd28684..b1c793a9709e77a373a634a168e0d2fafd668156 100644 (file)
@@ -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;
 }