Commit Graph

22435 Commits

Author SHA1 Message Date
swift-ci
ad721b21c9 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-14 15:33:31 -07:00
Arnold Schwaighofer
8ebb3ec473 IRGen: Add the ability to mark certain generic entry points in back traces
Mark generic function calls with concrete parameters, generic v-table calls and
generic witness table calls where self is generic.
2024-10-14 14:06:10 -07:00
Rintaro Ishizaki
e4dc04d564 [Macros] Reap plugin process as soon as it ends 2024-10-14 09:44:38 -07:00
swift-ci
02074b566b Merge remote-tracking branch 'origin/main' into rebranch 2024-10-13 13:13:52 -07:00
Rintaro Ishizaki
66138e8395 [ASTGen] Generate ForceValueExpr and BindOptionalExpr 2024-10-13 07:30:36 -07:00
swift-ci
ce9c86722d Merge remote-tracking branch 'origin/main' into rebranch 2024-10-12 11:34:21 -07:00
Holly Borla
2f33d875d9 Merge pull request #76988 from hborla/init-checking-order
[Sema] Fix an issue with the ordering of effects checking and actor isolation checking.
2024-10-12 11:21:33 -07:00
Hamish Knight
7c3f965578 Merge pull request #76979 from hamishknight/regex-request
Requestify regex pattern parsing
2024-10-12 19:19:09 +01:00
swift-ci
61fa7d51fa Merge remote-tracking branch 'origin/main' into rebranch 2024-10-11 21:45:39 -07:00
Allan Shortlidge
6c18bf2932 Merge pull request #76989 from tshortli/remove-trc-explicit-availability 2024-10-11 21:42:39 -07:00
Holly Borla
e1bf19822d [Sema] Put effects checking behind a request for experimental lazy
type checking.
2024-10-11 20:33:38 -07:00
Allan Shortlidge
6bc9cf5e43 AST: Remove ExplicitAvailabilityInfo from TypeRefinementContext.
This field was complicating initialization of `TypeRefinementContext` and
bloating its storage just to make it slightly more convenient to look up
information that is pretty easy to derive on-demand when it is actually needed.
2024-10-11 17:10:38 -07:00
swift-ci
8a2edbc4c5 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-11 17:05:06 -07:00
nate-chandler
249831f9f3 Merge pull request #76942 from nate-chandler/general-coro/20240927/1
[CoroutineAccessors] SIL represents callee alloc.
2024-10-11 16:39:53 -07:00
swift-ci
3fbd2b5151 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-11 13:15:53 -07:00
Rintaro Ishizaki
9461af4c5a Merge pull request #76978 from rintaro/astgen-placeholderexpr
[ASTGen] Generate EditorPlaceholderExpr and 'do' expressions
2024-10-11 13:12:21 -07:00
Hamish Knight
6a435960b7 Requestify regex pattern parsing
Instead of doing the pattern parsing in both the
C++ parser and ASTGen, factor out the parsing into
a request that returns the pattern to emit, regex
type, and version. This can then be lazily run
during type-checking.
2024-10-11 19:25:58 +01:00
swift-ci
e1cfbb45cc Merge remote-tracking branch 'origin/main' into rebranch 2024-10-11 11:19:47 -07:00
Anthony Latsis
8519334b89 Merge pull request #76749 from AnthonyLatsis/amanita-muscaria 2024-10-11 18:02:36 +00:00
Rintaro Ishizaki
cb6372a9c4 [ASTGen] Generate EditorPlaceholderExpr and 'do' expressions 2024-10-11 09:34:41 -07:00
Nate Chandler
49a2831d3f [CoroutineAccessors] Old ABI may be used via flag.
Add a setting to IRGenOptions and key off of it to emit yield_once_2
coroutines using either (1) the same code-path as yield_once coroutines
or (2) a new, not-yet implemented code-path.

Add flags to set the value in both directions.  During bringup, by
default, use the existing caller-allocated ABI.
2024-10-11 08:25:02 -07:00
Nate Chandler
11b5d27594 [CoroutineAccessors] Add flag to observe errors.
Temporarily allow the legacy behavior of allowing caller coroutine
accessors to observe errors (i.e. by executing no code after the yield
if the caller threw an error) behind the
CoroutineAccessorsUnwindOnCallerError flag.
2024-10-11 08:25:02 -07:00
Nate Chandler
df1c4f6b25 [CoroutineAccessors] Add new SILFnTy CoroKind.
For `modify` and `read` coroutines, produce SILFunctionType's whose
coroutineKind is ::YieldOnce2.
2024-10-11 08:25:02 -07:00
swift-ci
eb44cd10be Merge remote-tracking branch 'origin/main' into rebranch 2024-10-10 23:13:50 -07:00
Allan Shortlidge
5440dcef92 AST: Make ExpandChildTypeRefinementContextsRequest a side effectful request.
While returning the actual child vector from
`ExpandChildTypeRefinementContextsRequest` is a nice idea, it is both
inefficient (the vector gets copied in and out) and kind of inaccurate, since
the vector remains mutable after the initial expansion and may gain additional
children as macros are lazily expanded.
2024-10-10 18:06:39 -07:00
Anthony Latsis
41adfec8da [NFC] AST, Sema: Move TypeChecker::findReturnStatements into AnyFunctionRef
Also rename it to `getExplicitReturnStmts` for clarity and have it
take a `SmallVector` out parameter instead as a small optimization and
to discourage use of this new method as an alternative to
`AnyFunctionRef::bodyHasExplicitReturnStmt`.
2024-10-11 03:57:43 +03:00
Anthony Latsis
244185c4f4 [NFC] AST: Rename BraceHasReturnRequest to BraceHasExplicitReturnStmtRequest 2024-10-11 03:44:43 +03:00
Anthony Latsis
c7ea672463 [NFC] AST, Sema: Internalize BraceHasReturnRequest evaluation in AnyFunctionRef method 2024-10-11 03:44:43 +03:00
swift-ci
26796d7375 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-10 07:14:16 -07:00
James Paolantonio
5e1de491b6 [Const extract] Extract static function calls (#76251)
Co-authored-by: James Paolantonio <j_paolantonio@apple.com>
2024-10-10 09:59:20 -04:00
swift-ci
6c5df94ea4 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-09 22:54:18 -07:00
Rintaro Ishizaki
6018662615 Merge pull request #76889 from rintaro/astgen-regexexpr
[ASTGen] Implement some Expr generation
2024-10-09 22:39:50 -07:00
swift-ci
25f0382ca5 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-09 18:07:23 -07:00
Michael Gottesman
131ab89f49 Merge pull request #76920 from gottesmm/pr-4ab85a74d0641a99b3a480971f93b2f98f726e31
[region-isolation] Add a special error for when a closure captures a non-Sendable box.
2024-10-09 17:36:29 -07:00
Michael Gottesman
ce7a0db192 [region-isolation] Add a special error for when a closure captures a non-Sendable box.
The reason that I am modifying this error is that in situations like the
following one can have a Sendable type that triggers this error since the box
containing the value is non-Sendable.

```
func methodConsuming(x: consuming SendableKlass) async throws {
  try await withThrowingTaskGroup(of: Void.self) { group in
    group.addTask { // expected-tns-warning {{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}}
      useValue(x) // expected-tns-note {{closure captures reference to mutable var 'x' which is accessible to code in the current task}}
    }

    try await group.waitForAll()
  }
}
```

rdar://133813644
(cherry picked from commit 36c2b3cc1330c07dcf9715f8ae88d31f9dba58c4)
2024-10-09 11:14:28 -07:00
swift-ci
c49a0e84d3 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-09 10:44:16 -07:00
Meghana Gupta
4df55a12cd Merge pull request #76834 from meg-gupta/lifetimedepmultiple
Replace dependsOn with @lifetime
2024-10-09 10:17:43 -07:00
swift-ci
c2fff1cc0f Merge remote-tracking branch 'origin/main' into rebranch 2024-10-09 03:14:46 -07:00
eeckstein
f65d41e3c9 Merge pull request #76908 from eeckstein/array-improvements
Improve code generation for arrays of classes.
2024-10-09 12:02:41 +02:00
swift-ci
0532e29e70 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 21:09:22 -07:00
Allan Shortlidge
cee810a0bc Merge pull request #76912 from tshortli/sorted-type-refinement-contexts
AST: Sort TypeRefinementContexts for better lookup performance
2024-10-08 20:48:53 -07:00
swift-ci
40aee60b24 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 19:09:12 -07:00
Allan Shortlidge
bfbb9f85e2 Merge pull request #76922 from tshortli/remove-unused-server-field
AST: Remove unused server field from InProcessPlugins
2024-10-08 18:19:04 -07:00
Meghana Gupta
b443ff76e4 [NFC] Use llvm::TrailingObjects to represent variable list of lifetime sources 2024-10-08 15:11:26 -07:00
Meghana Gupta
ea420e0780 Add a test for @lifetime(immortal) 2024-10-08 15:10:59 -07:00
Meghana Gupta
8e8b21e25e Fix AST printing of @lifetime 2024-10-08 15:10:59 -07:00
Meghana Gupta
4ac90a3e11 Diagnose multiple @lifetime attributes with same target 2024-10-08 15:10:59 -07:00
Meghana Gupta
31c1dc7eb5 Add support for specifying target in @lifetime
@lifetime(target: source1, source2...) where target can be any
parameter or 'self'. We cannot have @lifetime attributes with duplicate targets.

Also, update the internal data structures. Previously LifetimeEntry stored
pairwise (target, source) dependencies. Now, LifetimeEntry will store an optional
target descriptor and an array of source descriptors.
2024-10-08 15:10:48 -07:00
Allan Shortlidge
c9d1ac07eb AST: Remove unused server field from InProcessPlugins. 2024-10-08 14:32:56 -07:00
swift-ci
c11a29a722 Merge remote-tracking branch 'origin/main' into rebranch 2024-10-08 13:28:36 -07:00