Commit Graph

20 Commits

Author SHA1 Message Date
Saleem Abdulrasool
79d2af759b ClangImporter: support modularizing __msvc_string_view.hpp
This header was introduced in a recent STL release. Modularise the
header properly, adding a shim for compatibility with older releases.

Partially based on a change from @egorzhdan.
2025-02-10 12:48:35 -08:00
furby™
c68b0d8320 Fix typos in VCRuntime modulemap.
* https://github.com/swiftlang/swift/issues/77351

Signed-off-by: furby™ <devs@wabi.foundation>
2024-11-01 19:16:00 -06:00
Egor Zhdan
16e7cbeafa [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
2024-10-04 13:15:20 +01:00
Saleem Abdulrasool
b68188b00c Platform: add new module for VC 17.10.0
The new headers for LWG-3268 in the new VC release broke the
modularisation of `std.atomic`. Add the dependent private module to
ensure that we correctly modularise the dependency and allow
`std.atomic` to be built again.
2024-05-22 13:10:08 -07:00
Saleem Abdulrasool
47eb843f02 Merge pull request #67821 from stevapple/stevapple-patch-1-1
Remove `vcruntime._Private.xstddef`
2023-08-09 13:45:34 -07:00
Saleem Abdulrasool
af57672c0f Platform: further modularise vcruntime._Private
Create an explicit module for `xhash` to correct the usage for
`unordered_set`.
2023-08-09 13:45:21 -07:00
YR Chen
7c43dfb986 Remove vcruntime._Private.xstddef
`<xstddef>` was removed since MSVC 14.37. It isn't meant to be used by most users, but the reference will break all clients of `vcruntime`, including Swift standard library itself.
2023-08-09 18:53:00 +08:00
Saleem Abdulrasool
3de765cad3 Platform: correct requirements for std.unordered_set
This module requires C++11, not `unordered_set` which prevents the use
of the module.
2023-08-08 13:28:08 -07:00
Saleem Abdulrasool
3aec82da29 Platform: make stdint module implicit on Windows
This makes the `stdint` module implicit which repairs the ability to
build some components.  In order to accomplish this, we need to
potentially break the fragile Swift build system.  Due to the incorrect
handling of compilers we need some workarounds to support
cross-compilation.  This removes the injected system header paths when
building on Windows to ensure that the clang resource headers are not
following the system headers which breaks the modules as the clang
resources are dependent on the system headers when running in hosted
mode.
2023-08-04 15:37:59 -07:00
Saleem Abdulrasool
fc72e7cb0e Platform: add missing std._Private modules
Add the missing `std._Private.xstddef`, `std._Private.yvals`, and
`std._Private.yvals_core` modules.  This repairs the use of `std.map` as
a private member variable of a type with an explicit ctor.
2023-07-26 15:50:15 -07:00
Saleem Abdulrasool
04742d64e5 Platform: remove some deprecated modules from MSVCPRT
These modules were deprecated and do not exist in the distribution,
remove the commented out form.
2023-07-26 15:50:15 -07:00
Saleem Abdulrasool
e2466d05ab Platform: add some missing C++ modules for MSVCPRT
Add a couple of missing submodules to the modulemap.  This is for
completeness and to help with newer MSVCPRT releases.
2023-07-26 15:50:14 -07:00
Saleem Abdulrasool
39e1a72d56 Platform: add std._Private.xutility for Windows
This adds the `xutility` module to strip that from the first modular
inclusion of the header.
2023-07-26 15:50:14 -07:00
Saleem Abdulrasool
4667c12f48 Platform: introduce a std._Private module for Windows
These headers are not meant to be publicly consumed, introduce a
`_Private` module for internal use for the `std` module.
2023-07-26 15:50:14 -07:00
Saleem Abdulrasool
33f4bcb8b2 Platform: add std.iomanip on Windows
Add the missing submodule for `iomanip` on Windows.
2023-07-26 15:50:13 -07:00
Saleem Abdulrasool
c5fc76d995 Platform: add some version indicators on C++ submodules
Specify the C++ standard required for these submodules.  Although this
has no practical implications, it is useful for isolating the features
with different C++ standards.
2023-07-26 15:50:13 -07:00
Saleem Abdulrasool
b420071835 vcruntime: adjust module definition further
Add some of the x* headers to the c++ module.  These are included
multiply and so we create private modules for them rather than
associate them with a different module which could cause issues
in practice due to intra-module dependencies.
2022-08-14 08:02:12 -07:00
Saleem Abdulrasool
f57fe44fdb Update vcruntime.modulemap
Remove `spanstream` header from the module until we can identify a way to do per-release variants.
2022-06-28 19:01:41 -07:00
Saleem Abdulrasool
1779c569c8 Platform: add a definition for std on Windows
This adds the c++ module for Windows to help further the C++ interop.
2022-06-28 16:10:37 -07:00
Saleem Abdulrasool
fc070c6167 platform: restructure visualc module
Restructure the `visualc` module into `vcruntime` in order to help
expose the various components (SAL, vcruntime, ucrt, corecrt, STL) for C++
modularization.  Include the `stdint.h` textually to deal with
redefinition of types in clang resources and MSVC.
2022-06-26 14:06:59 -07:00