Skip to content

Commit aa80b83

Browse files
authored
Merge pull request #19420 from github/jketema/swift-6.1-contructs
Swift: Support new Swift 6.1 AST elements
2 parents ae2fd52 + 5c4ca64 commit aa80b83

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+12038
-19
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
predicate removedClass(Element e, string name, Element child) {
6+
type_value_exprs(e, child) and
7+
name = "TypeValueExpr"
8+
or
9+
unsafe_cast_exprs(e) and
10+
name = "UnsafeCastExpr" and
11+
implicit_conversion_exprs(e, child)
12+
}
13+
14+
predicate removedClass(Element e, string name) {
15+
integer_types(e, _) and
16+
name = "IntegerType"
17+
or
18+
builtin_fixed_array_types(e) and
19+
name = "BuiltinFixedArrayType"
20+
or
21+
removedClass(e, name, _)
22+
}
23+
24+
query predicate new_unspecified_elements(Element e, string property, string error) {
25+
unspecified_elements(e, property, error)
26+
or
27+
exists(string name |
28+
removedClass(e, name) and
29+
property = "" and
30+
error = name + " nodes removed during database downgrade. Please update your CodeQL code."
31+
)
32+
}
33+
34+
query predicate new_unspecified_element_children(Element e, int index, Element child) {
35+
unspecified_element_children(e, index, child)
36+
or
37+
removedClass(e, _, child) and index = 0
38+
}
39+
40+
query predicate new_implicit_conversion_exprs(Element e, Element child) {
41+
implicit_conversion_exprs(e, child) and not removedClass(e, _)
42+
}
43+
44+
query predicate new_expr_types(Element e, Element type) {
45+
expr_types(e, type) and not removedClass(e, _)
46+
}
47+
48+
query predicate new_types(Element e, string name, Element canonicalType) {
49+
types(e, name, canonicalType) and not removedClass(e, _)
50+
}

0 commit comments

Comments
 (0)