r211323 - diagtool: simplify TreeView diagnostic classification
Alp Toker
alp at nuanti.com
Thu Jun 19 16:00:52 PDT 2014
Author: alp
Date: Thu Jun 19 18:00:52 2014
New Revision: 211323
URL: http://llvm.org/viewvc/llvm-project?rev=211323&view=rev
Log:
diagtool: simplify TreeView diagnostic classification
This utility doesn't need to know about the specifics of diagnostic levels.
Modified:
cfe/trunk/tools/diagtool/TreeView.cpp
Modified: cfe/trunk/tools/diagtool/TreeView.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/diagtool/TreeView.cpp?rev=211323&r1=211322&r2=211323&view=diff
==============================================================================
--- cfe/trunk/tools/diagtool/TreeView.cpp (original)
+++ cfe/trunk/tools/diagtool/TreeView.cpp Thu Jun 19 18:00:52 2014
@@ -50,11 +50,11 @@ static void resetColor(bool ShowColors,
out << llvm::sys::Process::ResetColor();
}
-static clang::DiagnosticsEngine::Level getLevel(unsigned DiagID) {
+static bool isIgnored(unsigned DiagID) {
// FIXME: This feels like a hack.
static clang::DiagnosticsEngine Diags(new DiagnosticIDs,
new DiagnosticOptions);
- return Diags.getDiagnosticLevel(DiagID, SourceLocation());
+ return Diags.isIgnored(DiagID, SourceLocation());
}
static void printGroup(llvm::raw_ostream &out, const GroupRecord &Group,
@@ -78,7 +78,7 @@ static void printGroup(llvm::raw_ostream
E = Group.diagnostics_end();
I != E; ++I) {
if (ShowColors) {
- if (getLevel(I->DiagID) != DiagnosticsEngine::Ignored) {
+ if (!isIgnored(I->DiagID)) {
setColor(ShowColors, out, llvm::raw_ostream::GREEN);
}
}
More information about the cfe-commits
mailing list