From: Ted Kremenek Date: Sat, 7 Jul 2012 06:30:31 +0000 (+0000) Subject: Enhance 'diagtool list-warnings' to report number of diagnostics covered directly... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a437b84765d6b98d57f2789435ad641f1dd61474;p=clang Enhance 'diagtool list-warnings' to report number of diagnostics covered directly under -Wpedantic, and enhance warning-flags.c test to test that this set does not grow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159893 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 15b2d27b21..4edd77d94b 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -177,3 +177,8 @@ CHECK-NEXT: warn_use_out_of_scope_declaration CHECK-NEXT: warn_weak_identifier_undeclared CHECK-NEXT: warn_weak_import +The list of warnings in -Wpedenatic should NEVER grow. + +CHECK: Number in -Wpedantic (not covered by other -W flags): 71 + + diff --git a/tools/diagtool/ListWarnings.cpp b/tools/diagtool/ListWarnings.cpp index d59ffaa2a0..d554a2ef41 100644 --- a/tools/diagtool/ListWarnings.cpp +++ b/tools/diagtool/ListWarnings.cpp @@ -98,6 +98,10 @@ int ListWarnings::run(unsigned int argc, char **argv, llvm::raw_ostream &out) { out << " Average number of diagnostics per flag: " << llvm::format("%.4g", avgDiagsPerFlag) << '\n'; + out << " Number in -Wpedantic (not covered by other -W flags): " + << flagHistogram.GetOrCreateValue("pedantic").getValue().size() + << '\n'; + out << '\n'; return 0;