[AMDGPU] New AMDGPUInsertSingleUseVDST pass (#72388)
[llvm-project.git] / libcxxabi / src / demangle / cp-to-llvm.sh
blobcfe32c228e65d4313ea724586abe802d3ece9a82
1 #!/bin/bash
3 # Copies the 'demangle' library, excluding 'DemangleConfig.h', to llvm. If no
4 # llvm directory is specified, then assume a monorepo layout.
6 set -e
8 cd $(dirname $0)
9 HDRS="ItaniumDemangle.h ItaniumNodes.def StringViewExtras.h Utility.h"
10 LLVM_DEMANGLE_DIR=$1
12 if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then
13 LLVM_DEMANGLE_DIR="../../../llvm/include/llvm/Demangle"
16 if [[ ! -d "$LLVM_DEMANGLE_DIR" ]]; then
17 echo "No such directory: $LLVM_DEMANGLE_DIR" >&2
18 exit 1
21 read -p "This will overwrite the copies of $FILES in $LLVM_DEMANGLE_DIR; are you sure? [y/N]" -n 1 -r ANSWER
22 echo
24 if [[ $ANSWER =~ ^[Yy]$ ]]; then
25 cp -f README.txt $LLVM_DEMANGLE_DIR
26 chmod -w $LLVM_DEMANGLE_DIR/README.txt
27 for I in $HDRS ; do
28 rm -f $LLVM_DEMANGLE_DIR/$I
29 dash=$(echo "$I---------------------------" | cut -c -27 |\
30 sed 's|[^-]*||')
31 sed -e '1s|^//=*-* .*\..* -*.*=*// *$|//===--- '"$I $dash"'-*- mode:c++;eval:(read-only-mode) -*-===//|' \
32 -e '2s|^// *$|// Do not edit! See README.txt.|' \
33 $I >$LLVM_DEMANGLE_DIR/$I
34 chmod -w $LLVM_DEMANGLE_DIR/$I
35 done