Commit Graph

178828 Commits

Author SHA1 Message Date
Fabrice de Gans
5d90af9f23 [caches] Add cache files for macOS Runtime builds 2025-01-16 12:11:00 -08:00
Alastair Houghton
452302e3b9 Merge pull request #78679 from al45tair/fix-stdint-include-error
[Backtracing] Don't include things inside a namespace.
2025-01-16 19:00:19 +00:00
Michael Gottesman
2adc68b36b Merge pull request #78665 from gottesmm/pr-054dfe289af455d0471eefd8e16ff4496a45c2f9
[concurrency] Inherit caller isolation inheriting when inferring isolation from a nominal type context for a method on the nominal type.
2025-01-16 10:41:02 -08:00
Saleem Abdulrasool
0e77477147 Merge pull request #78553 from compnerd/well-known-imports
IRGen: further generalise runtime function generation
2025-01-16 09:25:54 -08:00
Saleem Abdulrasool
5f0bd9b005 Merge pull request #78275 from andrurogerz/swift-inspect-android
[swift-inspect] implement Android support including remote heap iteration
2025-01-16 09:20:59 -08:00
Eric Miotto
cb47eb14f3 Merge pull request #78667 from edymtt/edymtt/change-minsize-rel-flags-for-apple-platforms
[CMake] Update MinSizeRel configuration for Apple platforms...
2025-01-16 07:29:55 -08:00
John Hui
5a4ff294c8 [cxx-interop] Forbid C++ function template instantiation with Swift types (#77430)
Instantiating C++ function templates with Swift types is not currently supported, but the Swift compiler attempts to do so. Sometimes this leads to a compiler crash; other times it leads to a runtime crash. This patch turns those crashes into compiler errors.

At the call site of a C++ function template, the Swift compiler must convert Swift types deduced by the Swift type checker back into Clang types, which are then used to instantiate the C++ function template. Prior to this patch, this conversion was performed by ClangTypeConverter::convert(), which converts unsupported Swift types. This patch factors out some reusable parts of convert() and uses them in a new ClangTypeConverter::convertTemplateArgument() method that only converts supported template argument types. In the future, this method can be elaborated to support instantiating C++ templates with more types.

rdar://112692940
2025-01-16 10:05:20 -05:00
Alastair Houghton
ad78a86ca9 [Backtracing] Don't include things inside a namespace.
We shouldn't be including `<stdint.h>` inside the namespace.
2025-01-16 14:38:22 +00:00
Slava Pestov
d1d2411bf3 Merge pull request #78267 from slavapestov/incremental-bindings-part-0
Sema: Some small cleanups in CSBindings.cpp and related code
2025-01-16 09:03:32 -05:00
Venkatesh Sriram
a5cc53f356 Merge pull request #78511 from venkatesh5789/null-value-optional-extraction
[Compile Time Constant Extraction] Extract Nil Values for Optionals
2025-01-16 18:43:07 +05:30
Alastair Houghton
d6447284f8 Merge pull request #78514 from al45tair/eng/PR-137201928
[Backtracing] Update module maps.
2025-01-16 11:21:33 +00:00
Cassie Jones
9121192ddc Merge pull request #78676 from porglezomp-misc/workaround-simd-quatf 2025-01-16 03:19:19 -08:00
Andrew Trick
d18510bc83 Merge pull request #78675 from atrick/lifedep-comment
[NFC] Update an incomplete comment.
2025-01-16 00:17:24 -08:00
Venkatesh Sriram
c6c8526b87 [Compile Time Constant Extraction] Extract Nil Values for Optionals 2025-01-16 12:04:03 +05:30
Anthony Latsis
99c3802e02 Merge pull request #78669 from AnthonyLatsis/andromeda
[NFC] Add some unit tests for diagnostic behaviors
2025-01-16 06:30:56 +00:00
Tim Kientzle
5a284751de Merge pull request #78668 from tbkka/tbkka-missing-include
[Gardening] Include Runtime/Config.h directly
2025-01-15 21:32:19 -08:00
Cassie Jones
c7021ae979 [cxx-interop] Workaround name lookup issues with namespace simd
On Apple platforms, a system module `simd` declares a `namespace simd`
under `#if defined(__cplusplus)`. This namespace defines C++ overlays of
the simd types, but these types are already refined for Swift
separately, so it's not necessary to import this namespace.

This is the same issue previously encountered for the `os` module, work
around it in the same way.

rdar://143007477
2025-01-15 21:29:17 -08:00
Daniil Kovalev
ccdce9f514 [AutoDiff] Delete wrong FIXMEs (TF-284) from tests (#78663)
In AutoDiff/Sema/differentiable_attr_type_checking.swift, we have a
couple of following FIXMEs:

```
// FIXME(TF-284): Fix unexpected diagnostic.
```

However, the diagnostic is expected for the case of public protocol
requirements: see description https://github.com/swiftlang/swift/pull/30629.
This PR removed the diagnostic for less-than-public-visible requirements,
and the FIXME was initially related to them.

It looks like that the FIXMEs present now are a result of copy-paste and
have no meaning, and the diagnostic is expected and should be present and
does not need to be removed.

Fixes #78609
2025-01-15 20:36:46 -08:00
Allan Shortlidge
6576929902 Merge pull request #78642 from tshortli/warn-unrecognized-language-feature
Frontend: Implement optional parsing diagnostics for enabled language features
2025-01-15 20:28:18 -08:00
nate-chandler
b59280c0f0 Merge pull request #78624 from nate-chandler/rdar142520491_2
[OSSACanonicalizeOwned] Fix liveness passed to completion.
2025-01-15 19:38:21 -08:00
Slava Pestov
9a48fed9c7 Sema: Add BindingSet::operator==
This will be used for debugging.
2025-01-15 22:30:34 -05:00
Slava Pestov
bed95dd1a4 Sema: Simplify PotentialBindings updates a little 2025-01-15 22:30:34 -05:00
Slava Pestov
340a60b0b9 Sema: Add PotentialBindings::dump() and improve BindingSet::dump() 2025-01-15 22:30:33 -05:00
Slava Pestov
cfcc73f164 Sema: Add -solver-disable-splitter flag for debugging
We're not planning on removing the splitter because it is a big win
in some cases, but we want to run it less often since it can also
be a source of overhead. This flag allows us to compare performance
to understand the tradeoffs better.
2025-01-15 22:30:33 -05:00
Slava Pestov
1aff26eaa6 Sema: Store BindingSet inside the ConstraintGraphNode
Building the DenseMap in determineBestBindings() is extremely
expensive.

Also rename getCurrentBindings() to getPotentialBindings().
2025-01-15 22:30:32 -05:00
Anthony Latsis
87cf1179ff [NFC] Sema: Add Solution::getCalleeOverloadChoice 2025-01-16 02:35:26 +00:00
Andrew Trick
c839e265df [NFC] Update an incomplete comment. 2025-01-15 16:53:03 -08:00
Allan Shortlidge
24f5632ca1 Frontend: Implement optional parsing diagnostics for enabled language features.
Parsing for `-enable-upcoming-feature` and `-enable-experimental-feature` is
lenient by default because some projects need to be compatible with multiple
language versions and compiler toolchains simultaneously, and strict
diagnostics would be a nuisance. On the other hand, though, it would be useful
to get feedback from the compiler when you attempt to enable a feature that
doesn't exist. This change splits the difference by introducing new diagnostics
for potential feature enablement misconfigurations but leaves those diagnostics
ignored by default. Projects that wish to use them can specify `-Wwarning
StrictLanguageFeatures`.
2025-01-15 16:34:32 -08:00
Allan Shortlidge
4ea157efdb Frontend: Parse diagnostic options earlier.
Diagnostics may be emitted while parsing command line arguments. This implies
that the options which affect how diagnostics are emitted and presented need to
be parsed first.
2025-01-15 16:34:32 -08:00
Arnold Schwaighofer
29bcd2caa0 Merge pull request #78445 from aschwaighofer/loadable_by_address_magic_constant
LoadableByAddress: Replace some magic constants
2025-01-15 15:53:13 -08:00
Tim Kientzle
cf4701ce5d [Gardening] Include Runtime/Config.h directly
This file was relying on Runtime/Config.h for SWIFT_CC() but
didn't include it directly.

I found this when some local experiments went awry in confusing
ways.
2025-01-15 15:36:56 -08:00
Anthony Latsis
77ddc28167 [NFC] Add some unit tests for diagnostic behaviors 2025-01-15 23:23:50 +00:00
Anthony Latsis
29626c4427 [NFC] Diag: Rename error_in_future_swift_version wrappers
Be clear that these are about language mode.
2025-01-15 23:14:08 +00:00
Eric Miotto
0c33858e74 [CMake] Avoid using a couple flags when building MinSizeRel
This preserves the behaviour introduced in #33444.

Addresses rdar://142820419
2025-01-15 14:41:49 -08:00
Michael Gottesman
26512720db [concurrency] Inherit caller isolation inheriting when inferring isolation from a nominal type context for a method on the nominal type.
rdar://142790025
2025-01-15 14:41:26 -08:00
Michael Gottesman
c20a5b7bec Merge pull request #78660 from gottesmm/pr-d2eb2f2271cf2358744df06d6de4a08b14d73179
Fix misleading comment.
2025-01-15 14:37:29 -08:00
Eric Miotto
5d194a925e [CMake] Update MinSizeRel configuration for Apple platforms...
...and use it as a default for one of them.

Addresses rdar://142820419
2025-01-15 14:14:54 -08:00
Saleem Abdulrasool
ec70054c93 IRGen: further generalise runtime function generation
This adjusts the runtime function declaration handling to track the
owning module for the well known functions. This allows us to ensure
that we are able to properly identify if the symbol should be imported
or not when building the shared libraries. This will require a
subsequent tweak to allow for checking for static library linkage to
ensure that we do not mark the symbol as DLLImport when doing static
linking.
2025-01-15 13:54:34 -08:00
Andrew Trick
0f1295884d Merge pull request #78648 from atrick/cleanup-test
[NFC] cleanup test/SILOptimizer/addressable_dependencies.swift
2025-01-15 13:44:56 -08:00
Evan Wilde
e0b2197a3c Merge pull request #78659 from swiftlang/egorzhdan/logger-test-fix
[cxx-interop] Fix a failing test
2025-01-15 12:59:24 -08:00
Alex Hoppen
e2235e201c Merge pull request #78421 from ahoppen/add-sourcekit-plugin
[SourceKit] Add mechanism to load plugins for request handling into SourceKit
2025-01-15 12:42:10 -08:00
Nate Chandler
ebf602803e [OSSACanOwned] Fix liveness passed to completion.
To determine where a lifetime ends within dead-end blocks,
OSSACanonicalizeOwned uses OSSACompleteLifetime's
visitAvailabilityBoundary.  This API takes a liveness which it uses to
walk forward to the availability boundary.  Specifically, the liveness
passed from OSSACanonicalizeOwned to OSSACompleteLifetime is a variation
of OSSACanonicalizeOwned's own liveness (it has destroys added).

There is a mismatch in the characteristics of livenesses created by
OSSACanonicalizeOwned and OSSACompleteLifetime:  The former deals with
not only direct uses of a value but also uses of its copies; that
introduces the possibility for consuming uses in the middle of liveness.
The latter on the other hand deals only with uses of a single value
(nestedly, but at each level of nesting only a single value).  Passing a
liveness from the former to the latter without handling this mismatch
is incorrect: OSSACompleteLifetime understands consuming uses to always
end a lifetime, even when they are in the middle of a copy-extended
liveness.  The result is that OSSACompleteLifetime produces non-sensical
results when provided with such a liveness.

To address this, fixup the liveness passed from OSSACanonicalizeOwned to
OSSACompleteLifetime by demoting consuming uses that appear within
(that's to say _not_ on the boundary) of liveness to non-consuming uses.

rdar://142846936
2025-01-15 11:57:13 -08:00
Dave Lee
3e05e0bbf4 RemoteInspection: Append ResumeAsyncContext field to AsyncTaskInfo (#78645)
Expose a `Task`'s resume context via the `AsyncTaskInfo` struct.

This will be used by lldb, but since this data is not specific to lldb it seems reasonable to include it generally.
2025-01-15 11:41:41 -08:00
Guillaume Lessard
346704cdb7 Merge pull request #78647 from glessard/rdar142867382
[stdlib] fix getting eager-lazy-bridged Array buffer
2025-01-15 11:31:08 -08:00
Hiroshi Yamauchi
1d8e48dcf7 Merge pull request #78563 from hjyamauchi/issue78447
Add a reproducer for issue 78447
2025-01-15 10:56:06 -08:00
Andrew Rogers
f2649f20c8 PR Feedback: make PTrace.init fileprivate 2025-01-15 10:55:31 -08:00
Andrew Rogers
6381de4434 PR feedback: fix incorrect comment 2025-01-15 10:55:12 -08:00
Michael Gottesman
9960079656 Fix misleading comment. 2025-01-15 10:43:19 -08:00
Egor Zhdan
7537dac9b0 [cxx-interop] Fix a failing test
The API that is being used is not available on all versions of all platforms.

rdar://142973844
2025-01-15 18:14:59 +00:00
Chris Miles
73b184df24 Merge pull request #78564 from swiftlang/eng/chrismiles/playground-transform-crash-parsing-nested-generic-func
Fixes crash instrumenting generic func body nested in another func.

The crash was caused by attempting to add logging expressions that capture generic variables while using the outer func decl context that was not the generic decl context of the inner (generic) func.

The fix "pushes" the current func decl context while instrumenting the body. Rather than always using the top-level func decl context for all nested func bodies.
2025-01-15 10:05:25 -08:00