Sejak awal, penganalisis PVS-Studio C ++ untuk Windows (saat itu masih Viva64 versi 1.00 pada tahun 2006) telah dirakit dengan kompiler MSVC. Dengan rilis rilis C ++ baru, inti penganalisis belajar bekerja di Linux dan macOS, dan struktur proyek dialihkan untuk menggunakan CMake. Namun pada Windows, build masih dilakukan menggunakan compiler MSVC. Pada tanggal 29 April 2019, pengembang Visual Studio mengumumkan penyertaan satu set utilitas LLVM dan compiler Clang di lingkungan pengembangan mereka. Dan sekarang kami akhirnya berhasil mencobanya.
Pengujian kinerja
SelfTester. . , - , , . SelfTester " โ ".
โ . , , SelfTester' . , .
C++ Clang, SelfTester 11 .
13% โ , , , ?
, . 8 , 1,6 ( ~500 - ).
, LTO ( ) .
, .
Clang
CMake .
Clang Visual Studio Installer.
Clang-cl โ "", clang cl.exe. , MSBuild, .
LLVM, GitHub. , Visual Studio . toolset' llvm, clangcl, .
toolchain solution Visual Studio:
cmake -G "Visual Studio 16 2019" -Tclangcl <src>
GUI:
, . , , .
lang-cl CL, , .
, /W4 /WX. Clang , . :
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
....
if (WIN32)
add_compile_options(-Wno-error=deprecated-declarations
-Wno-error=reorder-ctor
-Wno-error=format-security
-Wno-error=macro-redefined
-Wno-error=bitwise-op-parentheses
-Wno-error=missing-field-initializers
-Wno-error=overloaded-virtual
-Wno-error=invalid-source-encoding
-Wno-error=multichar
-Wno-unused-local-typedef
-Wno-c++11-narrowing)
....
endif()
endif()
.
GCC Clang int128, MSVC Windows. Int128 Windows ( ifdef', C/C++). , :
if (MSVC)
set(DEFAULT_INT128_ASM ON)
else ()
set(DEFAULT_INT128_ASM OFF)
endif ()
if (MSVC AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(DEFAULT_INT128_ASM ON)
else ()
set(DEFAULT_INT128_ASM OFF)
endif ()
builtin' (lld) , clang.exe clang-cl.exe. MSBuild , , . , , .
if (CMAKE_GENERATOR MATCHES "Visual Studio")
link_libraries("$(LLVMInstallDir)\\lib\\clang\\\
${CMAKE_CXX_COMPILER_VERSION}\\lib\\windows\\\
clang_rt.builtins-x86_64.lib")
else()
link_libraries(clang_rt.builtins-x86_64)
endif()
! . :
- IntegerInterval, :
Dataflow- Int128, SIMD-. :
MOVAPS SIMD-. , 0, 8. , :
class alignas(16) Int128
.
- Docker-:
MSVC , Clang . , Windows Microsoft Visual C++ Redistributable. , .
, , 10%.
PVS-Studio Windows Clang.