Commit Graph

4545 Commits

Author SHA1 Message Date
Justice Adams
5da5e93706 Add trigger for Swift SDK for android (#86987) 2026-02-04 19:56:36 -08:00
Kavon Farvardin
ed65f8bb55 Mangling: support Self in associated conformance descriptor
For reparenting, we rely on a default associated conformance witness accessor
to build the witness table for 'Self: NewParent' at runtime. This means that
when mangling the symbol for such a descriptor, we need support for there
being no associated type at all; it's just tau_0_0 aka Self as the subject.

This patch extends _default_ associated conformance witness accessor mangling
to support a GenericTypeParamType for the subject, as the non-default accessors
already quietly did have support; see `mangleAssociatedConformanceDescriptor`.
It was quiet in the sense that there was no demangling support for it, nor
documentation about it either. So I've brought both kinds of witness accessor
manglings up-to-par, without extending the `assoc-type-name` grammar itself.
2026-02-03 16:39:19 -08:00
Kavon Farvardin
eb7fe3c8a3 Reparenting: initial functionality 2026-02-03 16:39:19 -08:00
Michael Gottesman
57be178d6a [DebuggingTheCompiler.md] Add link to Swift Testing LLDB command-line debugging docs 2026-01-28 10:14:31 -08:00
Joe Groff
6b05c0eaca Document Builtin.Borrow instructions in SIL reference. 2026-01-23 08:02:10 -08:00
Erik Eckstein
0f0aa0c17b Optimizer: require that there are no unreachable blocks and infinite loops in OSSA
These two new invariants eliminate corner cases which caused bugs if optimization didn't handle them.
Also, it will significantly simplify lifetime completion.

The implementation basically consists of these changes:
* add a flag in SILFunction which tells optimization if they need to take care of infinite loops
* add a utility to break infinite loops
* let all optimizations remove unreachable blocks and break infinite loops if necessary
* add verification to check the new SIL invariants

The new `breakIfniniteLoops` utility breaks infinite loops in the control flow by inserting an "artificial" loop exit to a new dead-end block with an `unreachable`.
It inserts a `cond_br` with a `builtin "infinite_loop_true_condition"`:
```
bb0:
  br bb1
bb1:
  br bb1              // back-end branch
```
->
```
bb0:
  br bb1
bb1:
  %1 = builtin "infinite_loop_true_condition"() // always true, but the compiler doesn't know
  cond_br %1, bb2, bb3
bb2:                  // new back-end block
  br bb1
bb3:                  // new dead-end block
  unreachable
```
2026-01-22 17:41:23 +01:00
Charles Zablit
596ee750f9 Merge pull request #83871 from charles-zablit/charles-zablit/update-windows-documentation 2026-01-22 14:47:50 +00:00
Charles Zablit
c7e374379d [documentation] update the WindowsBuild guide 2026-01-21 18:26:04 +00:00
Hamish Knight
b5d4c4c46d [utils] Move swift-xcodegen to swift-dev-utils
The goal here is for `swift-dev-utils` to be a monolithic package
for development utils written in Swift.
2026-01-18 19:25:51 +00:00
Erik Eckstein
15edad813d add option '-save-sil <file>'
The option can be used to save the SIL after optimizations to a file.
In contrast to `-emit-sil`, the compiler doesn't stop an continues to e.g. create the regular output object file
2026-01-13 10:45:38 +01:00
Erik Eckstein
3db59e4cea docs: document -sil-output-path and -ir-output-path in DebuggingTheCompiler.md 2026-01-12 10:54:51 +01:00
Slava Pestov
804aa90dbb Merge pull request #86441 from slavapestov/small-docs-updates
docs: Small updates
2026-01-10 17:06:10 -05:00
Slava Pestov
24504ab60d Update docs/HowToGuides/GettingStarted.md
Co-authored-by: Max Desiatov <m_desiatov@apple.com>
2026-01-10 10:59:34 -05:00
Slava Pestov
59e3cb83aa docs: Clarify GettingStarted.md for macOS 2026-01-10 10:44:20 -05:00
Slava Pestov
4e962558f2 docs: Embedded Swift docs have moved to swift.org 2026-01-10 10:44:20 -05:00
Slava Pestov
82b3c0060f docs: Fix indentation in generics.bib 2026-01-10 10:44:19 -05:00
Tim Kientzle
adec1f6cbe Merge pull request #86277 from tbkka/tbkka-rdar149303951-try1
[SE-0474] Implement final `yielding borrow`/`yielding mutate` naming for coroutine accessors
2026-01-09 08:52:21 -08:00
Kavon Farvardin
adf14929f9 Merge pull request #86337 from kavon/noncopyable-opaque-read-ownership
introduce UnderscoreOwned feature
2026-01-07 18:58:54 -08:00
Kavon Farvardin
458b62c9ed introduce UnderscoreOwned feature
This experimental feature allows you to override the default behavior
of a 'get' returning a noncopyable type, so that it returns an owned
value rather than a borrow, when that getter is exposed in opaque
interfaces like protocol requirements or resilient types.

resolves rdar://157318147
2026-01-06 16:39:54 -08:00
Jamie
cab5c62ef4 [docs]: typo fix in Opaque abstraction patterns section 2026-01-05 18:03:04 -06:00
Jamie
a62b052428 [docs]: minor typo fixes in substitution-maps.tex 2026-01-05 13:42:58 -06:00
Tim Kientzle
104dba920b [SE-0474] Implement yielding borrow and yielding mutate syntax
This does not rename all the internal variables, functions, and types
whose names were based on the old syntax.

I think it adds new syntax support everywhere it's needed while
retaining enough of the old syntax support that early adopters will
see nice deprecation messages guiding them to the new syntax.
2026-01-03 15:07:10 -08:00
Michael Gottesman
80152b21eb Merge pull request #86133 from gottesmm/pr-91db5caa642bf6c807850e655681e6f121a9260f
[DebuggingTheCompiler.md] Show how to use -Rmodule-loading and SWIFT_FORCE_MODULE_LOADING to debug module/swiftinterface loading issues.
2025-12-19 14:01:10 -08:00
Michael Gottesman
c2cde972f6 [DebuggingTheCompiler.md] Show how to use -Rmodule-loading and SWIFT_FORCE_MODULE_LOADING to debug module/swiftinterface loading issues.
Just had to do this recently and realized I had forgotten how to do it. Placing
it in DebuggingTheCompiler.md so I can look it up from here again after I forget
how to do it again.
2025-12-18 13:50:00 -08:00
Doug Gregor
09a12946a4 Merge pull request #86100 from DougGregor/aeic-now-export-docs
Note that @_alwaysEmitIntoClient was formalized as `@export(implementation)`
2025-12-17 02:28:39 -08:00
Doug Gregor
6a600de97e Note that @_alwaysEmitIntoClient was formalized as @export(implementation) 2025-12-16 15:20:43 -08:00
Andrew Trick
edfe1a1e47 Merge pull request #85998 from atrick/lifedep-sametype
[lifetimes] add same-type default lifetime inference
2025-12-16 11:01:09 -08:00
Max Desiatov
a71c1836c7 docs/Wasm: remove incompatible --libcxx flags for build-script (#86017)
Freshly built libc++ introduces issues when building `swift-build`:

```
Undefined symbols for architecture arm64:
  "std::__1::__hash_memory(void const*, unsigned long)", referenced from:
      (anonymous namespace)::CAPIBuildDB::buildUpKeyCache(std::__1::vector<llbuild::core::KeyType, std::__1::allocator<llbuild::core::KeyType>>&) in BuildDB-C-API.cpp.o
      _llb_build_key_make in BuildKey-C-API.cpp.o
      _llb_build_key_make_command in BuildKey-C-API.cpp.o
      _llb_build_key_make_custom_task in BuildKey-C-API.cpp.o
      _llb_build_key_make_custom_task_with_data in BuildKey-C-API.cpp.o
      _llb_build_key_make_directory_contents in BuildKey-C-API.cpp.o
      _llb_build_key_make_filtered_directory_contents in BuildKey-C-API.cpp.o
      ...
ld: symbol(s) not found for architecture arm64
```

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-12-13 15:31:05 -08:00
Andrew Trick
c490a9f731 [docs] update lifetime defaults to prioritize the same-type rule 2025-12-12 20:58:55 -08:00
Max Desiatov
125a63d349 docs/WebAssembly.md: add Wasm stdlib testing steps (#85947)
Added instructions for building and running Wasm stdlib tests, including filtering options and environment variable usage.
2025-12-11 09:06:42 +00:00
Max Desiatov
f9c064d161 Merge pull request #85844 from MaxDesiatov/wasm-build-instructions
docs: Add instructions for Wasm stdlib building and testing
2025-12-10 16:07:39 +00:00
Slava Pestov
d9dcc88c46 docs: Fix links to Windows docs in README.md 2025-12-08 10:12:02 -05:00
Michael Gottesman
26d83d4393 Merge pull request #85827 from gottesmm/pr-50a580749c0f00c1a29b7985f98b412538950dce
[mangling.rst] Add a more indepth discussion of what padding bytes are used for when encoding relative symbolic references into mangled names.
2025-12-04 17:27:02 -08:00
Max Desiatov
6c389fe151 Add instructions for stdlib builds 2025-12-04 21:28:22 +00:00
Max Desiatov
b182f239ab Recommend --sccache for Wasm Swift SDK builds 2025-12-04 20:34:13 +00:00
Kavon Farvardin
12cb3f9a9a Merge pull request #85704 from kavon/suppressed-assoc-types-with-defaults
Sema: introduce SuppressedAssociatedTypesWithDefaults
2025-12-03 23:07:40 -08:00
Michael Gottesman
da54f03ada Add a more indepth discussion of what padding bytes are used for when encoding relative symbolic references into mangled names. 2025-12-03 16:14:09 -08:00
Kavon Farvardin
c9d2f522c0 Sema: introduce ProtocolInversesRequest
We need special handling for protocols whose requirement
signature exists but is in a serialized state, as we
cannot run the StructuralRequirementsRequest on such
a protocol as there's no work to be done, effectively.
2025-12-02 21:09:54 -08:00
Erik Eckstein
4c09fa6805 Mangling: add a specialization mangling for changing the function type representation of a function 2025-11-26 16:23:47 +01:00
Michael Gottesman
26627d7987 Merge pull request #85590 from gottesmm/pr-ec98d099eea90c59803748f629e9c4dfb27d42a0
[docs] Add some information to DebuggingTheCompiler.md about working with the various simulators.
2025-11-19 14:49:22 -08:00
Michael Gottesman
ef3298e44e [docs] Add some information to DebuggingTheCompiler.md about working with the various simulators.
I am adding this since I had to go spelunking around to find the SIMCTL_CHILD_
prefix which I need to debug an app. Rather than just forgetting it again, I
thought it made sense to just document it here so I can forget it again. I also
put in a little bit of other stuff about simctl as well while I was here.
2025-11-19 09:44:47 -08:00
Slava Pestov
058bacf255 Update docs/README.md
Co-authored-by: Charles Zablit <c_zablit@apple.com>
2025-11-19 07:16:44 -05:00
Slava Pestov
e5a713465d docs: Remove dead link
I took down my medium.com blog a few years ago, and all of the same material
in this post is now found in "Compiling Swift Generics", in docs/Generics/.
2025-11-18 21:55:25 -05:00
Slava Pestov
a3ecbc8202 Re-organize docs/README.md
Also remove links to stuff that's extremely out of date at this point.
It's still all there in docs/ if you want to see it, but there's no
longer any reason to feature it so prominently at the top of the
README.
2025-11-18 21:50:44 -05:00
Mishal Shah
fe97b6d055 Fix notification username in Branches.md 2025-11-12 08:41:24 -08:00
Mishal Shah
c345a31182 Update notification instructions in Branches.md
Clarified notification instructions for pull requests.
2025-11-12 08:41:01 -08:00
Anthony Latsis
8992ea82a2 Merge pull request #85433 from swiftlang/jepa-main4
AST: Rename `GenericContext::isGeneric` to `hasGenericParamList`
2025-11-11 21:12:34 +00:00
Anthony Latsis
bda6edb85c AST: Rename GenericContext::isGeneric to hasGenericParamList
`isGeneric` is a misleading name because this method checks for the
existence of a `GenericParamList`, which is not implied by genericity.
2025-11-11 15:55:16 +00:00
Slava Pestov
2349b5f6cf docs: Update generics book for 2025
- Revised "Substitution Maps" chapter:
  - New "Subclassing" section
  - New "SIL Type Lowering" section
- New "Opaque Result Types" chapter
- Various smaller edits

New PDF will be available shortly at https://download.swift.org/docs/assets/generics.pdf.
2025-11-11 08:34:36 -05:00
Alfonso Urdaneta
ae9fede33e Replace screenshot to reflect apple/swift -> swiftlang/swift 2025-11-06 03:32:48 +00:00