Commit Graph

3644 Commits

Author SHA1 Message Date
Xi Ge
43a8482fd4 doc: add documentation for @_spi_available 2022-03-06 08:39:03 -08:00
cabmeurer
23ba70e7ba [cxx-interop] Update GettingStartedWithC++Interop documentation (#41597) 2022-03-01 15:14:14 -08:00
cabmeurer
417adb5ac5 C++ Interop Getting Started Documentation (#41580) 2022-02-28 17:17:51 -08:00
Allan Shortlidge
9e4ba442a2 Merge pull request #41416 from tshortli/back-deploy-thunk
Emit and call thunks for back deployed functions
2022-02-25 17:49:08 -08:00
Robert Widmann
496da9dda9 Merge pull request #40977 from buttaface/droid-test 2022-02-21 22:46:42 -08:00
Allan Shortlidge
ed6d69fb15 Mangling: Add a mangling for back deployment fallback functions and update the back deployment thunk mangling to use the same prefix. 2022-02-18 16:30:27 -08:00
Allan Shortlidge
ff5abc4e2f Mangling: Use 'Tw' to mangle back deployment thunks. 2022-02-17 11:28:12 -08:00
Michael Gottesman
28fb3db8b9 Merge pull request #41378 from gottesmm/pr-4f030e9c7eb178276a709f3b668f8f9f357ffb40
[move-function] Add initial debug info support to move checker passes.
2022-02-14 22:41:00 -08:00
Michael Gottesman
375ce353f2 [move-function] Add a flag to alloc_stack and debug_value that states that they describe an address/value that was moved at some point locally in the function.
The main effect of this will be that in IRGen we will use llvm.dbg.addr instead
of llvm.dbg.declare. We must do this since llvm.dbg.declare implies that the
given address is valid throughout the program.

This just adds the instructions/printing/parsing/serialization/deserialization.

rdar://85020571
2022-02-14 17:56:03 -08:00
John McCall
b3b6701a50 Implement @_unsafeInheritExecutor.
SE-0338 changed the execution of non-actor async functions
so that they always hop to the generic executor, but some
functions need a way to suppress this so that they inherit
the caller's executor.

The right way to implement this is to have the caller pass
down the target executor in some reliable way and then
switch to it in all the appropriate places in the caller.
We might reasonably be able to build this on top of isolated
parameters, using some sort of default argument, or we might
need a wholly novel mechanism.

But those things are all ABI-breaking absent some sort of
guarantee about switching that we probably don't want to make,
and unfortunately we have functions in the library which we
need to export that need to inherit executors.  So in the
short term, we need some unsafe way of getting back to the
previous behavior.
2022-02-14 20:46:03 -05:00
Butta
26aafe66f6 [android] Fix some tests and a doc flag
Use off_t for a recently failing stdlib test, remove Python hacks for some
tests that now work without them, and correct build flag in the docs.
2022-02-14 03:02:04 +05:30
nate-chandler
63161e6ee5 Merge pull request #41228 from nate-chandler/lexical_lifetimes/owned_function_args_are_lexical
[SIL] Make owned function arguments lexical.
2022-02-11 18:11:59 -08:00
Nate Chandler
2da6ac19a0 [SIL] Doc'd deinit barriers. 2022-02-10 16:28:42 -08:00
swift-ci
e679d6f0be Merge pull request #41236 from apple/maxd/tbd-lexicon 2022-02-09 18:41:24 -08:00
Max Desiatov
3658a9d138 docs: add TBD to Lexicon.md
Description was copy-pasted from https://lists.llvm.org/pipermail/llvm-dev/2017-September/117264.html
2022-02-09 20:55:04 +00:00
Erik Eckstein
8fe36eedd8 SILPassManager: improve bisecting for debugging the optimizer
* Add the possibility to bisect the individual transforms of SILCombine and SimplifyCFG.
   To do so, the `-sil-opt-pass-count` option now accepts the format `<n>.<m>`, where `m` is the sub-pass number.
   The sub-pass number limits the number of individual transforms in SILCombine or SimplifyCFG.

* Add an option `-sil-print-last` to print the SIL of the currently optimized function before and after the last pass, which is specified with `-sil-opt-pass-count`.
2022-02-09 13:25:30 +01:00
Allan Shortlidge
b860e762b2 AST: Introduce the @_backDeploy function attribute:
- Parse the attribute and diagnose parsing issues
- Serialize the attribute
2022-02-08 10:11:04 -08:00
Philip Turner
19b4492432 Add DifferentiableProgrammingImplementation.md to docs/README.md (#41123)
* Update README.md

* Update docs/README.md

Co-authored-by: Robert Widmann <devteam.codafi@gmail.com>

Co-authored-by: Robert Widmann <devteam.codafi@gmail.com>
2022-02-07 12:03:38 -08:00
Malik Idrees Hasan Khan
65ba422d16 Fix typos in SIL.rst 2022-02-04 20:31:25 +05:30
Erik Eckstein
13d2b1fe15 mangling: add a mangling for constant propagating keypaths in capture propagation.
This is not ABI affecting.
2022-02-01 08:13:27 +01:00
Max Desiatov
ed5974dd69 docs: add "Bringing Swift to Windows" talk to the list (#41025)
Adding this relatively recent talk to `ExternalResources.md`.
2022-01-28 17:48:27 +00:00
nate-chandler
0472c0d83c Merge pull request #40926 from nate-chandler/sil/move_value_defined_flag
[SIL] Added lexical flag to move_value.
2022-01-26 19:58:27 -08:00
Pavel Yaskevich
4aa201396f Merge pull request #41001 from xedin/switch-to-build-wrangler
[Lexicon] Change `build czar` to `build wrangler`
2022-01-25 16:08:59 -08:00
Pavel Yaskevich
dd5dc84bf7 [Lexicon] Change build czar to build wrangler 2022-01-25 10:27:57 -08:00
Erik Eckstein
f09dfc93a9 Swift SIL: escape effects for function arguments.
Store a list of argument effects in a function, which specify if and how arguments escape.
Such effects can be specified in the Swift source code (for details see docs/ReferenceGuides/UnderscoredAttributes.md) or derived in an optimization pass.

For details see the documentation in SwiftCompilerSources/Sources/SIL/Effects.swift.
2022-01-25 11:29:44 +01:00
Erik Eckstein
72fc4e3c95 docs: document the existing @_effects() attributes 2022-01-25 11:29:25 +01:00
Xi Ge
1667c5f643 mangling: take the constness of function parameters into mangling
Taking constness of parameters into mangling allows us to support overloads of
functions vary on the constness of specific parameters.

rdar://87954644
2022-01-24 11:51:01 -08:00
Alex Lorenz
e106551028 [NFC][interop] rename the PrintAsObjC library to PrintAsClang
We're starting to support emission of C++ header interfaces, so a language-agnostic name makes more sense
2022-01-20 11:31:58 -08:00
Nate Chandler
572510835b [SIL] Added lexical flag to move_value.
The new flag will be used to track whether a move_value corresponds to a
source-level lexical scope. Here, the flag is just added to the
instruction and represented in textual and serialized SIL.
2022-01-20 08:33:09 -08:00
Philip Turner
bdce80f5ac [docs] Add "currency type" to the lexicon (#40874)
* Unclear word

* Update Lexicon.md

* Update README.md

* Update docs/Lexicon.md

Co-authored-by: Robert Widmann <devteam.codafi@gmail.com>

* Update Lexicon.md

* Update docs/README.md

Co-authored-by: Robert Widmann <devteam.codafi@gmail.com>

* Update docs/README.md

Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>

Co-authored-by: Robert Widmann <devteam.codafi@gmail.com>
Co-authored-by: Xiaodi Wu <13952+xwu@users.noreply.github.com>
2022-01-18 10:37:58 -08:00
Philip Turner
8c283278ef Change gradient(at:in:) to gradient(at:of:) 2022-01-17 12:18:24 -05:00
Philip Turner
d0258c6677 Another small fix 2022-01-16 14:40:44 -05:00
Philip Turner
0aabc0c400 Fix typo in GettingStarted.md 2022-01-16 08:51:01 -05:00
Doug Gregor
61d35f07a4 Merge pull request #40766 from DougGregor/mangle-multiple-opaque-types
Introduce a mangling for multiple opaque types within the declaration.
2022-01-07 15:45:38 -08:00
Doug Gregor
f89ff0485f Introduce a mangling for multiple opaque types within the declaration.
The `Qr` mangling is used to refer to the opaque type within the
declaration that produces the opaque type. When there are multiple
opaque types, e.g., due to structural or named opaque result types, it
does not specify which of the opaque type parameters it refers to.

Introduce a new mangling `QR INDEX` for opaque type parameters after
the first, retaining the `Qr` mangling for the first opaque type
parameter. This way, existing (non-structural) uses of opaque result
types retain the same manglings, but uses of structural or named
opaque result types (new features) will have distinct manglings.

Note that this mangling within a declaration is only used for the
declaration itself, and not for references to the opaque type of the
declaration, so there is no impact on the runtime demangler.
2022-01-07 10:43:45 -08:00
Erik Eckstein
383c52aa35 SIL: rename dealloc_ref [stack] -> dealloc_stack_ref
Introduce a new instruction `dealloc_stack_ref ` and remove the `stack` flag from `dealloc_ref`.

The `dealloc_ref [stack]` was confusing, because all it does is to mark the deallocation of the stack space for a stack promoted object.
2022-01-07 16:20:27 +01:00
Robert Widmann
9429514268 Merge pull request #40659 from buttaface/stdlib-remove-icu
[build] Remove last vestiges of ICU for anything other than Foundation
2022-01-07 00:36:13 -08:00
zoecarver
036361d1e4 [cxx-interop] Add SIL function representation cxx_method; Support extending C++ types.
There are three major changes here:
    1. The addition of "SILFunctionTypeRepresentation::CXXMethod".
    2. C++ methods are imported with their members *last*. Then the arguments are switched when emitting the IR for an application of the function.
    3. Clang decls are now marked as foreign witnesses.

These are all steps towards being able to have C++ protocol conformance.
2022-01-06 14:26:47 -08:00
Butta
2890d15da7 [build] Remove last vestiges of ICU for anything other than Foundation 2021-12-25 21:16:34 +05:30
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
Pavel Yaskevich
8e1aa19188 [Mangling] Define mangling for runtime accessible function records 2021-12-17 10:52:56 -08:00
Pavel Yaskevich
b8358b26fe [Mangling] Add mangling for distributed method accessors
`Distributed Method Accessor` is a global helper function
to get access to particular `distributed method` on an actor
from outside the process.
2021-12-17 10:52:55 -08:00
Philip Turner
8807f618d2 Update docs/DifferentiableProgrammingImplementation.md
Co-authored-by: Richard Wei <rxrwei@gmail.com>
2021-12-07 18:58:49 -08:00
Philip Turner
bd862efe59 Update docs/DifferentiableProgrammingImplementation.md
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2021-12-07 17:30:09 -08:00
Philip Turner
a4a74821cf Make two links relative - please review 2021-12-07 20:18:10 -05:00
Philip Turner
5891e06760 Update docs/DifferentiableProgrammingImplementation.md
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2021-12-07 17:15:18 -08:00
Philip Turner
0d7779e21b Please review - eliminate bulleted list 2021-12-07 20:12:34 -05:00
Philip Turner
59e5db4cfb Update docs/DifferentiableProgrammingImplementation.md
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2021-12-07 17:02:15 -08:00
Philip Turner
ef9fb888d4 Update DifferentiableProgrammingImplementation.md 2021-12-07 18:16:48 -05:00
Philip Turner
5a5d727528 Update DifferentiableProgrammingImplementation.md 2021-12-07 18:13:40 -05:00