Commit Graph

18436 Commits

Author SHA1 Message Date
Max Desiatov
cc72301a87 Merge pull request #66531 from swiftwasm/pr-8addaa1d85ba6750d500373b55bd9451e869c8e6
[stdlib] Fix calling convention mismatch for debugger utility functions
2023-08-01 09:49:37 +01:00
DianQK
017d31fc31 [Backtracing][Linux] Support the DW_AT_specification attribute.
Support parsing the following format:
```
0x0000104b: DW_TAG_subprogram
              DW_AT_specification (0x00000d23 "$s8CrashOpt6level1yyF")
              DW_AT_inline (DW_INL_inlined)
```
2023-08-01 06:59:56 +08:00
Max Desiatov
819d9847a5 stdlib/public/core: use UInt(bitPattern:) to make sure casts work 2023-07-31 16:50:52 +01:00
Dario Rexin
b82ac6bcdf Merge pull request #67599 from drexin/wip-112474091
[Runtime] Fix _swift_refCountBytesForMetatype for reference types
2023-07-28 14:53:56 -07:00
Dario Rexin
f257b3bbab [Runtime] Fix _swift_refCountBytesForMetatype for reference types
_swift_addRefCountStringForMetatype and _swift_refCountBytesForMetatype diverged in the code that determines whether a type is a reference, causing the size number of ref count bytes to differ from the actually used bytes. This can cause early termination of the runtime interpreter functions, which in turn causes unbalanced reference counts.

rdar://112474091
2023-07-28 11:55:53 -07:00
Slava Pestov
50b8c347eb Merge pull request #67565 from slavapestov/fix-issue67322
TypeDecoder: Push one-element tuple unwrapping down into createTupleType() implementations
2023-07-28 09:32:03 -04:00
Alex Lorenz
a219cfa632 Merge pull request #67557 from hyp/eng/64457
[cxx-interop][linux] modularize the bits part of libstdc++
2023-07-27 20:48:11 -07:00
Alex Lorenz
c215abdd8c [cxx-interop][linux] modularize the bits part of libstdc++
Fixes https://github.com/apple/swift/issues/64457
2023-07-27 10:20:28 -07:00
Slava Pestov
3a24b5361d TypeDecoder: Push one-element tuple unwrapping down into createTupleType() implementations
The old behavior was only correct when building substituted types,
ie, if createTupleType() was never called with a pack expansion type.

This was the case in the runtime's MetadataLookup which applies
substitutions to an interface type to ultimately construct metadata
for a fully-concrete type, but not in the ASTDemangler, where we
actually build interface types.

Since TypeDecoder doesn't have any way to query the kind of type
it just built, let's just instead make this decision inside the
implementation of the type builder concept.

Fixes https://github.com/apple/swift/issues/67322.
2023-07-27 12:14:54 -04:00
Saleem Abdulrasool
999b7900f0 Merge pull request #67553 from compnerd/modules
Platform: improve module definitions for Windows
2023-07-27 07:22:27 -07:00
swift-ci
fa17a05fad Merge pull request #67547 from mikeash/null-check-generic-args
[Runtime] Gracefully handle null genericArgs in SubstGenericParametersFromMetadata.
2023-07-26 19:42:08 -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
d4c5f2a845 Platform: add an additional corecrt submodule
This was detected as missing when trying to re-modularise MSVCPRT.
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
Egor Zhdan
276a232ea8 Merge pull request #67536 from apple/egorzhdan/unsafe-cxx-mutable-input-iterator
[cxx-interop] Add `UnsafeCxxMutableInputIterator` protocol
2023-07-26 22:15:57 +01:00
Mike Ash
b7f73cd52b [Runtime] Gracefully handle null genericArgs in SubstGenericParametersFromMetadata.
If a caller passes NULL generic parameters when looking up a generic type, we'll error and return NULL instead of crashing.

rdar://112153818
2023-07-26 16:49:52 -04:00
Egor Zhdan
8d7d0efe13 [cxx-interop] Add UnsafeCxxMutableInputIterator protocol
This is an inheritor of the existing `UnsafeCxxInputIterator` protocol, with the only difference being the ability to mutate `var pointee` via a non-const `operator*()`.

This is needed to support mutable subscripts for `std::map` via `CxxDictionary`.

rdar://105399019
2023-07-26 18:20:49 +01:00
Kirby Turner
73ded0f8c4 Update documentation links to the Observable macro and protocol. 2023-07-26 09:52:29 -04:00
Slava Pestov
82c172c8e3 Merge pull request #67527 from slavapestov/rdar112866068
Runtime: Lift prohibition on packs in swift_getTypeByMangledName() overload used by mirrors
2023-07-26 06:49:00 -04:00
Slava Pestov
e454458e2a Runtime: Lift prohibition on packs in swift_getTypeByMangledName() overload used by mirrors
Fixes rdar://problem/112866068.
2023-07-25 23:15:01 -04:00
Dario Rexin
620d516fe7 [Runtime] Fix MultiPayloadEnumFN case in swift_resolve_resilientAccessors
rdar://112825968

Offsets were wrong, causing invalid memory accesses
2023-07-25 13:50:17 -07:00
Alastair Houghton
6430cede12 Merge pull request #67505 from al45tair/eng/PR-112662487-part2
[Linux][Backtracing] Fix CMake scripts to install correctly.
2023-07-25 15:31:36 +01:00
Mike Ash
9f70da0726 Merge pull request #67457 from mikeash/task-cancellation-deadlock-docs
[Concurrency] Warn about deadlock potential in withTaskCancellationHandler docs.
2023-07-25 10:09:59 -04:00
Alastair Houghton
7873f52074 [Linux][Backtracing] Fix CMake scripts to install correctly.
The script erroneously used `UNIVERSAL_LIBRARY_NAME` instead of
`UNIVERSAL_NAME`.

rdar://112662487
2023-07-25 12:13:07 +01:00
Dario Rexin
f96b099ce9 Merge pull request #67485 from drexin/wip-fix-offset-writing-resolve
[Runtime] Fix issues with dynamic layout string instantiation
2023-07-24 13:09:52 -07:00
Ben Barham
b962cab6e1 Merge pull request #67478 from finagolfin/droid-ci
[Backtracing][Linux] Disable invoking process_vm_readv() for older Android APIs
2023-07-24 10:14:19 -07:00
Dario Rexin
6fb232510b [Runtime] Fix SinglePayloadEnumSimple read offset in swift_resolve_resilientAccessors
The offset was off by 1, causing subsequent tags to not be resolved properly.
2023-07-24 09:47:42 -07:00
Evan Wilde
669285fd17 Merge pull request #65534 from stephank/fix/cmake-3.25
build: fix accidental cmake expansions
2023-07-24 09:44:14 -07:00
Dario Rexin
10685367ce [Runtime] Use the properly resolved tag when adding offset after resolving relative pointers in layout strings
The tag was overwritten after resolve when a prior field caused a non-zero offset. This then caused the runtime to treat is a relative instead of an absolute pointer, causing invalid pointers to be dereferenced.
2023-07-24 09:36:26 -07:00
Saleem Abdulrasool
92e02b2a54 Merge pull request #67481 from compnerd/monikers
Platform: add URL Monikers to the WinSDK overlay
2023-07-23 19:34:56 -07:00
Konrad `ktoso` Malawski
244c48974c Merge pull request #67463 from ktoso/wip-executor-docs 2023-07-24 10:46:54 +09:00
Saleem Abdulrasool
a0500be652 Platform: add URL Monikers to the WinSDK overlay
Add a module definition for importing the URL Monikers interfaces.  This
is in service of DocC.
2023-07-23 14:33:57 -07:00
Finagolfin
4cbbb33dbf [Backtracing][Linux] Disable invoking process_vm_readv() for older Android APIs 2023-07-23 20:11:26 +05:30
Franz Busch
8dda2274bc Replace custom Deque implementation with swift-collection Deque
# Motivation
For AsyncStream we created a custom internal Deque implementation to use for the buffering. This implementation was relatively bare-bones compared to the one in swift-collections. Furthermore, it lacked some methods that we need to implement the new `AsyncStream` APIs that support producer backpressure.

# Modification
This PR copies over the Deque implementation of swift-collections and makes it internal and non-inlinable.

# Result
We now have a fully functional Deque.
2023-07-23 08:33:03 +01:00
Konrad `ktoso` Malawski
3b9be36f90 docs: fix old spelling of assert/assume APIs in docs 2023-07-22 09:19:39 +09:00
Mike Ash
1c86195349 [Concurrency] Warn about deadlock potential in withTaskCancellationHandler docs.
withTaskCancellationHandler gets called with the task status record lock held, so care needs to be taken if the cancellation handler acquires any locks of its own. Update the docs comment to describe this.

rdar://111686260
2023-07-21 16:31:18 -04:00
swift-ci
64ba7ffd16 Merge pull request #67289 from natecook1000/observation_peer_macros
[Observation] Switch to peer instead of arbitrary macros
2023-07-21 12:26:27 -07:00
Alastair Houghton
c3b925cd1f [Linux][Backtracing] Fix incorrect line number generation.
The code that looks up line numbers wasn't respecting the end-sequence
flag, so it could "find" a line number between the end of one sequence
and the beginning of another.  That was wrong.

rdar://112595022
2023-07-20 15:33:24 +01:00
Alastair Houghton
a73e98c660 [Linux][Backtracing] Fix unwinder so it stops properly.
On Linux specifically, it was possible for it to return `nil` to signal
the end of the unwind, then subsequently return non-`nil` again.  That
violates the expectations of the code layered above it, and can cause
an "Index out of range" error to occur.

rdar://112534548
2023-07-20 15:32:57 +01:00
Nate Cook
5b9d68b023 Merge branch 'main' into observation_peer_macros 2023-07-19 16:05:43 -05:00
Max Desiatov
fc1043ec3b StdlibUnittest: fix building with WASI (#67394)
This file can now be built for WASI when `WASILibc` is imported. Only slight branching is needed to disable child process spawning for this platform.
2023-07-19 18:51:40 +01:00
Max Desiatov
972af58bba WASI: support emulated signals in InterceptTraps.cpp (#67393)
When building with `_WASI_EMULATED_SIGNAL` excluding signal support on WASI is no longer needed.
2023-07-19 18:50:54 +01:00
Egor Zhdan
390beb9315 Merge pull request #67398 from apple/egorzhdan/cxx-pair-mutable
[cxx-interop] Make CxxPair's fields mutable
2023-07-19 18:34:03 +01:00
Alex Lorenz
3748b0ff1c Merge pull request #65129 from hyp/eng/no-evo-cxx
[interop] Prohibit use of C++ APIs in public interfaces that opt-in i…
2023-07-19 08:10:23 -07:00
Egor Zhdan
4ca1eeb141 [cxx-interop] Make CxxPair's fields mutable
This will be needed to support mutable C++ iterators, e.g. `std::map::iterator`.
2023-07-19 16:05:28 +01:00