diff options
Diffstat (limited to 'libcxxabi/src/demangle/cp-to-llvm.sh')
-rwxr-xr-x | libcxxabi/src/demangle/cp-to-llvm.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxxabi/src/demangle/cp-to-llvm.sh b/libcxxabi/src/demangle/cp-to-llvm.sh new file mode 100755 index 00000000000..808abbcd99b --- /dev/null +++ b/libcxxabi/src/demangle/cp-to-llvm.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Copies the 'demangle' library, excluding 'DemangleConfig.h', to llvm. If no +# llvm directory is specified, then assume a monorepo layout. + +set -e + +FILES="ItaniumDemangle.h StringView.h Utility.h README.txt" +LLVM_DEMANGLE_DIR=$1 + +if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then + LLVM_DEMANGLE_DIR="../../../llvm/include/llvm/Demangle" +fi + +if [[ ! -d "$LLVM_DEMANGLE_DIR" ]]; then + echo "No such directory: $LLVM_DEMANGLE_DIR" >&2 + exit 1 +fi + +read -p "This will overwrite the copies of $FILES in $LLVM_DEMANGLE_DIR; are you sure? [y/N]" -n 1 -r ANSWER +echo + +if [[ $ANSWER =~ ^[Yy]$ ]]; then + for I in $FILES ; do + cp $I $LLVM_DEMANGLE_DIR/$I + done +fi |