Commit Graph

101 Commits

Author SHA1 Message Date
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
0fb439b54d Swift: test ElementArchetypeType via PackType 2023-11-10 11:44:45 +01:00
Alex Denisov
e865c3cbd3 Swift: extract parameter packs 2023-11-10 10:20:14 +01:00
Alex Denisov
dd20a9b009 Swlft: fix wording in the comment 2023-11-07 17:28:37 +01:00
Alex Denisov
33de177fea Swift: extract SingleValueStmtExpr 2023-11-07 13:40:35 +01:00
Paolo Tranquilli
ffff10a7e8 Swift: synthesize CaptureListExpr::getVariable in QL instead of extracting it 2023-10-31 10:44:50 +01:00
Paolo Tranquilli
f81a3ec464 Swift: add VarDecl children to CaptureListExpr 2023-10-30 17:04:53 +01:00
Mathias Vorreiter Pedersen
9e2f0b5ed0 Merge branch 'main' into redsun82/swift-case-variables 2023-10-30 10:14:45 +00:00
Geoffrey White
8937e0b313 Swift: == -> = 2023-10-27 17:18:09 +01:00
Geoffrey White
ce471105e2 Swift: QLDoc getCanonicalType. 2023-10-27 14:23:51 +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
7cc20587ad Codegen: add @qltest.test_with
This allows to group together related AST classes to reuse the same
test source and extraction. For example this is useful for
`EnumDecl/EnumCaseDecl/EnumElementDecl`, where this is applied to.
2023-10-23 14:51:22 +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
Alex Denisov
0479ef5b9c Merge remote-tracking branch 'origin/rc/3.10' into alexdenisov/rc3.10_mergeback 2023-06-16 10:13:23 +02:00
Paolo Tranquilli
396b57696c Swift: minimal 5.8 compatibility 2023-06-14 16:17:44 +02:00
Nora Dimitrijević
a831456e94 Swift: make BraceStmt's variable a synth property 2023-06-06 16:54:47 +02:00
Nora Dimitrijević
387cde5972 Swift: add BraceStmt.getVariable(_) child with logic in QL. 2023-06-06 16:54:46 +02:00
Geoffrey White
edfdddb24a Swift: Tweak and update the qldoc string. 2023-06-01 11:47:05 +01:00
Geoffrey White
d68f602124 Merge branch 'main' into sharedsensitive 2023-06-01 11:11:42 +01:00
Geoffrey White
caf250cc1b Swift: Update the QLdoc on Callable. 2023-05-31 13:01:20 +01:00
Arthur Baars
490d22d123 Merge remote-tracking branch 'upstream/main' into post-release-prep/codeql-cli-2.13.3 2023-05-30 21:31:28 +02:00
Paolo Tranquilli
51f1a5dcc8 Swift: remove getOpaqueExpr from OpenExistentialExpr's children 2023-05-25 13:05:21 +02:00
Paolo Tranquilli
09ce29b79f Merge branch 'codeql-cli-2.13.3' into redsun82/swift-hidden-ast 2023-05-23 16:12:54 +02:00
Paolo Tranquilli
fce33d369b Merge branch 'codeql-cli-2.13.3' into redsun82/swift-hidden-ast 2023-05-23 15:31:29 +02:00
Paolo Tranquilli
aca85d76ee Merge branch 'codeql-cli-2.13.3' into redsun82/swift-remove-props-from-interpolated-strings 2023-05-23 14:42:00 +02:00
Paolo Tranquilli
b4edc92079 Swift: make hideability spread upward in the hierarchy 2023-05-23 12:45:18 +02:00
Paolo Tranquilli
b19194bd06 Swift: make only Expr, Pattern and Type hideable 2023-05-23 12:45:18 +02:00
Paolo Tranquilli
a087fef335 Swift: implement @ql.hideable 2023-05-23 12:45:18 +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
Geoffrey White
881134a6f5 Swift: Add warning note to Decl.getMember. 2023-05-19 16:12:09 +01:00
Nora Dimitrijević
ce1c4b88d8 Swift: rename Function hierarchy in schema.py 2023-04-26 15:31:54 +02:00
Alexandre Boulgakov
64443dfdcf Swift: Add named predicates for known KeyPathComponent kinds. 2023-04-12 12:06:14 +01: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
Paolo Tranquilli
cdd4e8021b Move swift/codegen to misc/codegen 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
8e079320f3 Swift: some restructuring of codegen
Loading of the schema and dbscheme has been moved to a separate
`loaders` package for better separation of concerns.
2023-02-14 09:53:02 +01:00
Geoffrey White
124e4ddd4f Merge pull request #12150 from geoffw0/cfg2
Swift: control flow for #available
2023-02-13 09:17:06 +00:00
Geoffrey White
11f022c69f Swift: Add some more qldoc. 2023-02-10 15:02:05 +00:00