Skip to content

Commit ebaebd1

Browse files
committed
Swift: Add upgrade and downgrade scripts
1 parent 98384bf commit ebaebd1

File tree

7 files changed

+11328
-0
lines changed

7 files changed

+11328
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
predicate removedClass(Element e, string name, Element child) {
6+
unsafe_cast_exprs(e) and
7+
name = "UnsafeCastExpr" and
8+
implicit_conversion_exprs(e, child)
9+
}
10+
11+
query predicate new_unspecified_elements(Element e, string property, string error) {
12+
unspecified_elements(e, property, error)
13+
or
14+
exists(string name |
15+
removedClass(e, name, _) and
16+
property = "" and
17+
error = name + " nodes removed during database downgrade. Please update your CodeQL code."
18+
)
19+
}
20+
21+
query predicate new_unspecified_element_children(Element e, int index, Element child) {
22+
unspecified_element_children(e, index, child)
23+
or
24+
removedClass(e, _, child) and index = 0
25+
}
26+
27+
query predicate new_implicit_conversion_exprs(Element e, Element child) {
28+
implicit_conversion_exprs(e, child) and not removedClass(e, _, _)
29+
}
30+
31+
query predicate new_expr_types(Element e, Element type) {
32+
expr_types(e, type) and not removedClass(e, _, _)
33+
}

0 commit comments

Comments
 (0)