3 # Copies the 'demangle' library, excluding 'DemangleConfig.h', to llvm. If no
4 # llvm directory is specified, then assume a monorepo layout.
9 HDRS
="ItaniumDemangle.h ItaniumNodes.def StringViewExtras.h Utility.h"
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
21 read -p "This will overwrite the copies of $FILES in $LLVM_DEMANGLE_DIR; are you sure? [y/N]" -n 1 -r ANSWER
24 if [[ $ANSWER =~ ^
[Yy
]$
]]; then
25 cp -f README.txt
$LLVM_DEMANGLE_DIR
26 chmod -w $LLVM_DEMANGLE_DIR/README.txt
28 rm -f $LLVM_DEMANGLE_DIR/$I
29 dash
=$
(echo "$I---------------------------" | cut
-c -27 |\
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