Mathias Vorreiter Pedersen
b715a6b63b
Swift: Add test containing local declarations.
2022-05-26 09:06:13 +01:00
Mathias Vorreiter Pedersen
c7cc8d2592
Swift: Fix copy-paste error.
2022-05-25 21:36:24 +01:00
Robert Marsh
aa77ea6bef
Swift: minimal tests for interprocedural flow
2022-05-25 19:24:34 +00:00
Robert Marsh
9f64622f31
Swift: data flow configurations working
2022-05-25 19:23:43 +00:00
Robert Marsh
d326b3a91c
Swift: global dataflow WIP
2022-05-25 18:54:47 +00:00
Robert Marsh
bba3564187
Swift: adjust for changes in main
2022-05-25 18:52:47 +00:00
Robert Marsh
91b34d5e8f
Swift: make LambdaCallKind a TODO
2022-05-25 18:26:38 +00:00
Robert Marsh
765e1e1115
Swift: autoformat
2022-05-25 18:26:38 +00:00
Robert Marsh
cf22ade9f3
Swift: initial local data flow implementation
2022-05-25 18:26:37 +00:00
Robert Marsh
117a1ad2f4
Swift: DataFlow expr and parameter nodes
2022-05-25 18:26:37 +00:00
Mathias Vorreiter Pedersen
fafdb016fa
Swift: Fixup based on review comments in #9291 .
2022-05-25 16:10:44 +01:00
Mathias Vorreiter Pedersen
f17afa8a11
Swift: Accept test changes.
2022-05-25 16:01:42 +01:00
Mathias Vorreiter Pedersen
dc2ba5b410
Swift: Implement better 'toString' overrides for all AST nodes.
2022-05-25 15:59:45 +01:00
Mathias Vorreiter Pedersen
80fad348bb
Swift: Implement CFG for property reads, writes, and observers.
2022-05-25 13:46:14 +01:00
Mathias Vorreiter Pedersen
67cc1b503b
Swift: Implement step 3 from the previous commit message.
2022-05-25 13:44:59 +01:00
Mathias Vorreiter Pedersen
1f4924f978
Swift: Create a custom "AST" version of the public CFG classes. This is
...
necessary because the CFG library doesn't support the following
two requirements simultaneously:
1. Traverse AST classes by virtual dispatch
2. Construct ControlFlowElements from non-AST classes
Because the CFG trees derive from the a base type that must be a
subtype of `ControlFlowElement`. So if we make `ControlFlowElement`
an IPA type, we cannot write:
```
class AssignTree extends PostOrderTree instanceof AssignExpr { ... }
```
because `AssignExpr` is not a subtype of PostOrderTree (since
PostOrderTree is now a subtype of the new IPA type).
To fix this, Tom suggested the following (which is implemented in
this PR):
1. Create a copy of the CFG tree classes (i.e., Pre/PostOrderTree,
LeafTree, etc.) and call them AstPreOrderTree/AstPostOrderTree,
AstLeafTree, etc.
2. For each tree AstTree from step 1, create a instance of the
internal CFG library's appropriate class.
3. In `ControlFlowGraphImpl`, proceed as normal with virtual
dispatch using `instanceof`, but extend the AstTree classes
from step 1 instead of the CFG's own tree classes.
This works because each AstTree implements one of the CFG
library's tree classes (as per step 2).
This commit performs step 1 and 2. Step 3 will be the next commit.
2022-05-25 13:39:48 +01:00
Mathias Vorreiter Pedersen
ab268514a1
Swift: Create a custom IPA type for 'ControlFlowElement's and fixup various type annotations.
2022-05-25 13:39:48 +01:00
Tom Hvitved
bcdef98392
Data flow: Sync files
2022-05-25 14:39:37 +02:00
AlexDenisov
8b131adeb1
Merge pull request #9283 from github/alexdenisov/swift-integration-tests
...
Swift: add integration tests
2022-05-25 10:04:08 +02:00
Michael Nebel
5f3a039c65
Swift: Sync changes to DataFlowImplCommon from PR #9024 .
2022-05-25 08:05:22 +02:00
Robert Marsh
8cc509e5e9
Merge pull request #9275 from MathiasVP/swift-add-dataflow-lib
...
Swift: Add shared dataflow library
2022-05-24 15:11:42 -04:00
Alex Denisov
fa09078976
Swift: do not keep trap files for tests
2022-05-24 11:48:45 +02:00
Alex Denisov
8e8da66325
Swift: share .gitignore across all tests
2022-05-24 11:48:06 +02:00
Mathias Vorreiter Pedersen
3e1a6a777e
Swift: Accept test changes.
2022-05-24 10:22:06 +01:00
Mathias Vorreiter Pedersen
dda60abfef
Swift: Add CFG for a couple more expressions.
2022-05-24 10:21:04 +01:00
Alex Denisov
528f6f73c5
Swift: add integration tests
2022-05-24 11:12:35 +02:00
Mathias Vorreiter Pedersen
21641eb1cd
Swift: Make the 'semantics.ql' test plantform-independent.
2022-05-24 10:00:14 +01:00
Mathias Vorreiter Pedersen
a0659072b5
Swift: Add tests and accept test changes.
2022-05-24 09:00:34 +01:00
Mathias Vorreiter Pedersen
cf5f1e593e
Swift: Extract new entities.
2022-05-24 08:57:05 +01:00
Mathias Vorreiter Pedersen
cdb081eaec
Swift: Update schema and update generated files.
2022-05-24 08:57:05 +01:00
Mathias Vorreiter Pedersen
f46fc34481
Swift: Add skeleton for shared dataflow library.
2022-05-23 18:03:47 +01:00
Mathias Vorreiter Pedersen
b681a10bfe
Swift: Add shared SSA library.
2022-05-23 18:01:43 +01:00
Mathias Vorreiter Pedersen
9b0d84c1a3
Merge pull request #9268 from MathiasVP/swift-add-cfg-library
...
Swift: Extend AST classes and add control-flow library
2022-05-23 16:37:51 +01:00
Mathias Vorreiter Pedersen
4ba29845e9
Swift: Fix Code Scanning alerts.
2022-05-23 15:18:36 +01:00
Mathias Vorreiter Pedersen
2882c42698
Swift: Sync identical files.
2022-05-23 13:13:26 +01:00
Mathias Vorreiter Pedersen
e98728b788
Swift: Fix casing on import alias.
2022-05-23 13:08:09 +01:00
Mathias Vorreiter Pedersen
83bcb53199
Swift: Add tests accept test changes.
2022-05-23 13:05:55 +01:00
Mathias Vorreiter Pedersen
9f8fbd7aa7
Swift: Add control-flow library.
2022-05-23 12:59:06 +01:00
Mathias Vorreiter Pedersen
26f0d3ac43
Swift: Add helper predicates on AST classes
2022-05-23 12:51:51 +01:00
Paolo Tranquilli
06a8cf6f1e
Merge pull request #9198 from github/redsun82/swift-self-contained-cpp-code-gen
...
Swift: make C++ code generation more self-contained
2022-05-23 13:45:58 +02:00
Paolo Tranquilli
1e9fcfb338
Merge pull request #9265 from github/redsun82/swift-rm-codeqlmanifest
...
Swift: remove `.codeqlmanifest`
2022-05-23 13:00:58 +02:00
Paolo Tranquilli
a3f6682bbb
Swift: remove .codeqlmanifest
...
The extractor pack entry in there has been moved to the root manifest.
2022-05-23 12:49:08 +02:00
Paolo Tranquilli
ea6a249fee
Swift: fix extractor built with NDEBUG
...
There was a call with side effects in an `assert`, that was therefore
not being called with `NDEBUG` turned on, changing extractor results.
2022-05-23 12:35:54 +02:00
Paolo Tranquilli
fc165c1975
Swift: remove IDE generated comment header
2022-05-20 16:25:33 +02:00
Paolo Tranquilli
f52a849ab8
Merge branch 'main' into redsun82/swift-self-contained-cpp-code-gen
2022-05-20 16:16:35 +02:00
Paolo Tranquilli
e6f2ab003c
Swift: remove empty DB-CHECK.expected files
2022-05-20 16:01:56 +02:00
Paolo Tranquilli
b0668ee6c2
Swift: remove unused decl properties
2022-05-20 15:42:28 +02:00
Paolo Tranquilli
553930d9e3
Swift: type visitor
...
This transfers the current state of `TypeVisitor` from the
proof-of-concept.
2022-05-20 15:42:20 +02:00
Paolo Tranquilli
922608c65a
Swift: expression visitor
...
This transfers the current status of `ExprVisitor` from the
proof-of-concept, together with some changes required for swift 5.6.
2022-05-20 15:41:27 +02:00
Paolo Tranquilli
3f45b73d62
Swift: pattern visitor
...
This transfers the current state of `PatternVisitor` from the
proof-of-concept.
2022-05-20 15:41:27 +02:00