[Libclc-dev] [PATCH 4/5] Add script to check for unresolved function calls

Jan Vesely via Libclc-dev libclc-dev at lists.llvm.org
Wed Sep 20 21:06:55 PDT 2017


Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 check_external_calls.sh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100755 check_external_calls.sh

diff --git a/check_external_calls.sh b/check_external_calls.sh
new file mode 100755
index 0000000..c7c54aa
--- /dev/null
+++ b/check_external_calls.sh
@@ -0,0 +1,20 @@
+
+FILE=$1
+if [ ! -f $FILE ]; then
+	echo "ERROR: Not a file: $FILE"
+fi
+
+BIN_DIR=$($LLVM_CONFIG --bindir)
+DIS="$BIN_DIR/llvm-dis"
+TMP_FILE=$(mktemp)
+
+# Check for calls. Calls to llvm intrinsics are OK
+$DIS < $FILE | grep ' call ' | grep -v '@llvm' > "$TMP_FILE"
+
+if [ $(wc -l < "$TMP_FILE") -ne "0" ]; then
+	echo "ERROR: unresolved calls detected"
+	cat $TMP_FILE
+	exit 1
+else
+	echo "File $FILE is OK"
+fi
-- 
2.13.5



More information about the Libclc-dev mailing list