Swift: finish upgrade script for for-in PR

This commit is contained in:
Robert Marsh 2023-09-25 20:13:52 +00:00
Родитель 8ce79e6be8
Коммит 92fdb7a35f
2 изменённых файлов: 22 добавлений и 2 удалений

Просмотреть файл

@ -210,6 +210,24 @@ query predicate new_var_decls(NewElement decl, string name, Element type) {
)
}
query predicate new_var_decl_parent_patterns(NewElement decl, NewElement pattern) {
var_decl_parent_patterns(decl, pattern)
or
exists(ForEachStmt stmt |
decl = Fresh::map(TIteratorVarConcreteDecl(stmt)) and
pattern = Fresh::map(TIteratorVarPattern(stmt))
)
}
query predicate new_var_decl_parent_initializers(NewElement decl, NewElement init) {
var_decl_parent_initializers(decl, init)
or
exists(ForEachStmt stmt |
decl = Fresh::map(TIteratorVarConcreteDecl(stmt)) and
init = stmt.getSequence()
)
}
query predicate new_expr_types(NewElement expr, NewElement type) {
expr_types(expr, type)
or
@ -235,7 +253,7 @@ query predicate new_expr_types(NewElement expr, NewElement type) {
value_decls(getNextMethod(stmt), type)
)
or
exists(ForEachStmt stmt, NewElement plainType|
exists(ForEachStmt stmt, NewElement plainType |
expr = Fresh::map(TNextCallInOutConversion(stmt)) and
expr_types(stmt.getSequence(), plainType) and
in_out_types(type, plainType)

Просмотреть файл

@ -17,4 +17,6 @@ call_exprs.rel: run for_in_upgrade.qlo new_call_exprs
locatable_locations.rel: run for_in_upgrade.qlo new_locatable_locations
var_decls.rel: run for_in_upgrade.qlo new_var_decls
concrete_var_decls.rel: run for_in_upgrade.qlo new_concrete_var_decls
expr_types.rel: run for_in_upgrade.qlo new_expr_types
expr_types.rel: run for_in_upgrade.qlo new_expr_types
var_decl_parent_initializers.rel: run for_in_upgrade.qlo new_var_decl_parent_initializers
var_decl_parent_patterns.rel: run for_in_upgrade.qlo new_var_decl_parent_patterns