From c41b58fd409a0647f14a415ed616e20d4dda4f6a Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 30 Jul 2019 22:49:11 +0000 Subject: [PATCH] Remove cmake checks for MSVC 1900 / VS 2013 Our minimum Visual C++ version is 19.10 from Visual Studio 2017. llvm-svn: 367362 --- compiler-rt/CMakeLists.txt | 11 +++++------ llvm/CMakeLists.txt | 4 +--- llvm/cmake/modules/HandleLLVMOptions.cmake | 20 ++++---------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index f26ae25..f69d6b8 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/CMakeLists.txt @@ -313,12 +313,11 @@ if(MSVC) endif() append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS) append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS) - # VS 2015 (version 1900) added support for thread safe static initialization. - # However, ASan interceptors run before CRT initialization, which causes the - # new thread safe code to crash. Disable this feature for now. - if (MSVC_VERSION GREATER 1899 OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-) - endif() + + # Disable thread safe initialization for static locals. ASan shouldn't need + # it. Thread safe initialization assumes that the CRT has already been + # initialized, but ASan initializes before the CRT. + list(APPEND SANITIZER_COMMON_CFLAGS /Zc:threadSafeInit-) endif() append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt index 5ea6c57..347ebbd7 100644 --- a/llvm/CMakeLists.txt +++ b/llvm/CMakeLists.txt @@ -573,10 +573,8 @@ if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND (LLVM_ENABLE_ASSERTIONS set(LLVM_USE_HOST_TOOLS ON) endif() -if (MSVC_IDE AND NOT (MSVC_VERSION LESS 1900)) +if (MSVC_IDE) option(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION "Configure project to use Visual Studio native visualizers" TRUE) -else() - set(LLVM_ADD_NATIVE_VISUALIZERS_TO_SOLUTION FALSE CACHE INTERNAL "For Visual Studio 2013, manually copy natvis files to Documents\\Visual Studio 2013\\Visualizers" FORCE) endif() if (LLVM_BUILD_INSTRUMENTED OR LLVM_BUILD_INSTRUMENTED_COVERAGE OR diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 2c32ae4..a243507 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -353,12 +353,6 @@ elseif(MINGW) # FIXME: Also cygwin? endif() if( MSVC ) - if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0 ) - # For MSVC 2013, disable iterator null pointer checking in debug mode, - # especially so std::equal(nullptr, nullptr, nullptr) will not assert. - add_definitions("-D_DEBUG_POINTER_IMPL=") - endif() - include(ChooseMSVCCRT) # Add definitions that make MSVC much less annoying. @@ -397,16 +391,10 @@ if( MSVC ) CMAKE_SHARED_LINKER_FLAGS) endif() - # /Zc:strictStrings is incompatible with VS12's (Visual Studio 2013's) - # debug mode headers. Instead of only enabling them in VS2013's debug mode, - # we'll just enable them for Visual Studio 2015 (VS 14, MSVC_VERSION 1900) - # and up. - if (NOT (MSVC_VERSION LESS 1900)) - # Disable string literal const->non-const type conversion. - # "When specified, the compiler requires strict const-qualification - # conformance for pointers initialized by using string literals." - append("/Zc:strictStrings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) - endif(NOT (MSVC_VERSION LESS 1900)) + # Disable string literal const->non-const type conversion. + # "When specified, the compiler requires strict const-qualification + # conformance for pointers initialized by using string literals." + append("/Zc:strictStrings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) # "Generate Intrinsic Functions". append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS) -- 2.7.4