Mercurial > hg > CbC > CbC_llvm
view clang/utils/find-unused-diagnostics.sh @ 266:00f31e85ec16 default tip
Added tag current for changeset 31d058e83c98
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 14 Oct 2023 10:13:55 +0900 |
parents | 1d019706d866 |
children |
line wrap: on
line source
#!/usr/bin/env bash # # This script produces a list of all diagnostics that are defined # in Diagnostic*.td files but not used in sources. # # Gather all diagnostic identifiers from the .td files. ALL_DIAGS=$(grep -E --only-matching --no-filename '(err_|warn_|ext_|note_)[a-z_]+' ./include/clang/Basic/Diagnostic*.td) # Now look for all potential identifiers in the source files. ALL_SOURCES=$(find lib include tools utils -name \*.cpp -or -name \*.h) DIAGS_IN_SOURCES=$(grep -E --only-matching --no-filename '(err_|warn_|ext_|note_)[a-z_]+' $ALL_SOURCES) # Print all diags that occur in the .td files but not in the source. comm -23 <(sort -u <<< "$ALL_DIAGS") <(sort -u <<< "$DIAGS_IN_SOURCES")