`<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.
Add a couple of submodules for these modules to further modularise the
headers. This might expose additional APIs now as some of these headers
would not have been indirectly included and wind up in the wrong module.
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.
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.
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.
As of CMake 3.25, there are now global variables `LINUX=1`, `ANDROID=1`,
etc. These conflict with expressions that used these names as unquoted
strings in positions where CMake accepts 'variable|string', for example:
- `if(sdk STREQUAL LINUX)` would fail, because `LINUX` is now defined and
expands to 1, where it would previously coerce to a string.
- `if(${sdk} STREQUAL "LINUX")` would fail if `sdk=LINUX`, because the
left-hand side expands twice.
In this patch, I looked for a number of patterns to fix up, sometimes a
little defensively:
- Quoted right-hand side of `STREQUAL` where I was confident it was
intended to be a string literal.
- Removed manual variable expansion on left-hand side of `STREQUAL`,
`MATCHES` and `IN_LIST` where I was confident it was unintended.
Fixes#65028.
It shares many of the same values as OpenBSD (which both inherited from 4.4BSD),
and we wouldn't expect those to diverge due to the respective platforms'
bincompat goals.
This patch goes through and adds zippering and the swift module
dependencies to a bunch of pieces of the swift runtimes. Here's to
hoping I hit everything that needed to be hit. :D
With this patch, I'm seeing the appropriate modules under
lib/swift/maccatalyst, so things seem to be working right.
When SwiftGlibc.h was added in #32404, no cmake code was added to copy it to the
static resources. Copy it along with glibc.modulemap, which references it.
This macro was previously substituted when generating `glibc.modulemap` file during the compiler build. Now Swift detects the location of Glibc dynamically and injects `glibc.modulemap` into it using LLVM VFS. The last usage of `GLIBC_INCLUDE_PATH` was removed in `78c0540b`.
This also removes `SWIFT_SDK_${sdk}_ARCH_${arch}_LIBC_INCLUDE_DIRECTORY` which doesn't have any usages left.
This improves portability of the Swift toolchains by removing a usage of absolute path to Glibc.
The Glibc modulemap is now injected into the Glibc include path using LLVM VFS, so it can reference Glibc headers using relative paths. This already works for other Glibc headers (e.g. `assert.h`)
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.
`assert.h` is missing from the modulemap, which causes clang to consider `assert.h` to be a part of the first module to include it. This causes issues in SwiftCompilerSources when we try to use classes coming from LLVM headers on Linux.
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.
Correct the header spelling for the ssse3 module. The suffix was
incorrect which was ignored as a result. This was identified by the
`modularize` tool from clang-tools-extras.
This introduces the `_visualc_intrinsics` module, which is the MSVC
analogue to `_Builtin_intrinsics` from clang. This is needed for the
ARM64 SDK build which will attempt to use the neon intrinsics during the
build.
Clean up the submodules in visualc to not export all imported modules.
The one special case is `vcruntime` which re-exports `SAL` due to a
dependency in the headers. The import of `visualc` however will
re-export all submodules to keep the current behaviour. This is
required to get the ARM64 SDK building on newer MSVC toolsets.
* [WIP] Initial draft at v2 Clock/Instant/Duration
* Ensure the literal types for _DoubleWide are able to be at least 64 bits on 32 bit platforms
* static cast timespec members to long
* Remove runtime exports from clock functions
* Export clock functions in implementations as they are in headers
* Clean up internal properties by adding leading underscores, refine availability to a TBD marker macro, and break at 80 lines to match style
* Shift operators to concrete Instant types to avoid complexity in solver resolution
* Adjust diagnostic note and error expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions
* Update stdlib/public/Concurrency/TaskSleep.swift
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
* [stdlib][NFC] Remove trailing whitespace
* [stdlib] Remove _DoubleWidth from stdlib's ABI
* [stdlib] Strip downd _DoubleWidth to _[U]Int128
* Additional adjustments to diagnostic notes and errors expectation of ambiguities to reflect new potential solver (perhaps incorrect) solutions
* Disable type checker performance validation for operator overload inferences (rdar://33958047)
* Decorate Duration, DurationProtocol, Instant and clocks with @available(SwiftStdlib 9999, *)
* Restore diagnostic ambiguity test assertion (due to availability)
* Add a rough attempt at implementing time accessors on win32
* Remove unused clock id, rename SPI for swift clock ids and correct a few more missing availabilities
* remove obsolete case of realtime clock for dispatch after callout
* Use the default implementation of ~ for Int128 and UInt128
* Ensure diagnostic ambiguitiy applies evenly to all platforms and their resolved types
* Restore the simd vector build modifications (merge damage)
* Update to latest naming results for Instant.Duration
* Updates to latest proposal initializers and accessors and adjust encoding/decoding to string based serialization
* Update availability for Clock/Instant/Duration methods and types to be 5.7
* Correct *Clock.now to report via the correct runtime API
* Ensure the hashing of Duration is based upon the attoseconds hashing
* Avoid string based encoding and resort back to high and low bit encoding/decoding but as unkeyed
* Adjust naming of component initializer to use suffixes on parameters
* Duration decoding should use a mutable container for decoding
* fix up components initializer and decode access
* Add platform base initializers for timespec and tiemval to and from Duration
* Add some first draft documentation for standard library types Duration, DurationProtocol and InstantProtocol
* Another round of documentation prose and some drive-by availability fixes
* InstantProtocol availability should be 5.7
* Correct linux timeval creation to be Int and not Int32
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
This adds the memoryapi submodule to WinSDK which isolates the memoryapi
contract. This enables additional functions such as
`QueryVirtualMemoryRegion` to now be available.
This migrates OpenBSD to use the single-header Glibc modulemap proposed
and implemented in #32404, and necessitates introducing some missing
headers for building Foundation added in #38341.
Additionally, incorporate nullability annotations in SwiftShims per