r197902 - TextDiagnosticBuffer: Fix copy-paste mistake in r197856

Alp Toker alp at nuanti.com
Sun Dec 22 23:47:49 PST 2013


Author: alp
Date: Mon Dec 23 01:47:48 2013
New Revision: 197902

URL: http://llvm.org/viewvc/llvm-project?rev=197902&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp

Modified: cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp?rev=197902&r1=197901&r2=197902&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp Mon Dec 23 01:47:48 2013
@@ -45,16 +45,13 @@ void TextDiagnosticBuffer::HandleDiagnos
 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;
 }
 





More information about the cfe-commits mailing list