Skip to content

Commit 57f1f5b

Browse files
authored
Merge pull request #14768 from github/alexdenisov/move-semantics
Swift: extract AST nodes related to move semantics
2 parents 0342b3e + 559b965 commit 57f1f5b

Some content is hidden

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

43 files changed

+11410
-45
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
class Element extends @element {
2+
string toString() { none() }
3+
}
4+
5+
query predicate new_unspecified_elements(Element e, string property, string error) {
6+
unspecified_elements(e, property, error)
7+
or
8+
error =
9+
"Move semantics support removed during database downgrade. Please update your CodeQL code." and
10+
property = "" and
11+
(
12+
copy_exprs(e, _) or
13+
consume_exprs(e, _) or
14+
borrow_exprs(e)
15+
)
16+
}
17+
18+
query predicate new_unspecified_element_children(Element e, int index, Element child) {
19+
unspecified_element_children(e, index, child)
20+
or
21+
copy_exprs(e, child) and index = 0
22+
or
23+
consume_exprs(e, child) and index = 0
24+
or
25+
borrow_exprs(e) and identity_exprs(e, child) and index = 0
26+
}
27+
28+
query predicate new_identity_exprs(Element e, Element child) {
29+
identity_exprs(e, child) and not borrow_exprs(e)
30+
}

0 commit comments

Comments
 (0)