Commit Graph

21434 Commits

Author SHA1 Message Date
Saleem Abdulrasool
5df0be0247 RemoteInspection: clean up CMakeLists.txt slightly (NFC)
Inline single use variable, inline CPP definition, and reflow some text.
2024-02-27 14:31:26 -08:00
Karoy Lorentey
16240a1342 [stdlib] Do not introduce any new ABI symbols for _get*RetainCount 2024-02-27 13:18:28 -08:00
Holly Borla
420859cdb4 Merge pull request #71906 from hborla/extract-function-isolation
[Concurrency] Add an API in the Concurrency library for extracting isolation from a dynamically isolated function value.
2024-02-27 09:19:44 -08:00
Mike Ash
81480b5b46 Merge pull request #71891 from mikeash/libprespecialize-rtld-noload
[Runtime] Harden SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH.
2024-02-27 09:09:22 -05:00
Oscar Byström Ericsson
e8db705e43 FlattenSequence/distance(from:to:) untrapping Int.min (v2).
A better, albeit a bit more verbose, method.
2024-02-27 11:51:08 +01:00
Oscar Byström Ericsson
401f8d13fe FlattenSequence/distance(from:to:) untrapping Int.min
This patch makes it so FlattenSequence/distance(from:to:) can return Int.min without trapping.
2024-02-27 07:14:46 +01:00
Holly Borla
59507ba361 [Concurrency] Add an API for extracting the isolation of a dynamically isolated
function value.
2024-02-26 17:59:27 -08:00
Ian Anderson
89b5215e73 Merge pull request #71864 from ian-twilightcoder/builtin-float-overlay-magic
[overlay] magic-symbols-for-install-name conflicts with @_originallyDefinedIn
2024-02-26 16:17:53 -08:00
Doug Gregor
7ff06a7f8b Merge pull request #71895 from DougGregor/unbreak-flat-map-abi
Fix accidental ABI break with AsyncSequence.flatMap
2024-02-26 13:29:30 -10:00
Doug Gregor
8c452b5cf5 Fix accidental ABI break with AsyncSequence.flatMap
At the type that I introduced type throws into AsyncSequence and its
algorithms, I accidentally dropped a `@preconcurrency` on the ABI
entrypoint, leading to a mangled name change.

Fixes rdar://123639030.
2024-02-26 12:38:56 -08:00
Guillaume Lessard
12010d63b5 Merge pull request #71871 from amomchilov/grammar-fix-seq-strart-with
Fix grammar in `starts(with:)` docs
2024-02-26 12:23:54 -08:00
Mike Ash
20d60406cb [Runtime] Harden SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH.
Have SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH use dlopen with RTLD_NOLOAD. We don't want it to allow loading arbitrary dylibs. Instead, a user can use something like DYLD_INSERT_LIBRARIES to load the dylib, which we will then pick up in the runtime, and processes that deny DYLD_INSERT_LIBRARIES will not be able to work around it with SWIFT_DEBUG_LIB_PRESPECIALIZED_PATH.

rdar://123643585
2024-02-26 14:38:09 -05:00
Guillaume Lessard
321e40e701 Merge pull request #71648 from oscbyspro/better-joined-distance-from-to
FlattenSequence/distance(from:to:) enhancements.
2024-02-26 04:21:34 -08:00
Doug Gregor
0c9c734f7e Merge pull request #71722 from DougGregor/diagnostic-style-swift-default 2024-02-24 14:42:38 -10:00
Alexander Momchilov
123fd36efb "a equivalence" → "an equivalence" 2024-02-24 19:32:50 -05:00
Ian Anderson
be413e96b4 [overlay] magic-symbols-for-install-name conflicts with @_originallyDefinedIn
The _Builtin_float interfaces were defined in $@rpath/lib/libswiftDarwin.dylib until macOS 10.14.4 and then in usr/lib/swift/libswiftDarwin.dylib after that. We were trying to use magic-symbols-for-install-name for the first one and @_originallyDefinedIn for the second one. However, @_originallyDefinedIn uses the @available introduced version as the first bound for $ld$previous$ which conflicts with the magic-symbols-for-install-name $ld$install_name$. Eventually @_originallyDefinedIn will need to support multiple install names, but until then just use it as-is and stop using magic-symbols-for-install-name.

Add the missing @_originallyDefinedIn on FLT_RADIX, and match the watchOS/tvOS order between @_originallyDefinedIn and @available.
There was no tvOS 7.0, the first one was 9.0.

rdar://122351557
2024-02-23 23:15:27 -08:00
Dave Lee
557628cd08 [Debugging] Use SWIFT_NATIVE_SWIFT_TOOLS_PATH if defined (#71814)
Fixes cross-host builds. See https://github.com/apple/swift/pull/71425/files#r1498582734
2024-02-23 14:19:17 -08:00
Alastair Houghton
b2509d9306 [Runtime] Don't use <sys/errno.h>.
We should always be using `<errno.h>`, not `<sys/errno.h>`.  The
former is part of the C standard.  The latter is a non-standard
header that happens to be present on some systems.

rdar://123507361
2024-02-23 16:02:31 +00:00
Ben Barham
1d2ef3a003 [stdlib] Move the remaining 5.11 availability to 6.0
Presumably this was a mid-air collision between two PRs. Just update the
remaining references.
2024-02-22 19:51:27 -08:00
Dave Lee
41add6df9f [Debugging] Disable use of DebugDescriptionMacro when bootstrapping is off (#71820) 2024-02-22 16:21:24 -08:00
Pavel Yaskevich
f9ec3b1d7e Merge pull request #71796 from xedin/make-dist-new-requirements-conditionally-available
[Distributed] Make new protocol requirements conditionally available
2024-02-22 15:18:52 -08:00
Allan Shortlidge
2a03207e54 Merge pull request #71802 from tshortli/typed-throws-in-inlinable-code
stdlib: Avoid condfails resulting from typed throws adoption
2024-02-22 14:03:26 -08:00
Ian Anderson
5acd961347 Merge pull request #71474 from ian-twilightcoder/builtin-float-overlay
[overlay] Make an overlay for the clang _Builtin_float module
2024-02-22 12:25:54 -08:00
Mishal Shah
cb96ec2893 Merge remote-tracking branch 'origin/main' into bump-swift-version-to-6 2024-02-22 09:44:44 -08:00
Konrad `ktoso` Malawski
1d44e2e8e0 [Distributed] Undo new record and mangling scheme for dist.p.witnesses (#71801) 2024-02-22 23:02:29 +09:00
Alastair Houghton
bfb6a58040 Merge pull request #71781 from al45tair/eng/PR-117963394-take2
[CommandLine][Linux] Don't read argv from /proc/self/cmdline (take 2).
2024-02-22 09:05:03 +00:00
Allan Shortlidge
25c0ed6008 stdlib: Avoid condfails resulting from typed throws adoption.
The standard library's swiftinterface must temporarily remain buildable when
`$TypedThrows` evaluates to false since there are still supported Swift 5.11
compilers that did not have the feature enabled by default. Declarations using
typed throws in their signatures are guarded in printed swiftinterface files
with `#if $TypedThrows` and therefore `@inlinable` code that uses those
declarations must also be conditionalized on `$TypedThrows`.
2024-02-21 20:38:39 -08:00
Ben Barham
5637284e48 Merge pull request #71368 from bnbarham/std-optional-all-the-things
Migrate llvm::Optional to std::optional
2024-02-21 16:54:00 -08:00
Guillaume Lessard
e90df7ef47 Merge pull request #71199 from glessard/utf8-license-header
[gardening] add a missing license header
2024-02-21 16:05:15 -08:00
Pavel Yaskevich
2bd1825a1f [stdlib] Distributed: Mark all new protocol requirements as available starting from stdlib 5.11 2024-02-21 13:29:47 -08:00
Mishal Shah
b8cd763b21 Merge branch 'main' into bump-swift-version-to-6 2024-02-21 12:40:54 -08:00
Ben Barham
ef8825bfe6 Migrate llvm::Optional to std::optional
LLVM has removed llvm::Optional, move over to std::optional. Also
clang-format to fix up all the renamed #includes.
2024-02-21 11:20:06 -08:00
Yuta Saito
d3d4bd203c Merge pull request #71768 from kateinoigakukun/pr-5b0947b86ee45b937e9b6fedd0963644227b754d 2024-02-22 04:07:42 +09:00
Joe Groff
ce0a04393c Revert "Switch to malloc_good_size instead of malloc_size (#70532)"
This reverts commit 0843891eb9.
2024-02-21 10:26:37 -08:00
Pavel Yaskevich
763e83bd01 Merge pull request #71765 from xedin/fix-abi-break-in-distributed-with-invokeOnReturn
[stdlib] Distributed: Bring back `DistributedActorSystem::invokeHandl…
2024-02-21 09:28:16 -08:00
Dave Lee
5b35938e5b [Debug] Introduce use of DebugDescription macro in stdlib (#71425)
Introduces the first use of `@_DebugDescription` in the standard library, applying it 
to `ObjectIdentifier`. In order to use the DebugDescription macro in the stdlib, the 
following changes are required:

1. Compilation must reference the just built macros (ie `libSwiftMacros.dylib`), not 
those from the SDK. This is addressed by adding an explicit `-external-plugin-path` 
flag that overrides the defaults generated by the compiler (which uses SDK paths, where 
the macro may or may not exist, and may not be the current version).
2. As DebugDescription uses `@_section`, compilation enables the `SymbolLinkageMarkers` 
feature.

Note that the use of DebugDescription is conditionally enabled for the following 
reasons:

1. Use is disabled in freestanding builds, where the stdlib macros are not built.
2. Use is temporarily disabled in Linux builds due to a dynamic loader issue that needs 
further investigation

The dynamic loader error causing issues with Linux CI is:
> swift-plugin-server: error while loading shared libraries: libswiftGlibc.so: cannot 
open shared object file: No such file or directory

This PR depended on #71639, #71588, and #71685.
2024-02-21 09:17:10 -08:00
Augusto Noronha
de75f0aa7e Merge pull request #71769 from augusto2112/gen-class-enum
Generate full debug info for generic enums and classes, and emit spare bits mask of MPE enums
2024-02-21 06:34:19 -08:00
Alastair Houghton
5f1a540010 [CommandLine][Linux] Don't assume the stack is one range in maps.
In `/proc/self/maps`, the stack isn't necessarily a single range, even
immediately after process start-up.  Apparently sometimes it's possible
for the kernel to allocate extra ranges below the first one, and these
show up separately in `/proc/self/maps`.

The upshot was that we were finding that `environ` didn't point into
the stack range we found, and then returning no arguments as a result.

The fix is to merge contiguous ranges after the first stack range we
find in `/proc/self/maps`.

rdar://117963394
2024-02-21 14:29:30 +00:00
Alastair Houghton
ff1cfbd274 [CommandLine][Linux] Don't read from /proc/self/cmdline (take 2)
This reverts the reversion of #71611.

rdar://117963394
2024-02-21 14:29:17 +00:00
Oscar Byström Ericsson
9abed8c833 FlattenSequence/distance(from:to:) enhancements v3.
A half-open range is a better expression of intent.
2024-02-21 09:59:54 +01:00
David Smith
f1feba0e42 Eytzingerize word break data (#71731)
Switch word break property searching to Eytzinger binary search
2024-02-20 22:49:34 -08:00
Mishal Shah
b488702cc9 Merge remote-tracking branch 'origin/main' into bump-swift-version-to-6 2024-02-20 21:04:47 -08:00
Pavel Yaskevich
f5ed53d918 Revert "[stdlib] Distributed: Remove invokeOnReturn requirement and its synthesis"
This reverts commit 961aa30d46.
2024-02-20 20:33:02 -08:00
Yuta Saito
f3f13a2637 [wasm] Enable --gc-sections for WebAssembly by default
This change enables the `--gc-sections` linker flag for WebAssembly
targets by default. This flag has been disabled because it did not
respect `llvm.used` and it caused stripping `swift5` metadata sections
even though they were used through encapsulation symbols (a.k.a `__start`/`__stop`).

The issue has been fixed in the LLVM side (ba3c1f9ce3)
by adding new segment flags to the WebAssembly object file format.
2024-02-21 02:13:01 +00:00
Augusto Noronha
b42752a900 Add interface for lookup of external MultiPayloadEnumDescriptor
This is a follow up patch that allows for external DescriptorFinders to
provide MultiPayloadEnumDescriptors (this is done to support embedded
Swift debugging, which encodes the equivalent of Swift metadata as
DWARF).
2024-02-20 15:38:54 -08:00
Mishal Shah
96d61d3c5c Merge remote-tracking branch 'origin/main' into bump-swift-version-to-6 2024-02-20 14:31:55 -08:00
Joe Groff
261bae0ee5 Revert "[CommandLine][Linux] Don't read argv from /proc/self/cmdline." 2024-02-20 13:19:43 -08:00
Joe Groff
a0810ec93a Merge pull request #71684 from jckarter/value-ownership-abi-fix
Fix ABI breakage caused by `ValueOwnership` order change.
2024-02-20 11:17:55 -08:00
Alastair Houghton
5a90430620 Merge pull request #71611 from al45tair/eng/PR-117963394
[CommandLine][Linux] Don't read argv from /proc/self/cmdline.
2024-02-20 18:45:34 +00:00
Dave Lee
b79c4ded76 [Debugging] Expand DebugDescriptionMacro docstring (#71700)
Describe more details of `DebugDescriptionMacro`.
2024-02-20 10:28:31 -08:00