[cfe-commits] r140511 - /cfe/trunk/lib/Frontend/TextDiagnosticPrinter.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sun Sep 25 19:14:13 PDT 2011
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
More information about the cfe-commits
mailing list