Commit Graph

18 Commits

Author SHA1 Message Date
Paolo Tranquilli
2388dd06d4 Swift: add new TypeValueExpr to CFG 2025-05-14 11:16:44 +02:00
Paolo Tranquilli
d9c40488bb Swift: add ThenStmt to control flow 2024-03-27 13:37:24 +01:00
Geoffrey White
1929dead39 Merge branch 'main' into implicitflow 2023-10-27 23:35:54 +01:00
Geoffrey White
225a9fe2d8 Merge branch 'main' into implicitflow 2023-10-16 11:02:34 +01:00
Robert Marsh
661da76838 Swift: add function call autoclosure tests 2023-10-06 19:49:33 +00:00
Geoffrey White
b0c7964ea6 Swift: Add the same code to the CFG test as well. 2023-10-06 10:07:52 +01:00
Robert Marsh
ca722dc74c Swift: add NilCoalescingTest node to CFG
Fixes an issue where a nil-coalescing operation used in a boolean
context would result in no control flow out of the default operand of
the nil-coalescing operator.
2023-10-02 18:07:11 +00:00
Robert Marsh
dd01da4938 Swift: AST and CFG tests for nil coalescing 2023-09-14 13:26:41 +00:00
Robert Marsh
65fbcc570c Swift: CFG test for for-try-await 2023-08-07 17:44:57 +00:00
Geoffrey White
38f4f65fc0 Swift: Add CFG test cases for #available. 2023-02-10 09:29:08 +00:00
Paolo Tranquilli
69dfdf5a34 Swift: fix IfConfigDecl in QL libraries
This fixes `IfConfigDecl` for both the AST printer and control flow
libraries.

It turns out that the active lements of an `IfConfigDecl` are already
listed in the enclosing scope (like a `BraceStmt`), so they should not
be listed as children, and `IfConfigDecl` can be jsut a leaf in the
control flow.
2022-09-21 12:12:55 +02:00
Paolo Tranquilli
9b50336e47 Swift: synthesize MethodRefExpr
This introduces a `MethodRefExpr` node synthesized out of
`DotSyntaxCallExpr` under the `LookupExpr` hierarchy. This means that
much like
```free_function(1, 2)```
is a `CallExpr` with `getFunction` giving a `DeclRefExpr`,
```foo.method(1, 2)```
is now a `CallExpr` with `getFunction` giving a `MethodRefExpr`.

`ApplyExpr::getStaticTarget` has been made work with it (as well as
`ConstructorRefCallExpr` which for the moment has been left where it
is), a new `MethodApplyExpr` has been introduced deriving from it,
and control and data flow libraries have adapted.

A small but was fixed in `qlgen` where the default constructor for DB
types was not correctly subtracting derived IPA types depending on the
order of definitions in `schema.yml`.

There are still some occurrences of `DotSyntaxCallExpr`, and as already
mentioned the other `SelfApply` class (`ConstructorRefCallExpr`) was
left alone. Their treatment is left for a future PR.
2022-08-19 14:48:36 +02:00
Mathias Vorreiter Pedersen
4356155eeb Merge branch 'main' into swift-decls-in-cfg 2022-06-29 10:03:34 +01:00
Mathias Vorreiter Pedersen
7e5235b4d5 Revert "Merge pull request #9419 from github/revert-9373-cfg-for-key-paths"
This reverts commit 2187bf5dde, reversing
changes made to 8b1605a617.
2022-06-13 10:12:22 +01:00
Paolo Tranquilli
c9d109ddd3 Revert "Swift: Control-flow for key paths" 2022-06-02 14:55:52 +02:00
Mathias Vorreiter Pedersen
b88fe1b2b4 Swift: Add test case and accept changes. 2022-05-30 17:05:06 +01:00
Mathias Vorreiter Pedersen
b715a6b63b Swift: Add test containing local declarations. 2022-05-26 09:06:13 +01:00
Mathias Vorreiter Pedersen
83bcb53199 Swift: Add tests accept test changes. 2022-05-23 13:05:55 +01:00