Dmitri Gribenko | 5189035 | 2012-02-13 20:21:52 +0000 | [diff] [blame] | 1 | #!/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 | |
| 7 | ALL_DIAGS=$(mktemp) |
| 8 | ALL_SOURCES=$(mktemp) |
| 9 | |
| 10 | grep -E --only-matching --no-filename '(err_|warn_|ext_|note_)[a-z_]+ ' ./include/clang/Basic/Diagnostic*.td > $ALL_DIAGS |
| 11 | find lib include tools -name \*.cpp -or -name \*.h > $ALL_SOURCES |
| 12 | for DIAG in $(cat $ALL_DIAGS); do |
| 13 | if ! grep -r $DIAG $(cat $ALL_SOURCES) > /dev/null; then |
| 14 | echo $DIAG |
| 15 | fi; |
| 16 | done |
| 17 | |
| 18 | rm $ALL_DIAGS $ALL_SOURCES |
| 19 | |