From 46035553bfdd96e63c94e32da0210227ec2e3cf1 Mon Sep 17 00:00:00 2001 From: patrick Date: Sat, 2 Jan 2021 20:29:13 +0000 Subject: Import libc++ 10.0.1 release. --- gnu/llvm/libcxx/CMakeLists.txt | 943 +++ gnu/llvm/libcxx/CREDITS.TXT | 154 + gnu/llvm/libcxx/LICENSE.TXT | 311 + gnu/llvm/libcxx/NOTES.TXT | 29 + gnu/llvm/libcxx/TODO.TXT | 76 + gnu/llvm/libcxx/benchmarks/CMakeLists.txt | 219 + gnu/llvm/libcxx/benchmarks/CartesianBenchmarks.h | 133 + gnu/llvm/libcxx/benchmarks/ContainerBenchmarks.h | 140 + gnu/llvm/libcxx/benchmarks/GenerateInput.h | 144 + gnu/llvm/libcxx/benchmarks/Utilities.h | 33 + gnu/llvm/libcxx/benchmarks/algorithms.bench.cpp | 276 + .../algorithms.partition_point.bench.cpp | 124 + gnu/llvm/libcxx/benchmarks/allocation.bench.cpp | 136 + gnu/llvm/libcxx/benchmarks/deque.bench.cpp | 47 + gnu/llvm/libcxx/benchmarks/filesystem.bench.cpp | 163 + gnu/llvm/libcxx/benchmarks/function.bench.cpp | 231 + gnu/llvm/libcxx/benchmarks/lit.cfg.py | 23 + gnu/llvm/libcxx/benchmarks/lit.site.cfg.py.in | 10 + gnu/llvm/libcxx/benchmarks/ordered_set.bench.cpp | 248 + gnu/llvm/libcxx/benchmarks/string.bench.cpp | 574 ++ gnu/llvm/libcxx/benchmarks/stringstream.bench.cpp | 40 + .../benchmarks/unordered_set_operations.bench.cpp | 307 + gnu/llvm/libcxx/benchmarks/util_smartptr.bench.cpp | 41 + .../libcxx/benchmarks/vector_operations.bench.cpp | 40 + .../libcxx/cmake/Modules/CheckLibcxxAtomic.cmake | 56 + gnu/llvm/libcxx/cmake/Modules/CodeCoverage.cmake | 50 + .../libcxx/cmake/Modules/DefineLinkerScript.cmake | 52 + .../libcxx/cmake/Modules/HandleCompilerRT.cmake | 64 + .../libcxx/cmake/Modules/HandleLibCXXABI.cmake | 135 + .../libcxx/cmake/Modules/HandleLibcxxFlags.cmake | 246 + .../libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake | 142 + .../Modules/MacroEnsureOutOfSourceBuild.cmake | 18 + gnu/llvm/libcxx/cmake/caches/Apple.cmake | 15 + gnu/llvm/libcxx/cmake/config-ix.cmake | 102 + gnu/llvm/libcxx/docs/BuildingLibcxx.rst | 549 ++ gnu/llvm/libcxx/docs/CMakeLists.txt | 9 + gnu/llvm/libcxx/docs/DesignDocs/ABIVersioning.rst | 17 + .../libcxx/docs/DesignDocs/AvailabilityMarkup.rst | 105 + .../libcxx/docs/DesignDocs/CapturingConfigInfo.rst | 86 + gnu/llvm/libcxx/docs/DesignDocs/DebugMode.rst | 91 + .../docs/DesignDocs/ExperimentalFeatures.rst | 203 + .../docs/DesignDocs/ExtendedCXX03Support.rst | 118 + .../libcxx/docs/DesignDocs/FeatureTestMacros.rst | 45 + gnu/llvm/libcxx/docs/DesignDocs/FileTimeType.rst | 495 ++ .../libcxx/docs/DesignDocs/ThreadingSupportAPI.rst | 83 + .../libcxx/docs/DesignDocs/VisibilityMacros.rst | 218 + gnu/llvm/libcxx/docs/FeatureTestMacroTable.rst | 204 + gnu/llvm/libcxx/docs/Makefile.sphinx | 37 + gnu/llvm/libcxx/docs/README.txt | 13 + gnu/llvm/libcxx/docs/ReleaseNotes.rst | 30 + gnu/llvm/libcxx/docs/TestingLibcxx.rst | 268 + gnu/llvm/libcxx/docs/UsingLibcxx.rst | 348 + gnu/llvm/libcxx/docs/conf.py | 251 + gnu/llvm/libcxx/docs/index.rst | 193 + gnu/llvm/libcxx/include/CMakeLists.txt | 274 + gnu/llvm/libcxx/include/__bit_reference | 1305 ++++ gnu/llvm/libcxx/include/__bsd_locale_defaults.h | 36 + gnu/llvm/libcxx/include/__bsd_locale_fallbacks.h | 139 + gnu/llvm/libcxx/include/__config | 1523 +++++ gnu/llvm/libcxx/include/__config_site.in | 36 + gnu/llvm/libcxx/include/__debug | 278 + gnu/llvm/libcxx/include/__errc | 217 + gnu/llvm/libcxx/include/__functional_03 | 1591 +++++ gnu/llvm/libcxx/include/__functional_base | 652 ++ gnu/llvm/libcxx/include/__functional_base_03 | 223 + gnu/llvm/libcxx/include/__hash_table | 2915 +++++++++ gnu/llvm/libcxx/include/__libcpp_version | 1 + gnu/llvm/libcxx/include/__locale | 1553 +++++ gnu/llvm/libcxx/include/__mutex_base | 532 ++ gnu/llvm/libcxx/include/__node_handle | 208 + gnu/llvm/libcxx/include/__nullptr | 61 + gnu/llvm/libcxx/include/__split_buffer | 644 ++ gnu/llvm/libcxx/include/__sso_allocator | 76 + gnu/llvm/libcxx/include/__std_stream | 361 ++ gnu/llvm/libcxx/include/__string | 1061 +++ gnu/llvm/libcxx/include/__threading_support | 691 ++ gnu/llvm/libcxx/include/__tree | 2846 +++++++++ gnu/llvm/libcxx/include/__tuple | 551 ++ gnu/llvm/libcxx/include/__undef_macros | 33 + gnu/llvm/libcxx/include/algorithm | 5713 +++++++++++++++++ gnu/llvm/libcxx/include/any | 671 ++ gnu/llvm/libcxx/include/array | 484 ++ gnu/llvm/libcxx/include/atomic | 2442 +++++++ gnu/llvm/libcxx/include/bit | 486 ++ gnu/llvm/libcxx/include/bitset | 1109 ++++ gnu/llvm/libcxx/include/cassert | 24 + gnu/llvm/libcxx/include/ccomplex | 28 + gnu/llvm/libcxx/include/cctype | 120 + gnu/llvm/libcxx/include/cerrno | 32 + gnu/llvm/libcxx/include/cfenv | 81 + gnu/llvm/libcxx/include/cfloat | 79 + gnu/llvm/libcxx/include/charconv | 616 ++ gnu/llvm/libcxx/include/chrono | 2966 +++++++++ gnu/llvm/libcxx/include/cinttypes | 257 + gnu/llvm/libcxx/include/ciso646 | 24 + gnu/llvm/libcxx/include/climits | 47 + gnu/llvm/libcxx/include/clocale | 54 + gnu/llvm/libcxx/include/cmath | 673 ++ gnu/llvm/libcxx/include/codecvt | 549 ++ gnu/llvm/libcxx/include/compare | 678 ++ gnu/llvm/libcxx/include/complex | 1495 +++++ gnu/llvm/libcxx/include/complex.h | 36 + gnu/llvm/libcxx/include/condition_variable | 268 + gnu/llvm/libcxx/include/csetjmp | 47 + gnu/llvm/libcxx/include/csignal | 57 + gnu/llvm/libcxx/include/cstdarg | 47 + gnu/llvm/libcxx/include/cstdbool | 31 + gnu/llvm/libcxx/include/cstddef | 113 + gnu/llvm/libcxx/include/cstdint | 190 + gnu/llvm/libcxx/include/cstdio | 171 + gnu/llvm/libcxx/include/cstdlib | 163 + gnu/llvm/libcxx/include/cstring | 96 + gnu/llvm/libcxx/include/ctgmath | 28 + gnu/llvm/libcxx/include/ctime | 81 + gnu/llvm/libcxx/include/ctype.h | 59 + gnu/llvm/libcxx/include/cwchar | 192 + gnu/llvm/libcxx/include/cwctype | 86 + gnu/llvm/libcxx/include/deque | 3039 +++++++++ gnu/llvm/libcxx/include/errno.h | 397 ++ gnu/llvm/libcxx/include/exception | 329 + gnu/llvm/libcxx/include/execution | 19 + gnu/llvm/libcxx/include/experimental/__config | 79 + gnu/llvm/libcxx/include/experimental/__memory | 89 + gnu/llvm/libcxx/include/experimental/algorithm | 59 + gnu/llvm/libcxx/include/experimental/coroutine | 334 + gnu/llvm/libcxx/include/experimental/deque | 46 + gnu/llvm/libcxx/include/experimental/filesystem | 256 + gnu/llvm/libcxx/include/experimental/forward_list | 46 + gnu/llvm/libcxx/include/experimental/functional | 458 ++ gnu/llvm/libcxx/include/experimental/iterator | 113 + gnu/llvm/libcxx/include/experimental/list | 46 + gnu/llvm/libcxx/include/experimental/map | 56 + .../libcxx/include/experimental/memory_resource | 426 ++ .../libcxx/include/experimental/propagate_const | 577 ++ gnu/llvm/libcxx/include/experimental/regex | 61 + gnu/llvm/libcxx/include/experimental/set | 56 + gnu/llvm/libcxx/include/experimental/simd | 1569 +++++ gnu/llvm/libcxx/include/experimental/string | 61 + gnu/llvm/libcxx/include/experimental/type_traits | 154 + gnu/llvm/libcxx/include/experimental/unordered_map | 64 + gnu/llvm/libcxx/include/experimental/unordered_set | 58 + gnu/llvm/libcxx/include/experimental/utility | 46 + gnu/llvm/libcxx/include/experimental/vector | 46 + gnu/llvm/libcxx/include/ext/__hash | 133 + gnu/llvm/libcxx/include/ext/hash_map | 984 +++ gnu/llvm/libcxx/include/ext/hash_set | 659 ++ gnu/llvm/libcxx/include/fenv.h | 116 + gnu/llvm/libcxx/include/filesystem | 2644 ++++++++ gnu/llvm/libcxx/include/float.h | 93 + gnu/llvm/libcxx/include/forward_list | 1781 ++++++ gnu/llvm/libcxx/include/fstream | 1763 +++++ gnu/llvm/libcxx/include/functional | 3096 +++++++++ gnu/llvm/libcxx/include/future | 2608 ++++++++ gnu/llvm/libcxx/include/initializer_list | 117 + gnu/llvm/libcxx/include/inttypes.h | 262 + gnu/llvm/libcxx/include/iomanip | 670 ++ gnu/llvm/libcxx/include/ios | 1066 ++++ gnu/llvm/libcxx/include/iosfwd | 220 + gnu/llvm/libcxx/include/iostream | 63 + gnu/llvm/libcxx/include/istream | 1651 +++++ gnu/llvm/libcxx/include/iterator | 2006 ++++++ gnu/llvm/libcxx/include/limits | 818 +++ gnu/llvm/libcxx/include/limits.h | 64 + gnu/llvm/libcxx/include/list | 2488 ++++++++ gnu/llvm/libcxx/include/locale | 4353 +++++++++++++ gnu/llvm/libcxx/include/locale.h | 44 + gnu/llvm/libcxx/include/map | 2246 +++++++ gnu/llvm/libcxx/include/math.h | 1578 +++++ gnu/llvm/libcxx/include/memory | 5351 ++++++++++++++++ gnu/llvm/libcxx/include/module.modulemap | 612 ++ gnu/llvm/libcxx/include/mutex | 711 +++ gnu/llvm/libcxx/include/new | 372 ++ gnu/llvm/libcxx/include/numeric | 590 ++ gnu/llvm/libcxx/include/optional | 1420 ++++ gnu/llvm/libcxx/include/ostream | 1107 ++++ gnu/llvm/libcxx/include/queue | 803 +++ gnu/llvm/libcxx/include/random | 6748 ++++++++++++++++++++ gnu/llvm/libcxx/include/ratio | 532 ++ gnu/llvm/libcxx/include/regex | 6672 +++++++++++++++++++ gnu/llvm/libcxx/include/scoped_allocator | 683 ++ gnu/llvm/libcxx/include/set | 1493 +++++ gnu/llvm/libcxx/include/setjmp.h | 44 + gnu/llvm/libcxx/include/shared_mutex | 508 ++ gnu/llvm/libcxx/include/span | 591 ++ gnu/llvm/libcxx/include/sstream | 985 +++ gnu/llvm/libcxx/include/stack | 321 + gnu/llvm/libcxx/include/stdbool.h | 38 + gnu/llvm/libcxx/include/stddef.h | 62 + gnu/llvm/libcxx/include/stdexcept | 304 + gnu/llvm/libcxx/include/stdint.h | 125 + gnu/llvm/libcxx/include/stdio.h | 119 + gnu/llvm/libcxx/include/stdlib.h | 103 + gnu/llvm/libcxx/include/streambuf | 500 ++ gnu/llvm/libcxx/include/string | 4381 +++++++++++++ gnu/llvm/libcxx/include/string.h | 109 + gnu/llvm/libcxx/include/string_view | 840 +++ gnu/llvm/libcxx/include/strstream | 399 ++ .../libcxx/include/support/android/locale_bionic.h | 69 + gnu/llvm/libcxx/include/support/fuchsia/xlocale.h | 22 + gnu/llvm/libcxx/include/support/ibm/limits.h | 98 + .../libcxx/include/support/ibm/locale_mgmt_aix.h | 84 + gnu/llvm/libcxx/include/support/ibm/support.h | 53 + gnu/llvm/libcxx/include/support/ibm/xlocale.h | 270 + gnu/llvm/libcxx/include/support/musl/xlocale.h | 57 + gnu/llvm/libcxx/include/support/newlib/xlocale.h | 27 + .../libcxx/include/support/solaris/floatingpoint.h | 13 + gnu/llvm/libcxx/include/support/solaris/wchar.h | 46 + gnu/llvm/libcxx/include/support/solaris/xlocale.h | 76 + .../include/support/win32/limits_msvc_win32.h | 71 + .../libcxx/include/support/win32/locale_win32.h | 264 + .../include/support/xlocale/__nop_locale_mgmt.h | 51 + .../include/support/xlocale/__posix_l_fallback.h | 164 + .../include/support/xlocale/__strtonum_fallback.h | 66 + gnu/llvm/libcxx/include/system_error | 486 ++ gnu/llvm/libcxx/include/tgmath.h | 36 + gnu/llvm/libcxx/include/thread | 421 ++ gnu/llvm/libcxx/include/tuple | 1453 +++++ gnu/llvm/libcxx/include/type_traits | 4070 ++++++++++++ gnu/llvm/libcxx/include/typeindex | 102 + gnu/llvm/libcxx/include/typeinfo | 350 + gnu/llvm/libcxx/include/unordered_map | 2445 +++++++ gnu/llvm/libcxx/include/unordered_set | 1680 +++++ gnu/llvm/libcxx/include/utility | 1619 +++++ gnu/llvm/libcxx/include/valarray | 4930 ++++++++++++++ gnu/llvm/libcxx/include/variant | 1668 +++++ gnu/llvm/libcxx/include/vector | 3406 ++++++++++ gnu/llvm/libcxx/include/version | 239 + gnu/llvm/libcxx/include/wchar.h | 181 + gnu/llvm/libcxx/include/wctype.h | 78 + .../lib/abi/3.9/x86_64-apple-darwin16.abilist | 2448 +++++++ .../libcxx/lib/abi/3.9/x86_64-linux-gnu.abilist | 2010 ++++++ .../lib/abi/4.0/x86_64-apple-darwin16.abilist | 2376 +++++++ .../lib/abi/4.0/x86_64-unknown-linux-gnu.abilist | 1905 ++++++ .../lib/abi/5.0/x86_64-apple-darwin16.abilist | 2378 +++++++ .../lib/abi/5.0/x86_64-unknown-linux-gnu.abilist | 1883 ++++++ .../lib/abi/6.0/x86_64-apple-darwin16.abilist | 2378 +++++++ .../lib/abi/6.0/x86_64-unknown-linux-gnu.abilist | 1883 ++++++ .../lib/abi/8.0/x86_64-apple-darwin.v1.abilist | 2360 +++++++ .../lib/abi/8.0/x86_64-apple-darwin.v2.abilist | 2315 +++++++ .../abi/8.0/x86_64-unknown-linux-gnu.v1.abilist | 1861 ++++++ gnu/llvm/libcxx/lib/abi/CHANGELOG.TXT | 604 ++ gnu/llvm/libcxx/lib/abi/CMakeLists.txt | 33 + gnu/llvm/libcxx/lib/abi/README.TXT | 8 + .../libcxx/lib/abi/x86_64-apple-darwin.v1.abilist | 2422 +++++++ .../libcxx/lib/abi/x86_64-apple-darwin.v2.abilist | 2378 +++++++ .../lib/abi/x86_64-unknown-linux-gnu.v1.abilist | 1919 ++++++ gnu/llvm/libcxx/lib/libc++abi-new-delete.exp | 20 + gnu/llvm/libcxx/lib/libc++abi.v1.exp | 160 + gnu/llvm/libcxx/lib/libc++abi.v2.exp | 305 + gnu/llvm/libcxx/lib/libc++sjlj-abi.v1.exp | 160 + gnu/llvm/libcxx/lib/libc++sjlj-abi.v2.exp | 310 + gnu/llvm/libcxx/lib/libc++unexp.exp | 19 + gnu/llvm/libcxx/lib/notweak.exp | 5 + gnu/llvm/libcxx/lib/weak.exp | 16 + gnu/llvm/libcxx/src/CMakeLists.txt | 399 ++ gnu/llvm/libcxx/src/algorithm.cpp | 95 + gnu/llvm/libcxx/src/any.cpp | 34 + gnu/llvm/libcxx/src/bind.cpp | 29 + gnu/llvm/libcxx/src/charconv.cpp | 160 + gnu/llvm/libcxx/src/chrono.cpp | 233 + gnu/llvm/libcxx/src/condition_variable.cpp | 93 + .../libcxx/src/condition_variable_destructor.cpp | 46 + gnu/llvm/libcxx/src/debug.cpp | 578 ++ gnu/llvm/libcxx/src/exception.cpp | 35 + .../libcxx/src/experimental/memory_resource.cpp | 161 + .../libcxx/src/filesystem/directory_iterator.cpp | 398 ++ gnu/llvm/libcxx/src/filesystem/filesystem_common.h | 435 ++ gnu/llvm/libcxx/src/filesystem/int128_builtins.cpp | 54 + gnu/llvm/libcxx/src/filesystem/operations.cpp | 1782 ++++++ gnu/llvm/libcxx/src/functional.cpp | 25 + gnu/llvm/libcxx/src/future.cpp | 277 + gnu/llvm/libcxx/src/hash.cpp | 561 ++ gnu/llvm/libcxx/src/include/apple_availability.h | 51 + gnu/llvm/libcxx/src/include/atomic_support.h | 176 + gnu/llvm/libcxx/src/include/config_elast.h | 41 + gnu/llvm/libcxx/src/include/refstring.h | 127 + gnu/llvm/libcxx/src/ios.cpp | 457 ++ gnu/llvm/libcxx/src/iostream.cpp | 159 + gnu/llvm/libcxx/src/locale.cpp | 6154 ++++++++++++++++++ gnu/llvm/libcxx/src/memory.cpp | 237 + gnu/llvm/libcxx/src/mutex.cpp | 260 + gnu/llvm/libcxx/src/mutex_destructor.cpp | 50 + gnu/llvm/libcxx/src/new.cpp | 297 + gnu/llvm/libcxx/src/optional.cpp | 41 + gnu/llvm/libcxx/src/random.cpp | 178 + gnu/llvm/libcxx/src/regex.cpp | 316 + gnu/llvm/libcxx/src/shared_mutex.cpp | 118 + gnu/llvm/libcxx/src/stdexcept.cpp | 19 + gnu/llvm/libcxx/src/string.cpp | 458 ++ gnu/llvm/libcxx/src/strstream.cpp | 335 + .../src/support/runtime/exception_fallback.ipp | 164 + .../src/support/runtime/exception_glibcxx.ipp | 32 + .../src/support/runtime/exception_libcxxabi.ipp | 27 + .../src/support/runtime/exception_libcxxrt.ipp | 25 + .../libcxx/src/support/runtime/exception_msvc.ipp | 163 + .../support/runtime/exception_pointer_cxxabi.ipp | 73 + .../support/runtime/exception_pointer_glibcxx.ipp | 77 + .../src/support/runtime/exception_pointer_msvc.ipp | 86 + .../runtime/exception_pointer_unimplemented.ipp | 79 + .../src/support/runtime/new_handler_fallback.ipp | 26 + .../src/support/runtime/stdexcept_default.ipp | 64 + .../src/support/runtime/stdexcept_vcruntime.ipp | 16 + gnu/llvm/libcxx/src/support/solaris/README | 4 + gnu/llvm/libcxx/src/support/solaris/mbsnrtowcs.inc | 76 + gnu/llvm/libcxx/src/support/solaris/wcsnrtombs.inc | 92 + gnu/llvm/libcxx/src/support/solaris/xlocale.cpp | 68 + gnu/llvm/libcxx/src/support/win32/locale_win32.cpp | 139 + gnu/llvm/libcxx/src/support/win32/support.cpp | 164 + gnu/llvm/libcxx/src/support/win32/thread_win32.cpp | 275 + gnu/llvm/libcxx/src/system_error.cpp | 295 + gnu/llvm/libcxx/src/thread.cpp | 225 + gnu/llvm/libcxx/src/typeinfo.cpp | 57 + gnu/llvm/libcxx/src/utility.cpp | 15 + gnu/llvm/libcxx/src/valarray.cpp | 57 + gnu/llvm/libcxx/src/variant.cpp | 17 + gnu/llvm/libcxx/src/vector.cpp | 15 + gnu/llvm/libcxx/utils/cat_files.py | 45 + gnu/llvm/libcxx/utils/ci/macos-backdeployment.sh | 145 + gnu/llvm/libcxx/utils/ci/macos-trunk.sh | 132 + .../libcxx/utils/docker/debian9/Dockerfile.base | 45 + .../utils/docker/debian9/Dockerfile.buildbot | 26 + .../libcxx/utils/docker/debian9/Dockerfile.clang | 19 + .../utils/docker/debian9/Dockerfile.compiler_zoo | 33 + .../libcxx/utils/docker/debian9/Dockerfile.gcc | 18 + gnu/llvm/libcxx/utils/docker/docker-compose.yml | 46 + .../utils/docker/scripts/build_gcc_version.sh | 108 + .../utils/docker/scripts/build_llvm_version.sh | 106 + .../utils/docker/scripts/docker_start_buildbots.sh | 8 + .../utils/docker/scripts/docker_update_bot.sh | 25 + .../utils/docker/scripts/install_clang_packages.sh | 81 + .../libcxx/utils/docker/scripts/run_buildbot.sh | 102 + gnu/llvm/libcxx/utils/gdb/libcxx/printers.py | 1008 +++ .../generate_feature_test_macro_components.py | 998 +++ .../libcxx/utils/google-benchmark/.clang-format | 4 + gnu/llvm/libcxx/utils/google-benchmark/.gitignore | 58 + .../utils/google-benchmark/.travis-libcxx-setup.sh | 28 + gnu/llvm/libcxx/utils/google-benchmark/.travis.yml | 199 + .../utils/google-benchmark/.ycm_extra_conf.py | 115 + gnu/llvm/libcxx/utils/google-benchmark/AUTHORS | 48 + .../libcxx/utils/google-benchmark/CMakeLists.txt | 267 + .../libcxx/utils/google-benchmark/CONTRIBUTING.md | 58 + .../libcxx/utils/google-benchmark/CONTRIBUTORS | 68 + gnu/llvm/libcxx/utils/google-benchmark/LICENSE | 202 + gnu/llvm/libcxx/utils/google-benchmark/README.LLVM | 16 + gnu/llvm/libcxx/utils/google-benchmark/README.md | 998 +++ gnu/llvm/libcxx/utils/google-benchmark/WORKSPACE | 7 + .../libcxx/utils/google-benchmark/appveyor.yml | 50 + .../cmake/AddCXXCompilerFlag.cmake | 74 + .../google-benchmark/cmake/CXXFeatureCheck.cmake | 64 + .../utils/google-benchmark/cmake/Config.cmake.in | 1 + .../google-benchmark/cmake/GetGitVersion.cmake | 54 + .../utils/google-benchmark/cmake/HandleGTest.cmake | 113 + .../utils/google-benchmark/cmake/benchmark.pc.in | 11 + .../google-benchmark/cmake/gnu_posix_regex.cpp | 11 + .../google-benchmark/cmake/llvm-toolchain.cmake | 8 + .../utils/google-benchmark/cmake/posix_regex.cpp | 13 + .../utils/google-benchmark/cmake/split_list.cmake | 3 + .../utils/google-benchmark/cmake/std_regex.cpp | 9 + .../utils/google-benchmark/cmake/steady_clock.cpp | 7 + .../cmake/thread_safety_attributes.cpp | 4 + .../utils/google-benchmark/docs/AssemblyTests.md | 146 + .../libcxx/utils/google-benchmark/docs/tools.md | 199 + .../google-benchmark/include/benchmark/benchmark.h | 1551 +++++ gnu/llvm/libcxx/utils/google-benchmark/mingw.py | 320 + .../libcxx/utils/google-benchmark/releasing.md | 16 + .../utils/google-benchmark/src/CMakeLists.txt | 108 + .../libcxx/utils/google-benchmark/src/arraysize.h | 33 + .../libcxx/utils/google-benchmark/src/benchmark.cc | 493 ++ .../google-benchmark/src/benchmark_api_internal.cc | 15 + .../google-benchmark/src/benchmark_api_internal.h | 52 + .../utils/google-benchmark/src/benchmark_main.cc | 17 + .../google-benchmark/src/benchmark_register.cc | 482 ++ .../google-benchmark/src/benchmark_register.h | 33 + .../utils/google-benchmark/src/benchmark_runner.cc | 350 + .../utils/google-benchmark/src/benchmark_runner.h | 51 + gnu/llvm/libcxx/utils/google-benchmark/src/check.h | 82 + .../utils/google-benchmark/src/colorprint.cc | 188 + .../libcxx/utils/google-benchmark/src/colorprint.h | 33 + .../utils/google-benchmark/src/commandlineflags.cc | 218 + .../utils/google-benchmark/src/commandlineflags.h | 79 + .../utils/google-benchmark/src/complexity.cc | 228 + .../libcxx/utils/google-benchmark/src/complexity.h | 55 + .../utils/google-benchmark/src/console_reporter.cc | 180 + .../libcxx/utils/google-benchmark/src/counter.cc | 75 + .../libcxx/utils/google-benchmark/src/counter.h | 26 + .../utils/google-benchmark/src/csv_reporter.cc | 153 + .../libcxx/utils/google-benchmark/src/cycleclock.h | 192 + .../utils/google-benchmark/src/internal_macros.h | 92 + .../utils/google-benchmark/src/json_reporter.cc | 220 + gnu/llvm/libcxx/utils/google-benchmark/src/log.h | 74 + gnu/llvm/libcxx/utils/google-benchmark/src/mutex.h | 155 + gnu/llvm/libcxx/utils/google-benchmark/src/re.h | 158 + .../libcxx/utils/google-benchmark/src/reporter.cc | 105 + .../libcxx/utils/google-benchmark/src/sleep.cc | 51 + gnu/llvm/libcxx/utils/google-benchmark/src/sleep.h | 15 + .../utils/google-benchmark/src/statistics.cc | 190 + .../libcxx/utils/google-benchmark/src/statistics.h | 37 + .../utils/google-benchmark/src/string_util.cc | 261 + .../utils/google-benchmark/src/string_util.h | 60 + .../libcxx/utils/google-benchmark/src/sysinfo.cc | 650 ++ .../utils/google-benchmark/src/thread_manager.h | 64 + .../utils/google-benchmark/src/thread_timer.h | 69 + .../libcxx/utils/google-benchmark/src/timers.cc | 217 + .../libcxx/utils/google-benchmark/src/timers.h | 48 + .../google-benchmark/test/AssemblyTests.cmake | 45 + .../utils/google-benchmark/test/CMakeLists.txt | 260 + .../utils/google-benchmark/test/basic_test.cc | 136 + .../utils/google-benchmark/test/benchmark_gtest.cc | 33 + .../utils/google-benchmark/test/benchmark_test.cc | 245 + .../test/clobber_memory_assembly_test.cc | 64 + .../utils/google-benchmark/test/complexity_test.cc | 183 + .../utils/google-benchmark/test/cxx03_test.cc | 63 + .../google-benchmark/test/diagnostics_test.cc | 80 + .../test/display_aggregates_only_test.cc | 43 + .../test/donotoptimize_assembly_test.cc | 163 + .../google-benchmark/test/donotoptimize_test.cc | 52 + .../utils/google-benchmark/test/filter_test.cc | 104 + .../utils/google-benchmark/test/fixture_test.cc | 49 + .../utils/google-benchmark/test/link_main_test.cc | 8 + .../libcxx/utils/google-benchmark/test/map_test.cc | 57 + .../google-benchmark/test/memory_manager_test.cc | 42 + .../google-benchmark/test/multiple_ranges_test.cc | 97 + .../utils/google-benchmark/test/options_test.cc | 65 + .../utils/google-benchmark/test/output_test.h | 213 + .../google-benchmark/test/output_test_helper.cc | 505 ++ .../test/register_benchmark_test.cc | 184 + .../test/report_aggregates_only_test.cc | 39 + .../google-benchmark/test/reporter_output_test.cc | 604 ++ .../google-benchmark/test/skip_with_error_test.cc | 189 + .../google-benchmark/test/state_assembly_test.cc | 68 + .../google-benchmark/test/statistics_gtest.cc | 28 + .../google-benchmark/test/string_util_gtest.cc | 146 + .../test/templated_fixture_test.cc | 28 + .../test/user_counters_tabular_test.cc | 268 + .../google-benchmark/test/user_counters_test.cc | 408 ++ .../test/user_counters_thousands_test.cc | 161 + .../libcxx/utils/google-benchmark/tools/compare.py | 408 ++ .../tools/gbench/Inputs/test1_run1.json | 102 + .../tools/gbench/Inputs/test1_run2.json | 102 + .../tools/gbench/Inputs/test2_run.json | 81 + .../tools/gbench/Inputs/test3_run0.json | 65 + .../tools/gbench/Inputs/test3_run1.json | 65 + .../google-benchmark/tools/gbench/__init__.py | 8 + .../utils/google-benchmark/tools/gbench/report.py | 522 ++ .../utils/google-benchmark/tools/gbench/util.py | 164 + .../utils/google-benchmark/tools/strip_asm.py | 151 + gnu/llvm/libcxx/utils/libcxx/__init__.py | 16 + gnu/llvm/libcxx/utils/libcxx/compiler.py | 308 + gnu/llvm/libcxx/utils/libcxx/sym_check/__init__.py | 16 + gnu/llvm/libcxx/utils/libcxx/sym_check/diff.py | 102 + gnu/llvm/libcxx/utils/libcxx/sym_check/extract.py | 201 + gnu/llvm/libcxx/utils/libcxx/sym_check/match.py | 39 + gnu/llvm/libcxx/utils/libcxx/sym_check/util.py | 271 + gnu/llvm/libcxx/utils/libcxx/test/__init__.py | 0 gnu/llvm/libcxx/utils/libcxx/test/config.py | 1208 ++++ gnu/llvm/libcxx/utils/libcxx/test/executor.py | 251 + gnu/llvm/libcxx/utils/libcxx/test/format.py | 265 + .../libcxx/utils/libcxx/test/googlebenchmark.py | 121 + gnu/llvm/libcxx/utils/libcxx/test/target_info.py | 311 + gnu/llvm/libcxx/utils/libcxx/test/tracing.py | 42 + gnu/llvm/libcxx/utils/libcxx/util.py | 288 + gnu/llvm/libcxx/utils/merge_archives.py | 155 + gnu/llvm/libcxx/utils/not.py | 51 + gnu/llvm/libcxx/utils/run.py | 38 + gnu/llvm/libcxx/utils/sym_diff.py | 72 + gnu/llvm/libcxx/utils/sym_extract.py | 54 + gnu/llvm/libcxx/utils/sym_match.py | 50 + .../utils/symcheck-blacklists/linux_blacklist.txt | 19 + .../utils/symcheck-blacklists/osx_blacklist.txt | 19 + 469 files changed, 220737 insertions(+) create mode 100644 gnu/llvm/libcxx/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/CREDITS.TXT create mode 100644 gnu/llvm/libcxx/LICENSE.TXT create mode 100644 gnu/llvm/libcxx/NOTES.TXT create mode 100644 gnu/llvm/libcxx/TODO.TXT create mode 100644 gnu/llvm/libcxx/benchmarks/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/benchmarks/CartesianBenchmarks.h create mode 100644 gnu/llvm/libcxx/benchmarks/ContainerBenchmarks.h create mode 100644 gnu/llvm/libcxx/benchmarks/GenerateInput.h create mode 100644 gnu/llvm/libcxx/benchmarks/Utilities.h create mode 100644 gnu/llvm/libcxx/benchmarks/algorithms.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/algorithms.partition_point.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/allocation.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/deque.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/filesystem.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/function.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/lit.cfg.py create mode 100644 gnu/llvm/libcxx/benchmarks/lit.site.cfg.py.in create mode 100644 gnu/llvm/libcxx/benchmarks/ordered_set.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/string.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/stringstream.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/unordered_set_operations.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/util_smartptr.bench.cpp create mode 100644 gnu/llvm/libcxx/benchmarks/vector_operations.bench.cpp create mode 100644 gnu/llvm/libcxx/cmake/Modules/CheckLibcxxAtomic.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/CodeCoverage.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/DefineLinkerScript.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/HandleCompilerRT.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/HandleLibCXXABI.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/HandleLibcxxFlags.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/HandleOutOfTreeLLVM.cmake create mode 100644 gnu/llvm/libcxx/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake create mode 100644 gnu/llvm/libcxx/cmake/caches/Apple.cmake create mode 100644 gnu/llvm/libcxx/cmake/config-ix.cmake create mode 100644 gnu/llvm/libcxx/docs/BuildingLibcxx.rst create mode 100644 gnu/llvm/libcxx/docs/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/ABIVersioning.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/AvailabilityMarkup.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/CapturingConfigInfo.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/DebugMode.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/ExperimentalFeatures.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/ExtendedCXX03Support.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/FeatureTestMacros.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/FileTimeType.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/ThreadingSupportAPI.rst create mode 100644 gnu/llvm/libcxx/docs/DesignDocs/VisibilityMacros.rst create mode 100644 gnu/llvm/libcxx/docs/FeatureTestMacroTable.rst create mode 100644 gnu/llvm/libcxx/docs/Makefile.sphinx create mode 100644 gnu/llvm/libcxx/docs/README.txt create mode 100644 gnu/llvm/libcxx/docs/ReleaseNotes.rst create mode 100644 gnu/llvm/libcxx/docs/TestingLibcxx.rst create mode 100644 gnu/llvm/libcxx/docs/UsingLibcxx.rst create mode 100644 gnu/llvm/libcxx/docs/conf.py create mode 100644 gnu/llvm/libcxx/docs/index.rst create mode 100644 gnu/llvm/libcxx/include/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/include/__bit_reference create mode 100644 gnu/llvm/libcxx/include/__bsd_locale_defaults.h create mode 100644 gnu/llvm/libcxx/include/__bsd_locale_fallbacks.h create mode 100644 gnu/llvm/libcxx/include/__config create mode 100644 gnu/llvm/libcxx/include/__config_site.in create mode 100644 gnu/llvm/libcxx/include/__debug create mode 100644 gnu/llvm/libcxx/include/__errc create mode 100644 gnu/llvm/libcxx/include/__functional_03 create mode 100644 gnu/llvm/libcxx/include/__functional_base create mode 100644 gnu/llvm/libcxx/include/__functional_base_03 create mode 100644 gnu/llvm/libcxx/include/__hash_table create mode 100644 gnu/llvm/libcxx/include/__libcpp_version create mode 100644 gnu/llvm/libcxx/include/__locale create mode 100644 gnu/llvm/libcxx/include/__mutex_base create mode 100644 gnu/llvm/libcxx/include/__node_handle create mode 100644 gnu/llvm/libcxx/include/__nullptr create mode 100644 gnu/llvm/libcxx/include/__split_buffer create mode 100644 gnu/llvm/libcxx/include/__sso_allocator create mode 100644 gnu/llvm/libcxx/include/__std_stream create mode 100644 gnu/llvm/libcxx/include/__string create mode 100644 gnu/llvm/libcxx/include/__threading_support create mode 100644 gnu/llvm/libcxx/include/__tree create mode 100644 gnu/llvm/libcxx/include/__tuple create mode 100644 gnu/llvm/libcxx/include/__undef_macros create mode 100644 gnu/llvm/libcxx/include/algorithm create mode 100644 gnu/llvm/libcxx/include/any create mode 100644 gnu/llvm/libcxx/include/array create mode 100644 gnu/llvm/libcxx/include/atomic create mode 100644 gnu/llvm/libcxx/include/bit create mode 100644 gnu/llvm/libcxx/include/bitset create mode 100644 gnu/llvm/libcxx/include/cassert create mode 100644 gnu/llvm/libcxx/include/ccomplex create mode 100644 gnu/llvm/libcxx/include/cctype create mode 100644 gnu/llvm/libcxx/include/cerrno create mode 100644 gnu/llvm/libcxx/include/cfenv create mode 100644 gnu/llvm/libcxx/include/cfloat create mode 100644 gnu/llvm/libcxx/include/charconv create mode 100644 gnu/llvm/libcxx/include/chrono create mode 100644 gnu/llvm/libcxx/include/cinttypes create mode 100644 gnu/llvm/libcxx/include/ciso646 create mode 100644 gnu/llvm/libcxx/include/climits create mode 100644 gnu/llvm/libcxx/include/clocale create mode 100644 gnu/llvm/libcxx/include/cmath create mode 100644 gnu/llvm/libcxx/include/codecvt create mode 100644 gnu/llvm/libcxx/include/compare create mode 100644 gnu/llvm/libcxx/include/complex create mode 100644 gnu/llvm/libcxx/include/complex.h create mode 100644 gnu/llvm/libcxx/include/condition_variable create mode 100644 gnu/llvm/libcxx/include/csetjmp create mode 100644 gnu/llvm/libcxx/include/csignal create mode 100644 gnu/llvm/libcxx/include/cstdarg create mode 100644 gnu/llvm/libcxx/include/cstdbool create mode 100644 gnu/llvm/libcxx/include/cstddef create mode 100644 gnu/llvm/libcxx/include/cstdint create mode 100644 gnu/llvm/libcxx/include/cstdio create mode 100644 gnu/llvm/libcxx/include/cstdlib create mode 100644 gnu/llvm/libcxx/include/cstring create mode 100644 gnu/llvm/libcxx/include/ctgmath create mode 100644 gnu/llvm/libcxx/include/ctime create mode 100644 gnu/llvm/libcxx/include/ctype.h create mode 100644 gnu/llvm/libcxx/include/cwchar create mode 100644 gnu/llvm/libcxx/include/cwctype create mode 100644 gnu/llvm/libcxx/include/deque create mode 100644 gnu/llvm/libcxx/include/errno.h create mode 100644 gnu/llvm/libcxx/include/exception create mode 100644 gnu/llvm/libcxx/include/execution create mode 100644 gnu/llvm/libcxx/include/experimental/__config create mode 100644 gnu/llvm/libcxx/include/experimental/__memory create mode 100644 gnu/llvm/libcxx/include/experimental/algorithm create mode 100644 gnu/llvm/libcxx/include/experimental/coroutine create mode 100644 gnu/llvm/libcxx/include/experimental/deque create mode 100644 gnu/llvm/libcxx/include/experimental/filesystem create mode 100644 gnu/llvm/libcxx/include/experimental/forward_list create mode 100644 gnu/llvm/libcxx/include/experimental/functional create mode 100644 gnu/llvm/libcxx/include/experimental/iterator create mode 100644 gnu/llvm/libcxx/include/experimental/list create mode 100644 gnu/llvm/libcxx/include/experimental/map create mode 100644 gnu/llvm/libcxx/include/experimental/memory_resource create mode 100644 gnu/llvm/libcxx/include/experimental/propagate_const create mode 100644 gnu/llvm/libcxx/include/experimental/regex create mode 100644 gnu/llvm/libcxx/include/experimental/set create mode 100644 gnu/llvm/libcxx/include/experimental/simd create mode 100644 gnu/llvm/libcxx/include/experimental/string create mode 100644 gnu/llvm/libcxx/include/experimental/type_traits create mode 100644 gnu/llvm/libcxx/include/experimental/unordered_map create mode 100644 gnu/llvm/libcxx/include/experimental/unordered_set create mode 100644 gnu/llvm/libcxx/include/experimental/utility create mode 100644 gnu/llvm/libcxx/include/experimental/vector create mode 100644 gnu/llvm/libcxx/include/ext/__hash create mode 100644 gnu/llvm/libcxx/include/ext/hash_map create mode 100644 gnu/llvm/libcxx/include/ext/hash_set create mode 100644 gnu/llvm/libcxx/include/fenv.h create mode 100644 gnu/llvm/libcxx/include/filesystem create mode 100644 gnu/llvm/libcxx/include/float.h create mode 100644 gnu/llvm/libcxx/include/forward_list create mode 100644 gnu/llvm/libcxx/include/fstream create mode 100644 gnu/llvm/libcxx/include/functional create mode 100644 gnu/llvm/libcxx/include/future create mode 100644 gnu/llvm/libcxx/include/initializer_list create mode 100644 gnu/llvm/libcxx/include/inttypes.h create mode 100644 gnu/llvm/libcxx/include/iomanip create mode 100644 gnu/llvm/libcxx/include/ios create mode 100644 gnu/llvm/libcxx/include/iosfwd create mode 100644 gnu/llvm/libcxx/include/iostream create mode 100644 gnu/llvm/libcxx/include/istream create mode 100644 gnu/llvm/libcxx/include/iterator create mode 100644 gnu/llvm/libcxx/include/limits create mode 100644 gnu/llvm/libcxx/include/limits.h create mode 100644 gnu/llvm/libcxx/include/list create mode 100644 gnu/llvm/libcxx/include/locale create mode 100644 gnu/llvm/libcxx/include/locale.h create mode 100644 gnu/llvm/libcxx/include/map create mode 100644 gnu/llvm/libcxx/include/math.h create mode 100644 gnu/llvm/libcxx/include/memory create mode 100644 gnu/llvm/libcxx/include/module.modulemap create mode 100644 gnu/llvm/libcxx/include/mutex create mode 100644 gnu/llvm/libcxx/include/new create mode 100644 gnu/llvm/libcxx/include/numeric create mode 100644 gnu/llvm/libcxx/include/optional create mode 100644 gnu/llvm/libcxx/include/ostream create mode 100644 gnu/llvm/libcxx/include/queue create mode 100644 gnu/llvm/libcxx/include/random create mode 100644 gnu/llvm/libcxx/include/ratio create mode 100644 gnu/llvm/libcxx/include/regex create mode 100644 gnu/llvm/libcxx/include/scoped_allocator create mode 100644 gnu/llvm/libcxx/include/set create mode 100644 gnu/llvm/libcxx/include/setjmp.h create mode 100644 gnu/llvm/libcxx/include/shared_mutex create mode 100644 gnu/llvm/libcxx/include/span create mode 100644 gnu/llvm/libcxx/include/sstream create mode 100644 gnu/llvm/libcxx/include/stack create mode 100644 gnu/llvm/libcxx/include/stdbool.h create mode 100644 gnu/llvm/libcxx/include/stddef.h create mode 100644 gnu/llvm/libcxx/include/stdexcept create mode 100644 gnu/llvm/libcxx/include/stdint.h create mode 100644 gnu/llvm/libcxx/include/stdio.h create mode 100644 gnu/llvm/libcxx/include/stdlib.h create mode 100644 gnu/llvm/libcxx/include/streambuf create mode 100644 gnu/llvm/libcxx/include/string create mode 100644 gnu/llvm/libcxx/include/string.h create mode 100644 gnu/llvm/libcxx/include/string_view create mode 100644 gnu/llvm/libcxx/include/strstream create mode 100644 gnu/llvm/libcxx/include/support/android/locale_bionic.h create mode 100644 gnu/llvm/libcxx/include/support/fuchsia/xlocale.h create mode 100644 gnu/llvm/libcxx/include/support/ibm/limits.h create mode 100644 gnu/llvm/libcxx/include/support/ibm/locale_mgmt_aix.h create mode 100644 gnu/llvm/libcxx/include/support/ibm/support.h create mode 100644 gnu/llvm/libcxx/include/support/ibm/xlocale.h create mode 100644 gnu/llvm/libcxx/include/support/musl/xlocale.h create mode 100644 gnu/llvm/libcxx/include/support/newlib/xlocale.h create mode 100644 gnu/llvm/libcxx/include/support/solaris/floatingpoint.h create mode 100644 gnu/llvm/libcxx/include/support/solaris/wchar.h create mode 100644 gnu/llvm/libcxx/include/support/solaris/xlocale.h create mode 100644 gnu/llvm/libcxx/include/support/win32/limits_msvc_win32.h create mode 100644 gnu/llvm/libcxx/include/support/win32/locale_win32.h create mode 100644 gnu/llvm/libcxx/include/support/xlocale/__nop_locale_mgmt.h create mode 100644 gnu/llvm/libcxx/include/support/xlocale/__posix_l_fallback.h create mode 100644 gnu/llvm/libcxx/include/support/xlocale/__strtonum_fallback.h create mode 100644 gnu/llvm/libcxx/include/system_error create mode 100644 gnu/llvm/libcxx/include/tgmath.h create mode 100644 gnu/llvm/libcxx/include/thread create mode 100644 gnu/llvm/libcxx/include/tuple create mode 100644 gnu/llvm/libcxx/include/type_traits create mode 100644 gnu/llvm/libcxx/include/typeindex create mode 100644 gnu/llvm/libcxx/include/typeinfo create mode 100644 gnu/llvm/libcxx/include/unordered_map create mode 100644 gnu/llvm/libcxx/include/unordered_set create mode 100644 gnu/llvm/libcxx/include/utility create mode 100644 gnu/llvm/libcxx/include/valarray create mode 100644 gnu/llvm/libcxx/include/variant create mode 100644 gnu/llvm/libcxx/include/vector create mode 100644 gnu/llvm/libcxx/include/version create mode 100644 gnu/llvm/libcxx/include/wchar.h create mode 100644 gnu/llvm/libcxx/include/wctype.h create mode 100644 gnu/llvm/libcxx/lib/abi/3.9/x86_64-apple-darwin16.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/3.9/x86_64-linux-gnu.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/4.0/x86_64-apple-darwin16.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/4.0/x86_64-unknown-linux-gnu.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/5.0/x86_64-apple-darwin16.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/5.0/x86_64-unknown-linux-gnu.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/6.0/x86_64-apple-darwin16.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/6.0/x86_64-unknown-linux-gnu.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/8.0/x86_64-apple-darwin.v1.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/8.0/x86_64-apple-darwin.v2.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/8.0/x86_64-unknown-linux-gnu.v1.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/CHANGELOG.TXT create mode 100644 gnu/llvm/libcxx/lib/abi/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/lib/abi/README.TXT create mode 100644 gnu/llvm/libcxx/lib/abi/x86_64-apple-darwin.v1.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/x86_64-apple-darwin.v2.abilist create mode 100644 gnu/llvm/libcxx/lib/abi/x86_64-unknown-linux-gnu.v1.abilist create mode 100644 gnu/llvm/libcxx/lib/libc++abi-new-delete.exp create mode 100644 gnu/llvm/libcxx/lib/libc++abi.v1.exp create mode 100644 gnu/llvm/libcxx/lib/libc++abi.v2.exp create mode 100644 gnu/llvm/libcxx/lib/libc++sjlj-abi.v1.exp create mode 100644 gnu/llvm/libcxx/lib/libc++sjlj-abi.v2.exp create mode 100644 gnu/llvm/libcxx/lib/libc++unexp.exp create mode 100644 gnu/llvm/libcxx/lib/notweak.exp create mode 100644 gnu/llvm/libcxx/lib/weak.exp create mode 100644 gnu/llvm/libcxx/src/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/src/algorithm.cpp create mode 100644 gnu/llvm/libcxx/src/any.cpp create mode 100644 gnu/llvm/libcxx/src/bind.cpp create mode 100644 gnu/llvm/libcxx/src/charconv.cpp create mode 100644 gnu/llvm/libcxx/src/chrono.cpp create mode 100644 gnu/llvm/libcxx/src/condition_variable.cpp create mode 100644 gnu/llvm/libcxx/src/condition_variable_destructor.cpp create mode 100644 gnu/llvm/libcxx/src/debug.cpp create mode 100644 gnu/llvm/libcxx/src/exception.cpp create mode 100644 gnu/llvm/libcxx/src/experimental/memory_resource.cpp create mode 100644 gnu/llvm/libcxx/src/filesystem/directory_iterator.cpp create mode 100644 gnu/llvm/libcxx/src/filesystem/filesystem_common.h create mode 100644 gnu/llvm/libcxx/src/filesystem/int128_builtins.cpp create mode 100644 gnu/llvm/libcxx/src/filesystem/operations.cpp create mode 100644 gnu/llvm/libcxx/src/functional.cpp create mode 100644 gnu/llvm/libcxx/src/future.cpp create mode 100644 gnu/llvm/libcxx/src/hash.cpp create mode 100644 gnu/llvm/libcxx/src/include/apple_availability.h create mode 100644 gnu/llvm/libcxx/src/include/atomic_support.h create mode 100644 gnu/llvm/libcxx/src/include/config_elast.h create mode 100644 gnu/llvm/libcxx/src/include/refstring.h create mode 100644 gnu/llvm/libcxx/src/ios.cpp create mode 100644 gnu/llvm/libcxx/src/iostream.cpp create mode 100644 gnu/llvm/libcxx/src/locale.cpp create mode 100644 gnu/llvm/libcxx/src/memory.cpp create mode 100644 gnu/llvm/libcxx/src/mutex.cpp create mode 100644 gnu/llvm/libcxx/src/mutex_destructor.cpp create mode 100644 gnu/llvm/libcxx/src/new.cpp create mode 100644 gnu/llvm/libcxx/src/optional.cpp create mode 100644 gnu/llvm/libcxx/src/random.cpp create mode 100644 gnu/llvm/libcxx/src/regex.cpp create mode 100644 gnu/llvm/libcxx/src/shared_mutex.cpp create mode 100644 gnu/llvm/libcxx/src/stdexcept.cpp create mode 100644 gnu/llvm/libcxx/src/string.cpp create mode 100644 gnu/llvm/libcxx/src/strstream.cpp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_fallback.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_glibcxx.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_libcxxabi.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_libcxxrt.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_msvc.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_pointer_cxxabi.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_pointer_glibcxx.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_pointer_msvc.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/exception_pointer_unimplemented.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/new_handler_fallback.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/stdexcept_default.ipp create mode 100644 gnu/llvm/libcxx/src/support/runtime/stdexcept_vcruntime.ipp create mode 100644 gnu/llvm/libcxx/src/support/solaris/README create mode 100644 gnu/llvm/libcxx/src/support/solaris/mbsnrtowcs.inc create mode 100644 gnu/llvm/libcxx/src/support/solaris/wcsnrtombs.inc create mode 100644 gnu/llvm/libcxx/src/support/solaris/xlocale.cpp create mode 100644 gnu/llvm/libcxx/src/support/win32/locale_win32.cpp create mode 100644 gnu/llvm/libcxx/src/support/win32/support.cpp create mode 100644 gnu/llvm/libcxx/src/support/win32/thread_win32.cpp create mode 100644 gnu/llvm/libcxx/src/system_error.cpp create mode 100644 gnu/llvm/libcxx/src/thread.cpp create mode 100644 gnu/llvm/libcxx/src/typeinfo.cpp create mode 100644 gnu/llvm/libcxx/src/utility.cpp create mode 100644 gnu/llvm/libcxx/src/valarray.cpp create mode 100644 gnu/llvm/libcxx/src/variant.cpp create mode 100644 gnu/llvm/libcxx/src/vector.cpp create mode 100755 gnu/llvm/libcxx/utils/cat_files.py create mode 100755 gnu/llvm/libcxx/utils/ci/macos-backdeployment.sh create mode 100755 gnu/llvm/libcxx/utils/ci/macos-trunk.sh create mode 100644 gnu/llvm/libcxx/utils/docker/debian9/Dockerfile.base create mode 100644 gnu/llvm/libcxx/utils/docker/debian9/Dockerfile.buildbot create mode 100644 gnu/llvm/libcxx/utils/docker/debian9/Dockerfile.clang create mode 100644 gnu/llvm/libcxx/utils/docker/debian9/Dockerfile.compiler_zoo create mode 100644 gnu/llvm/libcxx/utils/docker/debian9/Dockerfile.gcc create mode 100644 gnu/llvm/libcxx/utils/docker/docker-compose.yml create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/build_gcc_version.sh create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/build_llvm_version.sh create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/docker_start_buildbots.sh create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/docker_update_bot.sh create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/install_clang_packages.sh create mode 100755 gnu/llvm/libcxx/utils/docker/scripts/run_buildbot.sh create mode 100644 gnu/llvm/libcxx/utils/gdb/libcxx/printers.py create mode 100755 gnu/llvm/libcxx/utils/generate_feature_test_macro_components.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/.clang-format create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/.gitignore create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/.travis-libcxx-setup.sh create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/.travis.yml create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/.ycm_extra_conf.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/AUTHORS create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/CONTRIBUTING.md create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/CONTRIBUTORS create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/LICENSE create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/README.LLVM create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/README.md create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/WORKSPACE create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/appveyor.yml create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/CXXFeatureCheck.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/Config.cmake.in create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/GetGitVersion.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/HandleGTest.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/benchmark.pc.in create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/gnu_posix_regex.cpp create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/llvm-toolchain.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/posix_regex.cpp create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/split_list.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/std_regex.cpp create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/steady_clock.cpp create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/cmake/thread_safety_attributes.cpp create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/docs/AssemblyTests.md create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/docs/tools.md create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/include/benchmark/benchmark.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/mingw.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/releasing.md create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/arraysize.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_api_internal.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_api_internal.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_main.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_register.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_register.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_runner.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/benchmark_runner.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/check.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/colorprint.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/colorprint.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/commandlineflags.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/commandlineflags.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/complexity.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/complexity.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/console_reporter.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/counter.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/counter.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/csv_reporter.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/cycleclock.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/internal_macros.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/json_reporter.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/log.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/mutex.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/re.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/reporter.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/sleep.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/sleep.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/statistics.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/statistics.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/string_util.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/string_util.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/sysinfo.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/thread_manager.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/thread_timer.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/timers.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/src/timers.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/AssemblyTests.cmake create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/CMakeLists.txt create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/basic_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/benchmark_gtest.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/benchmark_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/clobber_memory_assembly_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/complexity_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/cxx03_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/diagnostics_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/display_aggregates_only_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/donotoptimize_assembly_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/donotoptimize_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/filter_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/fixture_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/link_main_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/map_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/memory_manager_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/multiple_ranges_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/options_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/output_test.h create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/output_test_helper.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/register_benchmark_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/report_aggregates_only_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/reporter_output_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/skip_with_error_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/state_assembly_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/statistics_gtest.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/string_util_gtest.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/templated_fixture_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/user_counters_tabular_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/user_counters_test.cc create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/test/user_counters_thousands_test.cc create mode 100755 gnu/llvm/libcxx/utils/google-benchmark/tools/compare.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/Inputs/test2_run.json create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/Inputs/test3_run0.json create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/Inputs/test3_run1.json create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/__init__.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/report.py create mode 100644 gnu/llvm/libcxx/utils/google-benchmark/tools/gbench/util.py create mode 100755 gnu/llvm/libcxx/utils/google-benchmark/tools/strip_asm.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/__init__.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/compiler.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/sym_check/__init__.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/sym_check/diff.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/sym_check/extract.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/sym_check/match.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/sym_check/util.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/__init__.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/config.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/executor.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/format.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/googlebenchmark.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/target_info.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/test/tracing.py create mode 100644 gnu/llvm/libcxx/utils/libcxx/util.py create mode 100755 gnu/llvm/libcxx/utils/merge_archives.py create mode 100644 gnu/llvm/libcxx/utils/not.py create mode 100644 gnu/llvm/libcxx/utils/run.py create mode 100755 gnu/llvm/libcxx/utils/sym_diff.py create mode 100755 gnu/llvm/libcxx/utils/sym_extract.py create mode 100755 gnu/llvm/libcxx/utils/sym_match.py create mode 100644 gnu/llvm/libcxx/utils/symcheck-blacklists/linux_blacklist.txt create mode 100644 gnu/llvm/libcxx/utils/symcheck-blacklists/osx_blacklist.txt diff --git a/gnu/llvm/libcxx/CMakeLists.txt b/gnu/llvm/libcxx/CMakeLists.txt new file mode 100644 index 00000000000..60564dc96c7 --- /dev/null +++ b/gnu/llvm/libcxx/CMakeLists.txt @@ -0,0 +1,943 @@ +# See www/CMake.html for instructions on how to build libcxx with CMake. + +#=============================================================================== +# Setup Project +#=============================================================================== +cmake_minimum_required(VERSION 3.4.3) + +if(POLICY CMP0042) + cmake_policy(SET CMP0042 NEW) # Set MACOSX_RPATH=YES by default +endif() +if(POLICY CMP0022) + cmake_policy(SET CMP0022 NEW) # Required when interacting with LLVM and Clang +endif() +if(POLICY CMP0068) + cmake_policy(SET CMP0068 NEW) + set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON) +endif() + +# Add path for custom modules +set(CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" + ${CMAKE_MODULE_PATH} + ) + +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR LIBCXX_STANDALONE_BUILD) + project(libcxx CXX C) + + set(PACKAGE_NAME libcxx) + set(PACKAGE_VERSION 10.0.1) + set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") + set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org") + + # Find the LLVM sources and simulate LLVM CMake options. + include(HandleOutOfTreeLLVM) +endif() + +if (LIBCXX_STANDALONE_BUILD) + include(FindPythonInterp) + if( NOT PYTHONINTERP_FOUND ) + message(WARNING "Failed to find python interpreter. " + "The libc++ test suite will be disabled.") + set(LLVM_INCLUDE_TESTS OFF) + endif() +endif() + +# Require out of source build. +include(MacroEnsureOutOfSourceBuild) +MACRO_ENSURE_OUT_OF_SOURCE_BUILD( + "${PROJECT_NAME} requires an out of source build. Please create a separate + build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there." + ) +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") + message(STATUS "Configuring for clang-cl") + set(LIBCXX_TARGETING_CLANG_CL ON) +endif() + +if (MSVC) + set(LIBCXX_TARGETING_MSVC ON) + message(STATUS "Configuring for MSVC") +else() + set(LIBCXX_TARGETING_MSVC OFF) +endif() + +#=============================================================================== +# Setup CMake Options +#=============================================================================== +include(CMakeDependentOption) +include(HandleCompilerRT) + +# Basic options --------------------------------------------------------------- +option(LIBCXX_ENABLE_ASSERTIONS "Enable assertions independent of build mode." OFF) +option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON) +option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON) +option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON) +set(ENABLE_FILESYSTEM_DEFAULT ON) +if (WIN32) + set(ENABLE_FILESYSTEM_DEFAULT OFF) +endif() +option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of the main libc++ library" + ${ENABLE_FILESYSTEM_DEFAULT}) +option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS}) +option(LIBCXX_ENABLE_PARALLEL_ALGORITHMS "Enable the parallel algorithms library. This requires the PSTL to be available." OFF) +option(LIBCXX_TEST_GDB_PRETTY_PRINTERS "Test gdb pretty printers." OFF) + +# Benchmark options ----------------------------------------------------------- +option(LIBCXX_INCLUDE_BENCHMARKS "Build the libc++ benchmarks and their dependencies" ON) + +set(LIBCXX_BENCHMARK_TEST_ARGS_DEFAULT --benchmark_min_time=0.01) +set(LIBCXX_BENCHMARK_TEST_ARGS "${LIBCXX_BENCHMARK_TEST_ARGS_DEFAULT}" CACHE STRING + "Arguments to pass when running the benchmarks using check-cxx-benchmarks") + +set(LIBCXX_BENCHMARK_NATIVE_STDLIB "" CACHE STRING + "Build the benchmarks against the specified native STL. + The value must be one of libc++/libstdc++") +set(LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN "" CACHE STRING + "Use alternate GCC toolchain when building the native benchmarks") + +if (LIBCXX_BENCHMARK_NATIVE_STDLIB) + if (NOT (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++" + OR LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++")) + message(FATAL_ERROR "Invalid value for LIBCXX_BENCHMARK_NATIVE_STDLIB: " + "'${LIBCXX_BENCHMARK_NATIVE_STDLIB}'") + endif() +endif() + +option(LIBCXX_INCLUDE_DOCS "Build the libc++ documentation." ${LLVM_INCLUDE_DOCS}) +set(LIBCXX_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}" CACHE STRING + "Define suffix of library directory name (32/64)") +option(LIBCXX_INSTALL_HEADERS "Install the libc++ headers." ON) +option(LIBCXX_INSTALL_LIBRARY "Install the libc++ library." ON) +cmake_dependent_option(LIBCXX_INSTALL_STATIC_LIBRARY + "Install the static libc++ library." ON + "LIBCXX_ENABLE_STATIC;LIBCXX_INSTALL_LIBRARY" OFF) +cmake_dependent_option(LIBCXX_INSTALL_SHARED_LIBRARY + "Install the shared libc++ library." ON + "LIBCXX_ENABLE_SHARED;LIBCXX_INSTALL_LIBRARY" OFF) +option(LIBCXX_INSTALL_SUPPORT_HEADERS "Install libc++ support headers." ON) +cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY + "Install libc++experimental.a" ON + "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF) + +set(LIBCXX_ABI_VERSION "1" CACHE STRING "ABI version of libc++. Can be either 1 or 2, where 2 is currently not stable. Defaults to 1.") +set(LIBCXX_ABI_NAMESPACE "" CACHE STRING "The inline ABI namespace used by libc++. It defaults to __n where `n` is the current ABI version.") +option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF) +option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.") +option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.") + + +set(LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT "" CACHE STRING + "Whether typeinfo names are expected to be unique. Defining this option overrides the default configuration in the library.") +set(MERGED_TYPEINFO_VALUES ";ON;OFF") +set_property(CACHE LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT PROPERTY STRINGS ${MERGED_TYPEINFO_DEFAULTS}) +list(FIND MERGED_TYPEINFO_VALUES "${LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT}" IS_VALID_DEFAULT) +if (${IS_VALID_DEFAULT} EQUAL -1) + message(FATAL_ERROR "Value '${LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT}' is not a valid value for + LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT") +endif() + +option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by default. To be used by vendors." OFF) +set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header.") +option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) +set(LIBCXX_LIBCPPABI_VERSION "2" CACHE STRING "Version of libc++abi's ABI to re-export from libc++ when re-exporting is enabled. + Note that this is not related to the version of libc++'s ABI itself!") + +# ABI Library options --------------------------------------------------------- +set(LIBCXX_CXX_ABI "default" CACHE STRING + "Specify C++ ABI library to use.") +set(CXXABIS none default libcxxabi libcxxrt libstdc++ libsupc++ vcruntime) +set_property(CACHE LIBCXX_CXX_ABI PROPERTY STRINGS ;${CXXABIS}) + +# FIXME: This is a temporary hack to get the buildbots working while D63883 is in flight. +# Without this all the bots fail while building libc++ +if (DEFINED ENV{USER}) + if (("$ENV{USER}" STREQUAL "buildbot") OR (("$ENV{USER}" STREQUAL "llvmbb") OR ("$ENV{USER}" STREQUAL "buildslave"))) + if (LIBCXX_CXX_ABI STREQUAL "libcxxabi" AND NOT DEFINED LIBCXX_CXX_ABI_INCLUDE_PATHS) + message(WARNING "OVERRIDING BUILDBOT CONFIG") + set(LIBCXX_CXX_ABI "default" CACHE STRING "FIXME" FORCE) + endif() + endif() +endif() +# Setup the default options if LIBCXX_CXX_ABI is not specified. +if (LIBCXX_CXX_ABI STREQUAL "default") + find_path( + LIBCXX_LIBCXXABI_INCLUDES_INTERNAL cxxabi.h + PATHS ${LLVM_MAIN_SRC_DIR}/projects/libcxxabi/include + ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include + ${LLVM_MAIN_SRC_DIR}/../libcxxabi/include + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH + ) + if (LIBCXX_TARGETING_MSVC) + # FIXME: Figure out how to configure the ABI library on Windows. + set(LIBCXX_CXX_ABI_LIBNAME "vcruntime") + elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND + IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") + set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}") + set(LIBCXX_CXX_ABI_INTREE 1) + elseif (APPLE) + set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi") + set(LIBCXX_CXX_ABI_SYSTEM 1) + elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") + set(LIBCXX_CXX_ABI_LIBNAME "libcxxrt") + set(LIBCXX_CXX_ABI_INCLUDE_PATHS "/usr/include/c++/v1") + else() + set(LIBCXX_CXX_ABI_LIBNAME "default") + endif() +else() + set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}") +endif() + +option(LIBCXX_ENABLE_STATIC_ABI_LIBRARY + "Use a static copy of the ABI library when linking libc++. + This option cannot be used with LIBCXX_ENABLE_ABI_LINKER_SCRIPT." OFF) + +cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY + "Statically link the ABI library to static library" ON + "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_STATIC" OFF) + +cmake_dependent_option(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY + "Statically link the ABI library to shared library" ON + "LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_ENABLE_SHARED" OFF) + +# Generate and install a linker script inplace of libc++.so. The linker script +# will link libc++ to the correct ABI library. This option is on by default +# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY' +# is on. This option is also disabled when the ABI library is not specified +# or is specified to be "none". +set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF) +if (LLVM_HAVE_LINK_VERSION_SCRIPT AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY + AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "none" + AND NOT LIBCXX_CXX_ABI_LIBNAME STREQUAL "default" + AND PYTHONINTERP_FOUND + AND LIBCXX_ENABLE_SHARED) + set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE ON) +endif() + +option(LIBCXX_ENABLE_ABI_LINKER_SCRIPT + "Use and install a linker script for the given ABI library" + ${ENABLE_LINKER_SCRIPT_DEFAULT_VALUE}) + +option(LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS + "Build libc++ with definitions for operator new/delete. This option can + be used to disable the definitions when libc++abi is expected to provide + them" ON) + +# Build libc++abi with libunwind. We need this option to determine whether to +# link with libunwind or libgcc_s while running the test cases. +option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF) +option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF) + +# Target options -------------------------------------------------------------- +option(LIBCXX_BUILD_32_BITS "Build 32 bit libc++." ${LLVM_BUILD_32_BITS}) +set(LIBCXX_TARGET_TRIPLE "" CACHE STRING "Use alternate target triple.") +set(LIBCXX_SYSROOT "" CACHE STRING "Use alternate sysroot.") +set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.") + +# Feature options ------------------------------------------------------------- +option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON) +option(LIBCXX_ENABLE_RTTI "Use run time type information." ON) +option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON) +option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON) +option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON) +option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON) +option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON) +option(LIBCXX_ENABLE_MONOTONIC_CLOCK + "Build libc++ with support for a monotonic clock. + This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON) +option(LIBCXX_HAS_MUSL_LIBC "Build libc++ with support for the Musl C library" OFF) +option(LIBCXX_HAS_PTHREAD_API "Ignore auto-detection and force use of pthread API" OFF) +option(LIBCXX_HAS_WIN32_THREAD_API "Ignore auto-detection and force use of win32 thread API" OFF) +option(LIBCXX_HAS_EXTERNAL_THREAD_API + "Build libc++ with an externalized threading API. + This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON." OFF) +option(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY + "Build libc++ with an externalized threading library. + This option may only be set to ON when LIBCXX_ENABLE_THREADS=ON" OFF) + +# Misc options ---------------------------------------------------------------- +# FIXME: Turn -pedantic back ON. It is currently off because it warns +# about #include_next which is used everywhere. +option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF) +option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) +option(LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS "Disable #warnings about conflicting macros." OFF) + +option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF) +set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING + "The Profile-rt library used to build with code coverage") + +# Don't allow a user to accidentally overwrite the system libc++ installation on Darwin. +# If the user specifies -DCMAKE_INSTALL_PREFIX=/usr the install rules for libc++ +# will not be generated and a warning will be issued. +option(LIBCXX_OVERRIDE_DARWIN_INSTALL "Enable overwriting darwins libc++ installation." OFF) +mark_as_advanced(LIBCXX_OVERRIDE_DARWIN_INSTALL) # Don't show this option by default. + +if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT LIBCXX_OVERRIDE_DARWIN_INSTALL) + if ("${CMAKE_INSTALL_PREFIX}" STREQUAL "/usr") + message(WARNING "Disabling libc++ install rules because installation would " + "overwrite the systems installation. Configure with " + "-DLIBCXX_OVERRIDE_DARWIN_INSTALL=ON to suppress this behaviour.") + mark_as_advanced(CLEAR LIBCXX_OVERRIDE_DARWIN_INSTALL) # Show the override option. + set(LIBCXX_INSTALL_HEADERS OFF) + set(LIBCXX_INSTALL_LIBRARY OFF) + endif() +endif() + +set(LIBCXX_CONFIGURE_IDE_DEFAULT OFF) +if (XCODE OR MSVC_IDE) + set(LIBCXX_CONFIGURE_IDE_DEFAULT ON) +endif() +option(LIBCXX_CONFIGURE_IDE "Configure libcxx for use within an IDE" + ${LIBCXX_CONFIGURE_IDE_DEFAULT}) + +option(LIBCXX_HERMETIC_STATIC_LIBRARY + "Do not export any symbols from the static library." OFF) + +#=============================================================================== +# Check option configurations +#=============================================================================== + +# Ensure LIBCXX_ENABLE_MONOTONIC_CLOCK is set to ON only when +# LIBCXX_ENABLE_THREADS is on. +if(LIBCXX_ENABLE_THREADS AND NOT LIBCXX_ENABLE_MONOTONIC_CLOCK) + message(FATAL_ERROR "LIBCXX_ENABLE_MONOTONIC_CLOCK can only be set to OFF" + " when LIBCXX_ENABLE_THREADS is also set to OFF.") +endif() + +if(NOT LIBCXX_ENABLE_THREADS) + if(LIBCXX_HAS_PTHREAD_API) + message(FATAL_ERROR "LIBCXX_HAS_PTHREAD_API can only be set to ON" + " when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() + if(LIBCXX_HAS_EXTERNAL_THREAD_API) + message(FATAL_ERROR "LIBCXX_HAS_EXTERNAL_THREAD_API can only be set to ON" + " when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() + if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) + message(FATAL_ERROR "LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY can only be set " + "to ON when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "LIBCXX_HAS_WIN32_THREAD_API can only be set to ON" + " when LIBCXX_ENABLE_THREADS is also set to ON.") + endif() + +endif() + +if (LIBCXX_HAS_EXTERNAL_THREAD_API) + if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) + message(FATAL_ERROR "The options LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY and " + "LIBCXX_HAS_EXTERNAL_THREAD_API cannot both be ON at " + "the same time") + endif() + if (LIBCXX_HAS_PTHREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" + "and LIBCXX_HAS_PTHREAD_API cannot be both" + "set to ON at the same time.") + endif() + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_EXTERNAL_THREAD_API" + "and LIBCXX_HAS_WIN32_THREAD_API cannot be both" + "set to ON at the same time.") + endif() +endif() + +if (LIBCXX_HAS_PTHREAD_API) + if (LIBCXX_HAS_WIN32_THREAD_API) + message(FATAL_ERROR "The options LIBCXX_HAS_PTHREAD_API" + "and LIBCXX_HAS_WIN32_THREAD_API cannot be both" + "set to ON at the same time.") + endif() +endif() + +# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE +# is ON. +if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE) + message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE") +endif() + +# Set LIBCXX_BUILD_32_BITS to (LIBCXX_BUILD_32_BITS OR LLVM_BUILD_32_BITS) +# and check that we can build with 32 bits if requested. +if (CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32) + if (LIBCXX_BUILD_32_BITS AND NOT LLVM_BUILD_32_BITS) # Don't duplicate the output from LLVM + message(STATUS "Building 32 bits executables and libraries.") + endif() +elseif(LIBCXX_BUILD_32_BITS) + message(FATAL_ERROR "LIBCXX_BUILD_32_BITS=ON is not supported on this platform.") +endif() + +# Warn users that LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option. +if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY) + message(WARNING "LIBCXX_ENABLE_STATIC_ABI_LIBRARY is an experimental option") + if (LIBCXX_ENABLE_STATIC AND NOT PYTHONINTERP_FOUND) + message(FATAL_ERROR "LIBCXX_ENABLE_STATIC_ABI_LIBRARY requires python but it was not found.") + endif() +endif() + +if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT) + if (APPLE) + message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT cannot be used on APPLE targets") + endif() + if (NOT LIBCXX_ENABLE_SHARED) + message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT is only available for shared library builds.") + endif() +endif() + +if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT) + message(FATAL_ERROR "Conflicting options given. + LIBCXX_ENABLE_STATIC_ABI_LIBRARY cannot be specified with + LIBCXX_ENABLE_ABI_LINKER_SCRIPT") +endif() + +if (LIBCXX_HAS_MUSL_LIBC AND NOT LIBCXX_INSTALL_SUPPORT_HEADERS) + message(FATAL_ERROR "LIBCXX_INSTALL_SUPPORT_HEADERS can not be turned off" + "when building for Musl with LIBCXX_HAS_MUSL_LIBC.") +endif() + +if (LIBCXX_ABI_FORCE_ITANIUM AND LIBCXX_ABI_FORCE_MICROSOFT) + message(FATAL_ERROR "Only one of LIBCXX_ABI_FORCE_ITANIUM and LIBCXX_ABI_FORCE_MICROSOFT can be specified.") +endif () + +#=============================================================================== +# Configure System +#=============================================================================== + +set(LIBCXX_COMPILER ${CMAKE_CXX_COMPILER}) +set(LIBCXX_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +set(LIBCXX_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build") + +string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION + ${PACKAGE_VERSION}) + +if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR AND NOT APPLE) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) + set(LIBCXX_INSTALL_LIBRARY_DIR lib${LLVM_LIBDIR_SUFFIX}/${LLVM_DEFAULT_TARGET_TRIPLE}/c++) + if(LIBCXX_LIBDIR_SUBDIR) + string(APPEND LIBCXX_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + string(APPEND LIBCXX_INSTALL_LIBRARY_DIR /${LIBCXX_LIBDIR_SUBDIR}) + endif() +elseif(LLVM_LIBRARY_OUTPUT_INTDIR) + set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR}) + set(LIBCXX_HEADER_DIR ${LLVM_BINARY_DIR}) + set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) +else() + set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX}) + set(LIBCXX_INSTALL_LIBRARY_DIR lib${LIBCXX_LIBDIR_SUFFIX}) +endif() + +file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}") + +set(LIBCXX_INSTALL_PREFIX "" CACHE STRING "Define libc++ destination prefix.") +set(LIBCXX_INSTALL_HEADER_PREFIX "" CACHE STRING "Define libc++ header destination prefix.") + +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR}) + +# Declare libc++ configuration variables. +# They are intended for use as follows: +# LIBCXX_CXX_FLAGS: General flags for both the compiler and linker. +# LIBCXX_COMPILE_FLAGS: Compile only flags. +# LIBCXX_LINK_FLAGS: Linker only flags. +# LIBCXX_LIBRARIES: libraries libc++ is linked to. +set(LIBCXX_COMPILE_FLAGS "") +set(LIBCXX_LINK_FLAGS "") +set(LIBCXX_LIBRARIES "") + +# Include macros for adding and removing libc++ flags. +include(HandleLibcxxFlags) + +# Target flags ================================================================ +# These flags get added to CMAKE_CXX_FLAGS and CMAKE_C_FLAGS so that +# 'config-ix' use them during feature checks. It also adds them to both +# 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS' +add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32") + +if(LIBCXX_TARGET_TRIPLE) + add_target_flags("--target=${LIBCXX_TARGET_TRIPLE}") +elseif(CMAKE_CXX_COMPILER_TARGET) + set(LIBCXX_TARGET_TRIPLE "${CMAKE_CXX_COMPILER_TARGET}") +endif() +if(LIBCXX_SYSROOT) + add_target_flags("--sysroot=${LIBCXX_SYSROOT}") +elseif(CMAKE_SYSROOT) + set(LIBCXX_SYSROOT "${CMAKE_SYSROOT}") +endif() +if(LIBCXX_GCC_TOOLCHAIN) + add_target_flags("--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}") +elseif(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) + set(LIBCXX_GCC_TOOLCHAIN "${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") +endif() + +if(LIBCXX_TARGET_TRIPLE) + set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}") +endif() + +# Configure compiler. +include(config-ix) + +# Configure coverage options. +if (LIBCXX_GENERATE_COVERAGE) + include(CodeCoverage) + set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE) +endif() + +string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE) +if (uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") + set(LIBCXX_DEBUG_BUILD ON) +else() + set(LIBCXX_DEBUG_BUILD OFF) +endif() + +#=============================================================================== +# Setup Compiler Flags +#=============================================================================== + +include(HandleLibCXXABI) # Setup the ABI library flags + +if (NOT LIBCXX_STANDALONE_BUILD) + # Remove flags that may have snuck in. + remove_flags(-DNDEBUG -UNDEBUG -D_DEBUG + -lc++abi) +endif() +remove_flags(-stdlib=libc++ -stdlib=libstdc++) + +# FIXME: Remove all debug flags and flags that change which Windows +# default libraries are linked. Currently we only support linking the +# non-debug DLLs +remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md") + +# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC. +# Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors +# so they don't get transformed into -Wno and -errors respectively. +remove_flags(-Wno-pedantic -pedantic-errors -pedantic) + +# Required flags ============================================================== +function(cxx_add_basic_build_flags target) + + # Require C++14 for all targets. C++14 is needed to ensure constant + # initialization for certain globals (ex global memory resources). + set_target_properties(${target} PROPERTIES + CXX_STANDARD 14 + CXX_STANDARD_REQUIRED YES + CXX_EXTENSIONS NO) + + # On all systems the system c++ standard library headers need to be excluded. + # MSVC only has -X, which disables all default includes; including the crt. + # Thus, we do nothing and hope we don't accidentally include any of the C++ + # headers + target_add_compile_flags_if_supported(${target} PUBLIC -nostdinc++) + + # Hide all inline function definitions which have not explicitly been marked + # visible. This prevents new definitions for inline functions from appearing in + # the dylib when get ODR used by another function. + target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility-inlines-hidden) + + # Our visibility annotations are not quite right for non-Clang compilers, + # so we end up not exporting all the symbols we should. In the future, we + # can improve the situation by providing an explicit list of exported + # symbols on all compilers. + if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + target_add_compile_flags_if_supported(${target} PRIVATE -fvisibility=hidden) + endif() + + if (LIBCXX_CONFIGURE_IDE) + # This simply allows IDE to process + target_add_compile_flags_if_supported(${target} PRIVATE -fcoroutines-ts) + endif() + + # Let the library headers know they are currently being used to build the + # library. + target_compile_definitions(${target} PRIVATE -D_LIBCPP_BUILDING_LIBRARY) + + if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_NEW_DELETE_DEFINITIONS) + endif() + + if (LIBCXX_HAS_COMMENT_LIB_PRAGMA) + if (LIBCXX_HAS_PTHREAD_LIB) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_PTHREAD_LIB) + endif() + if (LIBCXX_HAS_RT_LIB) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_LINK_RT_LIB) + endif() + endif() +endfunction() + +# Warning flags =============================================================== +function(cxx_add_warning_flags target) + target_compile_definitions(${target} PUBLIC -D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) + target_add_compile_flags_if_supported(${target} PRIVATE -Wall -Wextra -W -Wwrite-strings + -Wno-unused-parameter -Wno-long-long + -Werror=return-type -Wextra-semi) + if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") + target_add_compile_flags_if_supported(${target} PRIVATE + -Wno-user-defined-literals + -Wno-covered-switch-default + -Wno-ignored-attributes # FIXME: Caused by _LIBCPP_NODEBUG_TYPE not being supported on older clangs + ) + if (LIBCXX_TARGETING_CLANG_CL) + target_add_compile_flags_if_supported(${target} PRIVATE + -Wno-c++98-compat + -Wno-c++98-compat-pedantic + -Wno-c++11-compat + -Wno-undef + -Wno-reserved-id-macro + -Wno-gnu-include-next + -Wno-gcc-compat # For ignoring "'diagnose_if' is a clang extension" warnings + -Wno-zero-as-null-pointer-constant # FIXME: Remove this and fix all occurrences. + -Wno-deprecated-dynamic-exception-spec # For auto_ptr + -Wno-sign-conversion + -Wno-old-style-cast + -Wno-deprecated # FIXME: Remove this and fix all occurrences. + -Wno-shift-sign-overflow # FIXME: Why do we need this with clang-cl but not clang? + -Wno-double-promotion # FIXME: remove me + ) + endif() + elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + target_add_compile_flags_if_supported(${target} PRIVATE + -Wno-literal-suffix + -Wno-c++14-compat + -Wno-noexcept-type) + endif() + if (LIBCXX_ENABLE_WERROR) + target_add_compile_flags_if_supported(${target} PRIVATE -Werror) + target_add_compile_flags_if_supported(${target} PRIVATE -WX) + else() + # TODO(EricWF) Remove this. We shouldn't be suppressing errors when -Werror is + # added elsewhere. + target_add_compile_flags_if_supported(${target} PRIVATE -Wno-error) + endif() + if (LIBCXX_ENABLE_PEDANTIC) + target_add_compile_flags_if_supported(${target} PRIVATE -pedantic) + endif() + if (LIBCXX_DISABLE_MACRO_CONFLICT_WARNINGS) + target_compile_definitions(${target} PRIVATE -D_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS) + endif() +endfunction() + +# Exception flags ============================================================= +function(cxx_add_exception_flags target) + if (LIBCXX_ENABLE_EXCEPTIONS) + # Catches C++ exceptions only and tells the compiler to assume that extern C + # functions never throw a C++ exception. + target_add_compile_flags_if_supported(${target} PUBLIC -EHsc) + else() + target_compile_definitions(${target} PUBLIC -D_LIBCPP_NO_EXCEPTIONS) + target_add_compile_flags_if_supported(${target} PUBLIC -EHs- -EHa-) + target_add_compile_flags_if_supported(${target} PUBLIC -fno-exceptions) + endif() +endfunction() + +# RTTI flags ================================================================== +function(cxx_add_rtti_flags target) + if (NOT LIBCXX_ENABLE_RTTI) + target_compile_definitions(${target} PUBLIC -D_LIBCPP_NO_RTTI) + target_add_compile_flags_if_supported(${target} PUBLIC -GR-) + target_add_compile_flags_if_supported(${target} PUBLIC -fno-rtti) + endif() +endfunction() + +# Threading flags ============================================================= +if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY AND LIBCXX_ENABLE_SHARED) + # Need to allow unresolved symbols if this is to work with shared library builds + if (APPLE) + add_link_flags("-undefined dynamic_lookup") + else() + # Relax this restriction from HandleLLVMOptions + string(REPLACE "-Wl,-z,defs" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}") + endif() +endif() + +# Assertion flags ============================================================= +define_if(LIBCXX_ENABLE_ASSERTIONS -UNDEBUG) +define_if_not(LIBCXX_ENABLE_ASSERTIONS -DNDEBUG) +define_if(LIBCXX_ENABLE_ASSERTIONS -D_LIBCPP_DEBUG=0) +define_if(LIBCXX_DEBUG_BUILD -D_DEBUG) +if (LIBCXX_ENABLE_ASSERTIONS AND NOT LIBCXX_DEBUG_BUILD) + # MSVC doesn't like _DEBUG on release builds. See PR 4379. + define_if_not(LIBCXX_TARGETING_MSVC -D_DEBUG) +endif() + +# Modules flags =============================================================== +# FIXME The libc++ sources are fundamentally non-modular. They need special +# versions of the headers in order to provide C++03 and legacy ABI definitions. +# NOTE: The public headers can be used with modules in all other contexts. +function(cxx_add_module_flags target) + if (LLVM_ENABLE_MODULES) + # Ignore that the rest of the modules flags are now unused. + target_add_compile_flags_if_supported(${target} PUBLIC -Wno-unused-command-line-argument) + target_compile_options(${target} PUBLIC -fno-modules) + endif() +endfunction() + +# Sanitizer flags ============================================================= + +function(get_sanitizer_flags OUT_VAR USE_SANITIZER) + set(SANITIZER_FLAGS) + set(USE_SANITIZER "${USE_SANITIZER}") + # NOTE: LLVM_USE_SANITIZER checks for a UNIX like system instead of MSVC. + # But we don't have LLVM_ON_UNIX so checking for MSVC is the best we can do. + if (USE_SANITIZER AND NOT MSVC) + append_flags_if_supported(SANITIZER_FLAGS "-fno-omit-frame-pointer") + append_flags_if_supported(SANITIZER_FLAGS "-gline-tables-only") + + if (NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" AND + NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO") + append_flags_if_supported(SANITIZER_FLAGS "-gline-tables-only") + endif() + if (USE_SANITIZER STREQUAL "Address") + append_flags(SANITIZER_FLAGS "-fsanitize=address") + elseif (USE_SANITIZER MATCHES "Memory(WithOrigins)?") + append_flags(SANITIZER_FLAGS -fsanitize=memory) + if (USE_SANITIZER STREQUAL "MemoryWithOrigins") + append_flags(SANITIZER_FLAGS "-fsanitize-memory-track-origins") + endif() + elseif (USE_SANITIZER STREQUAL "Undefined") + append_flags(SANITIZER_FLAGS "-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all") + elseif (USE_SANITIZER STREQUAL "Thread") + append_flags(SANITIZER_FLAGS -fsanitize=thread) + else() + message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${USE_SANITIZER}") + endif() + elseif(USE_SANITIZER AND MSVC) + message(WARNING "LLVM_USE_SANITIZER is not supported on this platform.") + endif() + set(${OUT_VAR} "${SANITIZER_FLAGS}" PARENT_SCOPE) +endfunction() + +# Configure for sanitizers. If LIBCXX_STANDALONE_BUILD then we have to do +# the flag translation ourselves. Othewise LLVM's CMakeList.txt will handle it. +if (LIBCXX_STANDALONE_BUILD) + set(LLVM_USE_SANITIZER "" CACHE STRING + "Define the sanitizer used to build the library and tests") +endif() +get_sanitizer_flags(SANITIZER_FLAGS "${LLVM_USE_SANITIZER}") +if (LIBCXX_STANDALONE_BUILD AND SANITIZER_FLAGS) + add_flags(${SANITIZER_FLAGS}) +endif() + +# Link system libraries ======================================================= +function(cxx_link_system_libraries target) + target_add_link_flags_if_supported(${target} PRIVATE "-nodefaultlibs") + target_add_compile_flags_if_supported(${target} PRIVATE "/Zl") + target_add_link_flags_if_supported(${target} PRIVATE "/nodefaultlib") + + if (LIBCXX_HAS_SYSTEM_LIB) + target_link_libraries(${target} PRIVATE System) + endif() + + if (LIBCXX_HAS_PTHREAD_LIB) + target_link_libraries(${target} PRIVATE pthread) + endif() + + if (LIBCXX_HAS_C_LIB) + target_link_libraries(${target} PRIVATE c) + endif() + + if (LIBCXX_HAS_M_LIB) + target_link_libraries(${target} PRIVATE m) + endif() + + if (LIBCXX_HAS_RT_LIB) + target_link_libraries(${target} PRIVATE rt) + endif() + + if (LIBCXX_USE_COMPILER_RT) + find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY) + if (LIBCXX_BUILTINS_LIBRARY) + target_link_libraries(${target} PRIVATE "${LIBCXX_BUILTINS_LIBRARY}") + endif() + elseif (LIBCXX_HAS_GCC_S_LIB) + target_link_libraries(${target} PRIVATE gcc_s) + endif() + + if (LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB) + target_link_libraries(${target} PRIVATE atomic) + endif() + + if (MINGW) + target_link_libraries(${target} PRIVATE "${MINGW_LIBRARIES}") + endif() + + if (LIBCXX_TARGETING_MSVC) + if (LIBCXX_DEBUG_BUILD) + set(LIB_SUFFIX "d") + else() + set(LIB_SUFFIX "") + endif() + + target_link_libraries(${target} PRIVATE ucrt${LIB_SUFFIX}) # Universal C runtime + target_link_libraries(${target} PRIVATE vcruntime${LIB_SUFFIX}) # C++ runtime + target_link_libraries(${target} PRIVATE msvcrt${LIB_SUFFIX}) # C runtime startup files + target_link_libraries(${target} PRIVATE msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals. + # Required for standards-complaint wide character formatting functions + # (e.g. `printfw`/`scanfw`) + target_link_libraries(${target} PRIVATE iso_stdio_wide_specifiers) + endif() +endfunction() + +# Windows-related flags ======================================================= +function(cxx_add_windows_flags target) + if(WIN32 AND NOT MINGW) + target_compile_definitions(${target} PRIVATE + # Ignore the -MSC_VER mismatch, as we may build + # with a different compatibility version. + _ALLOW_MSC_VER_MISMATCH + # Don't check the msvcprt iterator debug levels + # as we will define the iterator types; libc++ + # uses a different macro to identify the debug + # level. + _ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH + # We are building the c++ runtime, don't pull in + # msvcprt. + _CRTBLD + # Don't warn on the use of "deprecated" + # "insecure" functions which are standards + # specified. + _CRT_SECURE_NO_WARNINGS + # Use the ISO conforming behaviour for conversion + # in printf, scanf. + _CRT_STDIO_ISO_WIDE_SPECIFIERS) + endif() +endfunction() + +# Configuration file flags ===================================================== +if (NOT LIBCXX_ABI_VERSION EQUAL 1) + config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION) +endif() +if (NOT LIBCXX_ABI_NAMESPACE STREQUAL "") + if (NOT LIBCXX_ABI_NAMESPACE MATCHES "__.*") + message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE must be a reserved identifier.") + endif() + if (LIBCXX_ABI_NAMESPACE MATCHES "__[0-9]+$") + message(FATAL_ERROR "LIBCXX_ABI_NAMESPACE '${LIBCXX_ABI_NAMESPACE}' is reserved for use by libc++.") + endif() + config_define(${LIBCXX_ABI_NAMESPACE} _LIBCPP_ABI_NAMESPACE) +endif() +config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE) +config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM) +config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT) +config_define_if(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT) +config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE) +config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN) +config_define_if_not(LIBCXX_ENABLE_STDOUT _LIBCPP_HAS_NO_STDOUT) +config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS) +config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK) +config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS) +if (NOT LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT STREQUAL "") + config_define("${LIBCXX_HAS_MERGED_TYPEINFO_NAMES_DEFAULT}" _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT) +endif() + +config_define_if(LIBCXX_HAS_PTHREAD_API _LIBCPP_HAS_THREAD_API_PTHREAD) +config_define_if(LIBCXX_HAS_EXTERNAL_THREAD_API _LIBCPP_HAS_THREAD_API_EXTERNAL) +config_define_if(LIBCXX_HAS_WIN32_THREAD_API _LIBCPP_HAS_THREAD_API_WIN32) +config_define_if(LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY _LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) +config_define_if(LIBCXX_HAS_MUSL_LIBC _LIBCPP_HAS_MUSL_LIBC) +config_define_if(LIBCXX_NO_VCRUNTIME _LIBCPP_NO_VCRUNTIME) +config_define_if(LIBCXX_ENABLE_PARALLEL_ALGORITHMS _LIBCPP_HAS_PARALLEL_ALGORITHMS) + +if (LIBCXX_ABI_DEFINES) + set(abi_defines) + foreach (abi_define ${LIBCXX_ABI_DEFINES}) + if (NOT abi_define MATCHES "^_LIBCPP_ABI_") + message(SEND_ERROR "Invalid ABI macro ${abi_define} in LIBCXX_ABI_DEFINES") + endif() + list(APPEND abi_defines "#define ${abi_define}") + endforeach() + string(REPLACE ";" "\n" abi_defines "${abi_defines}") + config_define(${abi_defines} _LIBCPP_ABI_DEFINES) +endif() + +# By default libc++ on Windows expects to use a shared library, which requires +# the headers to use DLL import/export semantics. However when building a +# static library only we modify the headers to disable DLL import/export. +if (DEFINED WIN32 AND LIBCXX_ENABLE_STATIC AND NOT LIBCXX_ENABLE_SHARED) + message(STATUS "Generating custom __config for non-DLL Windows build") + config_define(ON _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) +endif() + +set(site_config_path "${LIBCXX_BINARY_DIR}/__config_site") +if (LIBCXX_NEEDS_SITE_CONFIG) + configure_file("include/__config_site.in" + "${site_config_path}" + @ONLY) +elseif(EXISTS "${site_config_path}") + message(STATUS "Removing stale site configuration ${site_config_path}") + file(REMOVE "${site_config_path}") +endif() + +function(cxx_add_config_site target) + if (LIBCXX_NEEDS_SITE_CONFIG) + if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") + target_compile_options(${target} PUBLIC "/FI\"${site_config_path}\"") + else() + target_compile_options(${target} PUBLIC -include "${site_config_path}") + endif() + endif() +endfunction() + +# Setup all common build flags ================================================= +function(cxx_add_common_build_flags target) + cxx_add_basic_build_flags(${target}) + cxx_add_warning_flags(${target}) + cxx_add_windows_flags(${target}) + cxx_add_config_site(${target}) + cxx_add_exception_flags(${target}) + cxx_add_rtti_flags(${target}) + cxx_add_module_flags(${target}) + cxx_link_system_libraries(${target}) +endfunction() + +#=============================================================================== +# Setup Source Code And Tests +#=============================================================================== +include_directories(include) +add_subdirectory(include) +add_subdirectory(src) + +set(LIBCXX_TEST_DEPS "") + +if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY) + list(APPEND LIBCXX_TEST_DEPS cxx_experimental) +endif() + +if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY) + list(APPEND LIBCXX_TEST_DEPS cxx_external_threads) +endif() + +if (LIBCXX_INCLUDE_BENCHMARKS) + add_subdirectory(benchmarks) +endif() + +# Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or +# LLVM_FOUND is OFF. This allows users to run the tests manually using +# LIT without requiring a full LLVM checkout. +# +# However, since some submission systems strip test/ subdirectories, check for +# it before adding it. + +if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") + add_subdirectory(test) +endif() +if (LIBCXX_INCLUDE_TESTS) + add_subdirectory(lib/abi) +endif() + +if (LIBCXX_STANDALONE_BUILD AND EXISTS "${LLVM_MAIN_SRC_DIR}/utils/llvm-lit") + include(AddLLVM) # for get_llvm_lit_path + # Make sure the llvm-lit script is generated into the bin directory, and do + # it after adding all tests, since the generated script will only work + # correctly discovered tests against test locations from the source tree that + # have already been discovered. + add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit + ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit) +endif() + +if (LIBCXX_INCLUDE_DOCS) + add_subdirectory(docs) +endif() diff --git a/gnu/llvm/libcxx/CREDITS.TXT b/gnu/llvm/libcxx/CREDITS.TXT new file mode 100644 index 00000000000..f97b9d82277 --- /dev/null +++ b/gnu/llvm/libcxx/CREDITS.TXT @@ -0,0 +1,154 @@ +This file is a partial list of people who have contributed to the LLVM/libc++ +project. If you have contributed a patch or made some other contribution to +LLVM/libc++, please submit a patch to this file to add yourself, and it will be +done! + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Saleem Abdulrasool +E: compnerd@compnerd.org +D: Minor patches and Linux fixes. + +N: Dan Albert +E: danalbert@google.com +D: Android support and test runner improvements. + +N: Dimitry Andric +E: dimitry@andric.com +D: Visibility fixes, minor FreeBSD portability patches. + +N: Holger Arnold +E: holgerar@gmail.com +D: Minor fix. + +N: Ruben Van Boxem +E: vanboxem dot ruben at gmail dot com +D: Initial Windows patches. + +N: David Chisnall +E: theraven at theravensnest dot org +D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. + +N: Marshall Clow +E: mclow.lists@gmail.com +E: marshall@idio.com +D: C++14 support, patches and bug fixes. + +N: Jonathan B Coe +E: jbcoe@me.com +D: Implementation of propagate_const. + +N: Glen Joseph Fernandes +E: glenjofe@gmail.com +D: Implementation of to_address. + +N: Eric Fiselier +E: eric@efcs.ca +D: LFTS support, patches and bug fixes. + +N: Bill Fisher +E: william.w.fisher@gmail.com +D: Regex bug fixes. + +N: Matthew Dempsky +E: matthew@dempsky.org +D: Minor patches and bug fixes. + +N: Google Inc. +D: Copyright owner and contributor of the CityHash algorithm + +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of libc++ + +N: Sergej Jaskiewicz +E: jaskiewiczs@icloud.com +D: Minor improvements in the testing infrastructure + +N: Hyeon-bin Jeong +E: tuhertz@gmail.com +D: Minor patches and bug fixes. + +N: Argyrios Kyrtzidis +E: kyrtzidis@apple.com +D: Bug fixes. + +N: Bruce Mitchener, Jr. +E: bruce.mitchener@gmail.com +D: Emscripten-related changes. + +N: Michel Morin +E: mimomorin@gmail.com +D: Minor patches to is_convertible. + +N: Andrew Morrow +E: andrew.c.morrow@gmail.com +D: Minor patches and Linux fixes. + +N: Michael Park +E: mcypark@gmail.com +D: Implementation of . + +N: Arvid Picciani +E: aep at exys dot org +D: Minor patches and musl port. + +N: Bjorn Reese +E: breese@users.sourceforge.net +D: Initial regex prototype + +N: Nico Rieck +E: nico.rieck@gmail.com +D: Windows fixes + +N: Jon Roelofs +E: jroelofS@jroelofs.com +D: Remote testing, Newlib port, baremetal/single-threaded support. + +N: Jonathan Sauer +D: Minor patches, mostly related to constexpr + +N: Craig Silverstein +E: csilvers@google.com +D: Implemented Cityhash as the string hash function on 64-bit machines + +N: Richard Smith +D: Minor patches. + +N: Joerg Sonnenberger +E: joerg@NetBSD.org +D: NetBSD port. + +N: Stephan Tolksdorf +E: st@quanttec.com +D: Minor fix + +N: Michael van der Westhuizen +E: r1mikey at gmail dot com + +N: Larisse Voufo +D: Minor patches. + +N: Klaas de Vries +E: klaas at klaasgaaf dot nl +D: Minor bug fix. + +N: Zhang Xiongpang +E: zhangxiongpang@gmail.com +D: Minor patches and bug fixes. + +N: Xing Xue +E: xingxue@ca.ibm.com +D: AIX port + +N: Zhihao Yuan +E: lichray@gmail.com +D: Standard compatibility fixes. + +N: Jeffrey Yasskin +E: jyasskin@gmail.com +E: jyasskin@google.com +D: Linux fixes. diff --git a/gnu/llvm/libcxx/LICENSE.TXT b/gnu/llvm/libcxx/LICENSE.TXT new file mode 100644 index 00000000000..e159d283443 --- /dev/null +++ b/gnu/llvm/libcxx/LICENSE.TXT @@ -0,0 +1,311 @@ +============================================================================== +The LLVM Project is under the Apache License v2.0 with LLVM Exceptions: +============================================================================== + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + +---- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + +============================================================================== +Software from third parties included in the LLVM Project: +============================================================================== +The LLVM Project contains third party software which is under different license +terms. All such code will be identified clearly using at least one of two +mechanisms: +1) It will be in a separate directory tree with its own `LICENSE.txt` or + `LICENSE` file at the top containing the specific license and restrictions + which apply to that software, or +2) It will contain specific license and restriction terms at the top of every + file. + +============================================================================== +Legacy LLVM License (https://llvm.org/docs/DeveloperPolicy.html#legacy): +============================================================================== + +The libc++ library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2019 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/gnu/llvm/libcxx/NOTES.TXT b/gnu/llvm/libcxx/NOTES.TXT new file mode 100644 index 00000000000..24d245d437c --- /dev/null +++ b/gnu/llvm/libcxx/NOTES.TXT @@ -0,0 +1,29 @@ +//===---------------------------------------------------------------------===// +// Notes relating to various libc++ tasks +//===---------------------------------------------------------------------===// + +This file contains notes about various libc++ tasks and processes. + +//===---------------------------------------------------------------------===// +// Post-Release TODO +//===---------------------------------------------------------------------===// + +These notes contain a list of things that must be done after branching for +an LLVM release. + +1. Update _LIBCPP_VERSION in `__config` +2. Update the __libcpp_version file. +3. Update the version number in `docs/conf.py` +4. Create ABI lists for the previous release under `lib/abi` + +//===---------------------------------------------------------------------===// +// Adding a new header TODO +//===---------------------------------------------------------------------===// + +These notes contain a list of things that must be done upon adding a new header +to libc++. + +1. Add a test under `test/libcxx` that the header defines `_LIBCPP_VERSION`. +2. Update `test/libcxx/double_include.sh.cpp` to include the new header. +3. Create a submodule in `include/module.modulemap` for the new header. +4. Update the include/CMakeLists.txt file to include the new header. diff --git a/gnu/llvm/libcxx/TODO.TXT b/gnu/llvm/libcxx/TODO.TXT new file mode 100644 index 00000000000..652a38de75a --- /dev/null +++ b/gnu/llvm/libcxx/TODO.TXT @@ -0,0 +1,76 @@ +This is meant to be a general place to list things that should be done "someday" + +CXX Runtime Library Tasks +========================= +* Fix that CMake always link to /usr/lib/libc++abi.dylib on OS X. +* Look into mirroring libsupc++'s typeinfo vtable layout when libsupc++/libstdc++ + is used as the runtime library. +* Investigate and document interoperability between libc++ and libstdc++ on + linux. Do this for every supported c++ runtime library. + +Atomic Related Tasks +==================== +* future should use for synchronization. + +Test Suite Tasks +================ +* Improve the quality and portability of the locale test data. +* Convert failure tests to use Clang Verify. + +Filesystem Tasks +================ +* P0492r2 - Implement National body comments for Filesystem + * INCOMPLETE - US 25: has_filename() is equivalent to just !empty() + * INCOMPLETE - US 31: Everything is defined in terms of one implicit host system + * INCOMPLETE - US 32: Meaning of 27.10.2.1 unclear + * INCOMPLETE - US 33: Definition of canonical path problematic + * INCOMPLETE - US 34: Are there attributes of a file that are not an aspect of the file system? + * INCOMPLETE - US 35: What synchronization is required to avoid a file system race? + * INCOMPLETE - US 36: Symbolic links themselves are attached to a directory via (hard) links + * INCOMPLETE - US 37: The term “redundant current directory (dot) elements” is not defined + * INCOMPLETE - US 38: Duplicates §17.3.16 + * INCOMPLETE - US 39: Remove note: Dot and dot-dot are not directories + * INCOMPLETE - US 40: Not all directories have a parent. + * INCOMPLETE - US 41: The term “parent directory” for a (non-directory) file is unusual + * INCOMPLETE - US 42: Pathname resolution does not always resolve a symlink + * INCOMPLETE - US 43: Concerns about encoded character types + * INCOMPLETE - US 44: Definition of path in terms of a string requires leaky abstraction + * INCOMPLETE - US 45: Generic format portability compromised by unspecified root-name + * INCOMPLETE - US 46: filename can be empty so productions for relative-path are redundant + * INCOMPLETE - US 47: “.” and “..” already match the name production + * INCOMPLETE - US 48: Multiple separators are often meaningful in a root-name + * INCOMPLETE - US 49: What does “method of conversion method” mean? + * INCOMPLETE - US 50: 27.10.8.1 ¶ 1.4 largely redundant with ¶ 1.3 + * INCOMPLETE - US 51: Failing to add / when appending empty string prevents useful apps + * INCOMPLETE - US 52: remove_filename() postcondition is not by itself a definition + * INCOMPLETE - US 53: remove_filename()'s name does not correspond to its behavior + * INCOMPLETE - US 54: remove_filename() is broken + * INCOMPLETE - US 55: replace_extension()'s use of path as parameter is inappropriate + * INCOMPLETE - US 56: Remove replace_extension()'s conditional addition of period + * INCOMPLETE - US 57: On Windows, absolute paths will sort in among relative paths + * INCOMPLETE - US 58: parent_path() behavior for root paths is useless + * INCOMPLETE - US 59: filename() returning path for single path components is bizarre + * INCOMPLETE - US 60: path("/foo/").filename()==path(".") is surprising + * INCOMPLETE - US 61: Leading dots in filename() should not begin an extension + * INCOMPLETE - US 62: It is important that stem()+extension()==filename() + * INCOMPLETE - US 63: lexically_normal() inconsistently treats trailing "/" but not "/.." as directory + * INCOMPLETE - US 73, CA 2: root-name is effectively implementation defined + * INCOMPLETE - US 74, CA 3: The term “pathname” is ambiguous in some contexts + * INCOMPLETE - US 75, CA 4: Extra flag in path constructors is needed + * INCOMPLETE - US 76, CA 5: root-name definition is over-specified. + * INCOMPLETE - US 77, CA 6: operator/ and other appends not useful if arg has root-name + * INCOMPLETE - US 78, CA 7: Member absolute() in 27.10.4.1 is overspecified for non-POSIX-like O/S + * INCOMPLETE - US 79, CA 8: Some operation functions are overspecified for implementation-defined file types + * INCOMPLETE - US 185: Fold error_code and non-error_code signatures into one signature + * INCOMPLETE - FI 14: directory_entry comparisons are members + * INCOMPLETE - Late 36: permissions() error_code overload should be noexcept + * INCOMPLETE - Late 37: permissions() actions should be separate parameter + * INCOMPLETE - Late 42: resize_file() Postcondition missing argument + +Misc Tasks +========== +* Find all sequences of >2 underscores and eradicate them. +* run clang-tidy on libc++ +* Document the "conditionally-supported" bits of libc++ +* Look at basic_string's move assignment operator, re LWG 2063 and POCMA +* Put a static_assert in std::allocator to deny const/volatile types (LWG 2447) diff --git a/gnu/llvm/libcxx/benchmarks/CMakeLists.txt b/gnu/llvm/libcxx/benchmarks/CMakeLists.txt new file mode 100644 index 00000000000..bd38de97d7a --- /dev/null +++ b/gnu/llvm/libcxx/benchmarks/CMakeLists.txt @@ -0,0 +1,219 @@ +include(ExternalProject) +include(CheckCXXCompilerFlag) + +#============================================================================== +# Build Google Benchmark for libc++ +#============================================================================== + +set(BENCHMARK_LIBCXX_COMPILE_FLAGS + -Wno-unused-command-line-argument + -nostdinc++ + -isystem ${LIBCXX_SOURCE_DIR}/include + -L${LIBCXX_LIBRARY_DIR} + -Wl,-rpath,${LIBCXX_LIBRARY_DIR} + ${SANITIZER_FLAGS} + ) +if (DEFINED LIBCXX_CXX_ABI_LIBRARY_PATH) + list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS + -L${LIBCXX_CXX_ABI_LIBRARY_PATH} + -Wl,-rpath,${LIBCXX_CXX_ABI_LIBRARY_PATH}) +endif() +if (LIBCXX_NEEDS_SITE_CONFIG) + list(APPEND BENCHMARK_LIBCXX_COMPILE_FLAGS -include "${LIBCXX_BINARY_DIR}/__config_site") +endif() +split_list(BENCHMARK_LIBCXX_COMPILE_FLAGS) + +ExternalProject_Add(google-benchmark-libcxx + EXCLUDE_FROM_ALL ON + DEPENDS cxx cxx-headers + PREFIX benchmark-libcxx + SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx + CMAKE_CACHE_ARGS + -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_BUILD_TYPE:STRING=RELEASE + -DCMAKE_INSTALL_PREFIX:PATH= + -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_LIBCXX_COMPILE_FLAGS} + -DBENCHMARK_USE_LIBCXX:BOOL=ON + -DBENCHMARK_ENABLE_TESTING:BOOL=OFF) + +#============================================================================== +# Build Google Benchmark for the native stdlib +#============================================================================== +set(BENCHMARK_NATIVE_TARGET_FLAGS) +if (LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN) + set(BENCHMARK_NATIVE_TARGET_FLAGS + -gcc-toolchain ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN}) +endif() +split_list(BENCHMARK_NATIVE_TARGET_FLAGS) + +if (LIBCXX_BENCHMARK_NATIVE_STDLIB) + ExternalProject_Add(google-benchmark-native + EXCLUDE_FROM_ALL ON + PREFIX benchmark-native + SOURCE_DIR ${LIBCXX_SOURCE_DIR}/utils/google-benchmark + INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native + CMAKE_CACHE_ARGS + -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} + -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_CXX_FLAGS:STRING=${BENCHMARK_NATIVE_TARGET_FLAGS} + -DCMAKE_BUILD_TYPE:STRING=RELEASE + -DCMAKE_INSTALL_PREFIX:PATH= + -DBENCHMARK_ENABLE_TESTING:BOOL=OFF) +endif() + + +#============================================================================== +# Benchmark tests configuration +#============================================================================== +add_custom_target(cxx-benchmarks) +set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) +set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx) +set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native) + +check_flag_supported("-std=c++17") +mangle_name("LIBCXX_SUPPORTS_STD_EQ_c++17_FLAG" BENCHMARK_SUPPORTS_STD_CXX17_FLAG) +if (${BENCHMARK_SUPPORTS_STD_CXX17_FLAG}) + set(BENCHMARK_DIALECT_FLAG "-std=c++17") +else() + # If the compiler doesn't support -std=c++17, attempt to fall back to -std=c++1z while still + # requiring C++17 language features. + set(BENCHMARK_DIALECT_FLAG "-std=c++1z") +endif() + +set(BENCHMARK_TEST_COMPILE_FLAGS + ${BENCHMARK_DIALECT_FLAG} -O2 + -fsized-deallocation + -I${BENCHMARK_LIBCXX_INSTALL}/include + -I${LIBCXX_SOURCE_DIR}/test/support +) +set(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS + -nostdinc++ + -isystem ${LIBCXX_SOURCE_DIR}/include + ${BENCHMARK_TEST_COMPILE_FLAGS} + ${SANITIZER_FLAGS} + -Wno-user-defined-literals +) + +set(BENCHMARK_TEST_LIBCXX_LINK_FLAGS + -nodefaultlibs + -L${BENCHMARK_LIBCXX_INSTALL}/lib/ + ${SANITIZER_FLAGS} +) +set(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS + ${BENCHMARK_NATIVE_TARGET_FLAGS} + ${BENCHMARK_TEST_COMPILE_FLAGS} +) +set(BENCHMARK_TEST_NATIVE_LINK_FLAGS + ${BENCHMARK_NATIVE_TARGET_FLAGS} + -L${BENCHMARK_NATIVE_INSTALL}/lib +) +split_list(BENCHMARK_TEST_COMPILE_FLAGS) +split_list(BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS) +split_list(BENCHMARK_TEST_LIBCXX_LINK_FLAGS) +split_list(BENCHMARK_TEST_NATIVE_COMPILE_FLAGS) +split_list(BENCHMARK_TEST_NATIVE_LINK_FLAGS) + +if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++") + find_library(LIBSTDCXX_FILESYSTEM_TEST stdc++fs + PATHS ${LIBCXX_BENCHMARK_NATIVE_GCC_TOOLCHAIN} + PATH_SUFFIXES lib lib64 + DOC "The libstdc++ filesystem library used by the benchmarks" + ) + if (NOT "${LIBSTDCXX_FILESYSTEM_TEST}" STREQUAL "LIBSTDCXX_FILESYSTEM_TEST-NOTFOUND") + set(LIBSTDCXX_FILESYSTEM_LIB "stdc++fs") + endif() +endif() + +set(libcxx_benchmark_targets) + +function(add_benchmark_test name source_file) + set(libcxx_target ${name}_libcxx) + list(APPEND libcxx_benchmark_targets ${libcxx_target}) + add_executable(${libcxx_target} EXCLUDE_FROM_ALL ${source_file}) + add_dependencies(${libcxx_target} cxx cxx-headers google-benchmark-libcxx) + add_dependencies(cxx-benchmarks ${libcxx_target}) + if (LIBCXX_ENABLE_SHARED) + target_link_libraries(${libcxx_target} PRIVATE cxx_shared) + else() + target_link_libraries(${libcxx_target} PRIVATE cxx_static) + endif() + if (TARGET cxx_experimental) + target_link_libraries(${libcxx_target} PRIVATE cxx_experimental) + endif() + target_link_libraries(${libcxx_target} PRIVATE -lbenchmark) + if (LLVM_USE_SANITIZER) + target_link_libraries(${libcxx_target} PRIVATE -ldl) + endif() + set_target_properties(${libcxx_target} + PROPERTIES + OUTPUT_NAME "${name}.libcxx.out" + RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}" + COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}" + LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}") + cxx_link_system_libraries(${libcxx_target}) + if (LIBCXX_BENCHMARK_NATIVE_STDLIB) + if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++" AND NOT DEFINED LIBSTDCXX_FILESYSTEM_LIB + AND "${name}" STREQUAL "filesystem") + return() + endif() + set(native_target ${name}_native) + add_executable(${native_target} EXCLUDE_FROM_ALL ${source_file}) + add_dependencies(${native_target} google-benchmark-native + google-benchmark-libcxx) + target_link_libraries(${native_target} PRIVATE -lbenchmark) + if (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libstdc++") + target_link_libraries(${native_target} PRIVATE ${LIBSTDCXX_FILESYSTEM_LIB}) + elseif (LIBCXX_BENCHMARK_NATIVE_STDLIB STREQUAL "libc++") + target_link_libraries(${native_target} PRIVATE -lc++fs -lc++experimental) + endif() + if (LIBCXX_HAS_PTHREAD_LIB) + target_link_libraries(${native_target} PRIVATE -pthread) + endif() + add_dependencies(cxx-benchmarks ${native_target}) + set_target_properties(${native_target} + PROPERTIES + OUTPUT_NAME "${name}.native.out" + RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}" + INCLUDE_DIRECTORIES "" + COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}" + LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}") + endif() +endfunction() + + +#============================================================================== +# Register Benchmark tests +#============================================================================== +file(GLOB BENCHMARK_TESTS "*.bench.cpp") +foreach(test_path ${BENCHMARK_TESTS}) + get_filename_component(test_file "${test_path}" NAME) + string(REPLACE ".bench.cpp" "" test_name "${test_file}") + if (NOT DEFINED ${test_name}_REPORTED) + message(STATUS "Adding Benchmark: ${test_file}") + # Only report the adding of the benchmark once. + set(${test_name}_REPORTED ON CACHE INTERNAL "") + endif() + add_benchmark_test(${test_name} ${test_file}) +endforeach() + +if (LIBCXX_INCLUDE_TESTS) + include(AddLLVM) + + if (NOT DEFINED LIBCXX_TEST_DEPS) + message(FATAL_ERROR "Expected LIBCXX_TEST_DEPS to be defined") + endif() + + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py) + + set(BENCHMARK_LIT_ARGS "--show-all --show-xfail --show-unsupported ${LIT_ARGS_DEFAULT}") + + add_lit_target(check-cxx-benchmarks + "Running libcxx benchmarks tests" + ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS cxx-benchmarks ${LIBCXX_TEST_DEPS} + ARGS ${BENCHMARK_LIT_ARGS}) +endif() diff --git a/gnu/llvm/libcxx/benchmarks/CartesianBenchmarks.h b/gnu/llvm/libcxx/benchmarks/CartesianBenchmarks.h new file mode 100644 index 00000000000..2eea1568193 --- /dev/null +++ b/gnu/llvm/libcxx/benchmarks/CartesianBenchmarks.h @@ -0,0 +1,133 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + + +#include +#include +#include +#include + +#include "benchmark/benchmark.h" +#include "test_macros.h" + +namespace internal { + +template +struct EnumValue : std::integral_constant(I)> { + static std::string name() { return std::string("_") + D::Names[I]; } +}; + +template +constexpr auto makeEnumValueTuple(std::index_sequence) { + return std::make_tuple(EnumValue{}...); +} + +template +static auto skip(const B& Bench, int) -> decltype(Bench.skip()) { + return Bench.skip(); +} +template +static auto skip(const B& Bench, char) { + return false; +} + +template +void makeBenchmarkFromValuesImpl(const Args& A, std::index_sequence) { + for (auto& V : A) { + B Bench{std::get(V)...}; + if (!internal::skip(Bench, 0)) { + benchmark::RegisterBenchmark(Bench.name().c_str(), + [=](benchmark::State& S) { Bench.run(S); }); + } + } +} + +template +void makeBenchmarkFromValues(const std::vector >& A) { + makeBenchmarkFromValuesImpl(A, std::index_sequence_for()); +} + +template