summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/src
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-24 22:00:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-24 22:00:03 +0000
commit480093f4440d54b30b3025afeac24b48f2ba7a2e (patch)
tree162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/libcxx/src
parent489b1cf2ecf5b9b4a394857987014bfb09067726 (diff)
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'contrib/llvm-project/libcxx/src')
-rw-r--r--contrib/llvm-project/libcxx/src/CMakeLists.txt399
-rw-r--r--contrib/llvm-project/libcxx/src/algorithm.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/chrono.cpp4
-rw-r--r--contrib/llvm-project/libcxx/src/condition_variable.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/debug.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/experimental/memory_resource.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/filesystem/operations.cpp4
-rw-r--r--contrib/llvm-project/libcxx/src/locale.cpp4
-rw-r--r--contrib/llvm-project/libcxx/src/memory.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/mutex.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/mutex_destructor.cpp1
-rw-r--r--contrib/llvm-project/libcxx/src/regex.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/shared_mutex.cpp2
-rw-r--r--contrib/llvm-project/libcxx/src/thread.cpp4
14 files changed, 17 insertions, 415 deletions
diff --git a/contrib/llvm-project/libcxx/src/CMakeLists.txt b/contrib/llvm-project/libcxx/src/CMakeLists.txt
deleted file mode 100644
index 120505fe18da..000000000000
--- a/contrib/llvm-project/libcxx/src/CMakeLists.txt
+++ /dev/null
@@ -1,399 +0,0 @@
-set(LIBCXX_LIB_CMAKEFILES_DIR "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}" PARENT_SCOPE)
-
-# Get sources
-set(LIBCXX_SOURCES
- algorithm.cpp
- any.cpp
- bind.cpp
- charconv.cpp
- chrono.cpp
- condition_variable.cpp
- condition_variable_destructor.cpp
- debug.cpp
- exception.cpp
- functional.cpp
- future.cpp
- hash.cpp
- include/apple_availability.h
- include/atomic_support.h
- include/config_elast.h
- include/refstring.h
- ios.cpp
- iostream.cpp
- locale.cpp
- memory.cpp
- mutex.cpp
- mutex_destructor.cpp
- new.cpp
- optional.cpp
- random.cpp
- regex.cpp
- shared_mutex.cpp
- stdexcept.cpp
- string.cpp
- strstream.cpp
- support/runtime/exception_fallback.ipp
- support/runtime/exception_glibcxx.ipp
- support/runtime/exception_libcxxabi.ipp
- support/runtime/exception_libcxxrt.ipp
- support/runtime/exception_msvc.ipp
- support/runtime/exception_pointer_cxxabi.ipp
- support/runtime/exception_pointer_glibcxx.ipp
- support/runtime/exception_pointer_msvc.ipp
- support/runtime/exception_pointer_unimplemented.ipp
- support/runtime/new_handler_fallback.ipp
- support/runtime/stdexcept_default.ipp
- support/runtime/stdexcept_vcruntime.ipp
- system_error.cpp
- thread.cpp
- typeinfo.cpp
- utility.cpp
- valarray.cpp
- variant.cpp
- vector.cpp
- )
-
-if(WIN32)
- list(APPEND LIBCXX_SOURCES
- support/win32/locale_win32.cpp
- support/win32/support.cpp
- support/win32/thread_win32.cpp
- )
-elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")
- list(APPEND LIBCXX_SOURCES
- support/solaris/mbsnrtowcs.inc
- support/solaris/wcsnrtombs.inc
- support/solaris/xlocale.cpp
- )
-endif()
-
-if (LIBCXX_ENABLE_FILESYSTEM)
- list(APPEND LIBCXX_SOURCES
- filesystem/filesystem_common.h
- filesystem/operations.cpp
- filesystem/directory_iterator.cpp
- )
- # Filesystem uses __int128_t, which requires a definition of __muloi4 when
- # compiled with UBSAN. This definition is not provided by libgcc_s, but is
- # provided by compiler-rt. So we need to disable it to avoid having multiple
- # definitions. See filesystem/int128_builtins.cpp.
- if (NOT LIBCXX_USE_COMPILER_RT)
- list(APPEND LIBCXX_SOURCES
- filesystem/int128_builtins.cpp
- )
- endif()
-endif()
-
-# Add all the headers to the project for IDEs.
-if (LIBCXX_CONFIGURE_IDE)
- file(GLOB_RECURSE LIBCXX_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/*)
- if(WIN32)
- file( GLOB LIBCXX_WIN32_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/../include/support/win32/*.h)
- list(APPEND LIBCXX_HEADERS ${LIBCXX_WIN32_HEADERS})
- endif()
- # Force them all into the headers dir on MSVC, otherwise they end up at
- # project scope because they don't have extensions.
- if (MSVC_IDE)
- source_group("Header Files" FILES ${LIBCXX_HEADERS})
- endif()
-endif()
-
-if(NOT LIBCXX_INSTALL_LIBRARY)
- set(exclude_from_all EXCLUDE_FROM_ALL)
-endif()
-
-# If LIBCXX_CXX_ABI_LIBRARY_PATH is defined we want to add it to the search path.
-add_link_flags_if(LIBCXX_CXX_ABI_LIBRARY_PATH
- "${CMAKE_LIBRARY_PATH_FLAG}${LIBCXX_CXX_ABI_LIBRARY_PATH}")
-
-
-if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
- find_compiler_rt_library(profile LIBCXX_COVERAGE_LIBRARY)
-endif()
-add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
-
-if (APPLE AND LLVM_USE_SANITIZER)
- if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
- ("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR
- ("${LLVM_USE_SANITIZER}" STREQUAL "Undefined;Address"))
- set(LIBFILE "libclang_rt.asan_osx_dynamic.dylib")
- elseif("${LLVM_USE_SANITIZER}" STREQUAL "Undefined")
- set(LIBFILE "libclang_rt.ubsan_osx_dynamic.dylib")
- elseif("${LLVM_USE_SANITIZER}" STREQUAL "Thread")
- set(LIBFILE "libclang_rt.tsan_osx_dynamic.dylib")
- else()
- message(WARNING "LLVM_USE_SANITIZER=${LLVM_USE_SANITIZER} is not supported on OS X")
- endif()
- if (LIBFILE)
- find_compiler_rt_dir(LIBDIR)
- if (NOT IS_DIRECTORY "${LIBDIR}")
- message(FATAL_ERROR "Cannot find compiler-rt directory on OS X required for LLVM_USE_SANITIZER")
- endif()
- set(LIBCXX_SANITIZER_LIBRARY "${LIBDIR}/${LIBFILE}")
- set(LIBCXX_SANITIZER_LIBRARY "${LIBCXX_SANITIZER_LIBRARY}" PARENT_SCOPE)
- message(STATUS "Manually linking compiler-rt library: ${LIBCXX_SANITIZER_LIBRARY}")
- add_library_flags("${LIBCXX_SANITIZER_LIBRARY}")
- add_link_flags("-Wl,-rpath,${LIBDIR}")
- endif()
-endif()
-
-if (LIBCXX_ENABLE_PARALLEL_ALGORITHMS AND NOT TARGET pstl::ParallelSTL)
- message(FATAL_ERROR "Could not find ParallelSTL")
-endif()
-
-function(cxx_set_common_defines name)
- if(LIBCXX_CXX_ABI_HEADER_TARGET)
- add_dependencies(${name} ${LIBCXX_CXX_ABI_HEADER_TARGET})
- endif()
-
- if (LIBCXX_ENABLE_PARALLEL_ALGORITHMS)
- target_link_libraries(${name} PUBLIC pstl::ParallelSTL)
- endif()
-endfunction()
-
-split_list(LIBCXX_COMPILE_FLAGS)
-split_list(LIBCXX_LINK_FLAGS)
-
-# Build the shared library.
-if (LIBCXX_ENABLE_SHARED)
- add_library(cxx_shared SHARED ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
- if(COMMAND llvm_setup_rpath)
- llvm_setup_rpath(cxx_shared)
- endif()
- target_link_libraries(cxx_shared PRIVATE ${LIBCXX_LIBRARIES})
- set_target_properties(cxx_shared
- PROPERTIES
- COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
- OUTPUT_NAME "c++"
- VERSION "${LIBCXX_ABI_VERSION}.0"
- SOVERSION "${LIBCXX_ABI_VERSION}"
- DEFINE_SYMBOL ""
- )
- cxx_add_common_build_flags(cxx_shared)
- cxx_set_common_defines(cxx_shared)
-
- # Link against LLVM libunwind
- if (LIBCXXABI_USE_LLVM_UNWINDER)
- if (NOT LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET unwind_shared OR HAVE_LIBUNWIND))
- target_link_libraries(cxx_shared PUBLIC unwind_shared)
- elseif (LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY AND (TARGET unwind_static OR HAVE_LIBUNWIND))
- # libunwind is already included in libc++abi
- else()
- target_link_libraries(cxx_shared PUBLIC unwind)
- endif()
- endif()
-
- # Link against libc++abi
- if (LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
- if (APPLE)
- target_link_libraries(cxx_shared PRIVATE "-Wl,-force_load" "${LIBCXX_CXX_STATIC_ABI_LIBRARY}")
- else()
- target_link_libraries(cxx_shared PRIVATE "-Wl,--whole-archive,-Bstatic" "${LIBCXX_CXX_STATIC_ABI_LIBRARY}" "-Wl,-Bdynamic,--no-whole-archive")
- endif()
- else()
- target_link_libraries(cxx_shared PUBLIC "${LIBCXX_CXX_SHARED_ABI_LIBRARY}")
- endif()
-
- # Maybe re-export symbols from libc++abi
- if (APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
- LIBCXX_CXX_ABI_LIBNAME STREQUAL "default")
- AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
- set(LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS ON)
- endif()
-
- if (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
- if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "^(armv6|armv7|armv7s)$")
- set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++sjlj-abi.v${LIBCXX_LIBCPPABI_VERSION}.exp")
- else()
- set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi.v${LIBCXX_LIBCPPABI_VERSION}.exp")
- endif()
- target_link_libraries(cxx_shared PRIVATE
- "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++unexp.exp"
- "-Wl,-reexported_symbols_list,${RE_EXPORT_LIST}"
- "-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
- "-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
-
- if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
- target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-new-delete.exp")
- endif()
- endif()
-
- # Generate a linker script in place of a libc++.so symlink.
- if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- include(DefineLinkerScript)
- define_linker_script(cxx_shared)
- endif()
-
- list(APPEND LIBCXX_BUILD_TARGETS "cxx_shared")
- if(WIN32 AND NOT MINGW AND NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
- # Since we most likely do not have a mt.exe replacement, disable the
- # manifest bundling. This allows a normal cmake invocation to pass which
- # will attempt to use the manifest tool to generate the bundled manifest
- set_target_properties(cxx_shared PROPERTIES
- APPEND_STRING PROPERTY LINK_FLAGS " /MANIFEST:NO")
- endif()
-endif()
-
-# Build the static library.
-if (LIBCXX_ENABLE_STATIC)
- add_library(cxx_static STATIC ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
- target_link_libraries(cxx_static PRIVATE ${LIBCXX_LIBRARIES})
- set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
- set_target_properties(cxx_static
- PROPERTIES
- COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
- OUTPUT_NAME "c++"
- )
- cxx_add_common_build_flags(cxx_static)
- cxx_set_common_defines(cxx_static)
-
- if (LIBCXX_HERMETIC_STATIC_LIBRARY)
- # If the hermetic library doesn't define the operator new/delete functions
- # then its code shouldn't declare them with hidden visibility. They might
- # actually be provided by a shared library at link time.
- if (LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
- append_flags_if_supported(CXX_STATIC_LIBRARY_FLAGS -fvisibility-global-new-delete-hidden)
- endif()
- target_compile_options(cxx_static PRIVATE ${CXX_STATIC_LIBRARY_FLAGS})
- target_compile_definitions(cxx_static PRIVATE _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
- endif()
-
- list(APPEND LIBCXX_BUILD_TARGETS "cxx_static")
- # Attempt to merge the libc++.a archive and the ABI library archive into one.
- if (LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY)
- set(MERGE_ARCHIVES_SEARCH_PATHS "")
- if (LIBCXX_CXX_ABI_LIBRARY_PATH)
- set(MERGE_ARCHIVES_SEARCH_PATHS "-L${LIBCXX_CXX_ABI_LIBRARY_PATH}")
- endif()
- if (TARGET "${LIBCXX_CXX_STATIC_ABI_LIBRARY}" OR HAVE_LIBCXXABI)
- set(MERGE_ARCHIVES_ABI_TARGET "$<TARGET_LINKER_FILE:${LIBCXX_CXX_STATIC_ABI_LIBRARY}>")
- else()
- set(MERGE_ARCHIVES_ABI_TARGET
- "${CMAKE_STATIC_LIBRARY_PREFIX}${LIBCXX_CXX_STATIC_ABI_LIBRARY}${CMAKE_STATIC_LIBRARY_SUFFIX}")
- endif()
- if (APPLE)
- set(MERGE_ARCHIVES_LIBTOOL "--use-libtool" "--libtool" "${CMAKE_LIBTOOL}")
- endif()
- add_custom_command(TARGET cxx_static POST_BUILD
- COMMAND
- ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/merge_archives.py
- ARGS
- -o $<TARGET_LINKER_FILE:cxx_static>
- --ar "${CMAKE_AR}"
- ${MERGE_ARCHIVES_LIBTOOL}
- "$<TARGET_LINKER_FILE:cxx_static>"
- "${MERGE_ARCHIVES_ABI_TARGET}"
- "${MERGE_ARCHIVES_SEARCH_PATHS}"
- WORKING_DIRECTORY ${LIBCXX_BUILD_DIR}
- )
- endif()
-endif()
-
-# Add a meta-target for both libraries.
-add_custom_target(cxx DEPENDS cxx-headers ${LIBCXX_BUILD_TARGETS})
-
-if (LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY)
- set(LIBCXX_EXPERIMENTAL_SOURCES
- experimental/memory_resource.cpp
- )
- add_library(cxx_experimental STATIC ${LIBCXX_EXPERIMENTAL_SOURCES})
- if (LIBCXX_ENABLE_SHARED)
- target_link_libraries(cxx_experimental PRIVATE cxx_shared)
- else()
- target_link_libraries(cxx_experimental PRIVATE cxx_static)
- endif()
-
- set_target_properties(cxx_experimental
- PROPERTIES
- COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- OUTPUT_NAME "c++experimental"
- )
- cxx_add_common_build_flags(cxx_experimental)
- # Overwrite the previously-set Standard flag with -std=c++14 if supported
- check_flag_supported(-std=c++14)
- if (NOT MSVC AND LIBCXX_SUPPORTS_STD_EQ_CXX14_FLAG)
- target_compile_options(cxx_experimental PRIVATE "-std=c++14")
- endif()
-endif()
-
-
-if (LIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY)
- file(GLOB LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES ../test/support/external_threads.cpp)
-
- if (LIBCXX_ENABLE_SHARED)
- add_library(cxx_external_threads SHARED ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
- else()
- add_library(cxx_external_threads STATIC ${LIBCXX_EXTERNAL_THREADING_SUPPORT_SOURCES})
- endif()
-
- set_target_properties(cxx_external_threads
- PROPERTIES
- LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
- COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
- OUTPUT_NAME "c++external_threads"
- )
-endif()
-
-if (LIBCXX_INSTALL_LIBRARY)
- if (LIBCXX_INSTALL_SHARED_LIBRARY)
- install(TARGETS cxx_shared
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
-
- if (LIBCXX_INSTALL_STATIC_LIBRARY)
- install(TARGETS cxx_static
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
-
- if(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
- install(TARGETS ${LIBCXX_INSTALL_TARGETS} ${experimental_lib}
- LIBRARY DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- ARCHIVE DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR} COMPONENT cxx
- RUNTIME DESTINATION ${LIBCXX_INSTALL_PREFIX}bin COMPONENT cxx)
- endif()
-
- # NOTE: This install command must go after the cxx install command otherwise
- # it will not be executed after the library symlinks are installed.
- if (LIBCXX_ENABLE_SHARED AND LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
- # Replace the libc++ filename with $<TARGET_LINKER_FILE:cxx>
- # after we required CMake 3.0.
- install(FILES "${LIBCXX_LIBRARY_DIR}/libc++${CMAKE_SHARED_LIBRARY_SUFFIX}"
- DESTINATION ${LIBCXX_INSTALL_PREFIX}${LIBCXX_INSTALL_LIBRARY_DIR}
- COMPONENT libcxx)
- endif()
-endif()
-
-if (NOT CMAKE_CONFIGURATION_TYPES AND (LIBCXX_INSTALL_LIBRARY OR
- LIBCXX_INSTALL_HEADERS))
- if(LIBCXX_INSTALL_LIBRARY)
- set(lib_install_target cxx)
- endif()
- if (LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY)
- set(experimental_lib_install_target cxx_experimental)
- endif()
- if(LIBCXX_INSTALL_HEADERS)
- set(header_install_target install-cxx-headers)
- endif()
- add_custom_target(install-cxx
- DEPENDS ${lib_install_target}
- ${experimental_lib_install_target}
- ${header_install_target}
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=cxx
- -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
- add_custom_target(install-cxx-stripped
- DEPENDS ${lib_install_target}
- ${experimental_lib_install_target}
- ${header_install_target}
- COMMAND "${CMAKE_COMMAND}"
- -DCMAKE_INSTALL_COMPONENT=cxx
- -DCMAKE_INSTALL_DO_STRIP=1
- -P "${LIBCXX_BINARY_DIR}/cmake_install.cmake")
- add_custom_target(install-libcxx DEPENDS install-cxx)
-endif()
diff --git a/contrib/llvm-project/libcxx/src/algorithm.cpp b/contrib/llvm-project/libcxx/src/algorithm.cpp
index ffdcb5fccde7..40669fb9e756 100644
--- a/contrib/llvm-project/libcxx/src/algorithm.cpp
+++ b/contrib/llvm-project/libcxx/src/algorithm.cpp
@@ -10,7 +10,7 @@
#include "random"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/contrib/llvm-project/libcxx/src/chrono.cpp b/contrib/llvm-project/libcxx/src/chrono.cpp
index c461d19ddb1f..9d448b6a985b 100644
--- a/contrib/llvm-project/libcxx/src/chrono.cpp
+++ b/contrib/llvm-project/libcxx/src/chrono.cpp
@@ -37,7 +37,7 @@
#endif
#endif
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
#pragma comment(lib, "rt")
#endif
@@ -183,7 +183,7 @@ steady_clock::now() _NOEXCEPT
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms644905(v=vs.85).aspx says:
// If the function fails, the return value is zero. <snip>
-// On systems that run Windows XP or later, the function will always succeed
+// On systems that run Windows XP or later, the function will always succeed
// and will thus never return zero.
static LARGE_INTEGER
diff --git a/contrib/llvm-project/libcxx/src/condition_variable.cpp b/contrib/llvm-project/libcxx/src/condition_variable.cpp
index bf89d255dd82..d133b010d71f 100644
--- a/contrib/llvm-project/libcxx/src/condition_variable.cpp
+++ b/contrib/llvm-project/libcxx/src/condition_variable.cpp
@@ -15,7 +15,7 @@
#include "system_error"
#include "__undef_macros"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
diff --git a/contrib/llvm-project/libcxx/src/debug.cpp b/contrib/llvm-project/libcxx/src/debug.cpp
index 1f5ce1052f87..20055fcf7590 100644
--- a/contrib/llvm-project/libcxx/src/debug.cpp
+++ b/contrib/llvm-project/libcxx/src/debug.cpp
@@ -15,7 +15,7 @@
#include "__hash_table"
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/contrib/llvm-project/libcxx/src/experimental/memory_resource.cpp b/contrib/llvm-project/libcxx/src/experimental/memory_resource.cpp
index e98726283173..68c5bc99cc72 100644
--- a/contrib/llvm-project/libcxx/src/experimental/memory_resource.cpp
+++ b/contrib/llvm-project/libcxx/src/experimental/memory_resource.cpp
@@ -12,7 +12,7 @@
#include "atomic"
#elif !defined(_LIBCPP_HAS_NO_THREADS)
#include "mutex"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp
index 4e6cb1427a11..876399fb4d4e 100644
--- a/contrib/llvm-project/libcxx/src/filesystem/operations.cpp
+++ b/contrib/llvm-project/libcxx/src/filesystem/operations.cpp
@@ -44,7 +44,7 @@
#include <sys/time.h> // for gettimeofday and timeval
#endif // !defined(CLOCK_REALTIME)
-#if defined(__unix__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB)
#pragma comment(lib, "rt")
#endif
@@ -1592,7 +1592,7 @@ static int CompareRootDir(PathParser *LHS, PathParser *RHS) {
static int CompareRelative(PathParser *LHSPtr, PathParser *RHSPtr) {
auto &LHS = *LHSPtr;
auto &RHS = *RHSPtr;
-
+
int res;
while (LHS && RHS) {
if ((res = (*LHS).compare(*RHS)) != 0)
diff --git a/contrib/llvm-project/libcxx/src/locale.cpp b/contrib/llvm-project/libcxx/src/locale.cpp
index 5b29ee448685..2757eaa5acda 100644
--- a/contrib/llvm-project/libcxx/src/locale.cpp
+++ b/contrib/llvm-project/libcxx/src/locale.cpp
@@ -39,7 +39,7 @@
#include "__undef_macros"
// On Linux, wint_t and wchar_t have different signed-ness, and this causes
-// lots of noise in the build log, but no bugs that I know of.
+// lots of noise in the build log, but no bugs that I know of.
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wsign-conversion"
#endif
@@ -770,7 +770,7 @@ const ctype_base::mask ctype_base::xdigit;
const ctype_base::mask ctype_base::blank;
const ctype_base::mask ctype_base::alnum;
const ctype_base::mask ctype_base::graph;
-
+
locale::id ctype<wchar_t>::id;
ctype<wchar_t>::~ctype()
diff --git a/contrib/llvm-project/libcxx/src/memory.cpp b/contrib/llvm-project/libcxx/src/memory.cpp
index e89d94f27e4c..633c9a6f5658 100644
--- a/contrib/llvm-project/libcxx/src/memory.cpp
+++ b/contrib/llvm-project/libcxx/src/memory.cpp
@@ -10,7 +10,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
#include "mutex"
#include "thread"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/contrib/llvm-project/libcxx/src/mutex.cpp b/contrib/llvm-project/libcxx/src/mutex.cpp
index 7e979cd89041..27a4fd892778 100644
--- a/contrib/llvm-project/libcxx/src/mutex.cpp
+++ b/contrib/llvm-project/libcxx/src/mutex.cpp
@@ -13,7 +13,7 @@
#include "__undef_macros"
#ifndef _LIBCPP_HAS_NO_THREADS
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
#endif
diff --git a/contrib/llvm-project/libcxx/src/mutex_destructor.cpp b/contrib/llvm-project/libcxx/src/mutex_destructor.cpp
index 3a6b6b55eeb7..2038d2bbe21a 100644
--- a/contrib/llvm-project/libcxx/src/mutex_destructor.cpp
+++ b/contrib/llvm-project/libcxx/src/mutex_destructor.cpp
@@ -48,4 +48,3 @@ mutex::~mutex() _NOEXCEPT
#endif // !_LIBCPP_HAS_NO_THREADS
_LIBCPP_END_NAMESPACE_STD
-
diff --git a/contrib/llvm-project/libcxx/src/regex.cpp b/contrib/llvm-project/libcxx/src/regex.cpp
index a971f646459b..d31e49487432 100644
--- a/contrib/llvm-project/libcxx/src/regex.cpp
+++ b/contrib/llvm-project/libcxx/src/regex.cpp
@@ -53,6 +53,8 @@ make_error_type_string(regex_constants::error_type ecode)
return "An invalid regex grammar has been requested.";
case regex_constants::__re_err_empty:
return "An empty regex is not allowed in the POSIX grammar.";
+ case regex_constants::__re_err_parse:
+ return "The parser did not consume the entire regular expression.";
default:
break;
}
diff --git a/contrib/llvm-project/libcxx/src/shared_mutex.cpp b/contrib/llvm-project/libcxx/src/shared_mutex.cpp
index 9e6d5202aafa..5feef9f4889f 100644
--- a/contrib/llvm-project/libcxx/src/shared_mutex.cpp
+++ b/contrib/llvm-project/libcxx/src/shared_mutex.cpp
@@ -10,7 +10,7 @@
#ifndef _LIBCPP_HAS_NO_THREADS
#include "shared_mutex"
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
diff --git a/contrib/llvm-project/libcxx/src/thread.cpp b/contrib/llvm-project/libcxx/src/thread.cpp
index cee778f6ee85..c0bc1cbbbbc3 100644
--- a/contrib/llvm-project/libcxx/src/thread.cpp
+++ b/contrib/llvm-project/libcxx/src/thread.cpp
@@ -35,7 +35,7 @@
#include <windows.h>
#endif
-#if defined(__unix__) && !defined(__ANDROID__) && defined(__ELF__) && defined(_LIBCPP_HAS_COMMENT_LIB_PRAGMA)
+#if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
#pragma comment(lib, "pthread")
#endif
@@ -139,7 +139,7 @@ class _LIBCPP_HIDDEN __hidden_allocator
{
public:
typedef T value_type;
-
+
T* allocate(size_t __n)
{return static_cast<T*>(::operator new(__n * sizeof(T)));}
void deallocate(T* __p, size_t) {::operator delete(static_cast<void*>(__p));}