Commit Graph

141 Commits

Author SHA1 Message Date
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
Alexandre Boulgakov
afb7070fd3 Swift: Don't use std::hash<fs::path>. 2023-06-14 15:50:45 +01:00
Paolo Tranquilli
396b57696c Swift: minimal 5.8 compatibility 2023-06-14 16:17:44 +02:00
Alexandre Boulgakov
5952a729df Build: Bump build mode to C++20. 2023-06-08 13:10:43 +01:00
Paolo Tranquilli
70ff401f21 Swift: replace internal swift mangler with our own
Our mangler is split in two version:
* `SwiftTrapMangler`, with the same behaviour as the previous
  `SwiftMangler`, constructing mangled names with trap label references
* `SwiftRecursiveMangler` that replaces trap label references with
  recursive calls to its own `mangle` functions, effectively rolling out
  the entire chain of references

The latter is used to create lazy trap file names. Hashing is used to
avoid excessively long filenames.
2023-05-31 09:52:20 +02:00
Paolo Tranquilli
2183d380db Swift: implement review suggestions 2023-05-30 10:30:44 +02:00
Paolo Tranquilli
2fb6cdc19b Merge branch 'main' into alexdenisov+redsun82/tuple-mangling 2023-05-24 11:16:59 +02:00
Paolo Tranquilli
ec3c63a2b3 Swift: replace all usages of std::to_string with absl::StrCat or absl::StrAppend 2023-05-10 07:03:06 +02:00
Paolo Tranquilli
bce483ddb1 Swift: rename log package to logging 2023-05-04 10:42:39 +02:00
Paolo Tranquilli
9544b96ff1 Merge branch 'main' into redsun82/swift-json 2023-05-04 10:34:11 +02:00
Paolo Tranquilli
1d492f89cc Merge branch 'main' into redsun82/swift-logging-assertions-and-prints 2023-05-03 15:19:08 +02:00
Paolo Tranquilli
51763d65b0 Swift: reshape a TODO into another 2023-05-03 15:18:35 +02:00
Paolo Tranquilli
0ad529dff8 Swift: move logging to a common directory 2023-05-03 14:32:31 +02:00
Paolo Tranquilli
c7c12a7108 Swift: add json and date dependencies 2023-05-03 14:32:30 +02:00
Paolo Tranquilli
146591934a Swift: clean up SwiftMangler 2023-05-02 10:45:43 +02:00
Paolo Tranquilli
0aed7d56c2 Swift: more mangling 2023-05-02 10:45:42 +02:00
Paolo Tranquilli
c8ca6057d3 Swift: mangle several new things 2023-05-02 10:45:40 +02:00