最初から、Windows 用の PVS-Studio C ++ アナライザー (2006 年にはまだ Viva64 バージョン 1.00) は、MSVC コンパイラーを使用してアセンブルされていました。新しい C ++ リリースのリリースにより、アナライザー コアは Linux および macOS で動作することを学習し、プロジェクト構造は CMake を使用するように切り替えられました。ただし、Windows では、ビルドは引き続き MSVC コンパイラを使用して行われました。2019 年 4 月 29 日、Visual Studio 開発者は、開発環境に一連の LLVM ユーティリティと Clang コンパイラを含めることを発表しました。そして今、ついにそれを実際に試すことができました。
性能試験
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.