Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / utils / generate_ignore_format.sh
blob7eff9b562a97d01f24c3c79b04f2d92d0f5dad08
1 #!/bin/bash
3 # Generate a list of headers that aren't formatted yet
5 if [ -z "${CLANG_FORMAT}" ]; then
6 CLANG_FORMAT=clang-format
7 fi
9 rm libcxx/utils/data/ignore_format.txt
10 # This uses the same matches as the check-format CI step.
12 # Since it's hard to match empty extensions the following
13 # method is used, remove all files with an extension, then
14 # add the list of extensions that should be formatted.
15 for file in $(find libcxx -type f -not -name '*.*' -or \( \
16 -name "*.h" -or -name "*.hpp" -or \
17 -name "*.c" -or -name "*.cpp" -or \
18 -name "*.inc" -or -name "*.ipp" \
19 \) ); do
21 ${CLANG_FORMAT} --Werror --dry-run ${file} >& /dev/null
22 if [ $? != 0 ]; then
23 echo ${file} >> libcxx/utils/data/ignore_format.txt
25 done
27 # Force sorting not to depend on the system's locale.
28 LC_ALL=C sort libcxx/utils/data/ignore_format.txt -d -o libcxx/utils/data/ignore_format.txt