aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-07-07 06:30:31 +0000
committerTed Kremenek <kremenek@apple.com>2012-07-07 06:30:31 +0000
commita437b84765d6b98d57f2789435ad641f1dd61474 (patch)
treed4ce1ac239064d7a36743f0933580dbb38c58b38
parente8cf7d143446c45568bb7c9a6fbd8f32ca6ae93e (diff)
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
-rw-r--r--test/Misc/warning-flags.c5
-rw-r--r--tools/diagtool/ListWarnings.cpp4
2 files changed, 9 insertions, 0 deletions
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;