[cfe-commits] r140511 - /cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp

Chandler Carruth chandlerc at google.com
Sun Sep 25 22:11:15 PDT 2011


Doh! Thanks for catching this. Want to add some tests? I can when I'm
back....
On Sep 25, 2011 7:17 PM, "Benjamin Kramer" <benny.kra at googlemail.com> wrote:
> Author: d0k
> Date: Sun Sep 25 21:14:13 2011
> New Revision: 140511
>
> URL: http://llvm.org/viewvc/llvm-project?rev=140511&view=rev
> Log:
> Don't print a stray ] at the end of diagnostics.
>
> Also remove an obsolete utostr call.
>
> Modified:
> cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
>
> Modified: cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
> URL:
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp?rev=140511&r1=140510&r2=140511&view=diff
>
==============================================================================
> --- cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp (original)
> +++ cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp Sun Sep 25 21:14:13
2011
> @@ -20,7 +20,6 @@
> #include "llvm/Support/raw_ostream.h"
> #include "llvm/Support/ErrorHandling.h"
> #include "llvm/ADT/SmallString.h"
> -#include "llvm/ADT/StringExtras.h"
> #include <algorithm>
> using namespace clang;
>
> @@ -1070,15 +1069,17 @@
> DiagnosticIDs::getCategoryNumberForDiag(Info.getID());
> if (DiagCategory) {
> OS << (Started ? "," : " [");
> + Started = true;
> if (DiagOpts.ShowCategories == 1)
> - OS << llvm::utostr(DiagCategory);
> + OS << DiagCategory;
> else {
> assert(DiagOpts.ShowCategories == 2 && "Invalid ShowCategories value");
> OS << DiagnosticIDs::getCategoryNameFromID(DiagCategory);
> }
> }
> }
> - OS << "]";
> + if (Started)
> + OS << ']';
> }
>
> /// \brief Print the given string to a stream, word-wrapping it to
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110925/95df28e9/attachment.html>


More information about the cfe-commits mailing list