150 Commits

Author SHA1 Message Date
Jeroen Ketema
f4d1e1c034 Swift: Handle InlineArrayTypes 2025-10-31 10:15:07 +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
b08b123184 Swift: Support new accessors 2025-10-31 09:57:58 +01:00
Jeroen Ketema
626bc55caf Swift: Fix AvailabilitySpec trap generation 2025-10-24 14:37:47 +02:00
Jeroen Ketema
e79c0b0405 Swift: Update generated files 2025-10-24 14:37:45 +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
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
814218c7a8 Swift: extract variables as children of ForEachStmt 2024-11-28 11:03:46 +01:00
Tom Hvitved
4ab5a1a060 Swift: Run code generator 2024-09-16 13:40:02 +02:00
Tom Hvitved
4912ee8ab3 Swift: Make Callable a sub type of AstNode 2024-09-13 15:39:40 +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
Robert Marsh
3492b4820a Swift: extract types for patterns 2023-11-29 20:54:50 +00: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
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
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
f22d60f011 Swift: clean up VarDecl, NamedPattern and SwitchStmt interactions
* `variables` under `CaseStmt` are now AST children, which solves
  orphan `VarDecl`s in that case
* reordered `CaseStmt` AST children to be `labels > variables > body`
  (was `body > labels`)
* made `NamedPattern::getVarDecl` an extracted property instead of
  `getName`
* The above led to duplicate DB entities because of a quirk in the
  Swift compiler code. This is solved by tweaking the extraction of
  `variables` under `CaseStmt` to not use `getCaseBodyVariables`.
2023-10-23 17:36:42 +02:00
Paolo Tranquilli
d55289bf68 Swift: add children to UnspecifiedElement
This will allow better downgrade scripts in the future.
2023-10-18 16:42:04 +02:00
Robert Marsh
ae1072e09f Merge branch 'main' into rdmarsh2/swift/for-in 2023-09-26 15:12:46 +00:00
Paolo Tranquilli
4d3aecfff6 Swift: rename base_types to syntactic_base_types in TypeDecl 2023-09-14 10:03:52 +02:00
Robert Marsh
a3e250aef5 Swift: extract iterator variable for for-in loops 2023-09-08 19:08:57 +00:00
Alex Denisov
e9fdbfabea Swift: extract nextCall from ForEachStmt 2023-08-22 17:36:40 +02:00
Paolo Tranquilli
396b57696c Swift: minimal 5.8 compatibility 2023-06-14 16:17:44 +02:00
Paolo Tranquilli
9a0f87434e Swift: remove unneeded properties from InterpolatedStringLiteralExpr
These properties were unused in the QL library (hence the full
upgrade/downgrade compatibility).
2023-05-22 15:28:54 +02:00
Nora Dimitrijević
2d9295a5a4 Swift: [generated] library code changes 2023-04-26 15:47:20 +02:00
Alexandre Boulgakov
35a2d55d18 Swift: Extract structured keypath components.
Changes in swift/ql/lib are generated by swift/codegen without manual intervention.
2023-04-11 13:34:17 +01:00
Paolo Tranquilli
6f6d3f1262 Merge branch 'main' into redsun82/swift-imported-modules-as-set 2023-03-30 16:42:35 +02:00
Geoffrey White
d8703210dd Swift: Extract type aliases. 2023-03-29 15:49:12 +01:00
Paolo Tranquilli
20128adee4 Swift: make imported and exported modules a set 2023-03-29 15:44:07 +02:00
Paolo Tranquilli
a131966066 Swift: make SuccessfullyExtractedFiles.ql more precise
This is done by adding a `isSuccessfullyExtracted` predicate that is
filled for primary files at the very end of the extractor invocation if
the frontend was performed successfully. If for example the extractor
crashes this will therefore not be filled.

The upgrade script is written so that `SuccessfullyExtractedFiles.ql`
on an upgraded script will give exactly the same results as before it.
2023-03-20 08:34:34 +01:00
Paolo Tranquilli
f2dff092dc Swift: remove parameter labels from function types
As discussed [in this accepted proposal][1], parameter labels do not
take part any more in making up a function type, so we need to not
extract them any more to avoid DB inconsistencies.

These were unused in the library, which makes the upgrade and downgrade
scripts have full compatibility.

[1]: 9c53790a13/proposals/0111-remove-arg-label-type-significance.md
2023-03-17 10:22:02 +01:00
Paolo Tranquilli
54b6c6f8f7 Swift: make AnyGenericType::getDecl's type more specific
As shown by the extractor's code not needing any change, the DB values
already had that more specific type, which is why the upgrade/downgrade
scripts are actually no-ops.
2023-03-14 11:49:07 +01:00
Alex Denisov
712c25e6f4 Swift: extract availability info 2023-02-07 14:26:39 +01:00
Paolo Tranquilli
a244b825df Merge branch 'main' into redsun82/swift-regex 2023-02-07 09:37:09 +01:00
Nora Dimitrijević
50e5b29eb7 Swift: all Callables can have captures [codegen'd] 2023-02-02 11:56:51 +01:00
Nora Dimitrijević
d230431006 Swift: extract closure captures (codegen'd part) 2023-02-02 11:35:49 +01:00
Nora Dimitrijević
9a5614e8c5 Swift: subsume IterableDeclContext into Decl [codegen'd] 2023-01-28 00:44:49 +01:00
Paolo Tranquilli
f6e26211f9 Swift: add protocols to ExtensionDecl schema 2023-01-17 12:54:50 +01:00
Nora Dimitrijević
6269e6b24d Swift: move getName to Callable (generated)
Now that getStaticTarget returns a Callable.
2022-12-14 14:30:33 -05:00