Swift: add upgrade/downgrade scripts

This commit is contained in:
Paolo Tranquilli
2025-04-14 10:56:52 +02:00
parent fa6deaf87a
commit 1316e08365
7 changed files with 11269 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
class Element extends @element {
string toString() { none() }
}
predicate removedClass(Element e, string name, Element child) {
current_context_isolation_exprs(e, child) and name = "CurrentContextIsolationExpr"
or
extract_function_isolation_exprs(e, child) and name = "ExtractFunctionIsolationExpr"
or
(
actor_isolation_erasure_exprs(e) and name = "ActorIsolationErasureExpr"
or
unreachable_exprs(e) and name = "UnreachableExpr"
) and
implicit_conversion_exprs(e, child)
}
query predicate new_unspecified_elements(Element e, string property, string error) {
unspecified_elements(e, property, error)
or
exists(string name |
removedClass(e, name, _) and
property = "" and
error = name + " nodes removed during database downgrade. Please update your CodeQL code."
)
}
query predicate new_unspecified_element_children(Element e, int index, Element child) {
unspecified_element_children(e, index, child)
or
removedClass(e, _, child) and index = 0
}
query predicate new_implicit_conversion_exprs(Element e, Element child) {
implicit_conversion_exprs(e, child) and not removedClass(e, _, _)
}
query predicate new_expr_types(Element e, Element type) {
expr_types(e, type) and not removedClass(e, _, _)
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
description: Remove `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`.
compatibility: backwards
current_context_isolation_exprs.rel: delete
extract_function_isolation_exprs.rel: delete
actor_isolation_erasure_exprs.rel: delete
unreachable_exprs.rel: delete
unspecified_elements.rel: run downgrade.ql new_unspecified_elements
unspecified_element_children.rel: run downgrade.ql new_unspecified_element_children
implicit_conversion_exprs.rel: run downgrade.ql new_implicit_conversion_exprs
expr_types.rel: run downgrade.ql new_expr_types

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add `ExtracFunctionIsolationExpr`, `CurrentContextIsolationExpr`, `ActorIsolationErasureExpr` and `UnreachableExpr`.
compatibility: full