Commit Graph

4454 Commits

Author SHA1 Message Date
Andrew Trick
592642087f Merge pull request #84010 from atrick/lifedep-mutating-default
@_lifetime defaults
2025-09-04 15:44:46 -07:00
Erik Eckstein
1a4bd76f95 Mangling: add specialization mangling for more complex constant propagated function arguments
So far, constant propagated arguments could only be builtin literals.
Now we support arbitrary structs (with constant arguments), e.g. `Int`.
This requires a small addition in the mangling scheme for function specializations.
Also, the de-mangling tree now looks a bit different to support a "tree" of structs and literals.
2025-09-04 08:15:44 +02:00
Andrew Trick
84a4b328ec Lifetime inference test case improvements.
Cleanup the tests so we can cross reference them with the documentation.

Update the tests to allow multiple annotations and defaults.
2025-09-03 22:42:13 -07:00
Andrew Trick
bbdadac8fe Document @_lifetime annotation 2025-09-03 22:42:13 -07:00
Janat Baig
798c0f51a4 Merge branch 'main' into temp-branch 2025-08-23 11:11:04 -04:00
JanBaig
d3c40c0579 [Docs] Document mangling for the init accessor thunk 2025-08-23 11:03:57 -04:00
JanBaig
95cf42b516 [Docs] Add assign_or_init documentation and remove assign_by_wrapper 2025-08-23 10:38:53 -04:00
Nate Chandler
aa85694237 [NFC] OSSACompleteLifetime: Renamed. 2025-08-18 09:45:19 -07:00
finagolfin
1dbdf0c26f [android][docs] Update to latest info (#83611) 2025-08-09 01:44:53 +05:30
Nate Cook
c88d8cf885 Include Apple Silicon benchmarking command (#83216) 2025-07-22 15:46:19 -07:00
Max Desiatov
ede49497d5 GettingStarted.md: avoid preinstalling CMake (#83063)
We're seeing multiple build failures with CMake 4.0: e.g. SwiftPM bootstrapping issues  on macOS. `build-script` will always build a fixed version of CMake that's known to work if preinstalled one is not found. Let's reduce the chances for confusion by not recommending preinstalled CMake in `GettingStarted.md`.
2025-07-17 17:04:19 +01:00
Anthony Latsis
01c26004fc Merge pull request #66349 from LiamSwayne/patch-1 2025-07-06 16:25:03 +01:00
Slava Pestov
9033198674 ASTDemangler: Round-trip @isolated @sil_implicit_leading_param parameter attributes
We sometimes mangle SILFunctionTypes when generating debug info
for reabstraction thunks, and these can have various exotic
parameter and result attributes. Two recent additions were
never plumbed through the mangler, causing assertion failures
when emitting debug info.

Fixes rdar://153730847.
2025-06-27 10:56:12 -04:00
Doug Gregor
96297e61ee Make the mangling grammar a little more regular
A few cleanups:
- Fix some comments
- Remove redundant rules
- Make sure every term is defined
- Don't use '|'; write it out as a term
2025-06-23 07:05:39 -07:00
Rauhul Varma
acbdfef4f4 Remove stale embedded swift documentation (#82395)
Update in-tree markdown files with links to the new Embedded Swift
documentation home.
2025-06-21 19:24:55 -07:00
Andrew Trick
5b5f370ce1 LifetimeDependenceScopeFixup: crash handling dead-end coroutine
When extending a coroutine, handle the end_borrow instruction used to end a
coroutine lifetime at a dead-end block.

Fixes rdar://153479358 (Compiler crash when force-unwrapping optional ~Copyable type)
2025-06-16 21:43:44 -07:00
Pavel Yaskevich
8e49860349 [Demangle] Implement missing Node::Kind::OutlinedInitializeWithTakeNoValueWitness
Implements de/remangler support for `WOB` manglings.
2025-06-05 14:07:05 -07:00
Michael Gottesman
56aa981099 [sil][docs] Add documentation about sil_implicit_leading_param. 2025-05-23 10:25:54 -07:00
Anthony Latsis
6eacd233cf Merge pull request #81392 from jamieQ/patch-2
[docs][gardening]: fix typo in KeyPaths.md
2025-05-18 14:48:13 +01:00
Pavel Yaskevich
04d46760bb [AST] Extend @_inheritActorContext attribute to support optional always modifier
By default (currently) the closure passed to a parameter with `@_inheritActorContext`
would only inherit isolation from `nonisolated`, global actor isolated or actor
context when "self" is captured by the closure. `always` changes this behavior to
always inherit actor isolation from context regardless of whether it's captured
or not.
2025-05-14 20:07:57 -07:00
Erik Eckstein
a38db6439a SIL: add the vector_base_addr instruction
It derives the address of the first element of a vector, i.e. a `Builtin.FixedArray`, from the address of the vector itself.
Addresses of other vector elements can then be derived with `index_addr`.
2025-05-12 19:24:31 +02:00
Jamie
996510e9e8 [docs][gardening]: fix typo in KeyPaths.md
remove a superfluous word
2025-05-08 20:28:50 -05:00
Meghana Gupta
3cad5c5924 Merge pull request #81043 from meg-gupta/fixcow
Insert end_cow_mutation_addr for lifetime dependent values dependent on mutable addresses
2025-05-01 07:26:28 -07:00
Meghana Gupta
35d62a4a36 Introduce end_cow_mutation_addr instruction 2025-04-30 13:39:45 -07:00
Kuba (Brecka) Mracek
7768aa3c31 Merge pull request #81175 from kubamracek/embedded-docs10
[embedded] Add documentation for class-bound existentials in Embedded Swift
2025-04-30 13:38:59 -07:00
Kuba Mracek
b1624479ca [embedded] Add documentation for class-bound existentials in Embedded Swift 2025-04-29 11:51:56 -07:00
Kuba (Brecka) Mracek
61e818bcf6 [embedded] Update EmbeddedSwiftStatus.md about int parsing and lazy collections 2025-04-28 13:02:50 -07:00
Anthony Latsis
ada632c488 [docs] Diagnostics: Add quoting guidelines 2025-04-22 18:23:40 +01:00
Slava Pestov
a74a445dc4 Merge pull request #80964 from slavapestov/library-evolution-doc-fix
docs: Remove obsolete restriction from LibraryEvolution.rst
2025-04-21 21:57:49 -04:00
Kuba (Brecka) Mracek
73e5fbdae7 Merge pull request #80649 from kubamracek/embedded-docs-4
[embedded] Add documentation for non-final generic methods
2025-04-21 18:23:01 -07:00
Slava Pestov
4b6d19c98d docs: Remove obsolete restriction from LibraryEvolution.rst 2025-04-21 16:29:58 -04:00
Doug Gregor
721944a936 Merge pull request #80857 from daveyc123/doccForDiagnostics
Instructions for generating DocC for diagnostics
2025-04-17 18:08:22 -07:00
Doug Gregor
d72763f404 Merge pull request #80814 from DougGregor/diag-group-docs-on-swift-org
Point at diagnostic group documentation on docs.swift.org
2025-04-16 13:44:56 -07:00
David Cummings
33fbceecc5 Instructions for generating DocC for diagnostics
Add instructions to the diagnostics documentation on how to generate
the DocC documentation locally.
2025-04-16 14:05:43 -04:00
Anthony Latsis
8eb43af590 Merge pull request #80565 from ziad-ashraf7/update-docs
[docs] Add the Ubuntu 24.04 Dockerfile link to the getting started guide
2025-04-15 21:07:31 +01:00
Pavel Yaskevich
4b1695b999 [Docs] NFC: Remove last remaining references to @execution attribute 2025-04-15 00:08:17 -07:00
Doug Gregor
ccce10d28b Drop the ".md" suffix from diagnostic group file names in GROUP
While here, document the GROUP macro appropriately.
2025-04-14 20:03:46 -07:00
Ziad Ashraf
a9fb63a586 [docs] Add the Ubuntu 24.04 Dockerfile link to the getting started guide 2025-04-13 23:51:20 +02:00
Kuba Mracek
9e9b7e7c04 [embedded] Add documentation for non-final generic methods 2025-04-08 12:34:10 -07:00
Anthony Latsis
99f63ed933 DiagnosticEngine: Support TypeAttribute diagnostic arguments 2025-04-03 01:52:38 +01:00
Doug Gregor
e88f8995e1 [Diagnostics] Eliminate educational notes in favor of diagnostic groups
We've been converging the implementations of educational notes and
diagnostic groups, where both provide category information in
diagnostics (e.g., `[#StrictMemorySafety]`) and corresponding
short-form documentation files. The diagnostic group model is more
useful in a few ways:

* It provides warnings-as-errors control for warnings in the group
* It is easier to associate a diagnostic with a group with
GROUPED_ERROR/GROUPED_WARNING than it is to have a separate diagnostic
ID -> mapping.
* It is easier to see our progress on diagnostic-group coverage
* It provides an easy name to use for diagnostic purposes.

Collapse the educational-notes infrastructure into diagnostic groups,
migrating all of the existing educational notes into new groups.
Simplify the code paths that dealt with multiple educational notes to
have a single, possibly-missing "category documentation URL", which is
how we're treating this.
2025-03-29 15:40:35 -07:00
Caleb Hearth
62207ced88 Add missing closing paren in CMake example 2025-03-28 10:36:37 -06:00
Doug Gregor
e0b52cd20e [SIL] Extend checked-cast instructions with "prohibit isolated conformances" flag
When performing a dynamic cast to an existential type that satisfies
(Metatype)Sendable, it is unsafe to allow isolated conformances of any
kind to satisfy protocol requirements for the existential. Identify
these cases and mark the corresponding cast instructions with a new flag,
`[prohibit_isolated_conformances]` that will be used to indicate to the
runtime that isolated conformances need to be rejected.
2025-03-26 22:31:47 -07:00
Andrew Trick
edf02f9aff [docs] SIL mark_dependence 2025-03-25 23:02:06 -07:00
Nate Chandler
5eacbfd9d9 [DefaultOverrides] Mangling. 2025-03-25 07:22:14 -07:00
Hamish Knight
f8ab391737 Introduce type sugar for InlineArray (#80087)
* [CS] Decline to handle InlineArray in shrink

Previously we would try the contextual type `(<int>, <element>)`,
which is wrong. Given we want to eliminate shrink, let's just bail.

* [Sema] Sink `ValueMatchVisitor` into `applyUnboundGenericArguments`

Make sure it's called for sugar code paths too. Also let's just always
run it since it should be a pretty cheap check.

* [Sema] Diagnose passing integer to non-integer type parameter

This was previously missed, though would have been diagnosed later
as a requirement failure.

* [Parse] Split up `canParseType` 

While here, address the FIXME in `canParseTypeSimpleOrComposition`
and only check to see if we can parse a type-simple, including
`each`, `some`, and `any` for better recovery.

* Introduce type sugar for InlineArray

Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind
an experimental feature flag for now.
2025-03-23 15:31:37 -07:00
Kuba (Brecka) Mracek
f8e9c1b19f Merge pull request #80147 from kubamracek/embedded-faq1
[embedded] Update embedded UserManual.md to explain how to use a macOS downloadable toolchain
2025-03-19 21:26:44 -07:00
Amritpan Kaur
3c30d68d2e Merge pull request #78823 from amritpan/method-keypaths
[Sema/SILGen/IRGen] Implement method & initializer keypaths.
2025-03-19 18:59:17 -07:00
Kuba Mracek
bc6c5fe677 [embedded] Update embedded UserManual.md to explain how to use a macOS downloadable toolchain 2025-03-19 16:03:02 -07:00
Amritpan Kaur
555a486cda [Mangler] Add new mangling schemes. 2025-03-19 10:54:06 -07:00