[cfe-commits] r90091 - /cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp

Daniel Dunbar daniel at zuster.org
Sun Nov 29 12:58:39 PST 2009


Author: ddunbar
Date: Sun Nov 29 14:58:39 2009
New Revision: 90091

URL: http://llvm.org/viewvc/llvm-project?rev=90091&view=rev
Log:
Simplify.

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=90091&r1=90090&r2=90091&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp (original)
+++ cfe/trunk/lib/Frontend/TextDiagnosticBuffer.cpp Sun Nov 29 14:58:39 2009
@@ -20,20 +20,19 @@
 ///
 void TextDiagnosticBuffer::HandleDiagnostic(Diagnostic::Level Level,
                                             const DiagnosticInfo &Info) {
-  llvm::SmallString<100> StrC;
-  Info.FormatDiagnostic(StrC);
-  std::string Str(StrC.begin(), StrC.end());
+  llvm::SmallString<100> Buf;
+  Info.FormatDiagnostic(Buf);
   switch (Level) {
   default: assert(0 && "Diagnostic not handled during diagnostic buffering!");
   case Diagnostic::Note:
-    Notes.push_back(std::make_pair(Info.getLocation(), Str));
+    Notes.push_back(std::make_pair(Info.getLocation(), Buf.str()));
     break;
   case Diagnostic::Warning:
-    Warnings.push_back(std::make_pair(Info.getLocation(), Str));
+    Warnings.push_back(std::make_pair(Info.getLocation(), Buf.str()));
     break;
   case Diagnostic::Error:
   case Diagnostic::Fatal:
-    Errors.push_back(std::make_pair(Info.getLocation(), Str));
+    Errors.push_back(std::make_pair(Info.getLocation(), Buf.str()));
     break;
   }
 }





More information about the cfe-commits mailing list