Commit Graph

184973 Commits

Author SHA1 Message Date
Hamish Knight
5276f2e1ef Merge pull request #82334 from hamishknight/record-opened 2025-06-19 08:18:49 +01:00
Hamish Knight
9b21efdf7d Merge pull request #82316 from hamishknight/keyed 2025-06-19 08:18:29 +01:00
Saleem Abdulrasool
2ee8787712 Merge pull request #82343 from compnerd/ntapi
Platform: expose NTAPI
2025-06-18 23:09:01 -07:00
Ian Anderson
cb954b98f9 [ABIChecker] Use -Isystem and -Fsystem for swift-api-digester
Use the Swift -Fsystem flag for swift-api-digester instead of the clang -iframework flag. Add support for -Isystem for parity.

rdar://152747420
2025-06-18 21:21:45 -07:00
Anthony Latsis
3e9923f0c0 ASTBridging: Bridge swift::AccessorKind directly 2025-06-19 04:26:52 +01:00
Fabrice de Gans
b334c8eda1 libxml2: Explicitly set the LLDB LibXML2 version (#82210)
With this change, the `LibXml2_DIR` CMake define is no longer overridden
on configure and actually takes effect when building lldb.
2025-06-18 20:21:52 -07:00
Slava Pestov
5987bbf966 Merge pull request #82321 from slavapestov/rqm-fixes
RequirementMachine: Add more limits to catch runaway computation, and fix a bug
2025-06-18 23:00:38 -04:00
michael-yuji
cf2f7154a5 Merge pull request #77836 from michael-yuji/mchiu/freebsd
[FreeBSD] Adding FreeBSD support
2025-06-18 19:59:48 -07:00
Saleem Abdulrasool
7e6b7c8613 build: avoid installing SQLite3 (#82322)
We build SQLite statically. We do not need to stage this into an install
location to use. Directly pass along the paths modified as a build
product.
2025-06-18 18:16:16 -07:00
Adrian Prantl
45198dc0ee [reflection] Fine-tune error messages 2025-06-18 16:29:39 -07:00
Evan Wilde
3a48d6e95e FreeBSD: Enable a few more C++ interop tests
Some of these tests were marked as unsupported since they were only
checking for macOS and Linux. They seem to be passing on FreeBSD as
well, so enabling them here.
2025-06-18 16:16:34 -07:00
Evan Wilde
91aa7b88f5 FreeBSD: Autolink C++ runtime
This hooks up the autolink mechanism to link the C++ runtime when C++
interop is enabled on FreeBSD.
2025-06-18 16:16:14 -07:00
Dario Rexin
4ac3f7cbbe Merge pull request #82279 from drexin/wip-151476435
[Test] Fix Interpreter/layout_string_witnesses_dynamic.swift
2025-06-18 16:04:23 -07:00
Dario Rexin
545cf1ee0a Merge pull request #82240 from drexin/wip-149882902
[IRGen] Emit null check before swift_conformsToProtocol for nullable …
2025-06-18 15:56:39 -07:00
Jamie
1f3f830fc7 [SILOptimizer]: slow OSSA lifetime canonicalization mitigation
OSSA lifetime canonicalization can take a very long time in certain
cases in which there are large basic blocks. to mitigate this, add logic
to skip walking the liveness boundary for extending liveness to dead
ends when there aren't any dead ends in the function.

Updates `DeadEndBlocks` with a new `isEmpty` method and cache to
determine if there are any dead-end blocks in a given function.
2025-06-18 17:52:14 -05:00
Artem Chikin
5eb85acad5 Merge pull request #82031 from artemcm/RemovePlaceholdersInDepScanner
[Dependency Scanning] Remove obsolete placeholder module concept
2025-06-18 12:40:30 -07:00
Dario Rexin
5ec58209dc [IRGen] Fix placeholder logic for emission of conditionally inverted protocols
rdar://153681688

Instead fo counting the actual conformances, the logic took the size of the bit field, i.e. used the highest set bit, so when a type had a conditional conformance only on ~Escapable, but not on ~Copyable, it would still add 2 placeholders, but only fill one.
2025-06-18 11:28:13 -07:00
Adrian Prantl
9381a54c67 [RemoteInspection] Change RemoteAbsolutePointer (NFC)
This patch changes RemoteAbsolutePointer to store both the symbol and
the resolved address. This allows us to retire some ugly workarounds
to deal with non-symbolic addresses and it fixes code paths that would
need these workarounds, but haven't implemented them yet (i.e., the
pack shape handling in the symbolicReferenceResolver in MetadatyaReader.

Addresses parts of rdar://146273066.
rdar://153687085
2025-06-18 10:25:15 -07:00
Adrian Prantl
edc7109989 Merge pull request #82244 from adrian-prantl/expected-lowering
[Reflection] Add lightweight error handling to ReflectionContext
2025-06-18 10:08:43 -07:00
Saleem Abdulrasool
3269c0649b SILGen: adjust check for optional-to-optional conversion (#82099)
The new macro aliasing uncovered a latent issue where we would attempt
to perform an optional-to-optional conversion on a type that is
non-optional though may be aliased to an optional. `CVaList` is
sometimes an optional pointer and would be interpreted as an optional
type which would fail the assertion in the optional-to-optional
conversion.
2025-06-18 09:52:41 -07:00
Saleem Abdulrasool
e049493d77 Platform: expose NTAPI
The NTAPIs are sometimes required to access some system information. At
the very least, the types defined here are useful to expose.
2025-06-18 09:51:52 -07:00
Saleem Abdulrasool
c17e67e1a9 stdlib: handle unsafe annotations in additional places
This applies more annotations in the `INTERNAL_CHECKS_ENABLED` disabled
paths, Windows, 32-bit, and non-ObjC paths. Interestingly enough, there
are a couple of compiler intrinsics which are also uncovered.
2025-06-18 09:46:17 -07:00
Doug Schaefer
d7bfb577de Merge pull request #82329 from xedin/follow-up-to-fuzzer-fixes
[Tests] NFC: Update `Sema/enum_raw_representable_object_literals.swift`

Force merge to unblock CI.
2025-06-18 08:12:19 -07:00
Egor Zhdan
4b39802f63 Merge pull request #82299 from swiftlang/egorzhdan/old-runtime-tests
[cxx-interop] Disable test with an older runtime
2025-06-18 13:14:23 +01:00
Charles Zablit
fdde2a395d move NodePrinter declarations to a header 2025-06-18 12:21:59 +01:00
Hamish Knight
c6ec3156f7 [CS] Distinguish locators for generic args in addSpecializationConstraint
Make sure we give each argument a different locator to ensure we
can correctly record any opened types.

rdar://153674889
2025-06-18 12:19:12 +01:00
John Hui
6b36996081 [NFC] Refactor setLocationInfo to return LocationInfo instead 2025-06-18 02:26:15 -07:00
Alastair Houghton
9e65b84099 [Runtime][Tests] Disable Runtime/backtrace test on Android.
This should be disabled for Android.

Fixes #44446.

rdar://153615567
2025-06-18 10:03:24 +01:00
Hamish Knight
3d9e49038b Merge pull request #82295 from hamishknight/wrapping-paper 2025-06-18 08:50:57 +01:00
Pavel Yaskevich
93a75d72a7 [Tests] NFC: Update Sema/enum_raw_representable_object_literals.swift
This is follow-up to https://github.com/swiftlang/swift/pull/82275.
The test in question is enabled only on iOS so it slipped through.
2025-06-18 00:21:00 -07:00
John McCall
5c20b19296 Introduce non-recursive print options and use them to handle IUO
printing more elegantly.

NFC intended.
2025-06-18 11:47:36 +09:00
Slava Pestov
fcd94f1d6c Merge pull request #82308 from slavapestov/marker-protocol-conformance-availability-mismatch-tweak
Sema: Relax diagnosis of implied marker protocol conformances with mismatched availability
2025-06-17 22:31:12 -04:00
Pavel Yaskevich
6cfbafd968 [CSSimplify] VariadicGenerics: Don't attempt to wrap optional into one-element tuple
If we have a tuple with unresolved pack expansion on one side
and an optional type on the other, prevent `matchTypes` from
wrapping optional into a one-element tuple because the matching
should be handled as part of the optional injection.

Resolves: rdar://152940244
2025-06-17 18:25:22 -07:00
Stephen Canon
09dc0920e7 Add a feature check for extern c support of builtin vectors (#82306)
We want to be able to adopt
(https://github.com/swiftlang/swift/pull/82225) in the stdlib without
breaking people building at desk with older toolchains, so let's add a
feature flag.
2025-06-17 19:50:16 -04:00
Eric Miotto
4efbe16a6b [Runtimes][CMake] Refactor FindSwiftCore to put focus on targets...
...instead of platforms.

Notable changes/flags:
* Append to variables controlling paths and names, to allow for user
  configuration
* add `SwiftCore_USE_STATIC_LIBS` to generate static archives
* use PlatformInfo variables to get the platform and arch subfolders
  (where appropriate)
* add include guards to ensure PlatformInfo and FindSwiftCore are
    included once in a project
* search for the appropriate static or import library under Windows

Addresses rdar://152838903
2025-06-17 15:39:16 -07:00
Pavel Yaskevich
84cb3c89ff Merge pull request #79893 from simanerush/fix-explicit-nonisolated-proto-inference
[Concurrency] Look for explicit 'nonisolated' when getting isolation from protocol conformances.
2025-06-17 15:23:26 -07:00
Hamish Knight
b37e34ea8d [Sema] Tighten up function call check in resolveKeyPathExpr
Check for `CallExpr` instead of `ApplyExpr`, we don't support
arbitrary postfix operators in key paths.
2025-06-17 23:07:46 +01:00
Slava Pestov
fee97ea96a RequirementMachine: Fix the most embarassing bug of all time
The implementation of Knuth-Bendix completion has had a subtle
bookkeeping bug since I first wrote the code in 2021.

It is possible for two rules to overlap in more than one position,
but the ResolvedOverlaps set was a set of pairs (i, j), where
i and j are the index of the two rules. So overlaps other than
the first were not considered. Fix this by changing ResolvedOverlaps
to a set of triples (i, j, k), where k is the position in the
left-hand side of the first rule.

The end result is that we would incorrectly accept the protocol M3
shown in the test case. I'm pretty sure the monoid that M3 encodes
does not have a complete presentation over any alphabet, so of
course it should not be accepted here.
2025-06-17 17:51:26 -04:00
Slava Pestov
bf3f4a6d79 AST: Fix lost GenericSignatureErrors in getPlaceholderRequirementSignature() 2025-06-17 17:51:25 -04:00
Slava Pestov
7f8175b3da RequirementMachine: Add two more completion termination checks for concrete type requirements
The concrete nesting limit, which defaults to 30, catches
things like A == G<A>. However, with something like
A == (A, A), you end up with an exponential problem size
before you hit the limit.

Add two new limits.

The first is the total size of the concrete type, counting
all leaves, which defaults to 4000. It can be set with the
-requirement-machine-max-concrete-size= frontend flag.

The second avoids an assertion in addTypeDifference() which
can be hit if a certain counter overflows before any other
limit is breached. This also defaults to 4000 and can be set
with the -requirement-machine-max-type-differences= frontend flag.
2025-06-17 17:51:25 -04:00
Eric Miotto
ddf0e13e1c Merge pull request #82278 from edymtt/edymtt/add-llvmtestingsupport-only-when-available
[build-script] build LLVMTestingSupport only if target is generated
2025-06-17 14:36:41 -07:00
Pavel Yaskevich
fc573b6612 [ConstraintSystem] Guard all the performance hacks with a flag
Package the flag into `performanceHacksEnabled()` method on
`ConstraintSystem` and start using it to wrap all of the hacks
in constraint generator and the solver.
2025-06-17 13:53:05 -07:00
Pavel Yaskevich
833b6b19e9 [Frontend] Remove -disable-solver-shrink option
It's folded into a more general "disable performance hacks" one.
2025-06-17 13:52:28 -07:00
Andrew Trick
d44490ef7f Add tests for SILGen support of @_addressable annotations. 2025-06-17 13:33:39 -07:00
Hamish Knight
c78ed1c848 Merge pull request #82293 from hamishknight/case-closed
[xcodegen] Make sure to `realPath` Clang file paths
2025-06-17 21:30:20 +01:00
(null)
9d915c68da libc++ is the default standard library on FreeBSD 2025-06-17 16:13:38 -04:00
(null)
bc870eff36 removed duplicated 2025-06-17 16:07:39 -04:00
Michael Gottesman
bf78c6206b Revert "[flow-isolation] Allow for initialization of fields of a Global Actor isolated class in its nonisolated inits"
This reverts commit 501bad55a8.
2025-06-17 13:01:28 -07:00
(null)
aaf283258b Merge branch 'main' into mchiu/freebsd 2025-06-17 15:41:57 -04:00
(null)
cf041b126e address pltaform orders and other nits 2025-06-17 15:37:49 -04:00