swift
8dd36fe4 - [cxx-interop] Modularize __msvc_bit_utils on Windows

Commit
1 year ago
[cxx-interop] Modularize __msvc_bit_utils on Windows `__msvc_bit_utils.hpp` was added in a recent version of MSVC, and it is causing build errors for SwiftCompilerSources: ``` C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:12: error: function '_Select_countr_zero_impl<unsigned long long, (lambda at C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\include\numeric:598:55)>' with deduced return type cannot be used before it is defined return _Select_countr_zero_impl<_Common_unsigned>([=](auto _Countr_zero_impl) { ``` This change references the `__msvc_bit_utils.hpp` header from the modulemap. Since we still need to support older versions of Visual Studio that do not provide `__msvc_bit_utils.hpp`, this also teaches ClangImporter to inject an empty header file named `__msvc_bit_utils.hpp` into the system include directory, unless it already exists. rdar://137066642 (cherry picked from commit 16e7cbeafac991e8a732e686feca5000736e87bb)
Author
Committer
Parents
Loading