llvm-project/libclc/check_external_calls.sh
Fraser Cormack 9253950ec1
[libclc] Convert tabs to spaces in CMake (#85634)
Having a mix of tabs and spaces makes the diff of any changes to the
build system noisier than necessary. This commit unifies them to two
spaces.

This includes some minor cosmetic changes such as with joining things on
one line where appropriate.

There are other files in libclc which have tabs but those haven't been
touched at this time. Those could come at another time if desired,
though they might be more contentious as the project isn't
clang-formatted at all and so that might invite larger discussions
around formatting.
2024-03-18 14:37:04 +00:00

31 lines
539 B
Bash
Executable File

#!/bin/sh
FILE=$1
BIN_DIR=$2
if [ ! -f $FILE ]; then
echo "ERROR: Not a file: $FILE"
exit 3
fi
ret=0
DIS="$BIN_DIR/llvm-dis"
if [ ! -x $DIS ]; then
echo "ERROR: Disassembler '$DIS' is not executable"
exit 3
fi
TMP_FILE=$(mktemp)
# Check for calls. Calls to llvm intrinsics are OK
$DIS < $FILE | grep ' call ' | grep -v '@llvm' > "$TMP_FILE"
COUNT=$(wc -l < "$TMP_FILE")
if [ "$COUNT" -ne "0" ]; then
echo "ERROR: $COUNT unresolved calls detected in $FILE"
cat $TMP_FILE
ret=1
else
echo "File $FILE is OK"
fi
exit $ret