| author | |
| committer | |
| log | 4269868d6a98a9b868827c2fc7e67d2f9b359647 |
| tree | bcd3ea6e8ad6de9c0d4b6be10ea9254704870857 |
| parent | 372062b4fe148c17a42ff0938781748ca1dc8328 |
5 files changed, 5 insertions(+), 86 deletions(-)
lib/libcxx/src/support/solaris/README deleted-4| ... | ... | @@ -1,4 +0,0 @@ |
| 1 | This directory contains a partial implementation of the xlocale APIs for | |
| 2 | Solaris. Some portions are lifted from FreeBSD libc, and so are covered by a | |
| 3 | 2-clause BSD license instead of the MIT/UUIC license that the rest of libc++ is | |
| 4 | distributed under. |
lib/libcxxabi/src/demangle/.clang-format deleted-2| ... | ... | @@ -1,2 +0,0 @@ |
| 1 | BasedOnStyle: LLVM | |
| 2 |
lib/libcxxabi/src/demangle/README.txt deleted-52| ... | ... | @@ -1,52 +0,0 @@ |
| 1 | Itanium Name Demangler Library | |
| 2 | ============================== | |
| 3 | ||
| 4 | Introduction | |
| 5 | ------------ | |
| 6 | ||
| 7 | This directory contains the generic itanium name demangler library. The main | |
| 8 | purpose of the library is to demangle C++ symbols, i.e. convert the string | |
| 9 | "_Z1fv" into "f()". You can also use the CRTP base ManglingParser to perform | |
| 10 | some simple analysis on the mangled name, or (in LLVM) use the opaque | |
| 11 | ItaniumPartialDemangler to query the demangled AST. | |
| 12 | ||
| 13 | Why are there multiple copies of the this library in the source tree? | |
| 14 | --------------------------------------------------------------------- | |
| 15 | ||
| 16 | This directory is mirrored between libcxxabi/demangle and | |
| 17 | llvm/include/llvm/Demangle. The simple reason for this is that both projects | |
| 18 | need to demangle symbols, but neither can depend on each other. libcxxabi needs | |
| 19 | the demangler to implement __cxa_demangle, which is part of the itanium ABI | |
| 20 | spec. LLVM needs a copy for a bunch of places, but doesn't want to use the | |
| 21 | system's __cxa_demangle because it a) might not be available (i.e., on Windows), | |
| 22 | and b) probably isn't that up-to-date on the latest language features. | |
| 23 | ||
| 24 | The copy of the demangler in LLVM has some extra stuff that aren't needed in | |
| 25 | libcxxabi (ie, the MSVC demangler, ItaniumPartialDemangler), which depend on the | |
| 26 | shared generic components. Despite these differences, we want to keep the "core" | |
| 27 | generic demangling library identical between both copies to simplify development | |
| 28 | and testing. | |
| 29 | ||
| 30 | If you're working on the generic library, then do the work first in libcxxabi, | |
| 31 | then run the cp-to-llvm.sh script in src/demangle. This script takes as an | |
| 32 | argument the path to llvm, and re-copies the changes you made to libcxxabi over. | |
| 33 | Note that this script just blindly overwrites all changes to the generic library | |
| 34 | in llvm, so be careful. | |
| 35 | ||
| 36 | Because the core demangler needs to work in libcxxabi, everything needs to be | |
| 37 | declared in an anonymous namespace (see DEMANGLE_NAMESPACE_BEGIN), and you can't | |
| 38 | introduce any code that depends on the libcxx dylib. | |
| 39 | ||
| 40 | Hopefully, when LLVM becomes a monorepo, we can de-duplicate this code, and have | |
| 41 | both LLVM and libcxxabi depend on a shared demangler library. | |
| 42 | ||
| 43 | Testing | |
| 44 | ------- | |
| 45 | ||
| 46 | The tests are split up between libcxxabi/test/{unit,}test_demangle.cpp, and | |
| 47 | llvm/unittest/Demangle. The llvm directory should only get tests for stuff not | |
| 48 | included in the core library. In the future though, we should probably move all | |
| 49 | the tests to LLVM. | |
| 50 | ||
| 51 | It is also a really good idea to run libFuzzer after non-trivial changes, see | |
| 52 | libcxxabi/fuzz/cxa_demangle_fuzzer.cpp and https://llvm.org/docs/LibFuzzer.html. |
lib/libcxxabi/src/demangle/cp-to-llvm.sh deleted-27| ... | ... | @@ -1,27 +0,0 @@ |
| 1 | #!/bin/bash | |
| 2 | ||
| 3 | # Copies the 'demangle' library, excluding 'DemangleConfig.h', to llvm. If no | |
| 4 | # llvm directory is specified, then assume a monorepo layout. | |
| 5 | ||
| 6 | set -e | |
| 7 | ||
| 8 | FILES="ItaniumDemangle.h StringView.h Utility.h README.txt" | |
| 9 | LLVM_DEMANGLE_DIR=$1 | |
| 10 | ||
| 11 | if [[ -z "$LLVM_DEMANGLE_DIR" ]]; then | |
| 12 | LLVM_DEMANGLE_DIR="../../../llvm/include/llvm/Demangle" | |
| 13 | fi | |
| 14 | ||
| 15 | if [[ ! -d "$LLVM_DEMANGLE_DIR" ]]; then | |
| 16 | echo "No such directory: $LLVM_DEMANGLE_DIR" >&2 | |
| 17 | exit 1 | |
| 18 | fi | |
| 19 | ||
| 20 | read -p "This will overwrite the copies of $FILES in $LLVM_DEMANGLE_DIR; are you sure? [y/N]" -n 1 -r ANSWER | |
| 21 | echo | |
| 22 | ||
| 23 | if [[ $ANSWER =~ ^[Yy]$ ]]; then | |
| 24 | for I in $FILES ; do | |
| 25 | cp $I $LLVM_DEMANGLE_DIR/$I | |
| 26 | done | |
| 27 | fi |
src/install_files.h+5-1| ... | ... | @@ -1853,18 +1853,20 @@ static const char *ZIG_LIBCXXABI_FILES[] = { |
| 1853 | 1853 | "src/cxa_noexception.cpp", |
| 1854 | 1854 | "src/cxa_personality.cpp", |
| 1855 | 1855 | "src/cxa_thread_atexit.cpp", |
| 1856 | "src/cxa_unexpected.cpp", | |
| 1857 | 1856 | "src/cxa_vector.cpp", |
| 1858 | 1857 | "src/cxa_virtual.cpp", |
| 1859 | 1858 | "src/fallback_malloc.cpp", |
| 1860 | 1859 | "src/private_typeinfo.cpp", |
| 1861 | 1860 | "src/stdlib_exception.cpp", |
| 1861 | "src/stdlib_new_delete.cpp", | |
| 1862 | 1862 | "src/stdlib_stdexcept.cpp", |
| 1863 | 1863 | "src/stdlib_typeinfo.cpp", |
| 1864 | 1864 | }; |
| 1865 | 1865 | static const char *ZIG_LIBCXX_FILES[] = { |
| 1866 | 1866 | "src/algorithm.cpp", |
| 1867 | 1867 | "src/any.cpp", |
| 1868 | "src/atomic.cpp", | |
| 1869 | "src/barrier.cpp", | |
| 1868 | 1870 | "src/bind.cpp", |
| 1869 | 1871 | "src/charconv.cpp", |
| 1870 | 1872 | "src/chrono.cpp", |
| ... | ... | @@ -1874,6 +1876,7 @@ static const char *ZIG_LIBCXX_FILES[] = { |
| 1874 | 1876 | "src/exception.cpp", |
| 1875 | 1877 | "src/experimental/memory_resource.cpp", |
| 1876 | 1878 | "src/filesystem/directory_iterator.cpp", |
| 1879 | "src/filesystem/int128_builtins.cpp", | |
| 1877 | 1880 | "src/filesystem/operations.cpp", |
| 1878 | 1881 | "src/functional.cpp", |
| 1879 | 1882 | "src/future.cpp", |
| ... | ... | @@ -1887,6 +1890,7 @@ static const char *ZIG_LIBCXX_FILES[] = { |
| 1887 | 1890 | "src/new.cpp", |
| 1888 | 1891 | "src/optional.cpp", |
| 1889 | 1892 | "src/random.cpp", |
| 1893 | "src/random_shuffle.cpp", | |
| 1890 | 1894 | "src/regex.cpp", |
| 1891 | 1895 | "src/shared_mutex.cpp", |
| 1892 | 1896 | "src/stdexcept.cpp", |