blob: 89b7f7a700d5eee2d6e4f8b0991c56c812f06fb1 [file] [log] [blame]
Dmitri Gribenko51890352012-02-13 20:21:52 +00001#!/bin/bash
2#
3# This script produces a list of all diagnostics that are defined
4# in Diagnostic*.td files but not used in sources.
5#
6
7ALL_DIAGS=$(mktemp)
8ALL_SOURCES=$(mktemp)
9
10grep -E --only-matching --no-filename '(err_|warn_|ext_|note_)[a-z_]+ ' ./include/clang/Basic/Diagnostic*.td > $ALL_DIAGS
11find lib include tools -name \*.cpp -or -name \*.h > $ALL_SOURCES
12for DIAG in $(cat $ALL_DIAGS); do
13 if ! grep -r $DIAG $(cat $ALL_SOURCES) > /dev/null; then
14 echo $DIAG
15 fi;
16done
17
18rm $ALL_DIAGS $ALL_SOURCES
19