Commit Graph

158 Commits

Author SHA1 Message Date
Anthony Latsis
5620abbad8 Bridging: Bridge swift::CharSourceRange directly 2025-07-15 21:34:48 +01:00
Anthony Latsis
9001ce4687 Bridging: Bridge swift::SourceRange directly 2025-07-15 21:33:28 +01:00
Anthony Latsis
6eb5d7d857 Bridging: Bridge swift::SourceLoc directly 2025-07-15 21:33:06 +01:00
Anthony Latsis
8cbf5a26e4 Bridging: Bridge swift::DeclBaseName directly 2025-07-10 17:58:13 +01:00
Anthony Latsis
0e0fbc4160 Bridging: Bridge swift::Identifier directly 2025-07-10 17:58:13 +01:00
Alexis Laferrière
81a0f98783 Merge pull request #82194 from xymus/cdecl-parser
Parser: Accept `@cdecl` with an optional identifier for a custom C name
2025-06-27 15:06:11 -07:00
Anthony Latsis
dd78cd6dbe ASTBridging: Bridge swift::PlatformKind directly 2025-06-20 16:46:03 +01:00
Anthony Latsis
de46b95e7e ASTBridging: Bridge swift::GenericTypeParamKind directly 2025-06-20 16:46:03 +01:00
Anthony Latsis
dcbf2781c5 ASTBridging: Bridge swift::RequirementReprKind directly 2025-06-20 16:46:03 +01:00
Anthony Latsis
69a27e1735 ASTBridging: Bridge swift::LayoutConstraintKind directly 2025-06-20 16:46:03 +01:00
Anthony Latsis
b347aedeb0 ASTBridging: Encapsulate some operations on BridgedLayoutConstraint
NB: Switching from factory methods to initializers as well crashes on
Windows.
2025-06-20 16:44:49 +01:00
Anthony Latsis
30a8b59c6e ASTBridging: Bridge swift::TypeAttrKind directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
8501c8776e ASTBridging: Bridge swift::ExternKind directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
0b0ebfc9fb ASTBridging: Bridge swift::ExposureKind directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
b2b79f3ad7 ASTBridging: Bridge swift::InlineKind directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
6527be558a ASTBridging: Bridge swift::NonIsolatedModifier directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
29ef3e300f ASTBridging: Bridge swift::InheritActorContextModifier directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
68bb4b33f9 ASTBridging: Bridge swift::EffectsKind directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
12de029d97 ASTBridging: Bridge swift::AccessLevel directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
cf09773d66 ASTBridging: Bridge swift::Associativity directly 2025-06-19 18:11:40 +01:00
Anthony Latsis
38360fe625 ASTBridging: Bridge swift::DeclAttrKind directly 2025-06-19 18:11:39 +01:00
Anthony Latsis
722bc0f086 ASTBridging: Bridge swift::DiagID directly 2025-06-19 12:29:27 +01:00
Anthony Latsis
3e9923f0c0 ASTBridging: Bridge swift::AccessorKind directly 2025-06-19 04:26:52 +01:00
Anthony Latsis
b40b192227 ASTBriding: Bridge swift::DiagnosticKind directly 2025-06-16 19:11:35 +01:00
Anthony Latsis
106d5f4461 {AST,Basic}Bridging: Use SWIFT_COMPUTED_PROPERTY 2025-06-16 19:11:32 +01:00
Alexis Laferrière
d9566c6c1e ASTGen: Accept @cdecl 2025-06-11 12:42:38 -07:00
Meghana Gupta
0dfa1fc312 Update spelling for representing lifetime dependencies to @_lifetime 2025-06-07 12:49:07 -07:00
Pavel Yaskevich
4b5105df5e [ASTGen] Implement bridging for using declaration 2025-05-30 15:52:09 -07:00
Arnold Schwaighofer
13ff5abdb8 Introduce @specialized attribute
Implements SE-0460 -- the non-underscored version of @specialized.

It allows to specify "internal" (not abi affecting) specializations.

rdar://150033316
2025-05-23 13:12:47 -07:00
Hamish Knight
edca7c85ad Adopt ABORT throughout the compiler
Convert a bunch of places where we're dumping to stderr and calling
`abort` over to using `ABORT` such that the message gets printed to
the pretty stack trace. This ensures it gets picked up by
CrashReporter.
2025-05-19 20:55:01 +01:00
Pavel Yaskevich
917524de94 Merge pull request #81496 from xedin/inheritActorContext-alwayse
[AST/Sema/SIL] Implement `@_inheritActorContext(always)`
2025-05-15 08:17:30 -07:00
eeckstein
0d3edd629b Merge pull request #81502 from eeckstein/debug-info-in-embedded
embedded: fix source location of diagnostics which appear in imported modules
2025-05-15 06:58:54 +02:00
Pavel Yaskevich
c0aca5384b [ASTGen] Transform @_inheritActorContext into a custom attribute with an optional modifier 2025-05-14 20:07:59 -07:00
Becca Royal-Gordon
e71f837b1f [NFC] Stub module selector DeclNameRef/Loc members 2025-05-14 11:16:02 -07:00
Erik Eckstein
5dc71aa0a5 AST/SIL: support source location in diagnostics for de-serialized debug info
Diagnostics only work with `SourceLoc` which is basically a pointer into a buffer of the loaded source file.
But when debug info is de-serialized, the SIL `Location` consists of a filename+line+column.
To "convert" this to a `SourceLoc`, the file must be loaded.
This change adds `DiagnosticEngine.getLocationFromExternalSource` for this purpose.
Also, the new protocol `ProvidingSourceLocation` - to which `SourceLoc` and `Location` conform - help to generalize the helper struct `Diagnostic` and make this "conversion" happen automatically.
2025-05-14 11:43:47 +02:00
Alexis Laferrière
a6beaf8deb Merge branch 'main' into cdecl-global-function-checking 2025-04-16 11:19:37 -07:00
Pavel Yaskevich
07ff063ae3 [AST/ASTGen/Sema/Serialization] Remove @execution attribute
Complete the transition from `@execution` to `@concurrent` and `nonisolated(nonsending)`
2025-04-11 15:59:25 -07:00
Pavel Yaskevich
54b62ae983 [AST/Parse] Implement nonisolated(nonsending) type modifier 2025-04-11 15:59:25 -07:00
Pavel Yaskevich
b1ffa063b6 [AST/Sema] Intoduce nonisolated(nonsending) as a replacement for @execution(caller) 2025-04-11 15:57:11 -07:00
Pavel Yaskevich
4b8c8e7d72 [AST/Sema] Replace @execution(concurrent) with @concurrent 2025-04-11 12:08:29 -07:00
Alexis Laferrière
02b5998536 Parser: Intro @cdecl attribute and gate it behind feature flag CDecl 2025-04-11 11:34:39 -07:00
Meghana Gupta
ef1e94577f Revert "Merge pull request #80540 from swiftlang/revert-80452-lifetimeinout"
This reverts commit 6eaa07a880, reversing
changes made to e75ee3f4cf.
2025-04-04 09:50:13 -07:00
Artem Chikin
39e1791b67 Revert "Add support for inout lifetime dependence" 2025-04-04 09:00:09 -07:00
Meghana Gupta
d87a2b2ada Rename ParsedLifetimeDependenceKind::Scope -> ParsedLifetimeDependenceKind::Borrow 2025-04-03 17:22:13 -07:00
Meghana Gupta
cfacd25df4 Add support for @lifetime(&arg) 2025-04-03 17:22:06 -07:00
Hamish Knight
f8ab391737 Introduce type sugar for InlineArray (#80087)
* [CS] Decline to handle InlineArray in shrink

Previously we would try the contextual type `(<int>, <element>)`,
which is wrong. Given we want to eliminate shrink, let's just bail.

* [Sema] Sink `ValueMatchVisitor` into `applyUnboundGenericArguments`

Make sure it's called for sugar code paths too. Also let's just always
run it since it should be a pretty cheap check.

* [Sema] Diagnose passing integer to non-integer type parameter

This was previously missed, though would have been diagnosed later
as a requirement failure.

* [Parse] Split up `canParseType` 

While here, address the FIXME in `canParseTypeSimpleOrComposition`
and only check to see if we can parse a type-simple, including
`each`, `some`, and `any` for better recovery.

* Introduce type sugar for InlineArray

Parse e.g `[3 x Int]` as type sugar for InlineArray. Gated behind
an experimental feature flag for now.
2025-03-23 15:31:37 -07:00
Rintaro Ishizaki
92a6fece48 [ASTGen] ObjC improvements
* Generate `#selector(...)` expression
* Generate `#keyPath(...)` expression
* Implicit `@objc` attribute for `@_objcImplementation` attribute
2025-03-20 05:04:58 -07:00
Rintaro Ishizaki
7add493002 [ASTGen] Generate '@_spi_available' attribute 2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
607d122fe9 [ASTGen] Handle several missing syntax
* MissingExpr: Generate ErrorExpr with previous token location
* MissingType: Generate ErrorTypeRepr with previous token location
* MissingPattern: Generate implicit '_' pattern for recovery
2025-03-16 17:41:21 -07:00
Rintaro Ishizaki
ddd5b12661 [ASTGen] Handle trailing where clause in macro declarations 2025-03-16 17:41:21 -07:00