• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
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
20