Commit Graph

47194 Commits

Author SHA1 Message Date
Henrik G. Olsson
f2d3faefd6 [ASTPrint] Refactor CustomAttr printing (NFC)
This is a pure refactor to enable using PrintAST in the next commit.
2025-09-11 18:46:22 -07:00
swift-ci
64aaf36dc5 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-11 17:58:46 -07:00
Slava Pestov
59e8fdebbb Merge pull request #84209 from slavapestov/fix-rdar159790557
RequirementMachine: Fix crash-on-invalid with concrete type requirements involving packs
2025-09-11 20:23:38 -04:00
Allan Shortlidge
0647da5416 AST: Introduce an "always enabled" custom availability domain kind.
An always enabled availability domain is implicitly available in all contexts,
so uses of declarations that are marked as `@available` in the domain are never
rejected. This is useful for an availability domain representing a feature flag
that has become permanently enabled.

Partially resolves rdar://157593409.
2025-09-11 14:39:05 -07:00
swift-ci
3a5fac8201 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-11 13:17:30 -07:00
Chris McGee
3d5dc9bc4c Merge pull request #84212 from cmcgee1024/add_skip_inherited_docs
Add symbol graph option for skipping inherited docs
2025-09-11 16:00:40 -04:00
Artem Chikin
b6760e7617 Add new-driver-only flag for dependency scanning serialized diagnostic output path 2025-09-11 09:50:31 -07:00
Artem Chikin
c82048559a [Dependency Scanning] Configure a thread-safe serialized diagnostics consumer for in-memory scans
This change introduces a thread-safe version of the 'SerializedDiagnosticConsumer' and refactors scanning compilation instance creation code to ensure this consumer gets added when the scanner query configuration command-line includes '-serialized-diagnostics-path' option.
2025-09-11 09:50:24 -07:00
Hamish Knight
5c334c5f21 Requestify the loading of access notes
Replace `loadAccessNotesIfNeeded` with a request that loads the access
notes on-demand.
2025-09-11 16:54:08 +01:00
Hamish Knight
6ef8f45659 NFC: Move AccessNotesPath to LangOptions 2025-09-11 16:54:08 +01:00
swift-ci
48eb65ee53 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-11 08:04:53 -07:00
Hamish Knight
c84d2abb05 [AST] Allow storing original expression in ErrorTypeRepr
This is useful for ArrowExpr when the sub-expressions aren't valid
TypeExprs. Rather than throwing away the AST, attach it to the
ErrorTypeRepr to ensure we can still type-check it. This ensures
semantic functionality still works correctly, and fixes a crash where
we'd stop visiting an invalid binding pattern, losing track of the
nested VarDecl.
2025-09-11 13:21:03 +01:00
Hamish Knight
d2deaa9129 [AST] Require a SourceRange for ErrorTypeRepr 2025-09-11 13:21:03 +01:00
Hamish Knight
e1bd9038b3 [AST] NFC: Remove DelayedDiag from ErrorTypeRepr
This is no longer used.
2025-09-11 13:21:03 +01:00
Slava Pestov
0507b02024 RequirementMachine: Fix crash-on-invalid with concrete type requirements involving packs
We would crash in some cases, or produce a slightly misleading
diagnostic about same-element requirements, which are related but
not quite the same.

In the fullness of time, we should figure out this corner of the
language. Until then, add a new diagnostic since this is really
about same-type requirements between concrete types and packs.

Fixes rdar://159790557.
2025-09-10 20:20:31 -04:00
Slava Pestov
507f7617ea AST: Remove AbstractFunctionDecl::hasDynamicSelfResult() 2025-09-10 19:26:02 -04:00
Chris McGee
e71009b3ff Add symbol graph option for skipping inherited docs 2025-09-10 19:01:29 -04:00
swift-ci
f22ddb12f6 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 06:55:39 -07:00
John McCall
e5b6a88c5e Merge pull request #84181 from rjmccall/isolation-fixes
Isolation fixes for closures and defer bodies
2025-09-10 08:39:09 -04:00
swift-ci
95736f8e88 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 01:39:11 -07:00
Hamish Knight
f8218e3254 Merge pull request #83777 from hamishknight/ext-cleanup
[Sema] Clean up extension binding a little
2025-09-10 09:37:20 +01:00
Hamish Knight
872176bdd1 Merge pull request #84149 from hamishknight/case-and-pat
A few pattern cleanups + fixes
2025-09-10 09:36:22 +01:00
swift-ci
d71d1eec81 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 23:47:19 -07:00
Slava Pestov
0063c3c522 Merge pull request #84131 from slavapestov/remove-covariant-result-type-post-cleanup
Sema: Clean up getTypeOfMemberReference() and buildMemberRef()
2025-09-10 01:39:38 -04:00
Rintaro Ishizaki
b119407966 [Parse] Change whitespace rule between attribute name and '(' in Swift 6
In Swift 6 and later, whitespace is no longer permitted between an
attribute name and the opening parenthesis. Update the parser so that
in Swift 6+, a `(` without preceding whitespace is always treated as
the start of the argument list, while a '(' with preceding whitespace is
considered the start of the argument list _only when_ it is unambiguous.

This change makes the following closure be parsed correctly:

  { @MainActor (arg: Int) in ... }

rdar://147785544
2025-09-09 16:44:29 -07:00
Slava Pestov
60246a2889 Sema: Further split up getTypeOfMemberTypeReference() 2025-09-09 18:58:10 -04:00
Slava Pestov
6dc2e7558d Sema: Don't modify openedType in getMemberReferenceTypeFromOpenedType() 2025-09-09 18:58:09 -04:00
Slava Pestov
45e3f1bc00 AST: Add TypeBase::eraseDynamicSelfType() 2025-09-09 18:58:09 -04:00
swift-ci
820276b96c Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 15:56:53 -07:00
Owen Voorhees
c849ae2727 Merge pull request #83963 from owenv/exclusivity-docs
Add documentation to static exclusivity diagnostics
2025-09-09 15:44:08 -07:00
swift-ci
1aa91f7531 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 15:37:38 -07:00
Charles Zablit
ff62407c1b Merge pull request #84169 from charles-zablit/charles-zablit/demangling/make-printRoot-virtual
[demangling] make printRoot virtual
2025-09-09 23:37:12 +01:00
Meghana Gupta
ce128e71e2 Update SIL verification for borrow accessors 2025-09-09 15:25:08 -07:00
Hamish Knight
17fe3de8c7 [Sema] Clean up extension binding a little
- Turn `BindExtensionsForIDEInspectionRequest` into the main extension
binding request.
- Change `ExtendedNominalRequest` such that it's no longer what
extension binding calls into to do the name lookup, instead it calls
directly into `computeExtendedNominal`. `getExtendedNominal` can
then be the entrypoint for `ExtendedNominalRequest` and assumes that
extension binding has already run. This avoids needing to fake the
dependency relationship in the DeclChecker.
2025-09-09 23:18:52 +01:00
Hamish Knight
d9d0b2e6a3 [Sema] Make extension binding lazy for SourceLoader
This will mainly be useful once extension binding is fully
requestified, but even now it's a good idea to ensure module loading
isn't kicking name lookup.
2025-09-09 23:18:52 +01:00
Meghana Gupta
a09e258f7f Enable SIL parsing of borrow and mutate accessors 2025-09-09 14:45:49 -07:00
Meghana Gupta
518c3ac091 Updates to MemAccessUtils to handle borrowed address returns 2025-09-09 14:45:47 -07:00
Meghana Gupta
8c1231e86b SILGen support for borrow accessors on Copyable types and address-only ~Copyable types 2025-09-09 14:45:44 -07:00
Meghana Gupta
6b8c91efe2 [NFC] Move StorageRefResult to a header 2025-09-09 14:45:43 -07:00
Meghana Gupta
4f33d5201c Update SILFunctionType for borrow accessors 2025-09-09 14:45:43 -07:00
Meghana Gupta
a798f21fd2 Introduce ResultConvention::Guaranteed and ResultConvention::GuaranteedAddress in SwiftCompilerSources 2025-09-09 14:45:41 -07:00
Meghana Gupta
1cff471c57 Introduce ResultConvention::Guaranteed and ResultConvention::GuaranteedAddress
ResultConvention::Guaranteed will be used by borrow accessors when the storage type can be returned by value.

ResultConvention::GuaranteedAddress will be used by mutate accessors and borrow accessors when the storage type
cannot be returned by value.
2025-09-09 14:45:40 -07:00
Meghana Gupta
f1c41960d8 [NFC] Add some utilities in SILDeclRef 2025-09-09 14:45:36 -07:00
Meghana Gupta
280fc83292 Avoid synthesizing read when borrow is present and modify when mutate is present 2025-09-09 14:45:07 -07:00
Meghana Gupta
075d44ac43 Sema support for borrow and mutate accessors 2025-09-09 14:41:51 -07:00
Meghana Gupta
5f2aaa60b1 Parser support for borrow and mutate accessors 2025-09-09 14:30:35 -07:00
Meghana Gupta
28c4595735 Add mangling support for borrow/mutate accessors 2025-09-09 14:30:34 -07:00
Meghana Gupta
9fe489ce22 Introduce borrow and mutate as new accessor kinds
And handle them in various covered switches
2025-09-09 14:30:26 -07:00
Meghana Gupta
459a95888c Add a new experimental feature for borrow and mutate accessors 2025-09-09 13:52:27 -07:00
swift-ci
f507a04b8d Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 12:38:31 -07:00