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.

llvm-svn: 159893
This commit is contained in:
Ted Kremenek 2012-07-07 06:30:31 +00:00
parent b22ea2acea
commit 30105f67b4
2 changed files with 9 additions and 0 deletions

View File

@ -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

View File

@ -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;