Commit Graph

157 Commits

Author SHA1 Message Date
Jeroen Ketema
f4d1e1c034 Swift: Handle InlineArrayTypes 2025-10-31 10:15:07 +01:00
Jeroen Ketema
72e8ec3951 Swift: Update comment for LocatableTypes 2025-10-31 10:02:12 +01:00
Jeroen Ketema
b9d0cb7746 Swift: Add basic support for experimental using decls
Note that we cannot write tests for these at the moment. Passing
```
-enable-experimental-feature DefaultIsolationPerFile
```
to the extractor results in:
```
error: experimental feature 'DefaultIsolationPerFile' cannot be enabled in production compile
```
2025-10-31 09:58:12 +01:00
Jeroen Ketema
67b6b9cd15 Swift: Support UnsafeExpr 2025-10-31 09:58:10 +01:00
Jeroen Ketema
06d0d48416 Swift: Work around assertion failures in mangler 2025-10-24 14:37:55 +02:00
Jeroen Ketema
d890feedda Swift: Compensate for backwards going locations 2025-10-24 14:37:48 +02:00
Jeroen Ketema
2ef8bb0c53 Swift: Make extractor compile with Swift 6.2 2025-10-24 14:37:42 +02:00
Jeroen Ketema
98384bf4c2 Swift: Support BuiltinFixedArrayType 2025-05-02 14:47:58 +02:00
Jeroen Ketema
c74fca929a Swift: Support TypeValueExpr and IntegerType 2025-05-02 14:47:56 +02:00
Jeroen Ketema
97d2ed8b3b Swift: Support UnsafeCastExpr 2025-05-02 14:47:55 +02:00
Paolo Tranquilli
1ac47a892b Swift: make extractor compile again after 6.1 upgrade 2025-04-23 17:10:54 +02:00
Paolo Tranquilli
fa6deaf87a Swift: extract UnreachableExpr 2025-04-14 10:35:24 +02:00
Paolo Tranquilli
9473543933 Swift: extract ActorIsolationErasureExpr 2025-04-14 10:35:24 +02:00
Paolo Tranquilli
ad0f9f1e73 Swift: mark ErrorUnionType as type-check only 2025-04-14 10:35:23 +02:00
Paolo Tranquilli
712142cde9 Swift: extract CurrentContextIsolationExpr 2025-04-14 10:35:22 +02:00
Paolo Tranquilli
2910cb68ce Swift: extract ExtracFunctionIsolationExpr 2025-04-14 10:35:21 +02:00
Paolo Tranquilli
d3fb2543d2 Swift: try out new builds 2024-10-30 12:26:34 +01:00
Paolo Tranquilli
524686ce37 Swift: make extractor compilable with Swift 6 2024-10-08 16:39:21 +02:00
Paolo Tranquilli
b8e38288e3 Swift: add extraction of ThenStmt
These are currently added implicitly by the compiler in the context of
`if`/`switch` expressions. In the future, there might be explicit
`then <expr>` statement useful for cases where one would like to add
more than one statement in the branch, to mark what value to actually
use.

See https://forums.swift.org/t/pitch-multi-statement-if-switch-do-expressions/68443
2024-03-27 13:26:04 +01:00
Paolo Tranquilli
2382f76317 Swift: ignore experimental ThenStmt 2024-03-27 12:23:37 +01:00
Paolo Tranquilli
33b6ce7365 Swift: update formatting to clang-format 17.0.6
Also, added a format check in `swift.yml`.
2024-01-25 13:58:14 +01:00
Alex Denisov
d7d546e97f Swift: skip TypeJoinExpr 2023-11-24 09:46:04 +01:00
Alex Denisov
6a673e700b Swift: extract DiscardStmt 2023-11-24 09:46:01 +01:00
Alex Denisov
5cd74213cc Swift: extract MaterizliePackExpr 2023-11-24 09:45:01 +01:00
Alex Denisov
423c85377b Swift: skip MacroExpansionExpr/MacroExpansionDecl
They only appear in an intermediate AST and disappear as soon as the
macro is expanded.
The only way to get these in is to construct an "incorrect" AST, e.g.:

```
let x = #does_not_exist() // MacroExpansionExpr
struct S {
  #does_not_exist() // MacroExpansionDecl
}
```
2023-11-15 14:07:45 +01:00
Alex Denisov
8b126fe51a Swift: extract MacroDecl 2023-11-15 14:07:45 +01:00
Alex Denisov
002f2a0985 Swift: extract BorrowExpr 2023-11-13 15:55:37 +01:00
Alex Denisov
d21e27c717 Swift: extract ConsumeExpr 2023-11-13 15:55:37 +01:00
Alex Denisov
30e4822fb7 Swift: extract CopyExpr 2023-11-13 15:55:37 +01:00
Alex Denisov
c0fce80b7d Swift: mark BuiltinTuple as experimental 2023-11-13 11:34:51 +01:00
Alex Denisov
b385ddbab1 Swift: do not extract non-AST types 2023-11-13 09:12:22 +01:00
Alex Denisov
e865c3cbd3 Swift: extract parameter packs 2023-11-10 10:20:14 +01:00
Alex Denisov
33de177fea Swift: extract SingleValueStmtExpr 2023-11-07 13:40:35 +01:00
Paolo Tranquilli
9196939384 Swift: canonicalize all VarDecls 2023-10-25 10:38:17 +02:00
Paolo Tranquilli
60b7d79fba Revert "Revert "Swift: use C++20 constraints and concepts to simplify code"" 2023-09-21 10:17:22 +02:00
Paolo Tranquilli
1daedd9fb6 Revert "Swift: use C++20 constraints and concepts to simplify code" 2023-08-21 17:40:15 +02:00
Paolo Tranquilli
bda516e9ea C++: tweak dispatcher clauses 2023-08-21 10:01:45 +02:00
Paolo Tranquilli
b78f12481f Swift: tweak priority of location information sources 2023-08-18 15:18:48 +02:00
Paolo Tranquilli
386dedb9df Swift: fix location extractor hitting swift assertion 2023-08-18 14:21:30 +02:00
Paolo Tranquilli
c17a582b34 Revert "Swift: upgrade clang-formatting to 15.0.7"
This reverts commit 970b3d06be.
2023-08-18 13:59:41 +02:00
Paolo Tranquilli
3c4e755233 Swift: fix macOS not having std::ranges::sized_range 2023-08-18 10:18:53 +02:00
Paolo Tranquilli
8b3e32fa97 Swift: add missing include 2023-08-18 09:10:44 +02:00
Paolo Tranquilli
53ed39065c Swift: tweak location extractor using new concept 2023-08-18 06:45:11 +02:00
Paolo Tranquilli
970b3d06be Swift: upgrade clang-formatting to 15.0.7 2023-08-17 17:24:42 +02:00
Paolo Tranquilli
7c764f3b50 Swift: use C++20 constraints and concepts to simplify code
This simplifies several instances of metaprogramming by leveraging
[constraints and concepts from C++20][1]. This:
* gets rid of `std::enable_if` by usage of `requires`, making it more
  readable and yield better compiler messages.
* uses `requires` instead of `static_assert` to enforce `TrapLabel`
  typing
* simplifies all compile-time tests for validity of a given expression
* uses some standard library concepts where possible
* generalizes and simplifies `SwiftLocationExtractor`

Notice that in order to use the `std::derived_from` concept, `virtual`
inheritance had to be added to the label tags, because diamond
inheritance is a problem otherwise. That's because
`std::derived_from<T, U>` requires that `T*` be convertible to `U*`,
which is false if there are multiple non-virtual inheritance paths from
`U` to `T`. As tags never get actually instantiated, there is no runtime
performance penalty in using `virtual` inheritance.

[1]: https://en.cppreference.com/w/cpp/language/constraints
2023-08-17 17:24:42 +02:00
Paolo Tranquilli
75cc1d8f75 Swift: fix version check macro to be lexicographic 2023-08-17 12:19:28 +02:00
Paolo Tranquilli
67cd25184a Merge pull request #12433 from github/alexdenisov+redsun82/tuple-mangling
Swift: properly identify types and declarations in trap files via mangling
2023-08-03 13:27:07 +02:00
Alex Denisov
c517fc6c6f Swift: 5.9 preparation 2023-07-06 14:02:37 +02:00
Alexandre Boulgakov
81372d0b63 Merge commit '36d86787e6fbbb158a148f93eb63f829134fd6b1' into alexdenisov+redsun82/tuple-mangling 2023-06-28 12:21:59 +01:00
Alex Denisov
0479ef5b9c Merge remote-tracking branch 'origin/rc/3.10' into alexdenisov/rc3.10_mergeback 2023-06-16 10:13:23 +02:00