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

Aaron Watry via Libclc-dev libclc-dev at lists.llvm.org
Thu Sep 28 18:45:11 PDT 2017


On Wed, Sep 20, 2017 at 11:06 PM, Jan Vesely via Libclc-dev
<libclc-dev at lists.llvm.org> wrote:
> 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)

Could/Should we default LLVM_CONFIG to llvm-config from $PATH? First
time I tried to run this script manually it yelled at me that --bindir
wasn't a valid command.

--Aaron

> +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
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev


More information about the Libclc-dev mailing list