Commit Graph

4270 Commits

Author SHA1 Message Date
Alexander Cyon
ae0e94a555 [docs] Fix typos 2024-07-06 13:16:16 +02:00
Nate Chandler
b150a484f2 [SIL] Add dead_end flag to dealloc_box. 2024-07-03 15:26:59 -07:00
Nate Chandler
a8cc3bfdda [SIL] Add dead_end flag to destroy_value. 2024-07-03 15:26:59 -07:00
Akira Hatanaka
42bc49d3fe Add a new parameter convention @in_cxx for non-trivial C++ classes that are passed indirectly and destructed by the caller (#73019)
This corresponds to the parameter-passing convention of the Itanium C++
ABI, in which the argument is passed indirectly and possibly modified,
but not destroyed, by the callee.

@in_cxx is handled the same way as @in in callers and @in_guaranteed in
callees. OwnershipModelEliminator emits the call to destroy_addr that is
needed to destroy the argument in the caller.

rdar://122707697
2024-06-27 09:44:04 -07:00
Anthony Latsis
86ff1f9626 Merge pull request #74664 from vanvoorden/patch-1 2024-06-26 18:45:39 +03:00
Mishal Shah
cfc7c86f0a Merge pull request #74724 from AnthonyLatsis/acer-palmatum
[docs] FirstPullRequest.md: Adjust for `swiftlang`
2024-06-25 23:53:04 -07:00
Anthony Latsis
dcbc51bfe6 [docs] FirstPullRequest.md: Adjust for swiftlang 2024-06-26 09:45:42 +03:00
Alex Hoppen
a70e81f853 Merge pull request #74686 from ahoppen/swiftlang-migration
Update links for repositories moved to the swiftlang org on GitHub
2024-06-25 21:08:35 -07:00
Kavon Farvardin
bcedccac9c Docs: discuss @_preInverseGenerics 2024-06-25 12:06:23 -07:00
Alex Hoppen
8e20a6f479 Update links for repositories moved to the swiftlang org on GitHub 2024-06-25 04:35:39 -07:00
Rick van Voorden
943b9cbe4d Update GettingStarted.md with workaround for icu error 2024-06-24 12:38:38 -07:00
Slava Pestov
6176e02aa3 docs: Update generics.tex 2024-06-23 09:30:05 -04:00
Saleem Abdulrasool
94aa0cd450 Merge pull request #73581 from swiftlang/compnerd/cross-compile-model
Create CrossCompilationModel.md
2024-06-22 11:51:42 -07:00
Saleem Abdulrasool
3e6aa1741f Create CrossCompilationModel.md
Add some documentation to describe the proposed model for cross-compilation, associated flags, and the reasoning for the structure. This should allow us to have a reference for the design allowing us to evolve the model.

Co-authored-by: Evan Wilde <ewilde@apple.com>
Co-authored-by: Alexander Smarus <bender@readdle.com>
Co-authored-by: Danielle <dani@builds.terrible.systems>
2024-06-21 14:11:25 -07:00
Michael Gottesman
3f39bdc1ed [sending] closure literals that are passed as sending parameters are now inferred to be nonisolated.
Consider the following piece of code and what the isolation is of the closure
literal passed to doSomething():

```swift
func doSomething(_ f: sending () -> ()) { ... }

@MyCustomActor
func foo() async {
  doSomething {
    // What is the isolation here?
  }
}
```

In this case, the isolation of the closure is @MyCustomActor. This is because
non-Sendable closures are by default isolated to their current context (in this
case @MyCustomActor since foo is @MyCustomActor isolated). This is a problem
since

1. Our closure is a synchronous function that does not have the ability to hop
to MyCustomActor to run said code. This could result in a concurrency hole
caused by running the closure in doSomething() without hopping to
MyCustomActor's executor.

2. In Region Based Isolation, a closure that is actor isolated cannot be sent,
so we would immediately hit a region isolation error.

To fix this issue, by default, if a closure literal is passed as a sending
parameter, we make its isolation nonisolated. This ensures that it is
disconnected and can be transferred safely.

In the case of an async closure literal, we follow the same semantics, but we
add an additional wrinkle: we keep support of inheritActorIsolation. If one
marks an async closure literal with inheritActorIsolation, we allow for it to be
passed as a sendable parameter since it is actually Sendable under the hood.
2024-06-21 02:24:03 -07:00
Antoine Bollengier
e50a6c47f4 Few typos in docs/EmbeddedSwift/UserManual.md (#74311) 2024-06-14 19:27:17 -07:00
Michael Gottesman
045c214522 [docs] Add a little section about Disabling PCH Verification. 2024-06-12 10:59:43 -07:00
Kuba (Brecka) Mracek
7047809301 Merge pull request #73961 from kubamracek/embedded-docs6
[embedded] Add a summary of the Embedded Swift ABI
2024-06-10 17:07:00 -07:00
Kuba (Brecka) Mracek
bc147aea15 Merge pull request #73944 from kubamracek/embedded-docs5
[embedded] Add a section on Strings into the User Manual
2024-06-10 16:50:38 -07:00
Kuba Mracek
772e066238 [embedded] Add 'sorting strings' to the list of ops that need Unicode data tables 2024-06-10 13:38:32 -07:00
Kuba Mracek
cab0eeed65 [embedded] Expand ABI docs on C/C++ interop 2024-06-10 13:34:03 -07:00
Egor Zhdan
a3e3079fb6 [docs] Suggest --skip-xros in the Getting Started guide
The Getting Started guide offers a build-script command that new contributors can use to quickly build a debug compiler on their local machine. The command already has `--skip-tvos` and `--skip-watchos` flags since most compiler contributors don't need to build for those platforms. This change adds `--skip-xros` flag to the command.
2024-06-10 16:22:36 +01:00
Nate Chandler
2a5d07522d [SIL] Add extend_lifetime instruction.
It indicates that the value's lifetime continues to at least this point.
The boundary formed by all consuming uses together with these
instructions will encompass all uses of the value.
2024-06-05 16:28:26 -07:00
Alejandro Alonso
324cb2df1f Merge pull request #73955 from Azoy/show-me-those-moves
[IRGen] Add option for raw layout to move as its like type
2024-05-30 20:32:49 -07:00
Alejandro Alonso
1d941cddb4 Note that rawLayout movesAsLike should be initialized 2024-05-29 09:37:08 -07:00
Kuba Mracek
a9d149b9be [embedded] Add a summary of the Embedded Swift ABI 2024-05-28 16:21:59 -07:00
Alejandro Alonso
a9da08ccb6 Add option for raw layout to move as its like type 2024-05-28 14:34:22 -07:00
Kuba Mracek
02d7ec27e0 [embedded] Add a section on Strings into the User Manual 2024-05-28 09:32:27 -07:00
Li Xuanji
80e5843611 Update GenericsManifesto.md 2024-05-26 09:17:05 -04:00
Emil Pedersen
0bc6ece9db [DebugInfo] [SILGen] Always use emitDebugDescription (NFCI) 2024-05-23 14:05:13 -07:00
Anthony Latsis
5b9e79e21a Merge pull request #73772 from zaneenders/zane-sparkles-typo 2024-05-22 05:37:16 +03:00
zane
dc3d8d1704 Fix typo in FirstPullRequest.md 2024-05-21 11:19:22 -06:00
Slava Pestov
d489ad364d docs: Update generics.tex 2024-05-21 11:00:28 -04:00
Michael Gottesman
4789cc7e55 Merge pull request #73556 from gottesmm/rdar127295657_127844737
[region-isolation] When inferring isolation for an argument, handle non-self isolated parameters as well as self parameters that are actor isolated.
2024-05-13 11:18:51 -07:00
Emil Pedersen
15cab3a19f Merge pull request #73555 from Snowy1803/complete-getvarinfo
[DebugInfo] Return complete variable info from getVarInfo by default
2024-05-13 10:32:43 -07:00
Michael Gottesman
f51a050af4 [sil] Restrict sil_isolated to only being able to be applied to any actor types.
I also added some docs to SIL.rst about sil_isolated as well.
2024-05-11 17:14:49 -07:00
Emil Pedersen
0be63d0422 [DebugInfo] Return complete variable info from getVarInfo by default
getVarInfo() now always returns a variable with a location and scope.
To opt out of this change, getVarInfo(false) returns an incomplete variable.
This can be used to work around bugs, but should only really be used for
printing.

The complete var info will also contain the type, except for debug_values,
as its type depends on another instruction, which may be inconsistent if
called mid-pass.

All locations in debug variables are now also stripped of flags, to avoid
issues when comparing or hashing debug variables.
2024-05-10 16:12:56 -07:00
Emil Pedersen
bf58b030c5 Merge pull request #73387 from Snowy1803/allocbox-fix
[DebugInfo] Fix loss of variables at -Onone
2024-05-02 12:39:17 -07:00
Emil Pedersen
d451c3e4e1 Merge pull request #73334 from Snowy1803/unified-lost-vars-statistics
Add compile flag for lost debug variables statistics
2024-05-01 18:03:32 -07:00
Hamish Knight
c2266a17a5 [docs] Update ASan trigger in ContinuousIntegration.md 2024-05-01 22:06:29 +01:00
Emil Pedersen
f6232a937d [DebugInfo] Fix wrong scope being used in AllocBoxToStack 2024-04-30 16:29:49 -07:00
Emil Pedersen
7e81fd60f1 [docs] Document the lost variables statistics option 2024-04-30 13:18:38 -07:00
Emil Pedersen
84dae7c37a [DebugInfo] Add support for constant debug values 2024-04-26 16:31:16 -07:00
Emil Pedersen
8ad3066011 [DebugInfo] Fix implicit deref on arithmetic expressions 2024-04-26 16:31:16 -07:00
Emil Pedersen
c2c16f53dd [DebugInfo] Fix undef debug values being removed 2024-04-26 16:31:16 -07:00
Emil Pedersen
9c9f14f6d3 [docs] Add more details to HowToUpdateDebugInfo 2024-04-26 16:31:11 -07:00
Adrian Prantl
76bbea6070 Merge pull request #73122 from adrian-prantl/sil-howto-debuginfo
Add the beginning of a Debug Info guide for SIL pass authors.
2024-04-19 17:39:22 +02:00
Adrian Prantl
22afb55fb5 Add the beginning of a Debug Info guide for SIL pass authors.
This document describes how debug info works at the SIL level and how to
correctly update debug info in SIL optimization passes. This document is
inspired by its LLVM analog, "How to Update Debug Info: A Guide for LLVM Pass
Authors", which can be found at https://llvm.org/docs/HowToUpdateDebugInfo.html
2024-04-18 16:18:20 -07:00
Erik Eckstein
ac4bc89c9a SIL: add the borrowed-from instruction.
It declares from which enclosing values a guaranteed phi argument is borrowed from.
2024-04-10 13:38:10 +02:00
Emil Pedersen
512ac6cc31 Merge pull request #72860 from Snowy1803/salvage-debug-info-tuple
[DebugInfo] Salvage debug info for tuples
2024-04-05 20:16:24 -07:00