Commit Graph

4254 Commits

Author SHA1 Message Date
Andrew Trick
3bf7e715e7 Add AddressUtils.swift 2024-01-22 23:42:54 -08:00
Ikko Eltociear Ashimine
05d5833e38 generics.tex: fix typo in generic-environments.tex
accomodates -> accommodates
2024-01-23 16:36:30 +09:00
Anthony Latsis
bed316f4cc [docs] GettingStarted: Default to "hosttools" bootstrapping mode on macOS 2024-01-19 20:53:31 +03:00
Andrew Trick
801000f85f Update SIL-Utilities.md for new ownership utils. 2024-01-17 09:07:02 -08:00
Ruslan Alikhamov
fd3557bf5a Added a note about RAM and disk space hardware requirements
commit bcc59744b7da00395708f41984ee2be70924cb6c
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date:   Sat Jan 13 15:28:42 2024 +0400

    applied suggested phrasing

commit b5b0f9622a5dca80cf79df41e4834959021329ca
Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
Date:   Fri Jan 12 23:48:12 2024 +0400

    Added a note about hardware requirements for compiling on Linux

    commit 863c1d98dd8c3c3e67610fe9ea9ac00e161d687a
    Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
    Date:   Fri Jan 12 23:47:19 2024 +0400

        Moved note to Requirements section

    commit 307d0027967945cdc5c0d28b9c4525fc27149f66
    Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
    Date:   Wed Jan 10 19:45:54 2024 +0400

        Added a note about hardware requirements for compiling on Linux

        commit 943ccc2726aa2f8850f38670b848304acb3359aa
        Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
        Date:   Wed Jan 10 19:45:13 2024 +0400

            Replaced 'and' with 'plus' to ease comprehension

        commit 3427ace37d63d398542aa80be6c30a27a940eef9
        Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
        Date:   Thu Jan 4 21:02:22 2024 +0400

            Added a note about hardware requirements for compiling on Linux

            commit 49bafe98a3c938e83af3de351094b47650836aee
            Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
            Date:   Thu Jan 4 20:49:35 2024 +0400

                Added "of RAM" to each reference

            commit 9dc879cb30e9c9507d78d5de3a1d0de2808979c6
            Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
            Date:   Thu Jan 4 14:13:20 2024 +0400

                Updated text according to comment, removed mention of VM for Linux

            commit b652195dcbedc7fa3a770075457880d544a78a60
            Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
            Date:   Wed Jan 3 00:06:18 2024 +0400

                Added more information about different RAM requirements

            commit 2aa1be00ce6ab66f50928484727e684a9eb5c243
            Author: Ruslan Alikhamov <r.alikhamov@gmail.com>
            Date:   Mon Jan 1 03:19:22 2024 +0400

                Added a note about Linux inside of a VM hardware requirements
2024-01-13 15:29:27 +04:00
Erik Eckstein
04a6bbbb7a docs: add documentation for the -sil-pass-count-config-file option in DebuggingTheCompiler
Also, add this option in swift-autocomplete.bash.
Unrelated: support aliased commands in swift-autocomplete.bash
2024-01-11 11:10:05 +01:00
Erik Eckstein
bc99986cf9 SIL: add a dependency token operand to global_addr
Optionally, the dependency to the initialization of the global can be specified with a dependency token `depends_on <token>`.
This is usually a `builtin "once"` which calls the initializer for the global variable.
2024-01-10 09:33:58 +01:00
Andrew Trick
264cbaea42 Add mark_dependence [nonescaping] flag.
The dependent 'value' may be marked 'nonescaping', which guarantees that the
lifetime dependence is statically enforceable. In this case, the compiler
must be able to follow all values forwarded from the dependent 'value', and
recognize all final (non-forwarded, non-escaping) use points. This implies
that `findPointerEscape` is false. A diagnostic pass checks that the
incoming SIL to verify that these use points are all initially within the
'base' lifetime. Regular 'mark_dependence' semantics ensure that
optimizations cannot violate the lifetime dependence after diagnostics.
2024-01-04 14:47:35 -08:00
Kuba Mracek
31f821a455 [embedded] Add an initial docs/EmbeddedSwift/UserManual.md 2024-01-03 15:21:22 +01:00
SooHwanCho
6c6026ffb9 fix syntax error in generics.bib 2023-12-30 21:13:43 +09:00
Michael Gottesman
58a6e2aa4d [region-isolation] Add Asserting support for {alloc,dealloc}_pack_metadata since they only appear in Lowered SIL.
I also added a note to the SIL.rst and an assert into the SILVerifier to better
document this requirement.
2023-12-18 12:35:40 -08:00
Pavel Yaskevich
931342c76a Merge pull request #70374 from finagolfin/nux
[docs] GettingStarted: Update the linux instructions to use a prebuilt Swift compiler
2023-12-14 10:41:16 -08:00
Egor Zhdan
40ce4b0693 Merge pull request #70395 from ecbadeaux/Issue_69525
[Docs] Change (return this) to (return self)
2023-12-13 16:05:55 +01:00
Everett Badeaux
96fb3a0477 [Docs] Change return this to say return self
Signed-off-by: Everett Badeaux <everettc1810@gmail.com>
2023-12-12 17:33:56 -06:00
Finagolfin
22e1ed3acd [docs] GettingStarted: Update the linux instructions to use a prebuilt Swift compiler 2023-12-12 08:02:39 +05:30
Michael Gottesman
f328e7893b [region-isolation] Add support for representing ApplyIsolationCrossing at the SIL level on apply, begin_apply, try_apply.
Some notes:

This is not emitted by SILGen. This is just intended to be used so I can write
SIL test cases for transfer non sendable. I did this by adding an
ActorIsolationCrossing field to all FullApplySites rather than adding it into
the type system on a callee. The reason that this makes sense from a modeling
perspective is that an actor isolation crossing is a caller concept since it is
describing a difference in between the caller's and callee's isolation. As a
bonus it makes this a less viral change.

For simplicity, I made it so that the isolation is represented as an optional
modifier on the instructions:

  apply [callee_isolation=XXXX] [caller_isolation=XXXX]

where XXXX is a printed representation of the actor isolation.

When neither callee or caller isolation is specified then the
ApplyIsolationCrossing is std::nullopt. If only one is specified, we make the
other one ActorIsolation::Unspecified.

This required me to move ActorIsolationCrossing from AST/Expr.h ->
AST/ActorIsolation.h to work around compilation issues... Arguably that is where
it should exist anyways so it made sense.

rdar://118521597
2023-12-11 19:27:27 -06:00
Erik Eckstein
e652f2c92e SIL: add the alloc_vector and vector instructions
* `alloc_vector`: allocates an uninitialized vector of elements on the stack or in a statically initialized global
* `vector`: creates an initialized vector in a statically initialized global
2023-12-09 18:49:55 +01:00
Dario Rexin
36dd2c9450 [SilOpt] Add new layout type _TrivialStride and add pre-specialization suppport for it (#70308)
rdar://119329771

This layout allows adding pre-specializations for trivial types that have a different size, but the same stride. This is especially useful for collections, where the stride is the important factor.
2023-12-09 08:13:50 -08:00
Dario Rexin
df35f3327d [SilOpt] Add new layout _BridgeObject and add pre-specialization support for it (#70239)
rdar://119048001
2023-12-08 14:34:16 -08:00
Andrew Trick
ca16677608 Merge pull request #70052 from atrick/comment_drop_deinit
SIL: comment drop_deinit instruction.
2023-11-28 16:50:02 -08:00
Andrew Trick
8bec26bd33 SIL: comment drop_deinit instruction. 2023-11-28 12:35:01 -08:00
nate-chandler
126022f6e9 Merge pull request #70054 from nate-chandler/rdar118059326
[SIL] Key consume checking off var_decl attr.
2023-11-28 11:47:04 -08:00
Nate Chandler
b4f783e660 [SIL] Added var_decl flag to borrows/moves. 2023-11-28 07:26:08 -08:00
Nate Chandler
15182295c5 [SIL] Preserve pointer_escape flag during cloning. 2023-11-28 07:26:08 -08:00
Doug Gregor
36a2dcd927 Implement function body macros
Function body macros allow one to introduce a function body for a
particular function, either providing a body for a function that
doesn't have one, or wholesale replacing the body of a function that
was written with a new one.
2023-11-27 17:04:55 -08:00
Erik Eckstein
60070030f4 SIL.rst: make it clear that end_lifetime can also have an address operand. 2023-11-27 09:21:34 +01:00
Alex Hoppen
3bd764d70b Merge pull request #69897 from ahoppen/ahoppen/doc-lsan-ci-failures
[Docs] Add documentation how to diagnose LSAN CI failures
2023-11-16 11:45:40 -08:00
Alex Hoppen
bbb06a715f [Docs] Add documentation how to diagnose LSAN CI failures 2023-11-15 13:41:11 -08:00
Andrew Trick
cf2aeb8c17 Fix SIL.rst formatting in a few places.
This fixes errors in my local build.
2023-11-15 11:25:41 -08:00
Mishal Shah
786a0ba399 [Doc] Drop support for test and merge, and users should use auto-merge feature on GitHub 2023-11-08 13:17:35 -08:00
Michael Gottesman
48b4ca0b24 Merge pull request #69686 from gottesmm/rdar117880194
[region-isolation] When assigning RValues into memory, use tuple_addr_constructor instead of doing it in pieces.
2023-11-07 20:15:58 -08:00
Yuta Saito
79b3d2d626 Add underscore prefix to extern attribute
It's already guarded by a feature flag, but it would be nice to signal
users that it's not stable yet by adding an underscore prefix.
2023-11-07 02:01:02 +00:00
Michael Gottesman
6a65c7829e [sil] Add tuple_addr_constructor an instruction that can be used to initial a tuple in memory from individual address and object components.
This commit just introduces the instruction. In a subsequent commit, I am going
to add support to SILGen to emit this. This ensures that when we assign into a
tuple var we initialize it with one instruction instead of doing it in pieces.
The problem with doing it in pieces is that when one is emitting diagnostics it
looks semantically like SILGen actually is emitting code for initializing in
pieces which could be an error.
2023-11-06 15:32:05 -08:00
swift-ci
641be88935 Merge pull request #69500 from al45tair/eng/PR-117679284
[Docs] Update backtracing documentation for Linux.
2023-11-02 06:27:21 -07:00
Alastair Houghton
f9aeb57880 [Docs] Added a description of the platform and arch path components.
Describe what `<platform>` and `<arch>` mean in the search paths
for the `swift-backtrace` binary.

rdar://117679284
2023-11-02 11:06:51 +00:00
Slava Pestov
05ccd9734c SIL: Introduce ThrowAddrInst 2023-10-31 16:58:54 -04:00
Alastair Houghton
27641cb402 [Docs] Update backtracing documentation for Linux.
Update the backtracing documentation with details on static linking,
frame pointer usage and a couple of other matters.

rdar://117679284
2023-10-30 10:34:25 +00:00
Doug Gregor
4da1032f93 Add name mangling support for functions with a thrown error type 2023-10-29 09:12:32 -07:00
Allan Shortlidge
1a9cbbc749 Docs: Document library evolution restrictions for @inlinable functions.
As documented in the [SE-244 proposal](https://github.com/apple/swift-evolution/blob/main/proposals/0244-opaque-result-types.md#effect-on-api-resilience),
it is illegal to change the concrete return type of an @inlinable function with
an opaque return type. This ought to be documented since it is an extremely
subtle rule that authors of ABI stable libraries should be aware of.
2023-10-27 13:40:25 -07:00
nate-chandler
1a6d76ec47 Merge pull request #69314 from nate-chandler/opaque-values/20231020/1/coalesce-use-projections-into-phis
[AddressLowering] Allow use-projection into phi.
2023-10-24 07:06:32 -07:00
Nate Chandler
9e66a941fe [Test] Refer to inst results.
Via `.result[idx]`.
2023-10-20 18:16:38 -07:00
Yuta Saito
69479933df [c-interop] Rename @_extern to @extern
Now the feature is gated by experimental feature flag.
It's not shipped in any language release, so this rename should be fine.
2023-10-20 17:37:43 +00:00
Yuta Saito
7a75f5d2e2 [c-interop] Use Swift base name for @_extern(c) without explicit name 2023-10-20 15:34:09 +00:00
Yuta Saito
8f6491e6b6 [c-interop][docs] Add @_extern(c) attribute explanation 2023-10-20 15:34:09 +00:00
Andrew Trick
fca92e4ec6 Add a temporary @_nonEscapable attribute
For testing compiler support until we have the ~Escapable syntax.
2023-10-17 12:44:24 -07:00
finagolfin
75bfa4422a [android][test] Fix five tests that are failing on the community Android CI (#69189)
Update the Android doc with info about the latest LTS NDK not working.
2023-10-16 10:44:56 -07:00
swift-ci
d2b9ca0ccd Merge pull request #69201 from slavapestov/generics-se0404
generics.tex: Mention SE-0404
2023-10-16 09:06:36 -07:00
Slava Pestov
9f6029dd7d generics.tex: Mention SE-0404 2023-10-16 09:57:24 -04:00
Anthony Latsis
4f68365467 Merge pull request #69125 from AnthonyLatsis/not-my-first-pull-request
[docs] FirstPullRequest: Update and improve sections on tidying up & code review
2023-10-13 14:21:54 +03:00
Anthony Latsis
7130132be7 [docs] FirstPullRequest: Rewrite "Tidying up" section
* Link out to FAQ for an introduction to rewriting history.
* Link out to our commit message formatting guidelines.
* Expand a bit more on what it means to tidy commit history.
2023-10-13 09:53:59 +03:00