Skip to content

Commit d49c670

Browse files
authored
[libcxxabi][demangle] Fix the cp-to-llvm.sh sync script to copy all headers (#166572)
In #137947 I refactored the script and added a `copy_files` function, which takes the header files to copy as an argument. But because the list of headers is a space separated string, we need to quote the string. Otherwise we would just copy the first header in the list. This patch also adds an `echo` statement in the `copy_files` loop to print the source/destination. Confirming that the files are copied as expected. ``` $ libcxxabi/src/demangle/cp-to-llvm.sh This will overwrite the copies of ItaniumDemangle.h ItaniumNodes.def StringViewExtras.h Utility.h in ../../../llvm/include/llvm/Demangle and DemangleTestCases.inc in ../../../llvm/include/llvm/Demangle/../Testing/Demangle; are you sure? [y/N]y Copying ./ItaniumDemangle.h to ../../../llvm/include/llvm/Demangle/ItaniumDemangle.h Copying ./ItaniumNodes.def to ../../../llvm/include/llvm/Demangle/ItaniumNodes.def Copying ./StringViewExtras.h to ../../../llvm/include/llvm/Demangle/StringViewExtras.h Copying ./Utility.h to ../../../llvm/include/llvm/Demangle/Utility.h Copying ../../test/DemangleTestCases.inc to ../../../llvm/include/llvm/Demangle/../Testing/Demangle/DemangleTestCases.inc ``` Luckily there weren't any out-of-sync changes introduced in the meantime.
1 parent efa7ab0 commit d49c670

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libcxxabi/src/demangle/cp-to-llvm.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ copy_files() {
4242
chmod -w $dst/README.txt
4343

4444
for I in $hdrs ; do
45+
echo "Copying ${src}/$I to ${dst}/$I"
4546
rm -f $dst/$I
4647
dash=$(echo "$I---------------------------" | cut -c -27 |\
4748
sed 's|[^-]*||')
@@ -53,6 +54,6 @@ copy_files() {
5354
}
5455

5556
if [[ $ANSWER =~ ^[Yy]$ ]]; then
56-
copy_files . $LLVM_DEMANGLE_DIR $HDRS
57-
copy_files ../../test $LLVM_TESTING_DIR $TEST_HDRS
57+
copy_files . $LLVM_DEMANGLE_DIR "${HDRS}"
58+
copy_files ../../test $LLVM_TESTING_DIR "${TEST_HDRS}"
5859
fi

0 commit comments

Comments
 (0)