-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that the string table does not include unused entries
- Loading branch information
1 parent
68c62e6
commit a5ace61
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
whitelist=" \ | ||
" | ||
|
||
cleanup() | ||
{ | ||
rm -f "$ids_file" | ||
} | ||
|
||
ids_file=$(mktemp) | ||
|
||
trap cleanup EXIT | ||
|
||
gcc -E -P -x c src/util/irep_ids.def \ | ||
-D'IREP_ID_ONE(x)=ID_ ## x' -D'IREP_ID_TWO(x,y)=ID_ ## x' > $ids_file | ||
|
||
for w in $whitelist | ||
do | ||
perl -p -i -e "s/^$w\n//" $ids_file | ||
done | ||
|
||
for i in $(<$ids_file) | ||
do | ||
if ! git grep -w -q -c -F $i | ||
then | ||
echo "$i is never used" | ||
exit 1 | ||
fi | ||
done |