================
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+if [ $# -lt 1 ]; then
+  echo "Path to clang required!"
+  echo "Usage: update_thinlto_indirect_call_promotion_inputs.sh 
/path/to/updated/clang"
+  exit 1
+else
+  CLANG=$1
+fi
+
+# Allows the script to be invoked from other directories.
+OUTDIR=$(dirname $(realpath -s $0))
----------------
MaskRay wrote:

Nice script!
The clean up commands may be simplified using this scheme

```
#!/bin/bash
OUTDIR=$(dirname $(realpath -s $0))

dir=$(mktemp -d)
trap "rm -r $dir" EXIT
cd $dir
cat > lib.h <<EOF
...
EOF
...
rm -f $OUTDIR/thinlto_indirect_call_promotion.profraw
LLVM_PROFILE_FILE=$OUTDIR/thinlto_indirect_call_promotion ./a.out
```

https://github.com/llvm/llvm-project/pull/74008
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to