Commit Graph

2130 Commits

Author SHA1 Message Date
Mathias Vorreiter Pedersen
edf0be0854 Merge pull request #9611 from MathiasVP/swift-nomagic-get-location
Swift: Add `nomagic` to `getLocation`
2022-06-20 10:42:45 +01:00
Mathias Vorreiter Pedersen
12d27ec580 Swift: Modify 'toString' in 'OtherConstructorDeclRefExpr' to properly reflect that it's a reference and not a call. 2022-06-20 09:59:23 +01:00
Mathias Vorreiter Pedersen
068ac2b80e Swift: Add 'nomagic' to 'getLocation'. 2022-06-20 09:41:06 +01:00
Paolo Tranquilli
be210aa3af Merge alexdenisov/xref-decls into redsun82/swift-use-generated-classes 2022-06-17 17:03:30 +02:00
Anders Schack-Mulligen
6518a01ded Dataflow: Sync. 2022-06-16 11:25:28 +02:00
Erik Krogh Kristensen
c5e412db01 add empty implementation of defaultImplicitTaintRead 2022-06-16 10:17:59 +02:00
Robert Marsh
478c2773fe Merge pull request #9555 from MathiasVP/swift-mad
Swift: Add MaD skeleton
2022-06-15 11:58:04 -04:00
Paolo Tranquilli
0957801588 Merge pull request #9521 from github/redsun82/swift-qltestgen
Swift: generated extractor tests
2022-06-15 15:39:35 +02:00
Mathias Vorreiter Pedersen
eff046e2f7 Swift: Respond to review comments. 2022-06-15 13:01:27 +01:00
Mathias Vorreiter Pedersen
55d551c99c Swift: Add 'MaD' skeleton. 2022-06-15 13:00:56 +01:00
Paolo Tranquilli
8c60aee16d Swift: fix GetImmediateParent.qll 2022-06-15 09:33:39 +02:00
Paolo Tranquilli
fec15fb60a Merge main into redsun82/swift-qltestgen 2022-06-15 09:32:39 +02:00
Mathias Vorreiter Pedersen
ef224b9c1d Swift: Mark non-auto closures as callables in the CFG library. 2022-06-14 21:05:48 +01:00
Mathias Vorreiter Pedersen
6c96f71d0c Swift: Autogenerate and accept test changes. 2022-06-14 20:39:18 +01:00
Paolo Tranquilli
de52f9be7b Swift: generated extractor tests 2022-06-14 18:01:29 +02:00
Alex Denisov
311dcfa230 Swift: remove toString from UnknownElement
Another attempt to remove flakiness
2022-06-14 13:37:17 +02:00
Alex Denisov
9681358a6d Swift: extract OtherConstructorDeclRefExpr 2022-06-14 12:53:25 +02:00
Alex Denisov
e677b78ab9 Swift: attach NominalTypeDecl to the ExtensionDecl 2022-06-14 12:09:26 +02:00
Mathias Vorreiter Pedersen
6c8982b46e Merge pull request #9469 from rdmarsh2/rdmarsh2/swift/dataflow-inout
Swift: Dataflow through inout parameters
2022-06-13 18:11:11 +01:00
Mathias Vorreiter Pedersen
20d9aaf055 Merge pull request #9516 from MathiasVP/revert-9419-revert-9373-cfg-for-key-paths
Swift: Reintroduce control-flow for key paths
2022-06-13 17:34:12 +01:00
Robert Marsh
d7f839a147 Swift: use ExitNode as CFG for InoutReturnNode 2022-06-13 15:50:30 +00:00
Robert Marsh
84518c8d54 Merge pull request #9404 from MathiasVP/swift-get-enclosing-function
Swift: Add `getEnclosingFunction` to `AstNode`
2022-06-13 09:37:51 -04: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
Mathias Vorreiter Pedersen
ae288332cc Merge pull request #9511 from MathiasVP/fix-completion-for-patterns
Swift: Fix completion for "naked" patterns
2022-06-13 10:56:07 +02:00
Mathias Vorreiter Pedersen
9d7afab185 Swift: Fix completion for patterns that occur outside 'CaseLabelItems'. Previously we'd add an unnecessary 'no-match' completion to these patterns even though they were always matching. This caused some confusing output in the graph tests in particular. 2022-06-13 09:24:18 +01:00
Robert Marsh
97815bfa61 Swift: fix implicit this usage 2022-06-09 18:50:40 +00:00
Robert Marsh
755c56dafe Swift: autoformat 2022-06-09 18:50:39 +00:00
Robert Marsh
fca1afa493 Swift: fix inout parameter conflation at return 2022-06-09 17:09:49 +00:00
Robert Marsh
a7663adf90 Swift: add flow through inout parameters 2022-06-09 17:09:49 +00:00
Robert Marsh
21ba73138d Swift: add CallExprCfgNode 2022-06-09 17:09:49 +00:00
Robert Marsh
cb3da0eedd Swift: add some ParamDecl methods 2022-06-09 17:09:48 +00:00
Robert Marsh
776a2965ca Swift: extract isInOut for parameters 2022-06-09 17:09:48 +00:00
Paolo Tranquilli
a0acb19b68 Swift: remove redundant import 2022-06-03 15:28:48 +02:00
Paolo Tranquilli
01e1c13c29 Swift: add UnknownLocation
`getLocation()` will now exists for all entities. When there is no
valid location, the location will still not be emitted in the DB, but
on the QL side we will then assign a special `UnknownLocation` with
empty filename and 0 for line/column start/end.

This unknown location is currently emitted (with a unique `@` key) at
the start of every extraction, but we can move it elsewhere (and
possibly in a unique global trap file) at a later stage, possibly after
or when we rework the trap file strategy.

This should solve flakiness that was observed on the control flow tests,
which is probably caused by the `nodes` predicate in the `TestOutput`
class in `ControlFlowGraphImplShared.qll` not able to assign a proper
rank when the node does not have a location.
2022-06-03 14:59:22 +02:00
Alex Denisov
1dab01a31c Swift: fix ctor/dtor names in toString 2022-06-02 08:28:46 +02:00
Mathias Vorreiter Pedersen
cde2880392 Swift: Add getEnclosingFunction to AstNode. 2022-06-01 16:40:08 +01:00
Mathias Vorreiter Pedersen
7d962ac62b Merge pull request #9397 from MathiasVP/use-autogenerated-parent-in-cfg-library
Swift: Use the autogenerated `getParent`
2022-06-01 14:45:43 +01:00
Mathias Vorreiter Pedersen
eabb5c7137 Swift: Respond to PR comments. 2022-06-01 14:34:22 +01:00
Paolo Tranquilli
3414028b1b Swift: simplify GetImmediateParent.qll 2022-06-01 15:01:49 +02:00
Mathias Vorreiter Pedersen
db0498e38c Swift: Use the autogenerated 'getParent' predicate in the CFG library. 2022-06-01 13:49:12 +01:00
Paolo Tranquilli
6b90b2b05f Swift: add children to IsPattern 2022-06-01 14:35:58 +02:00
Paolo Tranquilli
a4f97dd67a Swift: add comment about unique in getImmediateParent 2022-06-01 14:32:59 +02:00
Paolo Tranquilli
bc0a32c26e Swift: sort import list
Also fix parent tests with updated `statements.swift` file.
2022-06-01 14:32:59 +02:00
Paolo Tranquilli
3597efb728 Swift: rename to getImmediateParent and use hidden AST 2022-06-01 14:32:58 +02:00
Paolo Tranquilli
a86d0fc8a7 Swift: move getAChild to a separate module 2022-06-01 14:32:58 +02:00
Paolo Tranquilli
946e1f498a Swift: generate getParent implementation
By explicitly marking children in the `schema.yml` file, an internal
`getAChild` predicate is implemented, that is in turn used in `AstNode`
to implement `getParent`.

This is yet to be used in the control flow library to replace the
hand-rolled implementation.

A further, more complex step is to use the same information to fully
generate the core implementation of `PrintAst` (including the
accessor string). This will be done later.

The `parent` tests use the same swift code as the extractor tests, and
this is currently enforced by `sync-files.py`. Notice that `qltest.sh`
had to be modified to deal with multiple files, which was not working
yet.
2022-06-01 14:32:58 +02:00
Anders Schack-Mulligen
4f3751dfea Merge pull request #9316 from hvitved/dataflow/edges-get-a-successor-consistency
Data flow: Make `PathGraph::edges/2` and `PathNode::getASuccessor/1` consistent
2022-06-01 10:38:25 +02:00
Paolo Tranquilli
9231013401 Swift: use C++ entry style visitor in DeclVisitor 2022-06-01 08:41:43 +02:00
Robert Marsh
42ec6350eb Merge pull request #9349 from MathiasVP/fix-inconsistent-cfg
Swift: Fix three CFG inconsistencies
2022-05-31 14:38:08 -04:00
Robert Marsh
bd095abea4 Merge pull request #9388 from MathiasVP/cfg-for-yield
Swift: CFG for `yield`
2022-05-31 11:22:21 -04:00