diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ccbe07a8aa4..d9beda01b10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: sync-files name: Fix files required to be identical - files: \.(qll?|qhelp)$ + files: \.(qll?|qhelp|swift)$ language: system entry: python3 config/sync-files.py --latest pass_filenames: false diff --git a/config/identical-files.json b/config/identical-files.json index 192144ebb4f..79c9c4e0f5d 100644 --- a/config/identical-files.json +++ b/config/identical-files.json @@ -566,5 +566,21 @@ "Typo database": [ "javascript/ql/src/Expressions/TypoDatabase.qll", "ql/ql/src/codeql_ql/style/TypoDatabase.qll" + ], + "Swift declarations test file": [ + "swift/ql/test/extractor-tests/declarations/declarations.swift", + "swift/ql/test/library-tests/parent/declarations.swift" + ], + "Swift statements test file": [ + "swift/ql/test/extractor-tests/statements/statements.swift", + "swift/ql/test/library-tests/parent/statements.swift" + ], + "Swift expressions test file": [ + "swift/ql/test/extractor-tests/expressions/expressions.swift", + "swift/ql/test/library-tests/parent/expressions.swift" + ], + "Swift patterns test file": [ + "swift/ql/test/extractor-tests/patterns/patterns.swift", + "swift/ql/test/library-tests/parent/patterns.swift" ] -} \ No newline at end of file +} diff --git a/swift/codegen/generators/qlgen.py b/swift/codegen/generators/qlgen.py index 580866f132c..2008f1e30fe 100755 --- a/swift/codegen/generators/qlgen.py +++ b/swift/codegen/generators/qlgen.py @@ -19,6 +19,7 @@ def get_ql_property(cls: schema.Class, prop: schema.Property): type=prop.type, tablename=inflection.tableize(cls.name), tableparams=["this"] + ["result" if p is prop else "_" for p in cls.properties if p.is_single], + is_child=prop.is_child, ) elif prop.is_repeated: return ql.Property( @@ -28,6 +29,7 @@ def get_ql_property(cls: schema.Class, prop: schema.Property): tablename=inflection.tableize(f"{cls.name}_{prop.name}"), tableparams=["this", "index", "result"], is_optional=prop.is_optional, + is_child=prop.is_child, ) elif prop.is_optional: return ql.Property( @@ -36,6 +38,7 @@ def get_ql_property(cls: schema.Class, prop: schema.Property): tablename=inflection.tableize(f"{cls.name}_{prop.name}"), tableparams=["this", "result"], is_optional=True, + is_child=prop.is_child, ) elif prop.is_predicate: return ql.Property( diff --git a/swift/codegen/lib/ql.py b/swift/codegen/lib/ql.py index 5d4a7076414..bbd0b02609f 100644 --- a/swift/codegen/lib/ql.py +++ b/swift/codegen/lib/ql.py @@ -22,6 +22,7 @@ class Property: local_var: str = "x" is_optional: bool = False is_predicate: bool = False + is_child: bool = False def __post_init__(self): if self.tableparams: diff --git a/swift/codegen/lib/schema.py b/swift/codegen/lib/schema.py index 648b8b2ec64..5ba19e4120f 100644 --- a/swift/codegen/lib/schema.py +++ b/swift/codegen/lib/schema.py @@ -19,6 +19,7 @@ class Property: name: str type: str = None + is_child: bool = False @dataclass @@ -62,17 +63,18 @@ class Schema: includes: Set[str] = field(default_factory=set) -def _parse_property(name, type): +def _parse_property(name: str, type: str, is_child: bool = False): + assert not (is_child and type[0].islower()), f"children must have class type, got {type} for {name}" if type.endswith("?*"): - return RepeatedOptionalProperty(name, type[:-2]) + return RepeatedOptionalProperty(name, type[:-2], is_child=is_child) elif type.endswith("*"): - return RepeatedProperty(name, type[:-1]) + return RepeatedProperty(name, type[:-1], is_child=is_child) elif type.endswith("?"): - return OptionalProperty(name, type[:-1]) + return OptionalProperty(name, type[:-1], is_child=is_child) elif type == "predicate": return PredicateProperty(name) else: - return SingleProperty(name, type) + return SingleProperty(name, type, is_child=is_child) class _DirSelector: @@ -109,6 +111,8 @@ def load(path): classes[base].derived.add(name) elif k == "_dir": cls.dir = pathlib.Path(v) + elif k == "_children": + cls.properties.extend(_parse_property(kk, vv, is_child=True) for kk, vv in v.items()) if not cls.bases and cls.name != root_class_name: cls.bases.add(root_class_name) classes[root_class_name].derived.add(name) diff --git a/swift/codegen/schema.yml b/swift/codegen/schema.yml index 20d38fd465e..d59de9eef59 100644 --- a/swift/codegen/schema.yml +++ b/swift/codegen/schema.yml @@ -52,9 +52,10 @@ AstNode: ConditionElement: _extends: Locatable - boolean: Expr? - pattern: Pattern? - initializer: Expr? + _children: + boolean: Expr? + pattern: Pattern? + initializer: Expr? _dir: stmt AnyFunctionType: @@ -247,7 +248,8 @@ TypeAliasType: EnumCaseDecl: _extends: Decl - elements: EnumElementDecl* + _children: + elements: EnumElementDecl* IfConfigDecl: _extends: Decl @@ -264,8 +266,9 @@ OperatorDecl: PatternBindingDecl: _extends: Decl - inits: Expr?* - patterns: Pattern* + _children: + inits: Expr?* + patterns: Pattern* PoundDiagnosticDecl: _extends: Decl @@ -275,7 +278,8 @@ PrecedenceGroupDecl: TopLevelCodeDecl: _extends: Decl - body: BraceStmt + _children: + body: BraceStmt ValueDecl: _extends: Decl @@ -286,37 +290,43 @@ AbstractClosureExpr: AnyTryExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr AppliedPropertyWrapperExpr: _extends: Expr Argument: label: string - expr: Expr + _children: + expr: Expr _dir: expr ApplyExpr: _extends: Expr - function: Expr - arguments: Argument* + _children: + function: Expr + arguments: Argument* ArrowExpr: _extends: Expr AssignExpr: _extends: Expr - dest: Expr - source: Expr + _children: + dest: Expr + source: Expr BindOptionalExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr CaptureListExpr: _extends: Expr - binding_decls: PatternBindingDecl* - closure_body: ClosureExpr + _children: + binding_decls: PatternBindingDecl* + closure_body: ClosureExpr CodeCompletionExpr: _extends: Expr @@ -343,103 +353,121 @@ DiscardAssignmentExpr: DotSyntaxBaseIgnoredExpr: _extends: Expr - qualifier: Expr - sub_expr: Expr + _children: + qualifier: Expr + sub_expr: Expr DynamicTypeExpr: _extends: Expr - base_expr: Expr + _children: + base_expr: Expr EditorPlaceholderExpr: _extends: Expr EnumIsCaseExpr: _extends: Expr - sub_expr: Expr - type_repr: TypeRepr - element: EnumElementDecl + _children: + sub_expr: Expr + type_repr: TypeRepr + element: EnumElementDecl ErrorExpr: _extends: Expr ExplicitCastExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr ForceValueExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr IdentityExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr IfExpr: _extends: Expr - condition: Expr - then_expr: Expr - else_expr: Expr + _children: + condition: Expr + then_expr: Expr + else_expr: Expr ImplicitConversionExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr InOutExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr KeyPathApplicationExpr: _extends: Expr - base: Expr - key_path: Expr + _children: + base: Expr + key_path: Expr KeyPathDotExpr: _extends: Expr KeyPathExpr: _extends: Expr - parsed_root: Expr? - parsed_path: Expr? + _children: + parsed_root: Expr? + parsed_path: Expr? LazyInitializerExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr LiteralExpr: _extends: Expr LookupExpr: _extends: Expr - base_expr: Expr + _children: + base_expr: Expr member: Decl MakeTemporarilyEscapableExpr: _extends: Expr - escaping_closure: OpaqueValueExpr - nonescaping_closure: Expr - sub_expr: Expr + _children: + escaping_closure: OpaqueValueExpr + nonescaping_closure: Expr + sub_expr: Expr ObjCSelectorExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr method: AbstractFunctionDecl OneWayExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr OpaqueValueExpr: _extends: Expr OpenExistentialExpr: _extends: Expr - sub_expr: Expr - existential: Expr - opaque_expr: OpaqueValueExpr + _children: + sub_expr: Expr + existential: Expr + opaque_expr: OpaqueValueExpr OptionalEvaluationExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr OtherConstructorDeclRefExpr: _extends: Expr @@ -452,8 +480,9 @@ PropertyWrapperValuePlaceholderExpr: RebindSelfInConstructorExpr: _extends: Expr - sub_expr: Expr - self: VarDecl + _children: + sub_expr: Expr + self: VarDecl SequenceExpr: _extends: Expr @@ -464,22 +493,26 @@ SuperRefExpr: TapExpr: _extends: Expr - sub_expr: Expr? + _children: + sub_expr: Expr? + body: BraceStmt var: VarDecl - body: BraceStmt TupleElementExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr index: int TupleExpr: _extends: Expr - elements: Expr* + _children: + elements: Expr* TypeExpr: _extends: Expr - type_repr: TypeRepr? + _children: + type_repr: TypeRepr? UnresolvedDeclRefExpr: _extends: Expr @@ -498,14 +531,16 @@ UnresolvedSpecializeExpr: VarargExpansionExpr: _extends: Expr - sub_expr: Expr + _children: + sub_expr: Expr AnyPattern: _extends: Pattern BindingPattern: _extends: Pattern - sub_pattern: Pattern + _children: + sub_pattern: Pattern BoolPattern: _extends: Pattern @@ -514,11 +549,13 @@ BoolPattern: EnumElementPattern: _extends: Pattern element: EnumElementDecl - sub_pattern: Pattern? + _children: + sub_pattern: Pattern? ExprPattern: _extends: Pattern - sub_expr: Expr + _children: + sub_expr: Expr IsPattern: _extends: Pattern @@ -531,24 +568,29 @@ NamedPattern: OptionalSomePattern: _extends: Pattern - sub_pattern: Pattern + _children: + sub_pattern: Pattern ParenPattern: _extends: Pattern - sub_pattern: Pattern + _children: + sub_pattern: Pattern TuplePattern: _extends: Pattern - elements: Pattern* + _children: + elements: Pattern* TypedPattern: _extends: Pattern - sub_pattern: Pattern - type_repr: TypeRepr? + _children: + sub_pattern: Pattern + type_repr: TypeRepr? BraceStmt: _extends: Stmt - elements: AstNode* + _children: + elements: AstNode* BreakStmt: _extends: Stmt @@ -557,14 +599,16 @@ BreakStmt: CaseStmt: _extends: Stmt - body: Stmt - labels: CaseLabelItem* + _children: + body: Stmt + labels: CaseLabelItem* variables: VarDecl* CaseLabelItem: _extends: AstNode - pattern: Pattern - guard: Expr? + _children: + pattern: Pattern + guard: Expr? _dir: stmt ContinueStmt: @@ -574,7 +618,8 @@ ContinueStmt: DeferStmt: _extends: Stmt - body: BraceStmt + _children: + body: BraceStmt FailStmt: _extends: Stmt @@ -593,15 +638,18 @@ PoundAssertStmt: ReturnStmt: _extends: Stmt - result: Expr? + _children: + result: Expr? ThrowStmt: _extends: Stmt - sub_expr: Expr + _children: + sub_expr: Expr YieldStmt: _extends: Stmt - results: Expr* + _children: + results: Expr* BoundGenericType: _extends: NominalOrBoundGenericNominalType @@ -657,17 +705,20 @@ AbstractFunctionDecl: - GenericContext - ValueDecl name: string - body: BraceStmt? - params: ParamDecl* + _children: + body: BraceStmt? + params: ParamDecl* AbstractStorageDecl: _extends: ValueDecl - accessor_decls: AccessorDecl* + _children: + accessor_decls: AccessorDecl* EnumElementDecl: _extends: ValueDecl name: string - params: ParamDecl* + _children: + params: ParamDecl* TypeDecl: _extends: ValueDecl @@ -676,11 +727,13 @@ TypeDecl: AutoClosureExpr: _extends: AbstractClosureExpr - body: BraceStmt + _children: + body: BraceStmt ClosureExpr: _extends: AbstractClosureExpr - body: BraceStmt + _children: + body: BraceStmt ForceTryExpr: _extends: AnyTryExpr @@ -705,15 +758,18 @@ PrefixUnaryExpr: SelfApplyExpr: _extends: ApplyExpr - base_expr: Expr + _children: + base_expr: Expr ArrayExpr: _extends: CollectionExpr - elements: Expr* + _children: + elements: Expr* DictionaryExpr: _extends: CollectionExpr - elements: Expr* + _children: + elements: Expr* CheckedCastExpr: _extends: ExplicitCastExpr @@ -832,9 +888,10 @@ BuiltinLiteralExpr: InterpolatedStringLiteralExpr: _extends: LiteralExpr interpolation_expr: OpaqueValueExpr? - interpolation_count_expr: Expr? - literal_capacity_expr: Expr? - appending_expr: TapExpr? + _children: + interpolation_count_expr: Expr? + literal_capacity_expr: Expr? + appending_expr: TapExpr? RegexLiteralExpr: _extends: LiteralExpr @@ -857,7 +914,8 @@ MemberRefExpr: SubscriptExpr: _extends: - LookupExpr - arguments: Argument* + _children: + arguments: Argument* has_direct_to_storage_semantics: predicate has_direct_to_implementation_semantics: predicate has_ordinary_semantics: predicate @@ -867,38 +925,45 @@ OverloadedDeclRefExpr: DoCatchStmt: _extends: LabeledStmt - body: Stmt - catches: CaseStmt* + _children: + body: Stmt + catches: CaseStmt* DoStmt: _extends: LabeledStmt - body: BraceStmt + _children: + body: BraceStmt ForEachStmt: _extends: LabeledStmt - pattern: Pattern - sequence: Expr - where: Expr? - body: BraceStmt + _children: + pattern: Pattern + sequence: Expr + where: Expr? + body: BraceStmt LabeledConditionalStmt: _extends: LabeledStmt - condition: StmtCondition + _children: + condition: StmtCondition StmtCondition: _extends: AstNode - elements: ConditionElement* + _children: + elements: ConditionElement* _dir: stmt RepeatWhileStmt: _extends: LabeledStmt - condition: Expr - body: Stmt + _children: + condition: Expr + body: Stmt SwitchStmt: _extends: LabeledStmt - expr: Expr - cases: CaseStmt* + _children: + expr: Expr + cases: CaseStmt* BoundGenericClassType: _extends: BoundGenericType @@ -943,7 +1008,8 @@ SubscriptDecl: _extends: - AbstractStorageDecl - GenericContext - params: ParamDecl* + _children: + params: ParamDecl* element_type: Type VarDecl: @@ -1006,16 +1072,19 @@ DynamicSubscriptExpr: GuardStmt: _extends: LabeledConditionalStmt - body: BraceStmt + _children: + body: BraceStmt IfStmt: _extends: LabeledConditionalStmt - then: Stmt - else: Stmt? + _children: + then: Stmt + else: Stmt? WhileStmt: _extends: LabeledConditionalStmt - body: Stmt + _children: + body: Stmt AccessorDecl: _extends: FuncDecl diff --git a/swift/codegen/templates/ql_class.mustache b/swift/codegen/templates/ql_class.mustache index 8c668de26d4..c22b5b88b0e 100644 --- a/swift/codegen/templates/ql_class.mustache +++ b/swift/codegen/templates/ql_class.mustache @@ -1,5 +1,8 @@ // generated by {{generator}} +{{^root}} +import codeql.swift.elements.Element +{{/root}} {{#imports}} import {{.}} {{/imports}} @@ -19,10 +22,26 @@ class {{name}}Base extends {{db_id}}{{#bases}}, {{.}}{{/bases}} { or result = getResolveStep().resolve() } + + {{name}}Base getAChild() { none() } // overridden by subclasses, internal use only {{/root}} {{#final}} override string getAPrimaryQlClass() { result = "{{name}}" } {{/final}} + {{^root}} + + cached override Element getAChild() { + none() + {{#bases}} + or result = {{.}}.super.getAChild() + {{/bases}} + {{#properties}} + {{#is_child}} + or result = {{getter}}({{#is_repeated}}_{{/is_repeated}}) + {{/is_child}} + {{/properties}} + } + {{/root}} {{#properties}} {{type}} {{getter}}({{#is_repeated}}int index{{/is_repeated}}) { diff --git a/swift/codegen/test/test_qlgen.py b/swift/codegen/test/test_qlgen.py index cda43714443..2a489b35fc6 100644 --- a/swift/codegen/test/test_qlgen.py +++ b/swift/codegen/test/test_qlgen.py @@ -99,44 +99,47 @@ def test_single_properties(opts, input, renderer): } -def test_optional_property(opts, input, renderer): +@pytest.mark.parametrize("is_child", [False, True]) +def test_optional_property(opts, input, renderer, is_child): input.classes = [ - schema.Class("MyObject", properties=[schema.OptionalProperty("foo", "bar")]), + schema.Class("MyObject", properties=[schema.OptionalProperty("foo", "bar", is_child=is_child)]), ] assert generate(opts, renderer) == { import_file(): ql.ImportList([stub_import_prefix + "MyObject"]), stub_path() / "MyObject.qll": ql.Stub(name="MyObject", base_import=gen_import_prefix + "MyObject"), ql_output_path() / "MyObject.qll": ql.Class(name="MyObject", final=True, properties=[ ql.Property(singular="Foo", type="bar", tablename="my_object_foos", tableparams=["this", "result"], - is_optional=True), + is_optional=True, is_child=is_child), ]) } -def test_repeated_property(opts, input, renderer): +@pytest.mark.parametrize("is_child", [False, True]) +def test_repeated_property(opts, input, renderer, is_child): input.classes = [ - schema.Class("MyObject", properties=[schema.RepeatedProperty("foo", "bar")]), + schema.Class("MyObject", properties=[schema.RepeatedProperty("foo", "bar", is_child=is_child)]), ] assert generate(opts, renderer) == { import_file(): ql.ImportList([stub_import_prefix + "MyObject"]), stub_path() / "MyObject.qll": ql.Stub(name="MyObject", base_import=gen_import_prefix + "MyObject"), ql_output_path() / "MyObject.qll": ql.Class(name="MyObject", final=True, properties=[ ql.Property(singular="Foo", plural="Foos", type="bar", tablename="my_object_foos", - tableparams=["this", "index", "result"]), + tableparams=["this", "index", "result"], is_child=is_child), ]) } -def test_repeated_optional_property(opts, input, renderer): +@pytest.mark.parametrize("is_child", [False, True]) +def test_repeated_optional_property(opts, input, renderer, is_child): input.classes = [ - schema.Class("MyObject", properties=[schema.RepeatedOptionalProperty("foo", "bar")]), + schema.Class("MyObject", properties=[schema.RepeatedOptionalProperty("foo", "bar", is_child=is_child)]), ] assert generate(opts, renderer) == { import_file(): ql.ImportList([stub_import_prefix + "MyObject"]), stub_path() / "MyObject.qll": ql.Stub(name="MyObject", base_import=gen_import_prefix + "MyObject"), ql_output_path() / "MyObject.qll": ql.Class(name="MyObject", final=True, properties=[ ql.Property(singular="Foo", plural="Foos", type="bar", tablename="my_object_foos", - tableparams=["this", "index", "result"], is_optional=True), + tableparams=["this", "index", "result"], is_optional=True, is_child=is_child), ]) } @@ -155,9 +158,10 @@ def test_predicate_property(opts, input, renderer): } -def test_single_class_property(opts, input, renderer): +@pytest.mark.parametrize("is_child", [False, True]) +def test_single_class_property(opts, input, renderer, is_child): input.classes = [ - schema.Class("MyObject", properties=[schema.SingleProperty("foo", "Bar")]), + schema.Class("MyObject", properties=[schema.SingleProperty("foo", "Bar", is_child=is_child)]), schema.Class("Bar"), ] assert generate(opts, renderer) == { @@ -166,7 +170,8 @@ def test_single_class_property(opts, input, renderer): stub_path() / "Bar.qll": ql.Stub(name="Bar", base_import=gen_import_prefix + "Bar"), ql_output_path() / "MyObject.qll": ql.Class( name="MyObject", final=True, imports=[stub_import_prefix + "Bar"], properties=[ - ql.Property(singular="Foo", type="Bar", tablename="my_objects", tableparams=["this", "result"]), + ql.Property(singular="Foo", type="Bar", tablename="my_objects", tableparams=["this", "result"], + is_child=is_child), ], ), ql_output_path() / "Bar.qll": ql.Class(name="Bar", final=True) diff --git a/swift/codegen/test/test_schema.py b/swift/codegen/test/test_schema.py index cbeb9c6989a..311333f827d 100644 --- a/swift/codegen/test/test_schema.py +++ b/swift/codegen/test/test_schema.py @@ -1,5 +1,7 @@ import sys +import pytest + from swift.codegen.test.utils import * root_name = schema.root_class_name @@ -163,9 +165,43 @@ Element: assert ret.classes == [ schema.Class(root_name, properties=[ schema.SingleProperty('x', 'string'), - ]), + ]), ] +def test_children(load): + ret = load(""" +A: + a: string + b: B* + _children: + c: C + d: D* + e: E? + f: F?* +""") + assert ret.classes == [ + schema.Class(root_name, derived={'A'}), + schema.Class('A', bases={root_name}, properties=[ + schema.SingleProperty('a', 'string'), + schema.RepeatedProperty('b', 'B'), + schema.SingleProperty('c', 'C', is_child=True), + schema.RepeatedProperty('d', 'D', is_child=True), + schema.OptionalProperty('e', 'E', is_child=True), + schema.RepeatedOptionalProperty('f', 'F', is_child=True), + ]), + ] + + +@pytest.mark.parametrize("type", ["string", "int", "boolean", "predicate"]) +def test_builtin_and_predicate_children_not_allowed(load, type): + with pytest.raises(AssertionError): + load(f""" +A: + _children: + x: {type} +""") + + if __name__ == '__main__': sys.exit(pytest.main([__file__] + sys.argv[1:])) diff --git a/swift/extractor/visitors/ExprVisitor.h b/swift/extractor/visitors/ExprVisitor.h index 6977a91d1a4..1719b646018 100644 --- a/swift/extractor/visitors/ExprVisitor.h +++ b/swift/extractor/visitors/ExprVisitor.h @@ -313,7 +313,7 @@ class ExprVisitor : public AstVisitorBase { auto varLabel = dispatcher_.fetchLabel(expr->getVar()); auto bodyLabel = dispatcher_.fetchLabel(expr->getBody()); - dispatcher_.emit(TapExprsTrap{label, varLabel, bodyLabel}); + dispatcher_.emit(TapExprsTrap{label, bodyLabel, varLabel}); if (auto subExpr = expr->getSubExpr()) { dispatcher_.emit(TapExprSubExprsTrap{label, dispatcher_.fetchLabel(subExpr)}); } diff --git a/swift/ql/lib/codeql/swift/elements/AstNode.qll b/swift/ql/lib/codeql/swift/elements/AstNode.qll index 8c6007436e9..0d327ef3d38 100644 --- a/swift/ql/lib/codeql/swift/elements/AstNode.qll +++ b/swift/ql/lib/codeql/swift/elements/AstNode.qll @@ -1,4 +1,7 @@ -// generated by codegen/codegen.py, remove this comment if you wish to edit this file private import codeql.swift.generated.AstNode -class AstNode extends AstNodeBase { } +class AstNode extends AstNodeBase { + AstNode getParent() { + result = unique(AstNode x | this = x.getAChild() and not exists(x.getResolveStep()) | x) + } +} diff --git a/swift/ql/lib/codeql/swift/elements/Element.qll b/swift/ql/lib/codeql/swift/elements/Element.qll index 9d2b7db4dbf..dd511c55436 100644 --- a/swift/ql/lib/codeql/swift/elements/Element.qll +++ b/swift/ql/lib/codeql/swift/elements/Element.qll @@ -1,15 +1,15 @@ private import codeql.swift.generated.Element class Element extends ElementBase { - private predicate resolvesTo(Element e) { e.getResolveStep() = this } + private predicate resolvesFrom(Element e) { e.getResolveStep() = this } override string toString() { result = getPrimaryQlClasses() } Element getFullyUnresolved() { - not this.resolvesTo(_) and result = this + not this.resolvesFrom(_) and result = this or exists(Element e | - this.resolvesTo(e) and + this.resolvesFrom(e) and result = e.getFullyUnresolved() ) } diff --git a/swift/ql/lib/codeql/swift/generated/AstNode.qll b/swift/ql/lib/codeql/swift/generated/AstNode.qll index 26734294d75..ec919626c11 100644 --- a/swift/ql/lib/codeql/swift/generated/AstNode.qll +++ b/swift/ql/lib/codeql/swift/generated/AstNode.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.Locatable -class AstNodeBase extends @ast_node, Locatable { } +class AstNodeBase extends @ast_node, Locatable { + cached + override Element getAChild() { + none() or + result = Locatable.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/Element.qll b/swift/ql/lib/codeql/swift/generated/Element.qll index a2c546d9c6b..6bbe1f8ec53 100644 --- a/swift/ql/lib/codeql/swift/generated/Element.qll +++ b/swift/ql/lib/codeql/swift/generated/Element.qll @@ -14,5 +14,7 @@ class ElementBase extends @element { result = getResolveStep().resolve() } + ElementBase getAChild() { none() } // overridden by subclasses, internal use only + predicate isUnknown() { element_is_unknown(this) } } diff --git a/swift/ql/lib/codeql/swift/generated/File.qll b/swift/ql/lib/codeql/swift/generated/File.qll index 38f1ea107a7..c435d9a57e6 100644 --- a/swift/ql/lib/codeql/swift/generated/File.qll +++ b/swift/ql/lib/codeql/swift/generated/File.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element class FileBase extends @file, Element { override string getAPrimaryQlClass() { result = "File" } + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + string getName() { files(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/Locatable.qll b/swift/ql/lib/codeql/swift/generated/Locatable.qll index b24cfdb71f3..abe3f3c6e31 100644 --- a/swift/ql/lib/codeql/swift/generated/Locatable.qll +++ b/swift/ql/lib/codeql/swift/generated/Locatable.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element import codeql.swift.elements.Location class LocatableBase extends @locatable, Element { + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + Location getLocation() { exists(Location x | locatables(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/Location.qll b/swift/ql/lib/codeql/swift/generated/Location.qll index 8379e4a5259..8a1d613a290 100644 --- a/swift/ql/lib/codeql/swift/generated/Location.qll +++ b/swift/ql/lib/codeql/swift/generated/Location.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element import codeql.swift.elements.File class LocationBase extends @location, Element { override string getAPrimaryQlClass() { result = "Location" } + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + File getFile() { exists(File x | locations(this, x, _, _, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/AbstractFunctionDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/AbstractFunctionDecl.qll index 5a6ba0e41a7..74103f9f9ad 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/AbstractFunctionDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/AbstractFunctionDecl.qll @@ -1,10 +1,20 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.decl.GenericContext import codeql.swift.elements.decl.ParamDecl import codeql.swift.elements.decl.ValueDecl class AbstractFunctionDeclBase extends @abstract_function_decl, GenericContext, ValueDecl { + cached + override Element getAChild() { + none() or + result = GenericContext.super.getAChild() or + result = ValueDecl.super.getAChild() or + result = getBody() or + result = getParam(_) + } + string getName() { abstract_function_decls(this, result) } BraceStmt getBody() { diff --git a/swift/ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll index 1b82572f568..49cd07736c5 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll @@ -1,8 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AccessorDecl import codeql.swift.elements.decl.ValueDecl class AbstractStorageDeclBase extends @abstract_storage_decl, ValueDecl { + cached + override Element getAChild() { + none() or + result = ValueDecl.super.getAChild() or + result = getAccessorDecl(_) + } + AccessorDecl getAccessorDecl(int index) { exists(AccessorDecl x | abstract_storage_decl_accessor_decls(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/AbstractTypeParamDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/AbstractTypeParamDecl.qll index f96f64de9f1..743e2d898a0 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/AbstractTypeParamDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/AbstractTypeParamDecl.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.TypeDecl -class AbstractTypeParamDeclBase extends @abstract_type_param_decl, TypeDecl { } +class AbstractTypeParamDeclBase extends @abstract_type_param_decl, TypeDecl { + cached + override Element getAChild() { + none() or + result = TypeDecl.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/decl/AccessorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/AccessorDecl.qll index 91ad9e46092..9201118bafd 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/AccessorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/AccessorDecl.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.FuncDecl class AccessorDeclBase extends @accessor_decl, FuncDecl { override string getAPrimaryQlClass() { result = "AccessorDecl" } + cached + override Element getAChild() { + none() or + result = FuncDecl.super.getAChild() + } + predicate isGetter() { accessor_decl_is_getter(this) } predicate isSetter() { accessor_decl_is_setter(this) } diff --git a/swift/ql/lib/codeql/swift/generated/decl/AssociatedTypeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/AssociatedTypeDecl.qll index efd33b04d8c..627c476a03e 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/AssociatedTypeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/AssociatedTypeDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractTypeParamDecl class AssociatedTypeDeclBase extends @associated_type_decl, AbstractTypeParamDecl { override string getAPrimaryQlClass() { result = "AssociatedTypeDecl" } + + cached + override Element getAChild() { + none() or + result = AbstractTypeParamDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ClassDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ClassDecl.qll index d770f1f7b4f..68e2ef9d63e 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ClassDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ClassDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.NominalTypeDecl class ClassDeclBase extends @class_decl, NominalTypeDecl { override string getAPrimaryQlClass() { result = "ClassDecl" } + + cached + override Element getAChild() { + none() or + result = NominalTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ConcreteFuncDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ConcreteFuncDecl.qll index 0ba9db75056..0af5575d0b5 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ConcreteFuncDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ConcreteFuncDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.FuncDecl class ConcreteFuncDeclBase extends @concrete_func_decl, FuncDecl { override string getAPrimaryQlClass() { result = "ConcreteFuncDecl" } + + cached + override Element getAChild() { + none() or + result = FuncDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll index 5be11bfe33a..1d81921c081 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.VarDecl class ConcreteVarDeclBase extends @concrete_var_decl, VarDecl { override string getAPrimaryQlClass() { result = "ConcreteVarDecl" } + cached + override Element getAChild() { + none() or + result = VarDecl.super.getAChild() + } + int getIntroducerInt() { concrete_var_decls(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ConstructorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ConstructorDecl.qll index 208804ca71a..96ff3831fa7 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ConstructorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ConstructorDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractFunctionDecl class ConstructorDeclBase extends @constructor_decl, AbstractFunctionDecl { override string getAPrimaryQlClass() { result = "ConstructorDecl" } + + cached + override Element getAChild() { + none() or + result = AbstractFunctionDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/Decl.qll b/swift/ql/lib/codeql/swift/generated/decl/Decl.qll index 8bf5c9a15a4..ad3950ea171 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/Decl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/Decl.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode -class DeclBase extends @decl, AstNode { } +class DeclBase extends @decl, AstNode { + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/decl/DestructorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/DestructorDecl.qll index 647dbe8daec..4bd564aa32c 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/DestructorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/DestructorDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractFunctionDecl class DestructorDeclBase extends @destructor_decl, AbstractFunctionDecl { override string getAPrimaryQlClass() { result = "DestructorDecl" } + + cached + override Element getAChild() { + none() or + result = AbstractFunctionDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/EnumCaseDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/EnumCaseDecl.qll index 179552ebf94..c128b82120b 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/EnumCaseDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/EnumCaseDecl.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.decl.EnumElementDecl class EnumCaseDeclBase extends @enum_case_decl, Decl { override string getAPrimaryQlClass() { result = "EnumCaseDecl" } + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() or + result = getElement(_) + } + EnumElementDecl getElement(int index) { exists(EnumElementDecl x | enum_case_decl_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/EnumDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/EnumDecl.qll index ae84dea0998..bbcf3c117d7 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/EnumDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/EnumDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.NominalTypeDecl class EnumDeclBase extends @enum_decl, NominalTypeDecl { override string getAPrimaryQlClass() { result = "EnumDecl" } + + cached + override Element getAChild() { + none() or + result = NominalTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/EnumElementDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/EnumElementDecl.qll index 5a7cc81bb31..3244bb57e84 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/EnumElementDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/EnumElementDecl.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.ParamDecl import codeql.swift.elements.decl.ValueDecl class EnumElementDeclBase extends @enum_element_decl, ValueDecl { override string getAPrimaryQlClass() { result = "EnumElementDecl" } + cached + override Element getAChild() { + none() or + result = ValueDecl.super.getAChild() or + result = getParam(_) + } + string getName() { enum_element_decls(this, result) } ParamDecl getParam(int index) { diff --git a/swift/ql/lib/codeql/swift/generated/decl/ExtensionDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ExtensionDecl.qll index 0efc904e43a..cf378b61a34 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ExtensionDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ExtensionDecl.qll @@ -1,8 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.decl.GenericContext import codeql.swift.elements.decl.IterableDeclContext class ExtensionDeclBase extends @extension_decl, Decl, GenericContext, IterableDeclContext { override string getAPrimaryQlClass() { result = "ExtensionDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() or + result = GenericContext.super.getAChild() or + result = IterableDeclContext.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/FuncDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/FuncDecl.qll index c7b789b7442..e963b217efe 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/FuncDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/FuncDecl.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractFunctionDecl -class FuncDeclBase extends @func_decl, AbstractFunctionDecl { } +class FuncDeclBase extends @func_decl, AbstractFunctionDecl { + cached + override Element getAChild() { + none() or + result = AbstractFunctionDecl.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/decl/GenericContext.qll b/swift/ql/lib/codeql/swift/generated/decl/GenericContext.qll index 3a474400f5c..950da77e44a 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/GenericContext.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/GenericContext.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element import codeql.swift.elements.decl.GenericTypeParamDecl class GenericContextBase extends @generic_context, Element { + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + GenericTypeParamDecl getGenericTypeParam(int index) { exists(GenericTypeParamDecl x | generic_context_generic_type_params(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/GenericTypeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/GenericTypeDecl.qll index 98f42820f79..bc580e8eb0f 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/GenericTypeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/GenericTypeDecl.qll @@ -1,5 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.GenericContext import codeql.swift.elements.decl.TypeDecl -class GenericTypeDeclBase extends @generic_type_decl, GenericContext, TypeDecl { } +class GenericTypeDeclBase extends @generic_type_decl, GenericContext, TypeDecl { + cached + override Element getAChild() { + none() or + result = GenericContext.super.getAChild() or + result = TypeDecl.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/decl/GenericTypeParamDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/GenericTypeParamDecl.qll index 990d69d1734..519d3926ab2 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/GenericTypeParamDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/GenericTypeParamDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractTypeParamDecl class GenericTypeParamDeclBase extends @generic_type_param_decl, AbstractTypeParamDecl { override string getAPrimaryQlClass() { result = "GenericTypeParamDecl" } + + cached + override Element getAChild() { + none() or + result = AbstractTypeParamDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/IfConfigDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/IfConfigDecl.qll index 578051e9f8b..217d9888180 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/IfConfigDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/IfConfigDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class IfConfigDeclBase extends @if_config_decl, Decl { override string getAPrimaryQlClass() { result = "IfConfigDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ImportDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ImportDecl.qll index fdd89db170a..f8117aba31e 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ImportDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ImportDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class ImportDeclBase extends @import_decl, Decl { override string getAPrimaryQlClass() { result = "ImportDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/InfixOperatorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/InfixOperatorDecl.qll index 47119bec078..6b5526ae3c0 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/InfixOperatorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/InfixOperatorDecl.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.OperatorDecl import codeql.swift.elements.decl.PrecedenceGroupDecl class InfixOperatorDeclBase extends @infix_operator_decl, OperatorDecl { override string getAPrimaryQlClass() { result = "InfixOperatorDecl" } + cached + override Element getAChild() { + none() or + result = OperatorDecl.super.getAChild() + } + PrecedenceGroupDecl getPrecedenceGroup() { exists(PrecedenceGroupDecl x | infix_operator_decl_precedence_groups(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/IterableDeclContext.qll b/swift/ql/lib/codeql/swift/generated/decl/IterableDeclContext.qll index b389c8588d4..42b681c0cbd 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/IterableDeclContext.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/IterableDeclContext.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.Element class IterableDeclContextBase extends @iterable_decl_context, Element { + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + Decl getMember(int index) { exists(Decl x | iterable_decl_context_members(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/MissingMemberDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/MissingMemberDecl.qll index bc6002e56d2..51201f69aa3 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/MissingMemberDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/MissingMemberDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class MissingMemberDeclBase extends @missing_member_decl, Decl { override string getAPrimaryQlClass() { result = "MissingMemberDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ModuleDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ModuleDecl.qll index aad5d00c0c6..5692eb70deb 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ModuleDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ModuleDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.TypeDecl class ModuleDeclBase extends @module_decl, TypeDecl { override string getAPrimaryQlClass() { result = "ModuleDecl" } + + cached + override Element getAChild() { + none() or + result = TypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/NominalTypeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/NominalTypeDecl.qll index 4924bb32a87..876ff0546f2 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/NominalTypeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/NominalTypeDecl.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.GenericTypeDecl import codeql.swift.elements.decl.IterableDeclContext import codeql.swift.elements.type.Type class NominalTypeDeclBase extends @nominal_type_decl, GenericTypeDecl, IterableDeclContext { + cached + override Element getAChild() { + none() or + result = GenericTypeDecl.super.getAChild() or + result = IterableDeclContext.super.getAChild() + } + Type getType() { exists(Type x | nominal_type_decls(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/OpaqueTypeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/OpaqueTypeDecl.qll index 42b8679dde0..51ea8109f39 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/OpaqueTypeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/OpaqueTypeDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.GenericTypeDecl class OpaqueTypeDeclBase extends @opaque_type_decl, GenericTypeDecl { override string getAPrimaryQlClass() { result = "OpaqueTypeDecl" } + + cached + override Element getAChild() { + none() or + result = GenericTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/OperatorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/OperatorDecl.qll index 22171d68b4b..fcc37e9d427 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/OperatorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/OperatorDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class OperatorDeclBase extends @operator_decl, Decl { + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } + string getName() { operator_decls(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ParamDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ParamDecl.qll index 079c1cba19e..96e2814bf89 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ParamDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ParamDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.VarDecl class ParamDeclBase extends @param_decl, VarDecl { override string getAPrimaryQlClass() { result = "ParamDecl" } + + cached + override Element getAChild() { + none() or + result = VarDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/PatternBindingDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PatternBindingDecl.qll index 44c80c76efa..ffa9d2e51c9 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PatternBindingDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PatternBindingDecl.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.expr.Expr import codeql.swift.elements.pattern.Pattern @@ -6,6 +7,14 @@ import codeql.swift.elements.pattern.Pattern class PatternBindingDeclBase extends @pattern_binding_decl, Decl { override string getAPrimaryQlClass() { result = "PatternBindingDecl" } + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() or + result = getInit(_) or + result = getPattern(_) + } + Expr getInit(int index) { exists(Expr x | pattern_binding_decl_inits(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/PostfixOperatorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PostfixOperatorDecl.qll index a52d858f853..05dff295c13 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PostfixOperatorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PostfixOperatorDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.OperatorDecl class PostfixOperatorDeclBase extends @postfix_operator_decl, OperatorDecl { override string getAPrimaryQlClass() { result = "PostfixOperatorDecl" } + + cached + override Element getAChild() { + none() or + result = OperatorDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll index 32f723ae081..bf8224dcc7e 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PoundDiagnosticDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class PoundDiagnosticDeclBase extends @pound_diagnostic_decl, Decl { override string getAPrimaryQlClass() { result = "PoundDiagnosticDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/PrecedenceGroupDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PrecedenceGroupDecl.qll index 381b92ed030..81aedd8ac88 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PrecedenceGroupDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PrecedenceGroupDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl class PrecedenceGroupDeclBase extends @precedence_group_decl, Decl { override string getAPrimaryQlClass() { result = "PrecedenceGroupDecl" } + + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/PrefixOperatorDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/PrefixOperatorDecl.qll index 5f66eb16fc9..4f9739c8577 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/PrefixOperatorDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/PrefixOperatorDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.OperatorDecl class PrefixOperatorDeclBase extends @prefix_operator_decl, OperatorDecl { override string getAPrimaryQlClass() { result = "PrefixOperatorDecl" } + + cached + override Element getAChild() { + none() or + result = OperatorDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/ProtocolDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ProtocolDecl.qll index 1c57a13aae7..8e72a52d008 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ProtocolDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ProtocolDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.NominalTypeDecl class ProtocolDeclBase extends @protocol_decl, NominalTypeDecl { override string getAPrimaryQlClass() { result = "ProtocolDecl" } + + cached + override Element getAChild() { + none() or + result = NominalTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/StructDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/StructDecl.qll index 135efec442a..4ec0faabef7 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/StructDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/StructDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.NominalTypeDecl class StructDeclBase extends @struct_decl, NominalTypeDecl { override string getAPrimaryQlClass() { result = "StructDecl" } + + cached + override Element getAChild() { + none() or + result = NominalTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/SubscriptDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/SubscriptDecl.qll index 0dac3084711..b0fd5c4f835 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/SubscriptDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/SubscriptDecl.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractStorageDecl import codeql.swift.elements.decl.GenericContext import codeql.swift.elements.decl.ParamDecl @@ -7,6 +8,14 @@ import codeql.swift.elements.type.Type class SubscriptDeclBase extends @subscript_decl, AbstractStorageDecl, GenericContext { override string getAPrimaryQlClass() { result = "SubscriptDecl" } + cached + override Element getAChild() { + none() or + result = AbstractStorageDecl.super.getAChild() or + result = GenericContext.super.getAChild() or + result = getParam(_) + } + ParamDecl getParam(int index) { exists(ParamDecl x | subscript_decl_params(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/TopLevelCodeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/TopLevelCodeDecl.qll index 7c664ad9bca..daa096e5fab 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/TopLevelCodeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/TopLevelCodeDecl.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.decl.Decl class TopLevelCodeDeclBase extends @top_level_code_decl, Decl { override string getAPrimaryQlClass() { result = "TopLevelCodeDecl" } + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | top_level_code_decls(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/TypeAliasDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/TypeAliasDecl.qll index fd437a62676..d68d03e0a4d 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/TypeAliasDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/TypeAliasDecl.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.GenericTypeDecl class TypeAliasDeclBase extends @type_alias_decl, GenericTypeDecl { override string getAPrimaryQlClass() { result = "TypeAliasDecl" } + + cached + override Element getAChild() { + none() or + result = GenericTypeDecl.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/decl/TypeDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/TypeDecl.qll index 3e5eb593395..ffe4fed55ac 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/TypeDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/TypeDecl.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type import codeql.swift.elements.decl.ValueDecl class TypeDeclBase extends @type_decl, ValueDecl { + cached + override Element getAChild() { + none() or + result = ValueDecl.super.getAChild() + } + string getName() { type_decls(this, result) } Type getBaseType(int index) { diff --git a/swift/ql/lib/codeql/swift/generated/decl/ValueDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/ValueDecl.qll index a9850e1c2a8..ee61e7511a7 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/ValueDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/ValueDecl.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.type.Type class ValueDeclBase extends @value_decl, Decl { + cached + override Element getAChild() { + none() or + result = Decl.super.getAChild() + } + Type getInterfaceType() { exists(Type x | value_decls(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/decl/VarDecl.qll b/swift/ql/lib/codeql/swift/generated/decl/VarDecl.qll index 2908b5e377d..9b0a39512cb 100644 --- a/swift/ql/lib/codeql/swift/generated/decl/VarDecl.qll +++ b/swift/ql/lib/codeql/swift/generated/decl/VarDecl.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractStorageDecl import codeql.swift.elements.expr.Expr import codeql.swift.elements.pattern.Pattern import codeql.swift.elements.type.Type class VarDeclBase extends @var_decl, AbstractStorageDecl { + cached + override Element getAChild() { + none() or + result = AbstractStorageDecl.super.getAChild() + } + string getName() { var_decls(this, result, _) } Type getType() { diff --git a/swift/ql/lib/codeql/swift/generated/expr/AbstractClosureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AbstractClosureExpr.qll index e5e568565ff..8c585337348 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AbstractClosureExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AbstractClosureExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr -class AbstractClosureExprBase extends @abstract_closure_expr, Expr { } +class AbstractClosureExprBase extends @abstract_closure_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll index 6e95203d957..f7663152566 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AnyHashableErasureExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class AnyHashableErasureExprBase extends @any_hashable_erasure_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "AnyHashableErasureExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/AnyTryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AnyTryExpr.qll index 47a8b2505d9..e590abe13de 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AnyTryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AnyTryExpr.qll @@ -1,7 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class AnyTryExprBase extends @any_try_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | any_try_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll index 9fb974487e7..12c197f74dd 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AppliedPropertyWrapperExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class AppliedPropertyWrapperExprBase extends @applied_property_wrapper_expr, Expr { override string getAPrimaryQlClass() { result = "AppliedPropertyWrapperExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ApplyExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ApplyExpr.qll index d9416bfa5e7..1c2145223e5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ApplyExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ApplyExpr.qll @@ -1,8 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Argument import codeql.swift.elements.expr.Expr class ApplyExprBase extends @apply_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getFunction() or + result = getArgument(_) + } + Expr getFunction() { exists(Expr x | apply_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ArchetypeToSuperExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ArchetypeToSuperExpr.qll index 7e9a9e4a7b8..809e9b40059 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ArchetypeToSuperExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ArchetypeToSuperExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ArchetypeToSuperExprBase extends @archetype_to_super_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ArchetypeToSuperExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/Argument.qll b/swift/ql/lib/codeql/swift/generated/expr/Argument.qll index 9f16b90e3fe..326b09bedff 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/Argument.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/Argument.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ArgumentBase extends @argument, Element { override string getAPrimaryQlClass() { result = "Argument" } + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() or + result = getExpr() + } + string getLabel() { arguments(this, result, _) } Expr getExpr() { diff --git a/swift/ql/lib/codeql/swift/generated/expr/ArrayExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ArrayExpr.qll index e62af8dde55..6a90b6f875e 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ArrayExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ArrayExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.CollectionExpr import codeql.swift.elements.expr.Expr class ArrayExprBase extends @array_expr, CollectionExpr { override string getAPrimaryQlClass() { result = "ArrayExpr" } + cached + override Element getAChild() { + none() or + result = CollectionExpr.super.getAChild() or + result = getElement(_) + } + Expr getElement(int index) { exists(Expr x | array_expr_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ArrayToPointerExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ArrayToPointerExpr.qll index 0eef1004773..bcc73871b8e 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ArrayToPointerExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ArrayToPointerExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ArrayToPointerExprBase extends @array_to_pointer_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ArrayToPointerExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ArrowExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ArrowExpr.qll index a10d68af913..57e936c0e68 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ArrowExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ArrowExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ArrowExprBase extends @arrow_expr, Expr { override string getAPrimaryQlClass() { result = "ArrowExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/AssignExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AssignExpr.qll index b733f8fc3e2..8fccf0d049a 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AssignExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AssignExpr.qll @@ -1,9 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class AssignExprBase extends @assign_expr, Expr { override string getAPrimaryQlClass() { result = "AssignExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getDest() or + result = getSource() + } + Expr getDest() { exists(Expr x | assign_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/AutoClosureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AutoClosureExpr.qll index f25248ed0fb..e094fc92438 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AutoClosureExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AutoClosureExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.AbstractClosureExpr import codeql.swift.elements.stmt.BraceStmt class AutoClosureExprBase extends @auto_closure_expr, AbstractClosureExpr { override string getAPrimaryQlClass() { result = "AutoClosureExpr" } + cached + override Element getAChild() { + none() or + result = AbstractClosureExpr.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | auto_closure_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/AwaitExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/AwaitExpr.qll index e18243db73a..00d87e55135 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/AwaitExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/AwaitExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.IdentityExpr class AwaitExprBase extends @await_expr, IdentityExpr { override string getAPrimaryQlClass() { result = "AwaitExpr" } + + cached + override Element getAChild() { + none() or + result = IdentityExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/BinaryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BinaryExpr.qll index 54895bbf294..7b87c2e68da 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BinaryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BinaryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ApplyExpr class BinaryExprBase extends @binary_expr, ApplyExpr { override string getAPrimaryQlClass() { result = "BinaryExpr" } + + cached + override Element getAChild() { + none() or + result = ApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/BindOptionalExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BindOptionalExpr.qll index 9cd270891ea..8953f0f1d9b 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BindOptionalExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BindOptionalExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class BindOptionalExprBase extends @bind_optional_expr, Expr { override string getAPrimaryQlClass() { result = "BindOptionalExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | bind_optional_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/BooleanLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BooleanLiteralExpr.qll index 853c8f08629..e7be288e585 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BooleanLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BooleanLiteralExpr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.BuiltinLiteralExpr class BooleanLiteralExprBase extends @boolean_literal_expr, BuiltinLiteralExpr { override string getAPrimaryQlClass() { result = "BooleanLiteralExpr" } + cached + override Element getAChild() { + none() or + result = BuiltinLiteralExpr.super.getAChild() + } + boolean getValue() { boolean_literal_exprs(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/BridgeFromObjCExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BridgeFromObjCExpr.qll index fc30c1b3f81..4b7dc60cea7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BridgeFromObjCExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BridgeFromObjCExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class BridgeFromObjCExprBase extends @bridge_from_obj_c_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "BridgeFromObjCExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/BridgeToObjCExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BridgeToObjCExpr.qll index da3cf85dc97..47288934993 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BridgeToObjCExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BridgeToObjCExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class BridgeToObjCExprBase extends @bridge_to_obj_c_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "BridgeToObjCExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/BuiltinLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/BuiltinLiteralExpr.qll index 73d2f125b66..b4a6f47e2fc 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/BuiltinLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/BuiltinLiteralExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LiteralExpr -class BuiltinLiteralExprBase extends @builtin_literal_expr, LiteralExpr { } +class BuiltinLiteralExprBase extends @builtin_literal_expr, LiteralExpr { + cached + override Element getAChild() { + none() or + result = LiteralExpr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/CallExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CallExpr.qll index 55dd803ce7d..744b4da7cf5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CallExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CallExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ApplyExpr class CallExprBase extends @call_expr, ApplyExpr { override string getAPrimaryQlClass() { result = "CallExpr" } + + cached + override Element getAChild() { + none() or + result = ApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/CaptureListExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CaptureListExpr.qll index 5e273ab1e4c..2a1e69b6438 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CaptureListExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CaptureListExpr.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ClosureExpr import codeql.swift.elements.expr.Expr import codeql.swift.elements.decl.PatternBindingDecl @@ -6,6 +7,14 @@ import codeql.swift.elements.decl.PatternBindingDecl class CaptureListExprBase extends @capture_list_expr, Expr { override string getAPrimaryQlClass() { result = "CaptureListExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getBindingDecl(_) or + result = getClosureBody() + } + PatternBindingDecl getBindingDecl(int index) { exists(PatternBindingDecl x | capture_list_expr_binding_decls(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/CheckedCastExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CheckedCastExpr.qll index 9ba4677ff44..ef58164ebce 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CheckedCastExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CheckedCastExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ExplicitCastExpr -class CheckedCastExprBase extends @checked_cast_expr, ExplicitCastExpr { } +class CheckedCastExprBase extends @checked_cast_expr, ExplicitCastExpr { + cached + override Element getAChild() { + none() or + result = ExplicitCastExpr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/ClassMetatypeToObjectExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ClassMetatypeToObjectExpr.qll index aaae45957cf..b459e30681a 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ClassMetatypeToObjectExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ClassMetatypeToObjectExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ClassMetatypeToObjectExprBase extends @class_metatype_to_object_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ClassMetatypeToObjectExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ClosureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ClosureExpr.qll index e1c1261654c..b970c6145ef 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ClosureExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ClosureExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.AbstractClosureExpr import codeql.swift.elements.stmt.BraceStmt class ClosureExprBase extends @closure_expr, AbstractClosureExpr { override string getAPrimaryQlClass() { result = "ClosureExpr" } + cached + override Element getAChild() { + none() or + result = AbstractClosureExpr.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | closure_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/CodeCompletionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CodeCompletionExpr.qll index 853f721ebb9..419a4b909d6 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CodeCompletionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CodeCompletionExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class CodeCompletionExprBase extends @code_completion_expr, Expr { override string getAPrimaryQlClass() { result = "CodeCompletionExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/CoerceExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CoerceExpr.qll index b11218595cb..e07814ac2fc 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CoerceExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CoerceExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ExplicitCastExpr class CoerceExprBase extends @coerce_expr, ExplicitCastExpr { override string getAPrimaryQlClass() { result = "CoerceExpr" } + + cached + override Element getAChild() { + none() or + result = ExplicitCastExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/CollectionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CollectionExpr.qll index 2babcfc8fb3..53a67de3d95 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CollectionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CollectionExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr -class CollectionExprBase extends @collection_expr, Expr { } +class CollectionExprBase extends @collection_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/CollectionUpcastConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CollectionUpcastConversionExpr.qll index 92dab3f54e0..eb0490c1e3c 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CollectionUpcastConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CollectionUpcastConversionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class CollectionUpcastConversionExprBase extends @collection_upcast_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "CollectionUpcastConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ConditionalBridgeFromObjCExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ConditionalBridgeFromObjCExpr.qll index 20a192b6c03..f0f59b52937 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ConditionalBridgeFromObjCExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ConditionalBridgeFromObjCExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ConditionalBridgeFromObjCExprBase extends @conditional_bridge_from_obj_c_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ConditionalBridgeFromObjCExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ConditionalCheckedCastExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ConditionalCheckedCastExpr.qll index d38199d4275..fd4fb2e0a5d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ConditionalCheckedCastExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ConditionalCheckedCastExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.CheckedCastExpr class ConditionalCheckedCastExprBase extends @conditional_checked_cast_expr, CheckedCastExpr { override string getAPrimaryQlClass() { result = "ConditionalCheckedCastExpr" } + + cached + override Element getAChild() { + none() or + result = CheckedCastExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ConstructorRefCallExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ConstructorRefCallExpr.qll index 6d379b8576b..ec6b20a1351 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ConstructorRefCallExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ConstructorRefCallExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.SelfApplyExpr class ConstructorRefCallExprBase extends @constructor_ref_call_expr, SelfApplyExpr { override string getAPrimaryQlClass() { result = "ConstructorRefCallExpr" } + + cached + override Element getAChild() { + none() or + result = SelfApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll index 56837b28e22..0818fc2b7e9 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CovariantFunctionConversionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class CovariantFunctionConversionExprBase extends @covariant_function_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "CovariantFunctionConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll index 1df6850ead7..c6216f0c50e 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/CovariantReturnConversionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class CovariantReturnConversionExprBase extends @covariant_return_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "CovariantReturnConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DeclRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DeclRefExpr.qll index bee60c864a9..cf1a301d1bd 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DeclRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DeclRefExpr.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.expr.Expr import codeql.swift.elements.type.Type @@ -6,6 +7,12 @@ import codeql.swift.elements.type.Type class DeclRefExprBase extends @decl_ref_expr, Expr { override string getAPrimaryQlClass() { result = "DeclRefExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } + Decl getDecl() { exists(Decl x | decl_ref_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll index e959c9c4a44..8f4d048212f 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DefaultArgumentExpr.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.decl.ParamDecl class DefaultArgumentExprBase extends @default_argument_expr, Expr { override string getAPrimaryQlClass() { result = "DefaultArgumentExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } + ParamDecl getParamDecl() { exists(ParamDecl x | default_argument_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll index 96ab92b74a9..a9e94dba54d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DerivedToBaseExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class DerivedToBaseExprBase extends @derived_to_base_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "DerivedToBaseExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DestructureTupleExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DestructureTupleExpr.qll index e21812e0c3d..83c633df73c 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DestructureTupleExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DestructureTupleExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class DestructureTupleExprBase extends @destructure_tuple_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "DestructureTupleExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DictionaryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DictionaryExpr.qll index 1daef547291..89d2ac6cbaf 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DictionaryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DictionaryExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.CollectionExpr import codeql.swift.elements.expr.Expr class DictionaryExprBase extends @dictionary_expr, CollectionExpr { override string getAPrimaryQlClass() { result = "DictionaryExpr" } + cached + override Element getAChild() { + none() or + result = CollectionExpr.super.getAChild() or + result = getElement(_) + } + Expr getElement(int index) { exists(Expr x | dictionary_expr_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExpr.qll index 1b27a3888be..e059d51a526 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class DifferentiableFunctionExprBase extends @differentiable_function_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "DifferentiableFunctionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExtractOriginalExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExtractOriginalExpr.qll index 039056df150..3a64dd62424 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExtractOriginalExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DifferentiableFunctionExtractOriginalExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class DifferentiableFunctionExtractOriginalExprBase extends @differentiable_function_extract_original_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "DifferentiableFunctionExtractOriginalExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DiscardAssignmentExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DiscardAssignmentExpr.qll index 3e1971fbc61..a849fb7c3e7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DiscardAssignmentExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DiscardAssignmentExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class DiscardAssignmentExprBase extends @discard_assignment_expr, Expr { override string getAPrimaryQlClass() { result = "DiscardAssignmentExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DotSelfExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DotSelfExpr.qll index 4c93babb697..949f774e1cf 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DotSelfExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DotSelfExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.IdentityExpr class DotSelfExprBase extends @dot_self_expr, IdentityExpr { override string getAPrimaryQlClass() { result = "DotSelfExpr" } + + cached + override Element getAChild() { + none() or + result = IdentityExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxBaseIgnoredExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxBaseIgnoredExpr.qll index bf5f76b3229..ef9a00b70de 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxBaseIgnoredExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxBaseIgnoredExpr.qll @@ -1,9 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class DotSyntaxBaseIgnoredExprBase extends @dot_syntax_base_ignored_expr, Expr { override string getAPrimaryQlClass() { result = "DotSyntaxBaseIgnoredExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getQualifier() or + result = getSubExpr() + } + Expr getQualifier() { exists(Expr x | dot_syntax_base_ignored_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxCallExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxCallExpr.qll index c026f329bce..119d4a9d4fb 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxCallExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DotSyntaxCallExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.SelfApplyExpr class DotSyntaxCallExprBase extends @dot_syntax_call_expr, SelfApplyExpr { override string getAPrimaryQlClass() { result = "DotSyntaxCallExpr" } + + cached + override Element getAChild() { + none() or + result = SelfApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DynamicLookupExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DynamicLookupExpr.qll index 8ca09d05317..435f8f49235 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DynamicLookupExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DynamicLookupExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LookupExpr -class DynamicLookupExprBase extends @dynamic_lookup_expr, LookupExpr { } +class DynamicLookupExprBase extends @dynamic_lookup_expr, LookupExpr { + cached + override Element getAChild() { + none() or + result = LookupExpr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/DynamicMemberRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DynamicMemberRefExpr.qll index fd4291b5ee0..1307d380c3c 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DynamicMemberRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DynamicMemberRefExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.DynamicLookupExpr class DynamicMemberRefExprBase extends @dynamic_member_ref_expr, DynamicLookupExpr { override string getAPrimaryQlClass() { result = "DynamicMemberRefExpr" } + + cached + override Element getAChild() { + none() or + result = DynamicLookupExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DynamicSubscriptExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DynamicSubscriptExpr.qll index a920f1b4329..fc566a6d050 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DynamicSubscriptExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DynamicSubscriptExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.DynamicLookupExpr class DynamicSubscriptExprBase extends @dynamic_subscript_expr, DynamicLookupExpr { override string getAPrimaryQlClass() { result = "DynamicSubscriptExpr" } + + cached + override Element getAChild() { + none() or + result = DynamicLookupExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/DynamicTypeExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/DynamicTypeExpr.qll index c43659d6dd1..70248bfa9b7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/DynamicTypeExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/DynamicTypeExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class DynamicTypeExprBase extends @dynamic_type_expr, Expr { override string getAPrimaryQlClass() { result = "DynamicTypeExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getBaseExpr() + } + Expr getBaseExpr() { exists(Expr x | dynamic_type_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/EditorPlaceholderExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/EditorPlaceholderExpr.qll index ce5397171b7..e4c2b955865 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/EditorPlaceholderExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/EditorPlaceholderExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class EditorPlaceholderExprBase extends @editor_placeholder_expr, Expr { override string getAPrimaryQlClass() { result = "EditorPlaceholderExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/EnumIsCaseExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/EnumIsCaseExpr.qll index e02b97813a4..331f0b7a9be 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/EnumIsCaseExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/EnumIsCaseExpr.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.EnumElementDecl import codeql.swift.elements.expr.Expr import codeql.swift.elements.typerepr.TypeRepr @@ -6,6 +7,15 @@ import codeql.swift.elements.typerepr.TypeRepr class EnumIsCaseExprBase extends @enum_is_case_expr, Expr { override string getAPrimaryQlClass() { result = "EnumIsCaseExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() or + result = getTypeRepr() or + result = getElement() + } + Expr getSubExpr() { exists(Expr x | enum_is_case_exprs(this, x, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ErasureExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ErasureExpr.qll index 9e3a585d8e7..c0b50f955b6 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ErasureExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ErasureExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ErasureExprBase extends @erasure_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ErasureExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ErrorExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ErrorExpr.qll index 224560ba9a6..d33c0f1e0bd 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ErrorExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ErrorExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ErrorExprBase extends @error_expr, Expr { override string getAPrimaryQlClass() { result = "ErrorExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll index 065a08ad391..6c1a1bc41d4 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ExistentialMetatypeToObjectExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ExistentialMetatypeToObjectExprBase extends @existential_metatype_to_object_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ExistentialMetatypeToObjectExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ExplicitCastExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ExplicitCastExpr.qll index 305be5338a0..a87e68c80e8 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ExplicitCastExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ExplicitCastExpr.qll @@ -1,7 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ExplicitCastExprBase extends @explicit_cast_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | explicit_cast_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/Expr.qll b/swift/ql/lib/codeql/swift/generated/expr/Expr.qll index 281d30988a9..a33c0ffc666 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/Expr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/Expr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode import codeql.swift.elements.type.Type class ExprBase extends @expr, AstNode { + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() + } + Type getType() { exists(Type x | expr_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/FloatLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/FloatLiteralExpr.qll index 984819e59aa..96439582ef2 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/FloatLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/FloatLiteralExpr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.NumberLiteralExpr class FloatLiteralExprBase extends @float_literal_expr, NumberLiteralExpr { override string getAPrimaryQlClass() { result = "FloatLiteralExpr" } + cached + override Element getAChild() { + none() or + result = NumberLiteralExpr.super.getAChild() + } + string getStringValue() { float_literal_exprs(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ForceTryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ForceTryExpr.qll index 79596be65fa..1faafcc64f4 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ForceTryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ForceTryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.AnyTryExpr class ForceTryExprBase extends @force_try_expr, AnyTryExpr { override string getAPrimaryQlClass() { result = "ForceTryExpr" } + + cached + override Element getAChild() { + none() or + result = AnyTryExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ForceValueExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ForceValueExpr.qll index 224dc78316e..257f4a8a0ac 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ForceValueExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ForceValueExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ForceValueExprBase extends @force_value_expr, Expr { override string getAPrimaryQlClass() { result = "ForceValueExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | force_value_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ForcedCheckedCastExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ForcedCheckedCastExpr.qll index 0f1a2e44637..a748359ff34 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ForcedCheckedCastExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ForcedCheckedCastExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.CheckedCastExpr class ForcedCheckedCastExprBase extends @forced_checked_cast_expr, CheckedCastExpr { override string getAPrimaryQlClass() { result = "ForcedCheckedCastExpr" } + + cached + override Element getAChild() { + none() or + result = CheckedCastExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ForeignObjectConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ForeignObjectConversionExpr.qll index ab40420b67b..6d1efb241ad 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ForeignObjectConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ForeignObjectConversionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ForeignObjectConversionExprBase extends @foreign_object_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ForeignObjectConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/FunctionConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/FunctionConversionExpr.qll index c6e771f3f11..08d953b04d1 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/FunctionConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/FunctionConversionExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class FunctionConversionExprBase extends @function_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "FunctionConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/IdentityExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/IdentityExpr.qll index 4047ebfde78..9a608760191 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/IdentityExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/IdentityExpr.qll @@ -1,7 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class IdentityExprBase extends @identity_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | identity_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/IfExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/IfExpr.qll index b1ec1a192f7..1354c6784da 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/IfExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/IfExpr.qll @@ -1,9 +1,19 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class IfExprBase extends @if_expr, Expr { override string getAPrimaryQlClass() { result = "IfExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getCondition() or + result = getThenExpr() or + result = getElseExpr() + } + Expr getCondition() { exists(Expr x | if_exprs(this, x, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ImplicitConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ImplicitConversionExpr.qll index 75d4a9337fa..9dbb75cd9c6 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ImplicitConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ImplicitConversionExpr.qll @@ -1,7 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class ImplicitConversionExprBase extends @implicit_conversion_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | implicit_conversion_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/InOutExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/InOutExpr.qll index 43da09784ae..fa9490979a9 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/InOutExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/InOutExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class InOutExprBase extends @in_out_expr, Expr { override string getAPrimaryQlClass() { result = "InOutExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | in_out_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/InOutToPointerExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/InOutToPointerExpr.qll index d158c645de4..55ae08eeb8b 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/InOutToPointerExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/InOutToPointerExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class InOutToPointerExprBase extends @in_out_to_pointer_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "InOutToPointerExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/InjectIntoOptionalExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/InjectIntoOptionalExpr.qll index cedf59de7bf..0541f3fd3d5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/InjectIntoOptionalExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/InjectIntoOptionalExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class InjectIntoOptionalExprBase extends @inject_into_optional_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "InjectIntoOptionalExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/IntegerLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/IntegerLiteralExpr.qll index dcd8f4b97a5..4ee2b7e02fa 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/IntegerLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/IntegerLiteralExpr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.NumberLiteralExpr class IntegerLiteralExprBase extends @integer_literal_expr, NumberLiteralExpr { override string getAPrimaryQlClass() { result = "IntegerLiteralExpr" } + cached + override Element getAChild() { + none() or + result = NumberLiteralExpr.super.getAChild() + } + string getStringValue() { integer_literal_exprs(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/InterpolatedStringLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/InterpolatedStringLiteralExpr.qll index 72f0fdac418..97dd92bce01 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/InterpolatedStringLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/InterpolatedStringLiteralExpr.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.expr.LiteralExpr import codeql.swift.elements.expr.OpaqueValueExpr @@ -7,6 +8,15 @@ import codeql.swift.elements.expr.TapExpr class InterpolatedStringLiteralExprBase extends @interpolated_string_literal_expr, LiteralExpr { override string getAPrimaryQlClass() { result = "InterpolatedStringLiteralExpr" } + cached + override Element getAChild() { + none() or + result = LiteralExpr.super.getAChild() or + result = getInterpolationCountExpr() or + result = getLiteralCapacityExpr() or + result = getAppendingExpr() + } + OpaqueValueExpr getInterpolationExpr() { exists(OpaqueValueExpr x | interpolated_string_literal_expr_interpolation_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/IsExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/IsExpr.qll index 45ddca73d8e..aa061abb66f 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/IsExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/IsExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.CheckedCastExpr class IsExprBase extends @is_expr, CheckedCastExpr { override string getAPrimaryQlClass() { result = "IsExpr" } + + cached + override Element getAChild() { + none() or + result = CheckedCastExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/KeyPathApplicationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/KeyPathApplicationExpr.qll index 900145c26bd..0287bb212d5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/KeyPathApplicationExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/KeyPathApplicationExpr.qll @@ -1,9 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class KeyPathApplicationExprBase extends @key_path_application_expr, Expr { override string getAPrimaryQlClass() { result = "KeyPathApplicationExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getBase() or + result = getKeyPath() + } + Expr getBase() { exists(Expr x | key_path_application_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/KeyPathDotExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/KeyPathDotExpr.qll index fbd58631fd4..4c8f69552f7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/KeyPathDotExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/KeyPathDotExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class KeyPathDotExprBase extends @key_path_dot_expr, Expr { override string getAPrimaryQlClass() { result = "KeyPathDotExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/KeyPathExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/KeyPathExpr.qll index 7ac3d4614f0..6d2b8ac3e26 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/KeyPathExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/KeyPathExpr.qll @@ -1,9 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class KeyPathExprBase extends @key_path_expr, Expr { override string getAPrimaryQlClass() { result = "KeyPathExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getParsedRoot() or + result = getParsedPath() + } + Expr getParsedRoot() { exists(Expr x | key_path_expr_parsed_roots(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/LazyInitializerExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LazyInitializerExpr.qll index b38aa2ebd5a..64302ced900 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LazyInitializerExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LazyInitializerExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class LazyInitializerExprBase extends @lazy_initializer_expr, Expr { override string getAPrimaryQlClass() { result = "LazyInitializerExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | lazy_initializer_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExpr.qll index 144278727be..6d2f49b8a2c 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class LinearFunctionExprBase extends @linear_function_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "LinearFunctionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExtractOriginalExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExtractOriginalExpr.qll index e03586daacc..24bacdc7afb 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExtractOriginalExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LinearFunctionExtractOriginalExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class LinearFunctionExtractOriginalExprBase extends @linear_function_extract_original_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "LinearFunctionExtractOriginalExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/LinearToDifferentiableFunctionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LinearToDifferentiableFunctionExpr.qll index e3bd9ae91b9..2ebc140b2b5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LinearToDifferentiableFunctionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LinearToDifferentiableFunctionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class LinearToDifferentiableFunctionExprBase extends @linear_to_differentiable_function_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "LinearToDifferentiableFunctionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/LiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LiteralExpr.qll index 65305e00a6e..aee8eb2deea 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LiteralExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr -class LiteralExprBase extends @literal_expr, Expr { } +class LiteralExprBase extends @literal_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/LoadExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LoadExpr.qll index 89466753b9a..dd4d843cdbc 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LoadExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LoadExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class LoadExprBase extends @load_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "LoadExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/LookupExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/LookupExpr.qll index c9defb9c0b0..cc4e92b8bc2 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/LookupExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/LookupExpr.qll @@ -1,8 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.expr.Expr class LookupExprBase extends @lookup_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getBaseExpr() + } + Expr getBaseExpr() { exists(Expr x | lookup_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/MagicIdentifierLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/MagicIdentifierLiteralExpr.qll index 075cb1f955a..317e55d64e7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/MagicIdentifierLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/MagicIdentifierLiteralExpr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.BuiltinLiteralExpr class MagicIdentifierLiteralExprBase extends @magic_identifier_literal_expr, BuiltinLiteralExpr { override string getAPrimaryQlClass() { result = "MagicIdentifierLiteralExpr" } + cached + override Element getAChild() { + none() or + result = BuiltinLiteralExpr.super.getAChild() + } + string getKind() { magic_identifier_literal_exprs(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/MakeTemporarilyEscapableExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/MakeTemporarilyEscapableExpr.qll index 5fe0c7c829d..bffcf5c66e0 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/MakeTemporarilyEscapableExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/MakeTemporarilyEscapableExpr.qll @@ -1,10 +1,20 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.expr.OpaqueValueExpr class MakeTemporarilyEscapableExprBase extends @make_temporarily_escapable_expr, Expr { override string getAPrimaryQlClass() { result = "MakeTemporarilyEscapableExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getEscapingClosure() or + result = getNonescapingClosure() or + result = getSubExpr() + } + OpaqueValueExpr getEscapingClosure() { exists(OpaqueValueExpr x | make_temporarily_escapable_exprs(this, x, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/MemberRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/MemberRefExpr.qll index 52890d6ce69..dc28b2c17cc 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/MemberRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/MemberRefExpr.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LookupExpr class MemberRefExprBase extends @member_ref_expr, LookupExpr { override string getAPrimaryQlClass() { result = "MemberRefExpr" } + cached + override Element getAChild() { + none() or + result = LookupExpr.super.getAChild() + } + predicate hasDirectToStorageSemantics() { member_ref_expr_has_direct_to_storage_semantics(this) } predicate hasDirectToImplementationSemantics() { diff --git a/swift/ql/lib/codeql/swift/generated/expr/MetatypeConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/MetatypeConversionExpr.qll index 876074af22e..11a22b65bfa 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/MetatypeConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/MetatypeConversionExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class MetatypeConversionExprBase extends @metatype_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "MetatypeConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/NilLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/NilLiteralExpr.qll index a0c78e7e567..43f9b71bc98 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/NilLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/NilLiteralExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LiteralExpr class NilLiteralExprBase extends @nil_literal_expr, LiteralExpr { override string getAPrimaryQlClass() { result = "NilLiteralExpr" } + + cached + override Element getAChild() { + none() or + result = LiteralExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/NumberLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/NumberLiteralExpr.qll index 102e11eab2c..20d6ac00141 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/NumberLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/NumberLiteralExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.BuiltinLiteralExpr -class NumberLiteralExprBase extends @number_literal_expr, BuiltinLiteralExpr { } +class NumberLiteralExprBase extends @number_literal_expr, BuiltinLiteralExpr { + cached + override Element getAChild() { + none() or + result = BuiltinLiteralExpr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/ObjCSelectorExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ObjCSelectorExpr.qll index 9853878d1a2..f14861d698d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ObjCSelectorExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ObjCSelectorExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AbstractFunctionDecl import codeql.swift.elements.expr.Expr class ObjCSelectorExprBase extends @obj_c_selector_expr, Expr { override string getAPrimaryQlClass() { result = "ObjCSelectorExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | obj_c_selector_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/ObjectLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ObjectLiteralExpr.qll index 247c2cc3cf9..4a517befeff 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ObjectLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ObjectLiteralExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LiteralExpr class ObjectLiteralExprBase extends @object_literal_expr, LiteralExpr { override string getAPrimaryQlClass() { result = "ObjectLiteralExpr" } + + cached + override Element getAChild() { + none() or + result = LiteralExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/OneWayExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OneWayExpr.qll index 4bebba18f26..da7389a3fc7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OneWayExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OneWayExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class OneWayExprBase extends @one_way_expr, Expr { override string getAPrimaryQlClass() { result = "OneWayExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | one_way_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/OpaqueValueExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OpaqueValueExpr.qll index d88483fe6ab..33869284bad 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OpaqueValueExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OpaqueValueExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class OpaqueValueExprBase extends @opaque_value_expr, Expr { override string getAPrimaryQlClass() { result = "OpaqueValueExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/OpenExistentialExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OpenExistentialExpr.qll index 5ee0583013d..4777089dacd 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OpenExistentialExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OpenExistentialExpr.qll @@ -1,10 +1,20 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.expr.OpaqueValueExpr class OpenExistentialExprBase extends @open_existential_expr, Expr { override string getAPrimaryQlClass() { result = "OpenExistentialExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() or + result = getExistential() or + result = getOpaqueExpr() + } + Expr getSubExpr() { exists(Expr x | open_existential_exprs(this, x, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/OptionalEvaluationExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OptionalEvaluationExpr.qll index a4ae044d1a4..3b68ca5eef4 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OptionalEvaluationExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OptionalEvaluationExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class OptionalEvaluationExprBase extends @optional_evaluation_expr, Expr { override string getAPrimaryQlClass() { result = "OptionalEvaluationExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | optional_evaluation_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/OptionalTryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OptionalTryExpr.qll index fa11ff63a72..0c522415f17 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OptionalTryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OptionalTryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.AnyTryExpr class OptionalTryExprBase extends @optional_try_expr, AnyTryExpr { override string getAPrimaryQlClass() { result = "OptionalTryExpr" } + + cached + override Element getAChild() { + none() or + result = AnyTryExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/OtherConstructorDeclRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OtherConstructorDeclRefExpr.qll index 7d139c9b616..42f34223f2a 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OtherConstructorDeclRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OtherConstructorDeclRefExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class OtherConstructorDeclRefExprBase extends @other_constructor_decl_ref_expr, Expr { override string getAPrimaryQlClass() { result = "OtherConstructorDeclRefExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/OverloadSetRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OverloadSetRefExpr.qll index a575fe6bd32..6d11d901664 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OverloadSetRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OverloadSetRefExpr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr -class OverloadSetRefExprBase extends @overload_set_ref_expr, Expr { } +class OverloadSetRefExprBase extends @overload_set_ref_expr, Expr { + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/expr/OverloadedDeclRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/OverloadedDeclRefExpr.qll index 96904abb628..471cc70c147 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/OverloadedDeclRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/OverloadedDeclRefExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.OverloadSetRefExpr class OverloadedDeclRefExprBase extends @overloaded_decl_ref_expr, OverloadSetRefExpr { override string getAPrimaryQlClass() { result = "OverloadedDeclRefExpr" } + + cached + override Element getAChild() { + none() or + result = OverloadSetRefExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ParenExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ParenExpr.qll index c8e92eeea24..66fdb2d48db 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ParenExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ParenExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.IdentityExpr class ParenExprBase extends @paren_expr, IdentityExpr { override string getAPrimaryQlClass() { result = "ParenExpr" } + + cached + override Element getAChild() { + none() or + result = IdentityExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/PointerToPointerExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/PointerToPointerExpr.qll index dc81ee62119..20a44edca2e 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/PointerToPointerExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/PointerToPointerExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class PointerToPointerExprBase extends @pointer_to_pointer_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "PointerToPointerExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/PostfixUnaryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/PostfixUnaryExpr.qll index 4e3ffb93560..2b546426dfb 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/PostfixUnaryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/PostfixUnaryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ApplyExpr class PostfixUnaryExprBase extends @postfix_unary_expr, ApplyExpr { override string getAPrimaryQlClass() { result = "PostfixUnaryExpr" } + + cached + override Element getAChild() { + none() or + result = ApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/PrefixUnaryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/PrefixUnaryExpr.qll index fcc0f15e3bd..c3c19d66e29 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/PrefixUnaryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/PrefixUnaryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ApplyExpr class PrefixUnaryExprBase extends @prefix_unary_expr, ApplyExpr { override string getAPrimaryQlClass() { result = "PrefixUnaryExpr" } + + cached + override Element getAChild() { + none() or + result = ApplyExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/PropertyWrapperValuePlaceholderExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/PropertyWrapperValuePlaceholderExpr.qll index 786cca40bca..7c2f1d91685 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/PropertyWrapperValuePlaceholderExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/PropertyWrapperValuePlaceholderExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class PropertyWrapperValuePlaceholderExprBase extends @property_wrapper_value_placeholder_expr, Expr { override string getAPrimaryQlClass() { result = "PropertyWrapperValuePlaceholderExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/ProtocolMetatypeToObjectExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/ProtocolMetatypeToObjectExpr.qll index d09c67d83b3..edf73c1cfb9 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/ProtocolMetatypeToObjectExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/ProtocolMetatypeToObjectExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class ProtocolMetatypeToObjectExprBase extends @protocol_metatype_to_object_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "ProtocolMetatypeToObjectExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/RebindSelfInConstructorExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/RebindSelfInConstructorExpr.qll index 101a8c73b09..bc3b3828486 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/RebindSelfInConstructorExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/RebindSelfInConstructorExpr.qll @@ -1,10 +1,19 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.decl.VarDecl class RebindSelfInConstructorExprBase extends @rebind_self_in_constructor_expr, Expr { override string getAPrimaryQlClass() { result = "RebindSelfInConstructorExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() or + result = getSelf() + } + Expr getSubExpr() { exists(Expr x | rebind_self_in_constructor_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/RegexLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/RegexLiteralExpr.qll index ce4df9d13cb..6e48bc867fc 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/RegexLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/RegexLiteralExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.LiteralExpr class RegexLiteralExprBase extends @regex_literal_expr, LiteralExpr { override string getAPrimaryQlClass() { result = "RegexLiteralExpr" } + + cached + override Element getAChild() { + none() or + result = LiteralExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/SelfApplyExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/SelfApplyExpr.qll index daa78c89a7e..68d20b8bf76 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/SelfApplyExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/SelfApplyExpr.qll @@ -1,8 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ApplyExpr import codeql.swift.elements.expr.Expr class SelfApplyExprBase extends @self_apply_expr, ApplyExpr { + cached + override Element getAChild() { + none() or + result = ApplyExpr.super.getAChild() or + result = getBaseExpr() + } + Expr getBaseExpr() { exists(Expr x | self_apply_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/SequenceExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/SequenceExpr.qll index 0361c393a72..9499f6561c5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/SequenceExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/SequenceExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class SequenceExprBase extends @sequence_expr, Expr { override string getAPrimaryQlClass() { result = "SequenceExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/StringLiteralExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/StringLiteralExpr.qll index bb8e4174ad7..2b6d51f2e9b 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/StringLiteralExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/StringLiteralExpr.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.BuiltinLiteralExpr class StringLiteralExprBase extends @string_literal_expr, BuiltinLiteralExpr { override string getAPrimaryQlClass() { result = "StringLiteralExpr" } + cached + override Element getAChild() { + none() or + result = BuiltinLiteralExpr.super.getAChild() + } + string getValue() { string_literal_exprs(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/StringToPointerExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/StringToPointerExpr.qll index ec679e974fb..51ac4e7c2f7 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/StringToPointerExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/StringToPointerExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class StringToPointerExprBase extends @string_to_pointer_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "StringToPointerExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/SubscriptExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/SubscriptExpr.qll index 9fa8f875664..96a440daf1c 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/SubscriptExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/SubscriptExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Argument import codeql.swift.elements.expr.LookupExpr class SubscriptExprBase extends @subscript_expr, LookupExpr { override string getAPrimaryQlClass() { result = "SubscriptExpr" } + cached + override Element getAChild() { + none() or + result = LookupExpr.super.getAChild() or + result = getArgument(_) + } + Argument getArgument(int index) { exists(Argument x | subscript_expr_arguments(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/SuperRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/SuperRefExpr.qll index 3513af5c0d7..45b91b55698 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/SuperRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/SuperRefExpr.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.decl.VarDecl class SuperRefExprBase extends @super_ref_expr, Expr { override string getAPrimaryQlClass() { result = "SuperRefExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } + VarDecl getSelf() { exists(VarDecl x | super_ref_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/TapExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/TapExpr.qll index a61533704e6..cec8f59f38d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/TapExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/TapExpr.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.expr.Expr import codeql.swift.elements.decl.VarDecl @@ -6,6 +7,14 @@ import codeql.swift.elements.decl.VarDecl class TapExprBase extends @tap_expr, Expr { override string getAPrimaryQlClass() { result = "TapExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() or + result = getBody() + } + Expr getSubExpr() { exists(Expr x | tap_expr_sub_exprs(this, x) and @@ -15,15 +24,15 @@ class TapExprBase extends @tap_expr, Expr { predicate hasSubExpr() { exists(getSubExpr()) } - VarDecl getVar() { - exists(VarDecl x | + BraceStmt getBody() { + exists(BraceStmt x | tap_exprs(this, x, _) and result = x.resolve() ) } - BraceStmt getBody() { - exists(BraceStmt x | + VarDecl getVar() { + exists(VarDecl x | tap_exprs(this, _, x) and result = x.resolve() ) diff --git a/swift/ql/lib/codeql/swift/generated/expr/TryExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/TryExpr.qll index 2e14a85bd16..95c6ad9fdfd 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/TryExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/TryExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.AnyTryExpr class TryExprBase extends @try_expr, AnyTryExpr { override string getAPrimaryQlClass() { result = "TryExpr" } + + cached + override Element getAChild() { + none() or + result = AnyTryExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/TupleElementExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/TupleElementExpr.qll index 4281d8d875c..5ac03deb083 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/TupleElementExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/TupleElementExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class TupleElementExprBase extends @tuple_element_expr, Expr { override string getAPrimaryQlClass() { result = "TupleElementExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | tuple_element_exprs(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/TupleExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/TupleExpr.qll index b985d64d111..1f8de09f349 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/TupleExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/TupleExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class TupleExprBase extends @tuple_expr, Expr { override string getAPrimaryQlClass() { result = "TupleExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getElement(_) + } + Expr getElement(int index) { exists(Expr x | tuple_expr_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/TypeExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/TypeExpr.qll index 8b9e238b3ca..80b0ddb6a27 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/TypeExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/TypeExpr.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.typerepr.TypeRepr class TypeExprBase extends @type_expr, Expr { override string getAPrimaryQlClass() { result = "TypeExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getTypeRepr() + } + TypeRepr getTypeRepr() { exists(TypeRepr x | type_expr_type_reprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll index 314b404b11b..24499dd2cb1 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnderlyingToOpaqueExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class UnderlyingToOpaqueExprBase extends @underlying_to_opaque_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "UnderlyingToOpaqueExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll index 659f52e3fe2..7254c0a7389 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnevaluatedInstanceExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class UnevaluatedInstanceExprBase extends @unevaluated_instance_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "UnevaluatedInstanceExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll index d30ac8d5d10..d3de0468e9d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDeclRefExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class UnresolvedDeclRefExprBase extends @unresolved_decl_ref_expr, Expr { override string getAPrimaryQlClass() { result = "UnresolvedDeclRefExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll index 4aa821a1476..db219388e7d 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedDotExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class UnresolvedDotExprBase extends @unresolved_dot_expr, Expr { override string getAPrimaryQlClass() { result = "UnresolvedDotExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll index fde8b29000e..78e476a9ea5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberChainResultExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.IdentityExpr class UnresolvedMemberChainResultExprBase extends @unresolved_member_chain_result_expr, IdentityExpr { override string getAPrimaryQlClass() { result = "UnresolvedMemberChainResultExpr" } + + cached + override Element getAChild() { + none() or + result = IdentityExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberExpr.qll index 5cb908bdd18..b28fd72495e 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedMemberExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class UnresolvedMemberExprBase extends @unresolved_member_expr, Expr { override string getAPrimaryQlClass() { result = "UnresolvedMemberExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedPatternExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedPatternExpr.qll index 8d03b2079aa..1d80027eef2 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedPatternExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedPatternExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class UnresolvedPatternExprBase extends @unresolved_pattern_expr, Expr { override string getAPrimaryQlClass() { result = "UnresolvedPatternExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedSpecializeExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedSpecializeExpr.qll index 6109728e089..4a5fdac8f7b 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedSpecializeExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedSpecializeExpr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class UnresolvedSpecializeExprBase extends @unresolved_specialize_expr, Expr { override string getAPrimaryQlClass() { result = "UnresolvedSpecializeExpr" } + + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedTypeConversionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedTypeConversionExpr.qll index fb4f5259c0a..a041e18adc5 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/UnresolvedTypeConversionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/UnresolvedTypeConversionExpr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.ImplicitConversionExpr class UnresolvedTypeConversionExprBase extends @unresolved_type_conversion_expr, ImplicitConversionExpr { override string getAPrimaryQlClass() { result = "UnresolvedTypeConversionExpr" } + + cached + override Element getAChild() { + none() or + result = ImplicitConversionExpr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/expr/VarargExpansionExpr.qll b/swift/ql/lib/codeql/swift/generated/expr/VarargExpansionExpr.qll index b72261cf82f..7ec9a76b9f2 100644 --- a/swift/ql/lib/codeql/swift/generated/expr/VarargExpansionExpr.qll +++ b/swift/ql/lib/codeql/swift/generated/expr/VarargExpansionExpr.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr class VarargExpansionExprBase extends @vararg_expansion_expr, Expr { override string getAPrimaryQlClass() { result = "VarargExpansionExpr" } + cached + override Element getAChild() { + none() or + result = Expr.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | vararg_expansion_exprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/AnyPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/AnyPattern.qll index d4349ccaa7e..5bcc94af8a9 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/AnyPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/AnyPattern.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class AnyPatternBase extends @any_pattern, Pattern { override string getAPrimaryQlClass() { result = "AnyPattern" } + + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/pattern/BindingPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/BindingPattern.qll index 0303ddab467..838df6e2d7b 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/BindingPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/BindingPattern.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class BindingPatternBase extends @binding_pattern, Pattern { override string getAPrimaryQlClass() { result = "BindingPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubPattern() + } + Pattern getSubPattern() { exists(Pattern x | binding_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/BoolPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/BoolPattern.qll index 2890e662e28..49385700bdd 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/BoolPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/BoolPattern.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class BoolPatternBase extends @bool_pattern, Pattern { override string getAPrimaryQlClass() { result = "BoolPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() + } + boolean getValue() { bool_patterns(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/pattern/EnumElementPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/EnumElementPattern.qll index e0df35b15a0..63d46feb84c 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/EnumElementPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/EnumElementPattern.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.EnumElementDecl import codeql.swift.elements.pattern.Pattern class EnumElementPatternBase extends @enum_element_pattern, Pattern { override string getAPrimaryQlClass() { result = "EnumElementPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubPattern() + } + EnumElementDecl getElement() { exists(EnumElementDecl x | enum_element_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/ExprPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/ExprPattern.qll index 75fdb81cad9..012e4bda3b4 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/ExprPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/ExprPattern.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.pattern.Pattern class ExprPatternBase extends @expr_pattern, Pattern { override string getAPrimaryQlClass() { result = "ExprPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | expr_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/IsPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/IsPattern.qll index 8caf5493b36..60388b31a72 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/IsPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/IsPattern.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern import codeql.swift.elements.typerepr.TypeRepr class IsPatternBase extends @is_pattern, Pattern { override string getAPrimaryQlClass() { result = "IsPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() + } + TypeRepr getCastTypeRepr() { exists(TypeRepr x | is_pattern_cast_type_reprs(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/NamedPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/NamedPattern.qll index a3d382fda9e..6eb61483943 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/NamedPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/NamedPattern.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class NamedPatternBase extends @named_pattern, Pattern { override string getAPrimaryQlClass() { result = "NamedPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() + } + string getName() { named_patterns(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/pattern/OptionalSomePattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/OptionalSomePattern.qll index 3517777b9ce..22ab4bd2d61 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/OptionalSomePattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/OptionalSomePattern.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class OptionalSomePatternBase extends @optional_some_pattern, Pattern { override string getAPrimaryQlClass() { result = "OptionalSomePattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubPattern() + } + Pattern getSubPattern() { exists(Pattern x | optional_some_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/ParenPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/ParenPattern.qll index 63d5e2909ec..79310b152f9 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/ParenPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/ParenPattern.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class ParenPatternBase extends @paren_pattern, Pattern { override string getAPrimaryQlClass() { result = "ParenPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubPattern() + } + Pattern getSubPattern() { exists(Pattern x | paren_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/Pattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/Pattern.qll index 2570d212c49..f1a262bbd8d 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/Pattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/Pattern.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode -class PatternBase extends @pattern, AstNode { } +class PatternBase extends @pattern, AstNode { + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/pattern/TuplePattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/TuplePattern.qll index b9eb01c83c9..b533bc5c728 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/TuplePattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/TuplePattern.qll @@ -1,9 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern class TuplePatternBase extends @tuple_pattern, Pattern { override string getAPrimaryQlClass() { result = "TuplePattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getElement(_) + } + Pattern getElement(int index) { exists(Pattern x | tuple_pattern_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/pattern/TypedPattern.qll b/swift/ql/lib/codeql/swift/generated/pattern/TypedPattern.qll index 9a16c9cfe02..01b649628e8 100644 --- a/swift/ql/lib/codeql/swift/generated/pattern/TypedPattern.qll +++ b/swift/ql/lib/codeql/swift/generated/pattern/TypedPattern.qll @@ -1,10 +1,19 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.pattern.Pattern import codeql.swift.elements.typerepr.TypeRepr class TypedPatternBase extends @typed_pattern, Pattern { override string getAPrimaryQlClass() { result = "TypedPattern" } + cached + override Element getAChild() { + none() or + result = Pattern.super.getAChild() or + result = getSubPattern() or + result = getTypeRepr() + } + Pattern getSubPattern() { exists(Pattern x | typed_patterns(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/BraceStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/BraceStmt.qll index 0cb37ff31bf..232dcb79354 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/BraceStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/BraceStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode import codeql.swift.elements.stmt.Stmt class BraceStmtBase extends @brace_stmt, Stmt { override string getAPrimaryQlClass() { result = "BraceStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getElement(_) + } + AstNode getElement(int index) { exists(AstNode x | brace_stmt_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/BreakStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/BreakStmt.qll index 05ba4de8fd3..e6562569e86 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/BreakStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/BreakStmt.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.Stmt class BreakStmtBase extends @break_stmt, Stmt { override string getAPrimaryQlClass() { result = "BreakStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } + string getTargetName() { break_stmt_target_names(this, result) } predicate hasTargetName() { exists(getTargetName()) } diff --git a/swift/ql/lib/codeql/swift/generated/stmt/CaseLabelItem.qll b/swift/ql/lib/codeql/swift/generated/stmt/CaseLabelItem.qll index f4f00f285b0..bc4f9812326 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/CaseLabelItem.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/CaseLabelItem.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode import codeql.swift.elements.expr.Expr import codeql.swift.elements.pattern.Pattern @@ -6,6 +7,14 @@ import codeql.swift.elements.pattern.Pattern class CaseLabelItemBase extends @case_label_item, AstNode { override string getAPrimaryQlClass() { result = "CaseLabelItem" } + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() or + result = getPattern() or + result = getGuard() + } + Pattern getPattern() { exists(Pattern x | case_label_items(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/CaseStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/CaseStmt.qll index d7111914429..ddb33377a79 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/CaseStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/CaseStmt.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.CaseLabelItem import codeql.swift.elements.stmt.Stmt import codeql.swift.elements.decl.VarDecl @@ -6,6 +7,14 @@ import codeql.swift.elements.decl.VarDecl class CaseStmtBase extends @case_stmt, Stmt { override string getAPrimaryQlClass() { result = "CaseStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getBody() or + result = getLabel(_) + } + Stmt getBody() { exists(Stmt x | case_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/ConditionElement.qll b/swift/ql/lib/codeql/swift/generated/stmt/ConditionElement.qll index eb68c35bdf0..a5697e64b06 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/ConditionElement.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/ConditionElement.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.Locatable import codeql.swift.elements.pattern.Pattern @@ -6,6 +7,15 @@ import codeql.swift.elements.pattern.Pattern class ConditionElementBase extends @condition_element, Locatable { override string getAPrimaryQlClass() { result = "ConditionElement" } + cached + override Element getAChild() { + none() or + result = Locatable.super.getAChild() or + result = getBoolean() or + result = getPattern() or + result = getInitializer() + } + Expr getBoolean() { exists(Expr x | condition_element_booleans(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/ContinueStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/ContinueStmt.qll index 10e6b2ac302..b07bcdc3118 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/ContinueStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/ContinueStmt.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.Stmt class ContinueStmtBase extends @continue_stmt, Stmt { override string getAPrimaryQlClass() { result = "ContinueStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } + string getTargetName() { continue_stmt_target_names(this, result) } predicate hasTargetName() { exists(getTargetName()) } diff --git a/swift/ql/lib/codeql/swift/generated/stmt/DeferStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/DeferStmt.qll index 7edd92fe917..b02dd5f4765 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/DeferStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/DeferStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.stmt.Stmt class DeferStmtBase extends @defer_stmt, Stmt { override string getAPrimaryQlClass() { result = "DeferStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | defer_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/DoCatchStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/DoCatchStmt.qll index 7f98906d007..40aeafa0422 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/DoCatchStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/DoCatchStmt.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.CaseStmt import codeql.swift.elements.stmt.LabeledStmt import codeql.swift.elements.stmt.Stmt @@ -6,6 +7,14 @@ import codeql.swift.elements.stmt.Stmt class DoCatchStmtBase extends @do_catch_stmt, LabeledStmt { override string getAPrimaryQlClass() { result = "DoCatchStmt" } + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getBody() or + result = getCatch(_) + } + Stmt getBody() { exists(Stmt x | do_catch_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/DoStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/DoStmt.qll index f83646426e4..6007691b9a5 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/DoStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/DoStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.stmt.LabeledStmt class DoStmtBase extends @do_stmt, LabeledStmt { override string getAPrimaryQlClass() { result = "DoStmt" } + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | do_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/FailStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/FailStmt.qll index 15f69def40d..8fb3e5e9eac 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/FailStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/FailStmt.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.Stmt class FailStmtBase extends @fail_stmt, Stmt { override string getAPrimaryQlClass() { result = "FailStmt" } + + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/stmt/FallthroughStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/FallthroughStmt.qll index 5faaac0ad9b..9001e209912 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/FallthroughStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/FallthroughStmt.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.CaseStmt import codeql.swift.elements.stmt.Stmt class FallthroughStmtBase extends @fallthrough_stmt, Stmt { override string getAPrimaryQlClass() { result = "FallthroughStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } + CaseStmt getFallthroughSource() { exists(CaseStmt x | fallthrough_stmts(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/ForEachStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/ForEachStmt.qll index 5c05bc84139..57ca569d979 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/ForEachStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/ForEachStmt.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.LabeledStmt @@ -7,6 +8,16 @@ import codeql.swift.elements.pattern.Pattern class ForEachStmtBase extends @for_each_stmt, LabeledStmt { override string getAPrimaryQlClass() { result = "ForEachStmt" } + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getPattern() or + result = getSequence() or + result = getWhere() or + result = getBody() + } + Pattern getPattern() { exists(Pattern x | for_each_stmts(this, x, _, _) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/GuardStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/GuardStmt.qll index 7ce5fae33a2..53de3117fc2 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/GuardStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/GuardStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.BraceStmt import codeql.swift.elements.stmt.LabeledConditionalStmt class GuardStmtBase extends @guard_stmt, LabeledConditionalStmt { override string getAPrimaryQlClass() { result = "GuardStmt" } + cached + override Element getAChild() { + none() or + result = LabeledConditionalStmt.super.getAChild() or + result = getBody() + } + BraceStmt getBody() { exists(BraceStmt x | guard_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/IfStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/IfStmt.qll index 4311173fe51..2663119de5e 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/IfStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/IfStmt.qll @@ -1,10 +1,19 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.LabeledConditionalStmt import codeql.swift.elements.stmt.Stmt class IfStmtBase extends @if_stmt, LabeledConditionalStmt { override string getAPrimaryQlClass() { result = "IfStmt" } + cached + override Element getAChild() { + none() or + result = LabeledConditionalStmt.super.getAChild() or + result = getThen() or + result = getElse() + } + Stmt getThen() { exists(Stmt x | if_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/LabeledConditionalStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/LabeledConditionalStmt.qll index c6d7acded63..76826c59fa5 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/LabeledConditionalStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/LabeledConditionalStmt.qll @@ -1,8 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.LabeledStmt import codeql.swift.elements.stmt.StmtCondition class LabeledConditionalStmtBase extends @labeled_conditional_stmt, LabeledStmt { + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getCondition() + } + StmtCondition getCondition() { exists(StmtCondition x | labeled_conditional_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/LabeledStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/LabeledStmt.qll index 98374c9a5d2..77b08b0b547 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/LabeledStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/LabeledStmt.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.Stmt class LabeledStmtBase extends @labeled_stmt, Stmt { + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } + string getLabel() { labeled_stmt_labels(this, result) } predicate hasLabel() { exists(getLabel()) } diff --git a/swift/ql/lib/codeql/swift/generated/stmt/PoundAssertStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/PoundAssertStmt.qll index afbd1ffdf13..1c42eef9440 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/PoundAssertStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/PoundAssertStmt.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.Stmt class PoundAssertStmtBase extends @pound_assert_stmt, Stmt { override string getAPrimaryQlClass() { result = "PoundAssertStmt" } + + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/stmt/RepeatWhileStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/RepeatWhileStmt.qll index 6d03dcc07a9..c473e256f89 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/RepeatWhileStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/RepeatWhileStmt.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.LabeledStmt import codeql.swift.elements.stmt.Stmt @@ -6,6 +7,14 @@ import codeql.swift.elements.stmt.Stmt class RepeatWhileStmtBase extends @repeat_while_stmt, LabeledStmt { override string getAPrimaryQlClass() { result = "RepeatWhileStmt" } + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getCondition() or + result = getBody() + } + Expr getCondition() { exists(Expr x | repeat_while_stmts(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/ReturnStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/ReturnStmt.qll index dcdaaae19b6..daf78055735 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/ReturnStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/ReturnStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.Stmt class ReturnStmtBase extends @return_stmt, Stmt { override string getAPrimaryQlClass() { result = "ReturnStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getResult() + } + Expr getResult() { exists(Expr x | return_stmt_results(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/Stmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/Stmt.qll index 092b314b01c..cdde19b6a83 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/Stmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/Stmt.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode -class StmtBase extends @stmt, AstNode { } +class StmtBase extends @stmt, AstNode { + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/stmt/StmtCondition.qll b/swift/ql/lib/codeql/swift/generated/stmt/StmtCondition.qll index 94aa0b746d2..72ca1aff4f5 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/StmtCondition.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/StmtCondition.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode import codeql.swift.elements.stmt.ConditionElement class StmtConditionBase extends @stmt_condition, AstNode { override string getAPrimaryQlClass() { result = "StmtCondition" } + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() or + result = getElement(_) + } + ConditionElement getElement(int index) { exists(ConditionElement x | stmt_condition_elements(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/SwitchStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/SwitchStmt.qll index 79bd3116cfe..2ef003dc69e 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/SwitchStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/SwitchStmt.qll @@ -1,4 +1,5 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.CaseStmt import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.LabeledStmt @@ -6,6 +7,14 @@ import codeql.swift.elements.stmt.LabeledStmt class SwitchStmtBase extends @switch_stmt, LabeledStmt { override string getAPrimaryQlClass() { result = "SwitchStmt" } + cached + override Element getAChild() { + none() or + result = LabeledStmt.super.getAChild() or + result = getExpr() or + result = getCase(_) + } + Expr getExpr() { exists(Expr x | switch_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/ThrowStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/ThrowStmt.qll index 7ede67545bb..3d354d99db3 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/ThrowStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/ThrowStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.Stmt class ThrowStmtBase extends @throw_stmt, Stmt { override string getAPrimaryQlClass() { result = "ThrowStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getSubExpr() + } + Expr getSubExpr() { exists(Expr x | throw_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/WhileStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/WhileStmt.qll index 959a129834b..befff3b3b65 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/WhileStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/WhileStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.stmt.LabeledConditionalStmt import codeql.swift.elements.stmt.Stmt class WhileStmtBase extends @while_stmt, LabeledConditionalStmt { override string getAPrimaryQlClass() { result = "WhileStmt" } + cached + override Element getAChild() { + none() or + result = LabeledConditionalStmt.super.getAChild() or + result = getBody() + } + Stmt getBody() { exists(Stmt x | while_stmts(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/stmt/YieldStmt.qll b/swift/ql/lib/codeql/swift/generated/stmt/YieldStmt.qll index d2f35762f7d..fa9820d97a4 100644 --- a/swift/ql/lib/codeql/swift/generated/stmt/YieldStmt.qll +++ b/swift/ql/lib/codeql/swift/generated/stmt/YieldStmt.qll @@ -1,10 +1,18 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.expr.Expr import codeql.swift.elements.stmt.Stmt class YieldStmtBase extends @yield_stmt, Stmt { override string getAPrimaryQlClass() { result = "YieldStmt" } + cached + override Element getAChild() { + none() or + result = Stmt.super.getAChild() or + result = getResult(_) + } + Expr getResult(int index) { exists(Expr x | yield_stmt_results(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/AnyBuiltinIntegerType.qll b/swift/ql/lib/codeql/swift/generated/type/AnyBuiltinIntegerType.qll index 230e0014a04..aa84556f170 100644 --- a/swift/ql/lib/codeql/swift/generated/type/AnyBuiltinIntegerType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/AnyBuiltinIntegerType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType -class AnyBuiltinIntegerTypeBase extends @any_builtin_integer_type, BuiltinType { } +class AnyBuiltinIntegerTypeBase extends @any_builtin_integer_type, BuiltinType { + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/AnyFunctionType.qll b/swift/ql/lib/codeql/swift/generated/type/AnyFunctionType.qll index da547ce7aac..01119c4ab39 100644 --- a/swift/ql/lib/codeql/swift/generated/type/AnyFunctionType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/AnyFunctionType.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class AnyFunctionTypeBase extends @any_function_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } + Type getResult() { exists(Type x | any_function_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/AnyGenericType.qll b/swift/ql/lib/codeql/swift/generated/type/AnyGenericType.qll index 41659bd5f08..2b893fe8509 100644 --- a/swift/ql/lib/codeql/swift/generated/type/AnyGenericType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/AnyGenericType.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.Decl import codeql.swift.elements.type.Type class AnyGenericTypeBase extends @any_generic_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } + Type getParent() { exists(Type x | any_generic_type_parents(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/AnyMetatypeType.qll b/swift/ql/lib/codeql/swift/generated/type/AnyMetatypeType.qll index 8e77aa7c707..cc95172d5d7 100644 --- a/swift/ql/lib/codeql/swift/generated/type/AnyMetatypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/AnyMetatypeType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type -class AnyMetatypeTypeBase extends @any_metatype_type, Type { } +class AnyMetatypeTypeBase extends @any_metatype_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/ArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/ArchetypeType.qll index 2807e6b23ee..dd09a98977b 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ArchetypeType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SubstitutableType -class ArchetypeTypeBase extends @archetype_type, SubstitutableType { } +class ArchetypeTypeBase extends @archetype_type, SubstitutableType { + cached + override Element getAChild() { + none() or + result = SubstitutableType.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/ArraySliceType.qll b/swift/ql/lib/codeql/swift/generated/type/ArraySliceType.qll index bb132bc2c72..0fb47668fae 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ArraySliceType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ArraySliceType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.UnarySyntaxSugarType class ArraySliceTypeBase extends @array_slice_type, UnarySyntaxSugarType { override string getAPrimaryQlClass() { result = "ArraySliceType" } + + cached + override Element getAChild() { + none() or + result = UnarySyntaxSugarType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BoundGenericClassType.qll b/swift/ql/lib/codeql/swift/generated/type/BoundGenericClassType.qll index 3d2a78b2309..0bbbc377086 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BoundGenericClassType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BoundGenericClassType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BoundGenericType class BoundGenericClassTypeBase extends @bound_generic_class_type, BoundGenericType { override string getAPrimaryQlClass() { result = "BoundGenericClassType" } + + cached + override Element getAChild() { + none() or + result = BoundGenericType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BoundGenericEnumType.qll b/swift/ql/lib/codeql/swift/generated/type/BoundGenericEnumType.qll index 57103dce7f7..b105c1e6c89 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BoundGenericEnumType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BoundGenericEnumType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BoundGenericType class BoundGenericEnumTypeBase extends @bound_generic_enum_type, BoundGenericType { override string getAPrimaryQlClass() { result = "BoundGenericEnumType" } + + cached + override Element getAChild() { + none() or + result = BoundGenericType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BoundGenericStructType.qll b/swift/ql/lib/codeql/swift/generated/type/BoundGenericStructType.qll index 2f5d514488a..81dd3a2b205 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BoundGenericStructType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BoundGenericStructType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BoundGenericType class BoundGenericStructTypeBase extends @bound_generic_struct_type, BoundGenericType { override string getAPrimaryQlClass() { result = "BoundGenericStructType" } + + cached + override Element getAChild() { + none() or + result = BoundGenericType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BoundGenericType.qll b/swift/ql/lib/codeql/swift/generated/type/BoundGenericType.qll index d6160998cff..945e5179832 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BoundGenericType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BoundGenericType.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalOrBoundGenericNominalType import codeql.swift.elements.type.Type class BoundGenericTypeBase extends @bound_generic_type, NominalOrBoundGenericNominalType { + cached + override Element getAChild() { + none() or + result = NominalOrBoundGenericNominalType.super.getAChild() + } + Type getArgType(int index) { exists(Type x | bound_generic_type_arg_types(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll index 8e18276ef2c..e7ddf9e35e7 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinBridgeObjectTypeBase extends @builtin_bridge_object_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinBridgeObjectType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll index cdc635f42a7..98ceab05705 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinDefaultActorStorageTypeBase extends @builtin_default_actor_storage_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinDefaultActorStorageType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinExecutorType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinExecutorType.qll index 32444cc4704..22b94c5e917 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinExecutorType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinExecutorType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinExecutorTypeBase extends @builtin_executor_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinExecutorType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinFloatType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinFloatType.qll index 509e66a070c..cd12850682d 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinFloatType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinFloatType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinFloatTypeBase extends @builtin_float_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinFloatType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll index 88c8b0dd3db..6defee4bd8b 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyBuiltinIntegerType class BuiltinIntegerLiteralTypeBase extends @builtin_integer_literal_type, AnyBuiltinIntegerType { override string getAPrimaryQlClass() { result = "BuiltinIntegerLiteralType" } + + cached + override Element getAChild() { + none() or + result = AnyBuiltinIntegerType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerType.qll index a3dfe331fe2..32dc21eb45d 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinIntegerType.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyBuiltinIntegerType class BuiltinIntegerTypeBase extends @builtin_integer_type, AnyBuiltinIntegerType { override string getAPrimaryQlClass() { result = "BuiltinIntegerType" } + cached + override Element getAChild() { + none() or + result = AnyBuiltinIntegerType.super.getAChild() + } + int getWidth() { builtin_integer_type_widths(this, result) } predicate hasWidth() { exists(getWidth()) } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinJobType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinJobType.qll index 4f89a9a02c2..136682e3b47 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinJobType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinJobType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinJobTypeBase extends @builtin_job_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinJobType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinNativeObjectType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinNativeObjectType.qll index 26d84273d89..d7ee353ea0c 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinNativeObjectType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinNativeObjectType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinNativeObjectTypeBase extends @builtin_native_object_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinNativeObjectType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinRawPointerType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinRawPointerType.qll index 509f0eddba6..61e9370ddbc 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinRawPointerType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinRawPointerType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinRawPointerTypeBase extends @builtin_raw_pointer_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinRawPointerType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinRawUnsafeContinuationType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinRawUnsafeContinuationType.qll index 4fd93326e5e..3948ed35aee 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinRawUnsafeContinuationType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinRawUnsafeContinuationType.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinRawUnsafeContinuationTypeBase extends @builtin_raw_unsafe_continuation_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinRawUnsafeContinuationType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinType.qll index a3490ac1d1e..dba1a241292 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type -class BuiltinTypeBase extends @builtin_type, Type { } +class BuiltinTypeBase extends @builtin_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinUnsafeValueBufferType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinUnsafeValueBufferType.qll index 76f2beb8d95..3c57e615e17 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinUnsafeValueBufferType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinUnsafeValueBufferType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinUnsafeValueBufferTypeBase extends @builtin_unsafe_value_buffer_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinUnsafeValueBufferType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/BuiltinVectorType.qll b/swift/ql/lib/codeql/swift/generated/type/BuiltinVectorType.qll index 493a64f7717..04e5bab73d7 100644 --- a/swift/ql/lib/codeql/swift/generated/type/BuiltinVectorType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/BuiltinVectorType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.BuiltinType class BuiltinVectorTypeBase extends @builtin_vector_type, BuiltinType { override string getAPrimaryQlClass() { result = "BuiltinVectorType" } + + cached + override Element getAChild() { + none() or + result = BuiltinType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ClassType.qll b/swift/ql/lib/codeql/swift/generated/type/ClassType.qll index c19d65608f2..f4b3554bcb8 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ClassType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ClassType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalType class ClassTypeBase extends @class_type, NominalType { override string getAPrimaryQlClass() { result = "ClassType" } + + cached + override Element getAChild() { + none() or + result = NominalType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/DependentMemberType.qll b/swift/ql/lib/codeql/swift/generated/type/DependentMemberType.qll index ac807feab85..da569558566 100644 --- a/swift/ql/lib/codeql/swift/generated/type/DependentMemberType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/DependentMemberType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.decl.AssociatedTypeDecl import codeql.swift.elements.type.Type class DependentMemberTypeBase extends @dependent_member_type, Type { override string getAPrimaryQlClass() { result = "DependentMemberType" } + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } + Type getBaseType() { exists(Type x | dependent_member_types(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/type/DictionaryType.qll b/swift/ql/lib/codeql/swift/generated/type/DictionaryType.qll index 6afb2507284..8a6ec855cfe 100644 --- a/swift/ql/lib/codeql/swift/generated/type/DictionaryType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/DictionaryType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SyntaxSugarType import codeql.swift.elements.type.Type class DictionaryTypeBase extends @dictionary_type, SyntaxSugarType { override string getAPrimaryQlClass() { result = "DictionaryType" } + cached + override Element getAChild() { + none() or + result = SyntaxSugarType.super.getAChild() + } + Type getKeyType() { exists(Type x | dictionary_types(this, x, _) and diff --git a/swift/ql/lib/codeql/swift/generated/type/DynamicSelfType.qll b/swift/ql/lib/codeql/swift/generated/type/DynamicSelfType.qll index ff3eeb90b87..0debd1be28e 100644 --- a/swift/ql/lib/codeql/swift/generated/type/DynamicSelfType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/DynamicSelfType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class DynamicSelfTypeBase extends @dynamic_self_type, Type { override string getAPrimaryQlClass() { result = "DynamicSelfType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/EnumType.qll b/swift/ql/lib/codeql/swift/generated/type/EnumType.qll index 99e2cea2fcd..f6e7ac69f72 100644 --- a/swift/ql/lib/codeql/swift/generated/type/EnumType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/EnumType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalType class EnumTypeBase extends @enum_type, NominalType { override string getAPrimaryQlClass() { result = "EnumType" } + + cached + override Element getAChild() { + none() or + result = NominalType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ErrorType.qll b/swift/ql/lib/codeql/swift/generated/type/ErrorType.qll index f7156ec110c..2bcc496fa99 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ErrorType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ErrorType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class ErrorTypeBase extends @error_type, Type { override string getAPrimaryQlClass() { result = "ErrorType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ExistentialMetatypeType.qll b/swift/ql/lib/codeql/swift/generated/type/ExistentialMetatypeType.qll index fcdd1a52224..96078e88576 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ExistentialMetatypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ExistentialMetatypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyMetatypeType class ExistentialMetatypeTypeBase extends @existential_metatype_type, AnyMetatypeType { override string getAPrimaryQlClass() { result = "ExistentialMetatypeType" } + + cached + override Element getAChild() { + none() or + result = AnyMetatypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ExistentialType.qll b/swift/ql/lib/codeql/swift/generated/type/ExistentialType.qll index e2d92d553de..56a75380c94 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ExistentialType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ExistentialType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class ExistentialTypeBase extends @existential_type, Type { override string getAPrimaryQlClass() { result = "ExistentialType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/FunctionType.qll b/swift/ql/lib/codeql/swift/generated/type/FunctionType.qll index dcb5da46bbd..e3650a03f0f 100644 --- a/swift/ql/lib/codeql/swift/generated/type/FunctionType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/FunctionType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyFunctionType class FunctionTypeBase extends @function_type, AnyFunctionType { override string getAPrimaryQlClass() { result = "FunctionType" } + + cached + override Element getAChild() { + none() or + result = AnyFunctionType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/GenericFunctionType.qll b/swift/ql/lib/codeql/swift/generated/type/GenericFunctionType.qll index 7b34e262d03..642c7e02050 100644 --- a/swift/ql/lib/codeql/swift/generated/type/GenericFunctionType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/GenericFunctionType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyFunctionType import codeql.swift.elements.type.GenericTypeParamType class GenericFunctionTypeBase extends @generic_function_type, AnyFunctionType { override string getAPrimaryQlClass() { result = "GenericFunctionType" } + cached + override Element getAChild() { + none() or + result = AnyFunctionType.super.getAChild() + } + GenericTypeParamType getGenericParam(int index) { exists(GenericTypeParamType x | generic_function_type_generic_params(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/GenericTypeParamType.qll b/swift/ql/lib/codeql/swift/generated/type/GenericTypeParamType.qll index c0b13904806..8cb7e9e7c61 100644 --- a/swift/ql/lib/codeql/swift/generated/type/GenericTypeParamType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/GenericTypeParamType.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SubstitutableType class GenericTypeParamTypeBase extends @generic_type_param_type, SubstitutableType { override string getAPrimaryQlClass() { result = "GenericTypeParamType" } + cached + override Element getAChild() { + none() or + result = SubstitutableType.super.getAChild() + } + string getName() { generic_type_param_types(this, result) } } diff --git a/swift/ql/lib/codeql/swift/generated/type/InOutType.qll b/swift/ql/lib/codeql/swift/generated/type/InOutType.qll index 4d54e929657..3f5eeeaece1 100644 --- a/swift/ql/lib/codeql/swift/generated/type/InOutType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/InOutType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class InOutTypeBase extends @in_out_type, Type { override string getAPrimaryQlClass() { result = "InOutType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/LValueType.qll b/swift/ql/lib/codeql/swift/generated/type/LValueType.qll index df0f433ac84..eee8a7f4e3d 100644 --- a/swift/ql/lib/codeql/swift/generated/type/LValueType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/LValueType.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class LValueTypeBase extends @l_value_type, Type { override string getAPrimaryQlClass() { result = "LValueType" } + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } + Type getObjectType() { exists(Type x | l_value_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/MetatypeType.qll b/swift/ql/lib/codeql/swift/generated/type/MetatypeType.qll index e6663f3b357..17ef392a89f 100644 --- a/swift/ql/lib/codeql/swift/generated/type/MetatypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/MetatypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyMetatypeType class MetatypeTypeBase extends @metatype_type, AnyMetatypeType { override string getAPrimaryQlClass() { result = "MetatypeType" } + + cached + override Element getAChild() { + none() or + result = AnyMetatypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ModuleType.qll b/swift/ql/lib/codeql/swift/generated/type/ModuleType.qll index 91da39854d7..09814f44c08 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ModuleType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ModuleType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class ModuleTypeBase extends @module_type, Type { override string getAPrimaryQlClass() { result = "ModuleType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/NestedArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/NestedArchetypeType.qll index 7306e294785..ce466db4766 100644 --- a/swift/ql/lib/codeql/swift/generated/type/NestedArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/NestedArchetypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ArchetypeType class NestedArchetypeTypeBase extends @nested_archetype_type, ArchetypeType { override string getAPrimaryQlClass() { result = "NestedArchetypeType" } + + cached + override Element getAChild() { + none() or + result = ArchetypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll b/swift/ql/lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll index b1e105b0f18..c20a14ba358 100644 --- a/swift/ql/lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/NominalOrBoundGenericNominalType.qll @@ -1,5 +1,12 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyGenericType class NominalOrBoundGenericNominalTypeBase extends @nominal_or_bound_generic_nominal_type, - AnyGenericType { } + AnyGenericType { + cached + override Element getAChild() { + none() or + result = AnyGenericType.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/NominalType.qll b/swift/ql/lib/codeql/swift/generated/type/NominalType.qll index eb9f1a1ef45..8cf77d376ee 100644 --- a/swift/ql/lib/codeql/swift/generated/type/NominalType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/NominalType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalOrBoundGenericNominalType -class NominalTypeBase extends @nominal_type, NominalOrBoundGenericNominalType { } +class NominalTypeBase extends @nominal_type, NominalOrBoundGenericNominalType { + cached + override Element getAChild() { + none() or + result = NominalOrBoundGenericNominalType.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll index c0a1f637f3c..15863b1d4f4 100644 --- a/swift/ql/lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/OpaqueTypeArchetypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ArchetypeType class OpaqueTypeArchetypeTypeBase extends @opaque_type_archetype_type, ArchetypeType { override string getAPrimaryQlClass() { result = "OpaqueTypeArchetypeType" } + + cached + override Element getAChild() { + none() or + result = ArchetypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/OpenedArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/OpenedArchetypeType.qll index 2d723dfb10d..4b48eebcdba 100644 --- a/swift/ql/lib/codeql/swift/generated/type/OpenedArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/OpenedArchetypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ArchetypeType class OpenedArchetypeTypeBase extends @opened_archetype_type, ArchetypeType { override string getAPrimaryQlClass() { result = "OpenedArchetypeType" } + + cached + override Element getAChild() { + none() or + result = ArchetypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/OptionalType.qll b/swift/ql/lib/codeql/swift/generated/type/OptionalType.qll index a814cf4d002..1cb07ae5b0d 100644 --- a/swift/ql/lib/codeql/swift/generated/type/OptionalType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/OptionalType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.UnarySyntaxSugarType class OptionalTypeBase extends @optional_type, UnarySyntaxSugarType { override string getAPrimaryQlClass() { result = "OptionalType" } + + cached + override Element getAChild() { + none() or + result = UnarySyntaxSugarType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ParenType.qll b/swift/ql/lib/codeql/swift/generated/type/ParenType.qll index b135fb728a5..5b4edbc2ae7 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ParenType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ParenType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SugarType import codeql.swift.elements.type.Type class ParenTypeBase extends @paren_type, SugarType { override string getAPrimaryQlClass() { result = "ParenType" } + cached + override Element getAChild() { + none() or + result = SugarType.super.getAChild() + } + Type getType() { exists(Type x | paren_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/PlaceholderType.qll b/swift/ql/lib/codeql/swift/generated/type/PlaceholderType.qll index 134bdb7a6c8..0c8c5022156 100644 --- a/swift/ql/lib/codeql/swift/generated/type/PlaceholderType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/PlaceholderType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class PlaceholderTypeBase extends @placeholder_type, Type { override string getAPrimaryQlClass() { result = "PlaceholderType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/PrimaryArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/PrimaryArchetypeType.qll index 6f062e05799..af299638912 100644 --- a/swift/ql/lib/codeql/swift/generated/type/PrimaryArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/PrimaryArchetypeType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ArchetypeType import codeql.swift.elements.type.GenericTypeParamType class PrimaryArchetypeTypeBase extends @primary_archetype_type, ArchetypeType { override string getAPrimaryQlClass() { result = "PrimaryArchetypeType" } + cached + override Element getAChild() { + none() or + result = ArchetypeType.super.getAChild() + } + GenericTypeParamType getInterfaceType() { exists(GenericTypeParamType x | primary_archetype_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/ProtocolCompositionType.qll b/swift/ql/lib/codeql/swift/generated/type/ProtocolCompositionType.qll index 863f8c8ca8b..c1f4e86c0d7 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ProtocolCompositionType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ProtocolCompositionType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class ProtocolCompositionTypeBase extends @protocol_composition_type, Type { override string getAPrimaryQlClass() { result = "ProtocolCompositionType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ProtocolType.qll b/swift/ql/lib/codeql/swift/generated/type/ProtocolType.qll index 9f157eb06ef..57c8f7bde38 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ProtocolType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ProtocolType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalType class ProtocolTypeBase extends @protocol_type, NominalType { override string getAPrimaryQlClass() { result = "ProtocolType" } + + cached + override Element getAChild() { + none() or + result = NominalType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/ReferenceStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/ReferenceStorageType.qll index f565b1dafda..8ff0b4cf920 100644 --- a/swift/ql/lib/codeql/swift/generated/type/ReferenceStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/ReferenceStorageType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type -class ReferenceStorageTypeBase extends @reference_storage_type, Type { } +class ReferenceStorageTypeBase extends @reference_storage_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/SequenceArchetypeType.qll b/swift/ql/lib/codeql/swift/generated/type/SequenceArchetypeType.qll index 08a9350d9ac..725c87307e1 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SequenceArchetypeType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SequenceArchetypeType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ArchetypeType class SequenceArchetypeTypeBase extends @sequence_archetype_type, ArchetypeType { override string getAPrimaryQlClass() { result = "SequenceArchetypeType" } + + cached + override Element getAChild() { + none() or + result = ArchetypeType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/SilBlockStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/SilBlockStorageType.qll index 185652e2e8a..ac402ff8787 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SilBlockStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SilBlockStorageType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class SilBlockStorageTypeBase extends @sil_block_storage_type, Type { override string getAPrimaryQlClass() { result = "SilBlockStorageType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/SilBoxType.qll b/swift/ql/lib/codeql/swift/generated/type/SilBoxType.qll index 5a879026ef3..fbf387c8b55 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SilBoxType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SilBoxType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class SilBoxTypeBase extends @sil_box_type, Type { override string getAPrimaryQlClass() { result = "SilBoxType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/SilFunctionType.qll b/swift/ql/lib/codeql/swift/generated/type/SilFunctionType.qll index 103e80dddf1..d7228775637 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SilFunctionType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SilFunctionType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class SilFunctionTypeBase extends @sil_function_type, Type { override string getAPrimaryQlClass() { result = "SilFunctionType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/SilTokenType.qll b/swift/ql/lib/codeql/swift/generated/type/SilTokenType.qll index 50582c2b761..55f751362d1 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SilTokenType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SilTokenType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class SilTokenTypeBase extends @sil_token_type, Type { override string getAPrimaryQlClass() { result = "SilTokenType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/StructType.qll b/swift/ql/lib/codeql/swift/generated/type/StructType.qll index 89b30746490..630472ffc59 100644 --- a/swift/ql/lib/codeql/swift/generated/type/StructType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/StructType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.NominalType class StructTypeBase extends @struct_type, NominalType { override string getAPrimaryQlClass() { result = "StructType" } + + cached + override Element getAChild() { + none() or + result = NominalType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/SubstitutableType.qll b/swift/ql/lib/codeql/swift/generated/type/SubstitutableType.qll index cbe8954f357..b78916407c1 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SubstitutableType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SubstitutableType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type -class SubstitutableTypeBase extends @substitutable_type, Type { } +class SubstitutableTypeBase extends @substitutable_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/SugarType.qll b/swift/ql/lib/codeql/swift/generated/type/SugarType.qll index 7bd520f2338..a228b72e63a 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SugarType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SugarType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type -class SugarTypeBase extends @sugar_type, Type { } +class SugarTypeBase extends @sugar_type, Type { + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/SyntaxSugarType.qll b/swift/ql/lib/codeql/swift/generated/type/SyntaxSugarType.qll index c13239c9702..41bc79024b0 100644 --- a/swift/ql/lib/codeql/swift/generated/type/SyntaxSugarType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/SyntaxSugarType.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SugarType -class SyntaxSugarTypeBase extends @syntax_sugar_type, SugarType { } +class SyntaxSugarTypeBase extends @syntax_sugar_type, SugarType { + cached + override Element getAChild() { + none() or + result = SugarType.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/type/TupleType.qll b/swift/ql/lib/codeql/swift/generated/type/TupleType.qll index 93ce824d771..344f1c8d717 100644 --- a/swift/ql/lib/codeql/swift/generated/type/TupleType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/TupleType.qll @@ -1,9 +1,16 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class TupleTypeBase extends @tuple_type, Type { override string getAPrimaryQlClass() { result = "TupleType" } + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } + Type getType(int index) { exists(Type x | tuple_type_types(this, index, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/Type.qll b/swift/ql/lib/codeql/swift/generated/type/Type.qll index cfe4b638da3..71c1bd64651 100644 --- a/swift/ql/lib/codeql/swift/generated/type/Type.qll +++ b/swift/ql/lib/codeql/swift/generated/type/Type.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py import codeql.swift.elements.Element +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class TypeBase extends @type, Element { + cached + override Element getAChild() { + none() or + result = Element.super.getAChild() + } + string getDiagnosticsName() { types(this, result, _) } Type getCanonicalType() { diff --git a/swift/ql/lib/codeql/swift/generated/type/TypeAliasType.qll b/swift/ql/lib/codeql/swift/generated/type/TypeAliasType.qll index 07787680465..da74d444660 100644 --- a/swift/ql/lib/codeql/swift/generated/type/TypeAliasType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/TypeAliasType.qll @@ -1,10 +1,17 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SugarType import codeql.swift.elements.decl.TypeAliasDecl class TypeAliasTypeBase extends @type_alias_type, SugarType { override string getAPrimaryQlClass() { result = "TypeAliasType" } + cached + override Element getAChild() { + none() or + result = SugarType.super.getAChild() + } + TypeAliasDecl getDecl() { exists(TypeAliasDecl x | type_alias_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/TypeVariableType.qll b/swift/ql/lib/codeql/swift/generated/type/TypeVariableType.qll index c6c82c1e982..5a964c47bd9 100644 --- a/swift/ql/lib/codeql/swift/generated/type/TypeVariableType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/TypeVariableType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class TypeVariableTypeBase extends @type_variable_type, Type { override string getAPrimaryQlClass() { result = "TypeVariableType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/UnarySyntaxSugarType.qll b/swift/ql/lib/codeql/swift/generated/type/UnarySyntaxSugarType.qll index 29713f37367..ab217b3f0da 100644 --- a/swift/ql/lib/codeql/swift/generated/type/UnarySyntaxSugarType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/UnarySyntaxSugarType.qll @@ -1,8 +1,15 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.SyntaxSugarType import codeql.swift.elements.type.Type class UnarySyntaxSugarTypeBase extends @unary_syntax_sugar_type, SyntaxSugarType { + cached + override Element getAChild() { + none() or + result = SyntaxSugarType.super.getAChild() + } + Type getBaseType() { exists(Type x | unary_syntax_sugar_types(this, x) and diff --git a/swift/ql/lib/codeql/swift/generated/type/UnboundGenericType.qll b/swift/ql/lib/codeql/swift/generated/type/UnboundGenericType.qll index b4946cea77d..bc30ad8c94d 100644 --- a/swift/ql/lib/codeql/swift/generated/type/UnboundGenericType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/UnboundGenericType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.AnyGenericType class UnboundGenericTypeBase extends @unbound_generic_type, AnyGenericType { override string getAPrimaryQlClass() { result = "UnboundGenericType" } + + cached + override Element getAChild() { + none() or + result = AnyGenericType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/UnmanagedStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/UnmanagedStorageType.qll index def9e7be671..72e87668d52 100644 --- a/swift/ql/lib/codeql/swift/generated/type/UnmanagedStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/UnmanagedStorageType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ReferenceStorageType class UnmanagedStorageTypeBase extends @unmanaged_storage_type, ReferenceStorageType { override string getAPrimaryQlClass() { result = "UnmanagedStorageType" } + + cached + override Element getAChild() { + none() or + result = ReferenceStorageType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/UnownedStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/UnownedStorageType.qll index 3a8b60c19b0..480288700eb 100644 --- a/swift/ql/lib/codeql/swift/generated/type/UnownedStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/UnownedStorageType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ReferenceStorageType class UnownedStorageTypeBase extends @unowned_storage_type, ReferenceStorageType { override string getAPrimaryQlClass() { result = "UnownedStorageType" } + + cached + override Element getAChild() { + none() or + result = ReferenceStorageType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/UnresolvedType.qll b/swift/ql/lib/codeql/swift/generated/type/UnresolvedType.qll index a5a5abb4d91..04f547500f6 100644 --- a/swift/ql/lib/codeql/swift/generated/type/UnresolvedType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/UnresolvedType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.Type class UnresolvedTypeBase extends @unresolved_type, Type { override string getAPrimaryQlClass() { result = "UnresolvedType" } + + cached + override Element getAChild() { + none() or + result = Type.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/VariadicSequenceType.qll b/swift/ql/lib/codeql/swift/generated/type/VariadicSequenceType.qll index 18ad64789df..4851f7fcf0f 100644 --- a/swift/ql/lib/codeql/swift/generated/type/VariadicSequenceType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/VariadicSequenceType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.UnarySyntaxSugarType class VariadicSequenceTypeBase extends @variadic_sequence_type, UnarySyntaxSugarType { override string getAPrimaryQlClass() { result = "VariadicSequenceType" } + + cached + override Element getAChild() { + none() or + result = UnarySyntaxSugarType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/type/WeakStorageType.qll b/swift/ql/lib/codeql/swift/generated/type/WeakStorageType.qll index ce6a8837816..343ef3bd105 100644 --- a/swift/ql/lib/codeql/swift/generated/type/WeakStorageType.qll +++ b/swift/ql/lib/codeql/swift/generated/type/WeakStorageType.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.type.ReferenceStorageType class WeakStorageTypeBase extends @weak_storage_type, ReferenceStorageType { override string getAPrimaryQlClass() { result = "WeakStorageType" } + + cached + override Element getAChild() { + none() or + result = ReferenceStorageType.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ArrayTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ArrayTypeRepr.qll index 486a98a541e..44c7a24c57f 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ArrayTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ArrayTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class ArrayTypeReprBase extends @array_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "ArrayTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/AttributedTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/AttributedTypeRepr.qll index 96d78c7c933..355318312b5 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/AttributedTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/AttributedTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class AttributedTypeReprBase extends @attributed_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "AttributedTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/CompileTimeConstTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/CompileTimeConstTypeRepr.qll index eecb67b9218..46dd7bce901 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/CompileTimeConstTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/CompileTimeConstTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.SpecifierTypeRepr class CompileTimeConstTypeReprBase extends @compile_time_const_type_repr, SpecifierTypeRepr { override string getAPrimaryQlClass() { result = "CompileTimeConstTypeRepr" } + + cached + override Element getAChild() { + none() or + result = SpecifierTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ComponentIdentTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ComponentIdentTypeRepr.qll index d0323ad681d..29f6a011de5 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ComponentIdentTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ComponentIdentTypeRepr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.IdentTypeRepr -class ComponentIdentTypeReprBase extends @component_ident_type_repr, IdentTypeRepr { } +class ComponentIdentTypeReprBase extends @component_ident_type_repr, IdentTypeRepr { + cached + override Element getAChild() { + none() or + result = IdentTypeRepr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/CompositionTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/CompositionTypeRepr.qll index b0789100618..a3f6c05777b 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/CompositionTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/CompositionTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class CompositionTypeReprBase extends @composition_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "CompositionTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/CompoundIdentTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/CompoundIdentTypeRepr.qll index 7c1c3548272..6c7b5cecfe4 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/CompoundIdentTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/CompoundIdentTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.IdentTypeRepr class CompoundIdentTypeReprBase extends @compound_ident_type_repr, IdentTypeRepr { override string getAPrimaryQlClass() { result = "CompoundIdentTypeRepr" } + + cached + override Element getAChild() { + none() or + result = IdentTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/DictionaryTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/DictionaryTypeRepr.qll index 692b9352e20..a7823ad2a45 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/DictionaryTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/DictionaryTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class DictionaryTypeReprBase extends @dictionary_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "DictionaryTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ErrorTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ErrorTypeRepr.qll index 511f7e25569..beb6a3a7c4e 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ErrorTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ErrorTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class ErrorTypeReprBase extends @error_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "ErrorTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ExistentialTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ExistentialTypeRepr.qll index 43aefeed5a9..247e3c1ad34 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ExistentialTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ExistentialTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class ExistentialTypeReprBase extends @existential_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "ExistentialTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/FixedTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/FixedTypeRepr.qll index 2a6e59a90a8..71b1df93f5f 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/FixedTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/FixedTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class FixedTypeReprBase extends @fixed_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "FixedTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/FunctionTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/FunctionTypeRepr.qll index da781a90d4b..87e909fa434 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/FunctionTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/FunctionTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class FunctionTypeReprBase extends @function_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "FunctionTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/GenericIdentTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/GenericIdentTypeRepr.qll index 101985aca56..4095ce8beb8 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/GenericIdentTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/GenericIdentTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.ComponentIdentTypeRepr class GenericIdentTypeReprBase extends @generic_ident_type_repr, ComponentIdentTypeRepr { override string getAPrimaryQlClass() { result = "GenericIdentTypeRepr" } + + cached + override Element getAChild() { + none() or + result = ComponentIdentTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/IdentTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/IdentTypeRepr.qll index d71eca38b92..28078ff567b 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/IdentTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/IdentTypeRepr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr -class IdentTypeReprBase extends @ident_type_repr, TypeRepr { } +class IdentTypeReprBase extends @ident_type_repr, TypeRepr { + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ImplicitlyUnwrappedOptionalTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ImplicitlyUnwrappedOptionalTypeRepr.qll index e0759e0fa3c..6f4d41815e6 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ImplicitlyUnwrappedOptionalTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ImplicitlyUnwrappedOptionalTypeRepr.qll @@ -1,7 +1,14 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class ImplicitlyUnwrappedOptionalTypeReprBase extends @implicitly_unwrapped_optional_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "ImplicitlyUnwrappedOptionalTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/InOutTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/InOutTypeRepr.qll index a7adf859579..b874cb5f179 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/InOutTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/InOutTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.SpecifierTypeRepr class InOutTypeReprBase extends @in_out_type_repr, SpecifierTypeRepr { override string getAPrimaryQlClass() { result = "InOutTypeRepr" } + + cached + override Element getAChild() { + none() or + result = SpecifierTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/IsolatedTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/IsolatedTypeRepr.qll index 63dcdd9e379..2fb8bef8757 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/IsolatedTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/IsolatedTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.SpecifierTypeRepr class IsolatedTypeReprBase extends @isolated_type_repr, SpecifierTypeRepr { override string getAPrimaryQlClass() { result = "IsolatedTypeRepr" } + + cached + override Element getAChild() { + none() or + result = SpecifierTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/MetatypeTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/MetatypeTypeRepr.qll index e0477db158b..96c4b094747 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/MetatypeTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/MetatypeTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class MetatypeTypeReprBase extends @metatype_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "MetatypeTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/NamedOpaqueReturnTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/NamedOpaqueReturnTypeRepr.qll index af885d21ab4..0d2a66dd7f1 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/NamedOpaqueReturnTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/NamedOpaqueReturnTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class NamedOpaqueReturnTypeReprBase extends @named_opaque_return_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "NamedOpaqueReturnTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/OpaqueReturnTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/OpaqueReturnTypeRepr.qll index 7ecb38e22c6..fff9071a4f5 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/OpaqueReturnTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/OpaqueReturnTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class OpaqueReturnTypeReprBase extends @opaque_return_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "OpaqueReturnTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/OptionalTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/OptionalTypeRepr.qll index 62a24285ef5..9425a2928ca 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/OptionalTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/OptionalTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class OptionalTypeReprBase extends @optional_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "OptionalTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/OwnedTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/OwnedTypeRepr.qll index b24ca1aa597..143b870a2e0 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/OwnedTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/OwnedTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.SpecifierTypeRepr class OwnedTypeReprBase extends @owned_type_repr, SpecifierTypeRepr { override string getAPrimaryQlClass() { result = "OwnedTypeRepr" } + + cached + override Element getAChild() { + none() or + result = SpecifierTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/PlaceholderTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/PlaceholderTypeRepr.qll index 5bb446c9c73..0ac1f6ddf61 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/PlaceholderTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/PlaceholderTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class PlaceholderTypeReprBase extends @placeholder_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "PlaceholderTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/ProtocolTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/ProtocolTypeRepr.qll index 1b2e7fb2652..16074816ee0 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/ProtocolTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/ProtocolTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class ProtocolTypeReprBase extends @protocol_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "ProtocolTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/SharedTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/SharedTypeRepr.qll index ca9254217c9..5e2a6e4c58f 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/SharedTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/SharedTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.SpecifierTypeRepr class SharedTypeReprBase extends @shared_type_repr, SpecifierTypeRepr { override string getAPrimaryQlClass() { result = "SharedTypeRepr" } + + cached + override Element getAChild() { + none() or + result = SpecifierTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/SilBoxTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/SilBoxTypeRepr.qll index 47d4585511b..c219965ed00 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/SilBoxTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/SilBoxTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class SilBoxTypeReprBase extends @sil_box_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "SilBoxTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/SimpleIdentTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/SimpleIdentTypeRepr.qll index 328b8bc7e69..821f1db8ddf 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/SimpleIdentTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/SimpleIdentTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.ComponentIdentTypeRepr class SimpleIdentTypeReprBase extends @simple_ident_type_repr, ComponentIdentTypeRepr { override string getAPrimaryQlClass() { result = "SimpleIdentTypeRepr" } + + cached + override Element getAChild() { + none() or + result = ComponentIdentTypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/SpecifierTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/SpecifierTypeRepr.qll index 469aa3413d1..7a86a19ba54 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/SpecifierTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/SpecifierTypeRepr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr -class SpecifierTypeReprBase extends @specifier_type_repr, TypeRepr { } +class SpecifierTypeReprBase extends @specifier_type_repr, TypeRepr { + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } +} diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/TupleTypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/TupleTypeRepr.qll index 79e65037aa9..cd96f740b65 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/TupleTypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/TupleTypeRepr.qll @@ -1,6 +1,13 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.typerepr.TypeRepr class TupleTypeReprBase extends @tuple_type_repr, TypeRepr { override string getAPrimaryQlClass() { result = "TupleTypeRepr" } + + cached + override Element getAChild() { + none() or + result = TypeRepr.super.getAChild() + } } diff --git a/swift/ql/lib/codeql/swift/generated/typerepr/TypeRepr.qll b/swift/ql/lib/codeql/swift/generated/typerepr/TypeRepr.qll index 497ac46fa64..5a57918ffc7 100644 --- a/swift/ql/lib/codeql/swift/generated/typerepr/TypeRepr.qll +++ b/swift/ql/lib/codeql/swift/generated/typerepr/TypeRepr.qll @@ -1,4 +1,11 @@ // generated by codegen/codegen.py +import codeql.swift.elements.Element import codeql.swift.elements.AstNode -class TypeReprBase extends @type_repr, AstNode { } +class TypeReprBase extends @type_repr, AstNode { + cached + override Element getAChild() { + none() or + result = AstNode.super.getAChild() + } +} diff --git a/swift/ql/lib/swift.dbscheme b/swift/ql/lib/swift.dbscheme index 2454395b524..71903a0880a 100644 --- a/swift/ql/lib/swift.dbscheme +++ b/swift/ql/lib/swift.dbscheme @@ -1002,8 +1002,8 @@ super_ref_exprs( tap_exprs( unique int id: @tap_expr, - int var: @var_decl ref, - int body: @brace_stmt ref + int body: @brace_stmt ref, + int var: @var_decl ref ); #keyset[id] diff --git a/swift/ql/test/extractor-tests/declarations/accessor.expected b/swift/ql/test/extractor-tests/declarations/accessor.expected index d47ce163c5d..69576471efa 100644 --- a/swift/ql/test/extractor-tests/declarations/accessor.expected +++ b/swift/ql/test/extractor-tests/declarations/accessor.expected @@ -1,53 +1,53 @@ -| test.swift:2:7:2:7 | (unnamed function decl) | ? | -| test.swift:2:7:2:7 | get | get | -| test.swift:2:7:2:7 | set | set | -| test.swift:3:7:3:7 | (unnamed function decl) | ? | -| test.swift:4:5:4:24 | get | get | -| test.swift:5:5:5:38 | set | set | -| test.swift:9:17:9:17 | (unnamed function decl) | ? | -| test.swift:9:17:9:17 | get | get | -| test.swift:9:17:9:17 | set | set | -| test.swift:23:9:23:9 | (unnamed function decl) | ? | -| test.swift:23:31:23:31 | get | get | -| test.swift:23:35:23:35 | set | set | -| test.swift:24:40:24:40 | get | get | -| test.swift:32:3:34:3 | get | get | -| test.swift:35:3:35:18 | set | set | -| test.swift:41:7:41:7 | (unnamed function decl) | ? | -| test.swift:41:7:41:7 | get | get | -| test.swift:41:7:41:7 | set | set | -| test.swift:70:5:72:5 | get | get | -| test.swift:77:20:77:20 | get | get | -| test.swift:82:7:82:7 | (unnamed function decl) | ? | -| test.swift:83:5:83:11 | set | set | -| test.swift:84:5:86:5 | get | get | -| test.swift:91:27:93:3 | get | get | -| test.swift:97:5:99:5 | get | get | -| test.swift:102:7:102:7 | (unnamed function decl) | ? | -| test.swift:102:7:102:7 | get | get | -| test.swift:102:7:102:7 | set | set | -| test.swift:104:3:104:3 | (unnamed function decl) | ? | -| test.swift:105:5:107:5 | get | get | -| test.swift:108:5:108:11 | set | set | -| test.swift:111:37:113:3 | get | get | -| test.swift:115:7:115:7 | (unnamed function decl) | ? | -| test.swift:115:7:115:7 | get | get | -| test.swift:115:7:115:7 | set | set | -| test.swift:116:5:116:25 | willSet | willSet | -| test.swift:119:7:119:7 | (unnamed function decl) | ? | -| test.swift:119:7:119:7 | get | get | -| test.swift:119:7:119:7 | set | set | -| test.swift:120:5:120:15 | willSet | willSet | -| test.swift:123:7:123:7 | (unnamed function decl) | ? | -| test.swift:123:7:123:7 | get | get | -| test.swift:123:7:123:7 | set | set | -| test.swift:124:5:124:24 | didSet | didSet | -| test.swift:127:7:127:7 | (unnamed function decl) | ? | -| test.swift:127:7:127:7 | get | get | -| test.swift:127:7:127:7 | set | set | -| test.swift:128:5:128:14 | didSet | didSet | -| test.swift:131:7:131:7 | (unnamed function decl) | ? | -| test.swift:131:7:131:7 | get | get | -| test.swift:131:7:131:7 | set | set | -| test.swift:132:5:132:15 | willSet | willSet | -| test.swift:134:5:134:14 | didSet | didSet | +| declarations.swift:2:7:2:7 | (unnamed function decl) | ? | +| declarations.swift:2:7:2:7 | get | get | +| declarations.swift:2:7:2:7 | set | set | +| declarations.swift:3:7:3:7 | (unnamed function decl) | ? | +| declarations.swift:4:5:4:24 | get | get | +| declarations.swift:5:5:5:38 | set | set | +| declarations.swift:9:17:9:17 | (unnamed function decl) | ? | +| declarations.swift:9:17:9:17 | get | get | +| declarations.swift:9:17:9:17 | set | set | +| declarations.swift:23:9:23:9 | (unnamed function decl) | ? | +| declarations.swift:23:31:23:31 | get | get | +| declarations.swift:23:35:23:35 | set | set | +| declarations.swift:24:40:24:40 | get | get | +| declarations.swift:32:3:34:3 | get | get | +| declarations.swift:35:3:35:18 | set | set | +| declarations.swift:41:7:41:7 | (unnamed function decl) | ? | +| declarations.swift:41:7:41:7 | get | get | +| declarations.swift:41:7:41:7 | set | set | +| declarations.swift:70:5:72:5 | get | get | +| declarations.swift:77:20:77:20 | get | get | +| declarations.swift:82:7:82:7 | (unnamed function decl) | ? | +| declarations.swift:83:5:83:11 | set | set | +| declarations.swift:84:5:86:5 | get | get | +| declarations.swift:91:27:93:3 | get | get | +| declarations.swift:97:5:99:5 | get | get | +| declarations.swift:102:7:102:7 | (unnamed function decl) | ? | +| declarations.swift:102:7:102:7 | get | get | +| declarations.swift:102:7:102:7 | set | set | +| declarations.swift:104:3:104:3 | (unnamed function decl) | ? | +| declarations.swift:105:5:107:5 | get | get | +| declarations.swift:108:5:108:11 | set | set | +| declarations.swift:111:37:113:3 | get | get | +| declarations.swift:115:7:115:7 | (unnamed function decl) | ? | +| declarations.swift:115:7:115:7 | get | get | +| declarations.swift:115:7:115:7 | set | set | +| declarations.swift:116:5:116:25 | willSet | willSet | +| declarations.swift:119:7:119:7 | (unnamed function decl) | ? | +| declarations.swift:119:7:119:7 | get | get | +| declarations.swift:119:7:119:7 | set | set | +| declarations.swift:120:5:120:15 | willSet | willSet | +| declarations.swift:123:7:123:7 | (unnamed function decl) | ? | +| declarations.swift:123:7:123:7 | get | get | +| declarations.swift:123:7:123:7 | set | set | +| declarations.swift:124:5:124:24 | didSet | didSet | +| declarations.swift:127:7:127:7 | (unnamed function decl) | ? | +| declarations.swift:127:7:127:7 | get | get | +| declarations.swift:127:7:127:7 | set | set | +| declarations.swift:128:5:128:14 | didSet | didSet | +| declarations.swift:131:7:131:7 | (unnamed function decl) | ? | +| declarations.swift:131:7:131:7 | get | get | +| declarations.swift:131:7:131:7 | set | set | +| declarations.swift:132:5:132:15 | willSet | willSet | +| declarations.swift:134:5:134:14 | didSet | didSet | diff --git a/swift/ql/test/extractor-tests/declarations/all.expected b/swift/ql/test/extractor-tests/declarations/all.expected index 0b4f70a71c7..ca79492c33b 100644 --- a/swift/ql/test/extractor-tests/declarations/all.expected +++ b/swift/ql/test/extractor-tests/declarations/all.expected @@ -1,207 +1,207 @@ -| test.swift:1:1:7:1 | Foo | -| test.swift:1:8:1:8 | deinit | -| test.swift:1:8:1:8 | deinit | -| test.swift:1:8:1:8 | x | -| test.swift:2:3:2:11 | var ... = ... | -| test.swift:2:7:2:7 | (unnamed function decl) | -| test.swift:2:7:2:7 | get | -| test.swift:2:7:2:7 | self | -| test.swift:2:7:2:7 | self | -| test.swift:2:7:2:7 | self | -| test.swift:2:7:2:7 | set | -| test.swift:2:7:2:7 | value | -| test.swift:2:7:2:7 | x | -| test.swift:3:3:6:3 | var ... = ... | -| test.swift:3:7:3:7 | (unnamed function decl) | -| test.swift:3:7:3:7 | next | -| test.swift:3:7:3:7 | self | -| test.swift:4:5:4:5 | self | -| test.swift:4:5:4:24 | get | -| test.swift:5:5:5:5 | self | -| test.swift:5:5:5:38 | set | -| test.swift:5:9:5:9 | newValue | -| test.swift:9:1:9:34 | Bar | -| test.swift:9:7:9:7 | deinit | -| test.swift:9:7:9:7 | init | -| test.swift:9:13:9:30 | var ... = ... | -| test.swift:9:17:9:17 | (unnamed function decl) | -| test.swift:9:17:9:17 | get | -| test.swift:9:17:9:17 | self | -| test.swift:9:17:9:17 | self | -| test.swift:9:17:9:17 | self | -| test.swift:9:17:9:17 | set | -| test.swift:9:17:9:17 | value | -| test.swift:9:17:9:17 | x | -| test.swift:11:1:14:1 | EnumValues | -| test.swift:12:5:12:18 | case ... | -| test.swift:12:10:12:10 | value1 | -| test.swift:12:18:12:18 | value2 | -| test.swift:13:5:13:26 | case ... | -| test.swift:13:10:13:10 | value3 | -| test.swift:13:18:13:18 | value4 | -| test.swift:13:26:13:26 | value5 | -| test.swift:16:1:20:1 | EnumWithParams | -| test.swift:17:5:17:22 | case ... | -| test.swift:17:10:17:22 | nodata1 | -| test.swift:17:18:17:18 | _ | -| test.swift:18:5:18:21 | case ... | -| test.swift:18:10:18:21 | intdata | -| test.swift:18:18:18:18 | _ | -| test.swift:19:5:19:35 | case ... | -| test.swift:19:10:19:35 | tuple | -| test.swift:19:16:19:16 | _ | -| test.swift:19:21:19:21 | _ | -| test.swift:19:29:19:29 | _ | -| test.swift:22:1:26:1 | MyProtocol | -| test.swift:23:5:23:39 | var ... = ... | -| test.swift:23:9:23:9 | (unnamed function decl) | -| test.swift:23:9:23:9 | mustBeSettable | -| test.swift:23:31:23:31 | get | -| test.swift:23:35:23:35 | newValue | -| test.swift:23:35:23:35 | set | -| test.swift:24:5:24:44 | var ... = ... | -| test.swift:24:9:24:9 | doesNotNeedToBeSettable | -| test.swift:24:40:24:40 | get | -| test.swift:25:5:25:22 | random | -| test.swift:28:1:28:37 | a_function | -| test.swift:28:17:28:31 | a_parameter | -| test.swift:30:1:30:18 | var ... = ... | -| test.swift:30:1:30:18 | { ... } | -| test.swift:30:5:30:5 | a_variable | -| test.swift:31:1:36:1 | var ... = ... | -| test.swift:31:1:36:1 | { ... } | -| test.swift:31:5:31:5 | a_property | -| test.swift:32:3:34:3 | get | -| test.swift:35:3:35:18 | set | -| test.swift:35:7:35:7 | newValue | -| test.swift:38:1:38:33 | { ... } | -| test.swift:40:1:53:1 | Baz | -| test.swift:41:3:41:14 | var ... = ... | -| test.swift:41:7:41:7 | (unnamed function decl) | -| test.swift:41:7:41:7 | field | -| test.swift:41:7:41:7 | get | -| test.swift:41:7:41:7 | self | -| test.swift:41:7:41:7 | self | -| test.swift:41:7:41:7 | self | -| test.swift:41:7:41:7 | set | -| test.swift:41:7:41:7 | value | -| test.swift:42:3:42:3 | self | -| test.swift:42:3:44:3 | deinit | -| test.swift:46:3:46:3 | self | -| test.swift:46:3:48:3 | init | -| test.swift:50:3:52:3 | +- | -| test.swift:50:26:50:33 | other | -| test.swift:55:8:55:17 | +- | -| test.swift:57:1:62:1 | precedencegroup ... | -| test.swift:64:7:64:16 | +++ | -| test.swift:66:7:66:21 | *** | -| test.swift:68:18:74:1 | ZeroWrapper | -| test.swift:68:25:68:25 | deinit | -| test.swift:69:3:73:3 | var ... = ... | -| test.swift:69:7:69:7 | wrappedValue | -| test.swift:70:5:72:5 | get | -| test.swift:76:1:79:1 | foo | -| test.swift:77:16:77:23 | var ... = ... | -| test.swift:77:20:77:20 | _x | -| test.swift:77:20:77:20 | get | -| test.swift:77:20:77:20 | x | -| test.swift:81:1:136:1 | HasPropertyAndObserver | -| test.swift:81:8:81:8 | deinit | -| test.swift:81:8:81:8 | hasBoth | -| test.swift:81:8:81:8 | hasDidSet1 | -| test.swift:81:8:81:8 | hasDidSet2 | -| test.swift:81:8:81:8 | hasWillSet1 | -| test.swift:81:8:81:8 | hasWillSet2 | -| test.swift:81:8:81:8 | normalField | -| test.swift:82:3:87:3 | var ... = ... | -| test.swift:82:7:82:7 | (unnamed function decl) | -| test.swift:82:7:82:7 | self | -| test.swift:82:7:82:7 | settableField | -| test.swift:83:5:83:5 | newValue | -| test.swift:83:5:83:11 | set | -| test.swift:84:5:86:5 | get | -| test.swift:91:3:93:3 | var ... = ... | -| test.swift:91:7:91:7 | readOnlyField1 | -| test.swift:91:27:93:3 | get | -| test.swift:96:3:100:3 | var ... = ... | -| test.swift:96:7:96:7 | readOnlyField2 | -| test.swift:97:5:99:5 | get | -| test.swift:102:3:102:21 | var ... = ... | -| test.swift:102:7:102:7 | (unnamed function decl) | -| test.swift:102:7:102:7 | get | -| test.swift:102:7:102:7 | normalField | -| test.swift:102:7:102:7 | self | -| test.swift:102:7:102:7 | self | -| test.swift:102:7:102:7 | self | -| test.swift:102:7:102:7 | set | -| test.swift:102:7:102:7 | value | -| test.swift:104:3:104:3 | (unnamed function decl) | -| test.swift:104:3:104:3 | self | -| test.swift:104:3:109:3 | subscript ... | -| test.swift:104:13:104:13 | x | -| test.swift:104:13:104:13 | x | -| test.swift:104:13:104:16 | x | -| test.swift:105:5:107:5 | get | -| test.swift:108:5:108:5 | newValue | -| test.swift:108:5:108:11 | set | -| test.swift:111:3:113:3 | subscript ... | -| test.swift:111:13:111:13 | x | -| test.swift:111:13:111:16 | x | -| test.swift:111:21:111:21 | y | -| test.swift:111:21:111:25 | y | -| test.swift:111:37:113:3 | get | -| test.swift:115:3:117:3 | var ... = ... | -| test.swift:115:7:115:7 | (unnamed function decl) | -| test.swift:115:7:115:7 | get | -| test.swift:115:7:115:7 | hasWillSet1 | -| test.swift:115:7:115:7 | self | -| test.swift:115:7:115:7 | self | -| test.swift:115:7:115:7 | self | -| test.swift:115:7:115:7 | set | -| test.swift:115:7:115:7 | value | -| test.swift:116:5:116:25 | willSet | -| test.swift:116:13:116:13 | newValue | -| test.swift:119:3:121:3 | var ... = ... | -| test.swift:119:7:119:7 | (unnamed function decl) | -| test.swift:119:7:119:7 | get | -| test.swift:119:7:119:7 | hasWillSet2 | -| test.swift:119:7:119:7 | self | -| test.swift:119:7:119:7 | self | -| test.swift:119:7:119:7 | self | -| test.swift:119:7:119:7 | set | -| test.swift:119:7:119:7 | value | -| test.swift:120:5:120:5 | newValue | -| test.swift:120:5:120:15 | willSet | -| test.swift:123:3:125:3 | var ... = ... | -| test.swift:123:7:123:7 | (unnamed function decl) | -| test.swift:123:7:123:7 | get | -| test.swift:123:7:123:7 | hasDidSet1 | -| test.swift:123:7:123:7 | self | -| test.swift:123:7:123:7 | self | -| test.swift:123:7:123:7 | self | -| test.swift:123:7:123:7 | set | -| test.swift:123:7:123:7 | value | -| test.swift:124:5:124:24 | didSet | -| test.swift:124:12:124:12 | oldValue | -| test.swift:127:3:129:3 | var ... = ... | -| test.swift:127:7:127:7 | (unnamed function decl) | -| test.swift:127:7:127:7 | get | -| test.swift:127:7:127:7 | hasDidSet2 | -| test.swift:127:7:127:7 | self | -| test.swift:127:7:127:7 | self | -| test.swift:127:7:127:7 | self | -| test.swift:127:7:127:7 | set | -| test.swift:127:7:127:7 | value | -| test.swift:128:5:128:14 | didSet | -| test.swift:131:3:135:3 | var ... = ... | -| test.swift:131:7:131:7 | (unnamed function decl) | -| test.swift:131:7:131:7 | get | -| test.swift:131:7:131:7 | hasBoth | -| test.swift:131:7:131:7 | self | -| test.swift:131:7:131:7 | self | -| test.swift:131:7:131:7 | self | -| test.swift:131:7:131:7 | set | -| test.swift:131:7:131:7 | value | -| test.swift:132:5:132:5 | newValue | -| test.swift:132:5:132:15 | willSet | -| test.swift:134:5:134:14 | didSet | +| declarations.swift:1:1:7:1 | Foo | +| declarations.swift:1:8:1:8 | deinit | +| declarations.swift:1:8:1:8 | deinit | +| declarations.swift:1:8:1:8 | x | +| declarations.swift:2:3:2:11 | var ... = ... | +| declarations.swift:2:7:2:7 | (unnamed function decl) | +| declarations.swift:2:7:2:7 | get | +| declarations.swift:2:7:2:7 | self | +| declarations.swift:2:7:2:7 | self | +| declarations.swift:2:7:2:7 | self | +| declarations.swift:2:7:2:7 | set | +| declarations.swift:2:7:2:7 | value | +| declarations.swift:2:7:2:7 | x | +| declarations.swift:3:3:6:3 | var ... = ... | +| declarations.swift:3:7:3:7 | (unnamed function decl) | +| declarations.swift:3:7:3:7 | next | +| declarations.swift:3:7:3:7 | self | +| declarations.swift:4:5:4:5 | self | +| declarations.swift:4:5:4:24 | get | +| declarations.swift:5:5:5:5 | self | +| declarations.swift:5:5:5:38 | set | +| declarations.swift:5:9:5:9 | newValue | +| declarations.swift:9:1:9:34 | Bar | +| declarations.swift:9:7:9:7 | deinit | +| declarations.swift:9:7:9:7 | init | +| declarations.swift:9:13:9:30 | var ... = ... | +| declarations.swift:9:17:9:17 | (unnamed function decl) | +| declarations.swift:9:17:9:17 | get | +| declarations.swift:9:17:9:17 | self | +| declarations.swift:9:17:9:17 | self | +| declarations.swift:9:17:9:17 | self | +| declarations.swift:9:17:9:17 | set | +| declarations.swift:9:17:9:17 | value | +| declarations.swift:9:17:9:17 | x | +| declarations.swift:11:1:14:1 | EnumValues | +| declarations.swift:12:5:12:18 | case ... | +| declarations.swift:12:10:12:10 | value1 | +| declarations.swift:12:18:12:18 | value2 | +| declarations.swift:13:5:13:26 | case ... | +| declarations.swift:13:10:13:10 | value3 | +| declarations.swift:13:18:13:18 | value4 | +| declarations.swift:13:26:13:26 | value5 | +| declarations.swift:16:1:20:1 | EnumWithParams | +| declarations.swift:17:5:17:22 | case ... | +| declarations.swift:17:10:17:22 | nodata1 | +| declarations.swift:17:18:17:18 | _ | +| declarations.swift:18:5:18:21 | case ... | +| declarations.swift:18:10:18:21 | intdata | +| declarations.swift:18:18:18:18 | _ | +| declarations.swift:19:5:19:35 | case ... | +| declarations.swift:19:10:19:35 | tuple | +| declarations.swift:19:16:19:16 | _ | +| declarations.swift:19:21:19:21 | _ | +| declarations.swift:19:29:19:29 | _ | +| declarations.swift:22:1:26:1 | MyProtocol | +| declarations.swift:23:5:23:39 | var ... = ... | +| declarations.swift:23:9:23:9 | (unnamed function decl) | +| declarations.swift:23:9:23:9 | mustBeSettable | +| declarations.swift:23:31:23:31 | get | +| declarations.swift:23:35:23:35 | newValue | +| declarations.swift:23:35:23:35 | set | +| declarations.swift:24:5:24:44 | var ... = ... | +| declarations.swift:24:9:24:9 | doesNotNeedToBeSettable | +| declarations.swift:24:40:24:40 | get | +| declarations.swift:25:5:25:22 | random | +| declarations.swift:28:1:28:37 | a_function | +| declarations.swift:28:17:28:31 | a_parameter | +| declarations.swift:30:1:30:18 | var ... = ... | +| declarations.swift:30:1:30:18 | { ... } | +| declarations.swift:30:5:30:5 | a_variable | +| declarations.swift:31:1:36:1 | var ... = ... | +| declarations.swift:31:1:36:1 | { ... } | +| declarations.swift:31:5:31:5 | a_property | +| declarations.swift:32:3:34:3 | get | +| declarations.swift:35:3:35:18 | set | +| declarations.swift:35:7:35:7 | newValue | +| declarations.swift:38:1:38:33 | { ... } | +| declarations.swift:40:1:53:1 | Baz | +| declarations.swift:41:3:41:14 | var ... = ... | +| declarations.swift:41:7:41:7 | (unnamed function decl) | +| declarations.swift:41:7:41:7 | field | +| declarations.swift:41:7:41:7 | get | +| declarations.swift:41:7:41:7 | self | +| declarations.swift:41:7:41:7 | self | +| declarations.swift:41:7:41:7 | self | +| declarations.swift:41:7:41:7 | set | +| declarations.swift:41:7:41:7 | value | +| declarations.swift:42:3:42:3 | self | +| declarations.swift:42:3:44:3 | deinit | +| declarations.swift:46:3:46:3 | self | +| declarations.swift:46:3:48:3 | init | +| declarations.swift:50:3:52:3 | +- | +| declarations.swift:50:26:50:33 | other | +| declarations.swift:55:8:55:17 | +- | +| declarations.swift:57:1:62:1 | precedencegroup ... | +| declarations.swift:64:7:64:16 | +++ | +| declarations.swift:66:7:66:21 | *** | +| declarations.swift:68:18:74:1 | ZeroWrapper | +| declarations.swift:68:25:68:25 | deinit | +| declarations.swift:69:3:73:3 | var ... = ... | +| declarations.swift:69:7:69:7 | wrappedValue | +| declarations.swift:70:5:72:5 | get | +| declarations.swift:76:1:79:1 | foo | +| declarations.swift:77:16:77:23 | var ... = ... | +| declarations.swift:77:20:77:20 | _x | +| declarations.swift:77:20:77:20 | get | +| declarations.swift:77:20:77:20 | x | +| declarations.swift:81:1:136:1 | HasPropertyAndObserver | +| declarations.swift:81:8:81:8 | deinit | +| declarations.swift:81:8:81:8 | hasBoth | +| declarations.swift:81:8:81:8 | hasDidSet1 | +| declarations.swift:81:8:81:8 | hasDidSet2 | +| declarations.swift:81:8:81:8 | hasWillSet1 | +| declarations.swift:81:8:81:8 | hasWillSet2 | +| declarations.swift:81:8:81:8 | normalField | +| declarations.swift:82:3:87:3 | var ... = ... | +| declarations.swift:82:7:82:7 | (unnamed function decl) | +| declarations.swift:82:7:82:7 | self | +| declarations.swift:82:7:82:7 | settableField | +| declarations.swift:83:5:83:5 | newValue | +| declarations.swift:83:5:83:11 | set | +| declarations.swift:84:5:86:5 | get | +| declarations.swift:91:3:93:3 | var ... = ... | +| declarations.swift:91:7:91:7 | readOnlyField1 | +| declarations.swift:91:27:93:3 | get | +| declarations.swift:96:3:100:3 | var ... = ... | +| declarations.swift:96:7:96:7 | readOnlyField2 | +| declarations.swift:97:5:99:5 | get | +| declarations.swift:102:3:102:21 | var ... = ... | +| declarations.swift:102:7:102:7 | (unnamed function decl) | +| declarations.swift:102:7:102:7 | get | +| declarations.swift:102:7:102:7 | normalField | +| declarations.swift:102:7:102:7 | self | +| declarations.swift:102:7:102:7 | self | +| declarations.swift:102:7:102:7 | self | +| declarations.swift:102:7:102:7 | set | +| declarations.swift:102:7:102:7 | value | +| declarations.swift:104:3:104:3 | (unnamed function decl) | +| declarations.swift:104:3:104:3 | self | +| declarations.swift:104:3:109:3 | subscript ... | +| declarations.swift:104:13:104:13 | x | +| declarations.swift:104:13:104:13 | x | +| declarations.swift:104:13:104:16 | x | +| declarations.swift:105:5:107:5 | get | +| declarations.swift:108:5:108:5 | newValue | +| declarations.swift:108:5:108:11 | set | +| declarations.swift:111:3:113:3 | subscript ... | +| declarations.swift:111:13:111:13 | x | +| declarations.swift:111:13:111:16 | x | +| declarations.swift:111:21:111:21 | y | +| declarations.swift:111:21:111:25 | y | +| declarations.swift:111:37:113:3 | get | +| declarations.swift:115:3:117:3 | var ... = ... | +| declarations.swift:115:7:115:7 | (unnamed function decl) | +| declarations.swift:115:7:115:7 | get | +| declarations.swift:115:7:115:7 | hasWillSet1 | +| declarations.swift:115:7:115:7 | self | +| declarations.swift:115:7:115:7 | self | +| declarations.swift:115:7:115:7 | self | +| declarations.swift:115:7:115:7 | set | +| declarations.swift:115:7:115:7 | value | +| declarations.swift:116:5:116:25 | willSet | +| declarations.swift:116:13:116:13 | newValue | +| declarations.swift:119:3:121:3 | var ... = ... | +| declarations.swift:119:7:119:7 | (unnamed function decl) | +| declarations.swift:119:7:119:7 | get | +| declarations.swift:119:7:119:7 | hasWillSet2 | +| declarations.swift:119:7:119:7 | self | +| declarations.swift:119:7:119:7 | self | +| declarations.swift:119:7:119:7 | self | +| declarations.swift:119:7:119:7 | set | +| declarations.swift:119:7:119:7 | value | +| declarations.swift:120:5:120:5 | newValue | +| declarations.swift:120:5:120:15 | willSet | +| declarations.swift:123:3:125:3 | var ... = ... | +| declarations.swift:123:7:123:7 | (unnamed function decl) | +| declarations.swift:123:7:123:7 | get | +| declarations.swift:123:7:123:7 | hasDidSet1 | +| declarations.swift:123:7:123:7 | self | +| declarations.swift:123:7:123:7 | self | +| declarations.swift:123:7:123:7 | self | +| declarations.swift:123:7:123:7 | set | +| declarations.swift:123:7:123:7 | value | +| declarations.swift:124:5:124:24 | didSet | +| declarations.swift:124:12:124:12 | oldValue | +| declarations.swift:127:3:129:3 | var ... = ... | +| declarations.swift:127:7:127:7 | (unnamed function decl) | +| declarations.swift:127:7:127:7 | get | +| declarations.swift:127:7:127:7 | hasDidSet2 | +| declarations.swift:127:7:127:7 | self | +| declarations.swift:127:7:127:7 | self | +| declarations.swift:127:7:127:7 | self | +| declarations.swift:127:7:127:7 | set | +| declarations.swift:127:7:127:7 | value | +| declarations.swift:128:5:128:14 | didSet | +| declarations.swift:131:3:135:3 | var ... = ... | +| declarations.swift:131:7:131:7 | (unnamed function decl) | +| declarations.swift:131:7:131:7 | get | +| declarations.swift:131:7:131:7 | hasBoth | +| declarations.swift:131:7:131:7 | self | +| declarations.swift:131:7:131:7 | self | +| declarations.swift:131:7:131:7 | self | +| declarations.swift:131:7:131:7 | set | +| declarations.swift:131:7:131:7 | value | +| declarations.swift:132:5:132:5 | newValue | +| declarations.swift:132:5:132:15 | willSet | +| declarations.swift:134:5:134:14 | didSet | diff --git a/swift/ql/test/extractor-tests/declarations/test.swift b/swift/ql/test/extractor-tests/declarations/declarations.swift similarity index 100% rename from swift/ql/test/extractor-tests/declarations/test.swift rename to swift/ql/test/extractor-tests/declarations/declarations.swift diff --git a/swift/ql/test/extractor-tests/declarations/func.expected b/swift/ql/test/extractor-tests/declarations/func.expected index 5eb8c4e6f30..e1f71cb9fef 100644 --- a/swift/ql/test/extractor-tests/declarations/func.expected +++ b/swift/ql/test/extractor-tests/declarations/func.expected @@ -1,57 +1,57 @@ -| test.swift:2:7:2:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:2:7:2:7 | get | (unnamed function decl) | -| test.swift:2:7:2:7 | set | (unnamed function decl) | -| test.swift:3:7:3:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:4:5:4:24 | get | (unnamed function decl) | -| test.swift:5:5:5:38 | set | (unnamed function decl) | -| test.swift:9:17:9:17 | (unnamed function decl) | (unnamed function decl) | -| test.swift:9:17:9:17 | get | (unnamed function decl) | -| test.swift:9:17:9:17 | set | (unnamed function decl) | -| test.swift:23:9:23:9 | (unnamed function decl) | (unnamed function decl) | -| test.swift:23:31:23:31 | get | (unnamed function decl) | -| test.swift:23:35:23:35 | set | (unnamed function decl) | -| test.swift:24:40:24:40 | get | (unnamed function decl) | -| test.swift:25:5:25:22 | random | random | -| test.swift:28:1:28:37 | a_function | a_function | -| test.swift:32:3:34:3 | get | (unnamed function decl) | -| test.swift:35:3:35:18 | set | (unnamed function decl) | -| test.swift:41:7:41:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:41:7:41:7 | get | (unnamed function decl) | -| test.swift:41:7:41:7 | set | (unnamed function decl) | -| test.swift:50:3:52:3 | +- | +- | -| test.swift:70:5:72:5 | get | (unnamed function decl) | -| test.swift:76:1:79:1 | foo | foo | -| test.swift:77:20:77:20 | get | (unnamed function decl) | -| test.swift:82:7:82:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:83:5:83:11 | set | (unnamed function decl) | -| test.swift:84:5:86:5 | get | (unnamed function decl) | -| test.swift:91:27:93:3 | get | (unnamed function decl) | -| test.swift:97:5:99:5 | get | (unnamed function decl) | -| test.swift:102:7:102:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:102:7:102:7 | get | (unnamed function decl) | -| test.swift:102:7:102:7 | set | (unnamed function decl) | -| test.swift:104:3:104:3 | (unnamed function decl) | (unnamed function decl) | -| test.swift:105:5:107:5 | get | (unnamed function decl) | -| test.swift:108:5:108:11 | set | (unnamed function decl) | -| test.swift:111:37:113:3 | get | (unnamed function decl) | -| test.swift:115:7:115:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:115:7:115:7 | get | (unnamed function decl) | -| test.swift:115:7:115:7 | set | (unnamed function decl) | -| test.swift:116:5:116:25 | willSet | (unnamed function decl) | -| test.swift:119:7:119:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:119:7:119:7 | get | (unnamed function decl) | -| test.swift:119:7:119:7 | set | (unnamed function decl) | -| test.swift:120:5:120:15 | willSet | (unnamed function decl) | -| test.swift:123:7:123:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:123:7:123:7 | get | (unnamed function decl) | -| test.swift:123:7:123:7 | set | (unnamed function decl) | -| test.swift:124:5:124:24 | didSet | (unnamed function decl) | -| test.swift:127:7:127:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:127:7:127:7 | get | (unnamed function decl) | -| test.swift:127:7:127:7 | set | (unnamed function decl) | -| test.swift:128:5:128:14 | didSet | (unnamed function decl) | -| test.swift:131:7:131:7 | (unnamed function decl) | (unnamed function decl) | -| test.swift:131:7:131:7 | get | (unnamed function decl) | -| test.swift:131:7:131:7 | set | (unnamed function decl) | -| test.swift:132:5:132:15 | willSet | (unnamed function decl) | -| test.swift:134:5:134:14 | didSet | (unnamed function decl) | +| declarations.swift:2:7:2:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:2:7:2:7 | get | (unnamed function decl) | +| declarations.swift:2:7:2:7 | set | (unnamed function decl) | +| declarations.swift:3:7:3:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:4:5:4:24 | get | (unnamed function decl) | +| declarations.swift:5:5:5:38 | set | (unnamed function decl) | +| declarations.swift:9:17:9:17 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:9:17:9:17 | get | (unnamed function decl) | +| declarations.swift:9:17:9:17 | set | (unnamed function decl) | +| declarations.swift:23:9:23:9 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:23:31:23:31 | get | (unnamed function decl) | +| declarations.swift:23:35:23:35 | set | (unnamed function decl) | +| declarations.swift:24:40:24:40 | get | (unnamed function decl) | +| declarations.swift:25:5:25:22 | random | random | +| declarations.swift:28:1:28:37 | a_function | a_function | +| declarations.swift:32:3:34:3 | get | (unnamed function decl) | +| declarations.swift:35:3:35:18 | set | (unnamed function decl) | +| declarations.swift:41:7:41:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:41:7:41:7 | get | (unnamed function decl) | +| declarations.swift:41:7:41:7 | set | (unnamed function decl) | +| declarations.swift:50:3:52:3 | +- | +- | +| declarations.swift:70:5:72:5 | get | (unnamed function decl) | +| declarations.swift:76:1:79:1 | foo | foo | +| declarations.swift:77:20:77:20 | get | (unnamed function decl) | +| declarations.swift:82:7:82:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:83:5:83:11 | set | (unnamed function decl) | +| declarations.swift:84:5:86:5 | get | (unnamed function decl) | +| declarations.swift:91:27:93:3 | get | (unnamed function decl) | +| declarations.swift:97:5:99:5 | get | (unnamed function decl) | +| declarations.swift:102:7:102:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:102:7:102:7 | get | (unnamed function decl) | +| declarations.swift:102:7:102:7 | set | (unnamed function decl) | +| declarations.swift:104:3:104:3 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:105:5:107:5 | get | (unnamed function decl) | +| declarations.swift:108:5:108:11 | set | (unnamed function decl) | +| declarations.swift:111:37:113:3 | get | (unnamed function decl) | +| declarations.swift:115:7:115:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:115:7:115:7 | get | (unnamed function decl) | +| declarations.swift:115:7:115:7 | set | (unnamed function decl) | +| declarations.swift:116:5:116:25 | willSet | (unnamed function decl) | +| declarations.swift:119:7:119:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:119:7:119:7 | get | (unnamed function decl) | +| declarations.swift:119:7:119:7 | set | (unnamed function decl) | +| declarations.swift:120:5:120:15 | willSet | (unnamed function decl) | +| declarations.swift:123:7:123:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:123:7:123:7 | get | (unnamed function decl) | +| declarations.swift:123:7:123:7 | set | (unnamed function decl) | +| declarations.swift:124:5:124:24 | didSet | (unnamed function decl) | +| declarations.swift:127:7:127:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:127:7:127:7 | get | (unnamed function decl) | +| declarations.swift:127:7:127:7 | set | (unnamed function decl) | +| declarations.swift:128:5:128:14 | didSet | (unnamed function decl) | +| declarations.swift:131:7:131:7 | (unnamed function decl) | (unnamed function decl) | +| declarations.swift:131:7:131:7 | get | (unnamed function decl) | +| declarations.swift:131:7:131:7 | set | (unnamed function decl) | +| declarations.swift:132:5:132:15 | willSet | (unnamed function decl) | +| declarations.swift:134:5:134:14 | didSet | (unnamed function decl) | diff --git a/swift/ql/test/extractor-tests/declarations/func_body.expected b/swift/ql/test/extractor-tests/declarations/func_body.expected index 15652c1b37c..ee2a2ccd59e 100644 --- a/swift/ql/test/extractor-tests/declarations/func_body.expected +++ b/swift/ql/test/extractor-tests/declarations/func_body.expected @@ -1,52 +1,52 @@ -| test.swift:2:7:2:7 | (unnamed function decl) | test.swift:2:7:2:7 | { ... } | -| test.swift:2:7:2:7 | get | test.swift:2:7:2:7 | { ... } | -| test.swift:2:7:2:7 | set | test.swift:2:7:2:7 | { ... } | -| test.swift:3:7:3:7 | (unnamed function decl) | test.swift:3:7:3:7 | { ... } | -| test.swift:4:5:4:24 | get | test.swift:4:9:4:24 | { ... } | -| test.swift:5:5:5:38 | set | test.swift:5:19:5:38 | { ... } | -| test.swift:9:17:9:17 | (unnamed function decl) | test.swift:9:17:9:17 | { ... } | -| test.swift:9:17:9:17 | get | test.swift:9:17:9:17 | { ... } | -| test.swift:9:17:9:17 | set | test.swift:9:17:9:17 | { ... } | -| test.swift:28:1:28:37 | a_function | test.swift:28:36:28:37 | { ... } | -| test.swift:32:3:34:3 | get | test.swift:32:7:34:3 | { ... } | -| test.swift:35:3:35:18 | set | test.swift:35:17:35:18 | { ... } | -| test.swift:41:7:41:7 | (unnamed function decl) | test.swift:41:7:41:7 | { ... } | -| test.swift:41:7:41:7 | get | test.swift:41:7:41:7 | { ... } | -| test.swift:41:7:41:7 | set | test.swift:41:7:41:7 | { ... } | -| test.swift:50:3:52:3 | +- | test.swift:50:45:52:3 | { ... } | -| test.swift:70:5:72:5 | get | test.swift:70:9:72:5 | { ... } | -| test.swift:76:1:79:1 | foo | test.swift:76:19:79:1 | { ... } | -| test.swift:77:20:77:20 | get | test.swift:77:20:77:20 | { ... } | -| test.swift:82:7:82:7 | (unnamed function decl) | test.swift:82:7:82:7 | { ... } | -| test.swift:83:5:83:11 | set | test.swift:83:9:83:11 | { ... } | -| test.swift:84:5:86:5 | get | test.swift:84:9:86:5 | { ... } | -| test.swift:91:27:93:3 | get | test.swift:91:27:93:3 | { ... } | -| test.swift:97:5:99:5 | get | test.swift:97:9:99:5 | { ... } | -| test.swift:102:7:102:7 | (unnamed function decl) | test.swift:102:7:102:7 | { ... } | -| test.swift:102:7:102:7 | get | test.swift:102:7:102:7 | { ... } | -| test.swift:102:7:102:7 | set | test.swift:102:7:102:7 | { ... } | -| test.swift:104:3:104:3 | (unnamed function decl) | test.swift:104:3:104:3 | { ... } | -| test.swift:105:5:107:5 | get | test.swift:105:9:107:5 | { ... } | -| test.swift:108:5:108:11 | set | test.swift:108:9:108:11 | { ... } | -| test.swift:111:37:113:3 | get | test.swift:111:37:113:3 | { ... } | -| test.swift:115:7:115:7 | (unnamed function decl) | test.swift:115:7:115:7 | { ... } | -| test.swift:115:7:115:7 | get | test.swift:115:7:115:7 | { ... } | -| test.swift:115:7:115:7 | set | test.swift:115:7:115:7 | { ... } | -| test.swift:116:5:116:25 | willSet | test.swift:116:23:116:25 | { ... } | -| test.swift:119:7:119:7 | (unnamed function decl) | test.swift:119:7:119:7 | { ... } | -| test.swift:119:7:119:7 | get | test.swift:119:7:119:7 | { ... } | -| test.swift:119:7:119:7 | set | test.swift:119:7:119:7 | { ... } | -| test.swift:120:5:120:15 | willSet | test.swift:120:13:120:15 | { ... } | -| test.swift:123:7:123:7 | (unnamed function decl) | test.swift:123:7:123:7 | { ... } | -| test.swift:123:7:123:7 | get | test.swift:123:7:123:7 | { ... } | -| test.swift:123:7:123:7 | set | test.swift:123:7:123:7 | { ... } | -| test.swift:124:5:124:24 | didSet | test.swift:124:22:124:24 | { ... } | -| test.swift:127:7:127:7 | (unnamed function decl) | test.swift:127:7:127:7 | { ... } | -| test.swift:127:7:127:7 | get | test.swift:127:7:127:7 | { ... } | -| test.swift:127:7:127:7 | set | test.swift:127:7:127:7 | { ... } | -| test.swift:128:5:128:14 | didSet | test.swift:128:12:128:14 | { ... } | -| test.swift:131:7:131:7 | (unnamed function decl) | test.swift:131:7:131:7 | { ... } | -| test.swift:131:7:131:7 | get | test.swift:131:7:131:7 | { ... } | -| test.swift:131:7:131:7 | set | test.swift:131:7:131:7 | { ... } | -| test.swift:132:5:132:15 | willSet | test.swift:132:13:132:15 | { ... } | -| test.swift:134:5:134:14 | didSet | test.swift:134:12:134:14 | { ... } | +| declarations.swift:2:7:2:7 | (unnamed function decl) | declarations.swift:2:7:2:7 | { ... } | +| declarations.swift:2:7:2:7 | get | declarations.swift:2:7:2:7 | { ... } | +| declarations.swift:2:7:2:7 | set | declarations.swift:2:7:2:7 | { ... } | +| declarations.swift:3:7:3:7 | (unnamed function decl) | declarations.swift:3:7:3:7 | { ... } | +| declarations.swift:4:5:4:24 | get | declarations.swift:4:9:4:24 | { ... } | +| declarations.swift:5:5:5:38 | set | declarations.swift:5:19:5:38 | { ... } | +| declarations.swift:9:17:9:17 | (unnamed function decl) | declarations.swift:9:17:9:17 | { ... } | +| declarations.swift:9:17:9:17 | get | declarations.swift:9:17:9:17 | { ... } | +| declarations.swift:9:17:9:17 | set | declarations.swift:9:17:9:17 | { ... } | +| declarations.swift:28:1:28:37 | a_function | declarations.swift:28:36:28:37 | { ... } | +| declarations.swift:32:3:34:3 | get | declarations.swift:32:7:34:3 | { ... } | +| declarations.swift:35:3:35:18 | set | declarations.swift:35:17:35:18 | { ... } | +| declarations.swift:41:7:41:7 | (unnamed function decl) | declarations.swift:41:7:41:7 | { ... } | +| declarations.swift:41:7:41:7 | get | declarations.swift:41:7:41:7 | { ... } | +| declarations.swift:41:7:41:7 | set | declarations.swift:41:7:41:7 | { ... } | +| declarations.swift:50:3:52:3 | +- | declarations.swift:50:45:52:3 | { ... } | +| declarations.swift:70:5:72:5 | get | declarations.swift:70:9:72:5 | { ... } | +| declarations.swift:76:1:79:1 | foo | declarations.swift:76:19:79:1 | { ... } | +| declarations.swift:77:20:77:20 | get | declarations.swift:77:20:77:20 | { ... } | +| declarations.swift:82:7:82:7 | (unnamed function decl) | declarations.swift:82:7:82:7 | { ... } | +| declarations.swift:83:5:83:11 | set | declarations.swift:83:9:83:11 | { ... } | +| declarations.swift:84:5:86:5 | get | declarations.swift:84:9:86:5 | { ... } | +| declarations.swift:91:27:93:3 | get | declarations.swift:91:27:93:3 | { ... } | +| declarations.swift:97:5:99:5 | get | declarations.swift:97:9:99:5 | { ... } | +| declarations.swift:102:7:102:7 | (unnamed function decl) | declarations.swift:102:7:102:7 | { ... } | +| declarations.swift:102:7:102:7 | get | declarations.swift:102:7:102:7 | { ... } | +| declarations.swift:102:7:102:7 | set | declarations.swift:102:7:102:7 | { ... } | +| declarations.swift:104:3:104:3 | (unnamed function decl) | declarations.swift:104:3:104:3 | { ... } | +| declarations.swift:105:5:107:5 | get | declarations.swift:105:9:107:5 | { ... } | +| declarations.swift:108:5:108:11 | set | declarations.swift:108:9:108:11 | { ... } | +| declarations.swift:111:37:113:3 | get | declarations.swift:111:37:113:3 | { ... } | +| declarations.swift:115:7:115:7 | (unnamed function decl) | declarations.swift:115:7:115:7 | { ... } | +| declarations.swift:115:7:115:7 | get | declarations.swift:115:7:115:7 | { ... } | +| declarations.swift:115:7:115:7 | set | declarations.swift:115:7:115:7 | { ... } | +| declarations.swift:116:5:116:25 | willSet | declarations.swift:116:23:116:25 | { ... } | +| declarations.swift:119:7:119:7 | (unnamed function decl) | declarations.swift:119:7:119:7 | { ... } | +| declarations.swift:119:7:119:7 | get | declarations.swift:119:7:119:7 | { ... } | +| declarations.swift:119:7:119:7 | set | declarations.swift:119:7:119:7 | { ... } | +| declarations.swift:120:5:120:15 | willSet | declarations.swift:120:13:120:15 | { ... } | +| declarations.swift:123:7:123:7 | (unnamed function decl) | declarations.swift:123:7:123:7 | { ... } | +| declarations.swift:123:7:123:7 | get | declarations.swift:123:7:123:7 | { ... } | +| declarations.swift:123:7:123:7 | set | declarations.swift:123:7:123:7 | { ... } | +| declarations.swift:124:5:124:24 | didSet | declarations.swift:124:22:124:24 | { ... } | +| declarations.swift:127:7:127:7 | (unnamed function decl) | declarations.swift:127:7:127:7 | { ... } | +| declarations.swift:127:7:127:7 | get | declarations.swift:127:7:127:7 | { ... } | +| declarations.swift:127:7:127:7 | set | declarations.swift:127:7:127:7 | { ... } | +| declarations.swift:128:5:128:14 | didSet | declarations.swift:128:12:128:14 | { ... } | +| declarations.swift:131:7:131:7 | (unnamed function decl) | declarations.swift:131:7:131:7 | { ... } | +| declarations.swift:131:7:131:7 | get | declarations.swift:131:7:131:7 | { ... } | +| declarations.swift:131:7:131:7 | set | declarations.swift:131:7:131:7 | { ... } | +| declarations.swift:132:5:132:15 | willSet | declarations.swift:132:13:132:15 | { ... } | +| declarations.swift:134:5:134:14 | didSet | declarations.swift:134:12:134:14 | { ... } | diff --git a/swift/ql/test/extractor-tests/declarations/func_params.expected b/swift/ql/test/extractor-tests/declarations/func_params.expected index aa94a212e37..457f9428c3c 100644 --- a/swift/ql/test/extractor-tests/declarations/func_params.expected +++ b/swift/ql/test/extractor-tests/declarations/func_params.expected @@ -1,25 +1,25 @@ -| test.swift:2:7:2:7 | set | 0 | test.swift:2:7:2:7 | value | -| test.swift:5:5:5:38 | set | 0 | test.swift:5:9:5:9 | newValue | -| test.swift:9:17:9:17 | set | 0 | test.swift:9:17:9:17 | value | -| test.swift:23:35:23:35 | set | 0 | test.swift:23:35:23:35 | newValue | -| test.swift:28:1:28:37 | a_function | 0 | test.swift:28:17:28:31 | a_parameter | -| test.swift:35:3:35:18 | set | 0 | test.swift:35:7:35:7 | newValue | -| test.swift:41:7:41:7 | set | 0 | test.swift:41:7:41:7 | value | -| test.swift:50:3:52:3 | +- | 0 | test.swift:50:26:50:33 | other | -| test.swift:83:5:83:11 | set | 0 | test.swift:83:5:83:5 | newValue | -| test.swift:102:7:102:7 | set | 0 | test.swift:102:7:102:7 | value | -| test.swift:104:3:104:3 | (unnamed function decl) | 0 | file://:0:0:0:0 | x | -| test.swift:105:5:107:5 | get | 0 | test.swift:104:13:104:13 | x | -| test.swift:108:5:108:11 | set | 0 | test.swift:108:5:108:5 | newValue | -| test.swift:108:5:108:11 | set | 1 | test.swift:104:13:104:13 | x | -| test.swift:111:37:113:3 | get | 0 | test.swift:111:13:111:13 | x | -| test.swift:111:37:113:3 | get | 1 | test.swift:111:21:111:21 | y | -| test.swift:115:7:115:7 | set | 0 | test.swift:115:7:115:7 | value | -| test.swift:116:5:116:25 | willSet | 0 | test.swift:116:13:116:13 | newValue | -| test.swift:119:7:119:7 | set | 0 | test.swift:119:7:119:7 | value | -| test.swift:120:5:120:15 | willSet | 0 | test.swift:120:5:120:5 | newValue | -| test.swift:123:7:123:7 | set | 0 | test.swift:123:7:123:7 | value | -| test.swift:124:5:124:24 | didSet | 0 | test.swift:124:12:124:12 | oldValue | -| test.swift:127:7:127:7 | set | 0 | test.swift:127:7:127:7 | value | -| test.swift:131:7:131:7 | set | 0 | test.swift:131:7:131:7 | value | -| test.swift:132:5:132:15 | willSet | 0 | test.swift:132:5:132:5 | newValue | +| declarations.swift:2:7:2:7 | set | 0 | declarations.swift:2:7:2:7 | value | +| declarations.swift:5:5:5:38 | set | 0 | declarations.swift:5:9:5:9 | newValue | +| declarations.swift:9:17:9:17 | set | 0 | declarations.swift:9:17:9:17 | value | +| declarations.swift:23:35:23:35 | set | 0 | declarations.swift:23:35:23:35 | newValue | +| declarations.swift:28:1:28:37 | a_function | 0 | declarations.swift:28:17:28:31 | a_parameter | +| declarations.swift:35:3:35:18 | set | 0 | declarations.swift:35:7:35:7 | newValue | +| declarations.swift:41:7:41:7 | set | 0 | declarations.swift:41:7:41:7 | value | +| declarations.swift:50:3:52:3 | +- | 0 | declarations.swift:50:26:50:33 | other | +| declarations.swift:83:5:83:11 | set | 0 | declarations.swift:83:5:83:5 | newValue | +| declarations.swift:102:7:102:7 | set | 0 | declarations.swift:102:7:102:7 | value | +| declarations.swift:104:3:104:3 | (unnamed function decl) | 0 | file://:0:0:0:0 | x | +| declarations.swift:105:5:107:5 | get | 0 | declarations.swift:104:13:104:13 | x | +| declarations.swift:108:5:108:11 | set | 0 | declarations.swift:108:5:108:5 | newValue | +| declarations.swift:108:5:108:11 | set | 1 | declarations.swift:104:13:104:13 | x | +| declarations.swift:111:37:113:3 | get | 0 | declarations.swift:111:13:111:13 | x | +| declarations.swift:111:37:113:3 | get | 1 | declarations.swift:111:21:111:21 | y | +| declarations.swift:115:7:115:7 | set | 0 | declarations.swift:115:7:115:7 | value | +| declarations.swift:116:5:116:25 | willSet | 0 | declarations.swift:116:13:116:13 | newValue | +| declarations.swift:119:7:119:7 | set | 0 | declarations.swift:119:7:119:7 | value | +| declarations.swift:120:5:120:15 | willSet | 0 | declarations.swift:120:5:120:5 | newValue | +| declarations.swift:123:7:123:7 | set | 0 | declarations.swift:123:7:123:7 | value | +| declarations.swift:124:5:124:24 | didSet | 0 | declarations.swift:124:12:124:12 | oldValue | +| declarations.swift:127:7:127:7 | set | 0 | declarations.swift:127:7:127:7 | value | +| declarations.swift:131:7:131:7 | set | 0 | declarations.swift:131:7:131:7 | value | +| declarations.swift:132:5:132:15 | willSet | 0 | declarations.swift:132:5:132:5 | newValue | diff --git a/swift/ql/test/extractor-tests/statements/ConditionElements.expected b/swift/ql/test/extractor-tests/statements/ConditionElements.expected index 1a25b7b650d..7ab2d41917c 100644 --- a/swift/ql/test/extractor-tests/statements/ConditionElements.expected +++ b/swift/ql/test/extractor-tests/statements/ConditionElements.expected @@ -1,7 +1,7 @@ -| main.swift:3:8:3:13 | ... call to == ... | main.swift:3:8:3:13 | ... call to == ... | -| main.swift:10:17:10:24 | ... call to < ... | main.swift:10:18:10:22 | ... call to < ... | -| main.swift:39:9:39:14 | ... call to != ... | main.swift:39:9:39:14 | ... call to != ... | -| main.swift:65:4:65:19 | let ... = ... | main.swift:65:9:65:15 | let ... | -| main.swift:65:4:65:19 | let ... = ... | main.swift:65:19:65:19 | x | -| main.swift:67:4:67:20 | .some(...) = ... | main.swift:67:9:67:16 | .some(...) | -| main.swift:67:4:67:20 | .some(...) = ... | main.swift:67:20:67:20 | x | +| statements.swift:3:8:3:13 | ... call to == ... | statements.swift:3:8:3:13 | ... call to == ... | +| statements.swift:10:17:10:24 | ... call to < ... | statements.swift:10:18:10:22 | ... call to < ... | +| statements.swift:39:9:39:14 | ... call to != ... | statements.swift:39:9:39:14 | ... call to != ... | +| statements.swift:65:4:65:19 | let ... = ... | statements.swift:65:9:65:15 | let ... | +| statements.swift:65:4:65:19 | let ... = ... | statements.swift:65:19:65:19 | x | +| statements.swift:67:4:67:20 | .some(...) = ... | statements.swift:67:9:67:16 | .some(...) | +| statements.swift:67:4:67:20 | .some(...) = ... | statements.swift:67:20:67:20 | x | diff --git a/swift/ql/test/extractor-tests/statements/LabeledConditionalStmts.expected b/swift/ql/test/extractor-tests/statements/LabeledConditionalStmts.expected index 783fbc5acf1..21e9b6d13ae 100644 --- a/swift/ql/test/extractor-tests/statements/LabeledConditionalStmts.expected +++ b/swift/ql/test/extractor-tests/statements/LabeledConditionalStmts.expected @@ -1,5 +1,5 @@ -| GuardStmt | main.swift:39:9:39:14 | StmtCondition | -| IfStmt | main.swift:3:8:3:13 | StmtCondition | -| IfStmt | main.swift:65:4:65:19 | StmtCondition | -| IfStmt | main.swift:67:4:67:20 | StmtCondition | -| WhileStmt | main.swift:10:17:10:24 | StmtCondition | +| GuardStmt | statements.swift:39:9:39:14 | StmtCondition | +| IfStmt | statements.swift:3:8:3:13 | StmtCondition | +| IfStmt | statements.swift:65:4:65:19 | StmtCondition | +| IfStmt | statements.swift:67:4:67:20 | StmtCondition | +| WhileStmt | statements.swift:10:17:10:24 | StmtCondition | diff --git a/swift/ql/test/extractor-tests/statements/LabeledStmts.expected b/swift/ql/test/extractor-tests/statements/LabeledStmts.expected index 8f7e9199113..b2552c50f16 100644 --- a/swift/ql/test/extractor-tests/statements/LabeledStmts.expected +++ b/swift/ql/test/extractor-tests/statements/LabeledStmts.expected @@ -1,12 +1,12 @@ -| main.swift:2:3:8:3 | for ... in ... { ... } | -| main.swift:3:5:7:5 | if ... then { ... } else { ... } | -| main.swift:10:3:12:3 | while ... { ... } | -| main.swift:15:3:17:18 | repeat { ... } while ... | -| main.swift:19:3:23:3 | do { ... } catch { ... } | -| main.swift:25:3:31:3 | do { ... } catch { ... } | -| main.swift:39:3:41:3 | guard ... else { ... } | -| main.swift:48:1:50:1 | do { ... } | -| main.swift:53:1:62:1 | switch index { ... } | -| main.swift:65:1:66:1 | if ... then { ... } | -| main.swift:67:1:68:1 | if ... then { ... } | -| main.swift:71:1:72:1 | for ... in ... where ... { ... } | +| statements.swift:2:3:8:3 | for ... in ... { ... } | +| statements.swift:3:5:7:5 | if ... then { ... } else { ... } | +| statements.swift:10:3:12:3 | while ... { ... } | +| statements.swift:15:3:17:18 | repeat { ... } while ... | +| statements.swift:19:3:23:3 | do { ... } catch { ... } | +| statements.swift:25:3:31:3 | do { ... } catch { ... } | +| statements.swift:39:3:41:3 | guard ... else { ... } | +| statements.swift:48:1:50:1 | do { ... } | +| statements.swift:53:1:62:1 | switch index { ... } | +| statements.swift:65:1:66:1 | if ... then { ... } | +| statements.swift:67:1:68:1 | if ... then { ... } | +| statements.swift:71:1:72:1 | for ... in ... where ... { ... } | diff --git a/swift/ql/test/extractor-tests/statements/Labels.expected b/swift/ql/test/extractor-tests/statements/Labels.expected index 035b823b168..741332e720e 100644 --- a/swift/ql/test/extractor-tests/statements/Labels.expected +++ b/swift/ql/test/extractor-tests/statements/Labels.expected @@ -1,3 +1,3 @@ -| main.swift:2:3:8:3 | for ... in ... { ... } | label1 | -| main.swift:10:3:12:3 | while ... { ... } | label2 | -| main.swift:15:3:17:18 | repeat { ... } while ... | label3 | +| statements.swift:2:3:8:3 | for ... in ... { ... } | label1 | +| statements.swift:10:3:12:3 | while ... { ... } | label2 | +| statements.swift:15:3:17:18 | repeat { ... } while ... | label3 | diff --git a/swift/ql/test/extractor-tests/statements/YieldStmts.expected b/swift/ql/test/extractor-tests/statements/YieldStmts.expected index e33a8a33eb1..770c90018d8 100644 --- a/swift/ql/test/extractor-tests/statements/YieldStmts.expected +++ b/swift/ql/test/extractor-tests/statements/YieldStmts.expected @@ -1,2 +1,2 @@ -| main.swift:75:7:75:7 | yield ... | 0 | file://:0:0:0:0 | &... | -| main.swift:78:7:78:14 | yield ... | 0 | main.swift:78:13:78:14 | &... | +| statements.swift:75:7:75:7 | yield ... | 0 | file://:0:0:0:0 | &... | +| statements.swift:78:7:78:14 | yield ... | 0 | statements.swift:78:13:78:14 | &... | diff --git a/swift/ql/test/extractor-tests/statements/main.swift b/swift/ql/test/extractor-tests/statements/statements.swift similarity index 100% rename from swift/ql/test/extractor-tests/statements/main.swift rename to swift/ql/test/extractor-tests/statements/statements.swift diff --git a/swift/ql/test/library-tests/parent/declarations.swift b/swift/ql/test/library-tests/parent/declarations.swift new file mode 100644 index 00000000000..1c18b78bf70 --- /dev/null +++ b/swift/ql/test/library-tests/parent/declarations.swift @@ -0,0 +1,136 @@ +struct Foo { + var x = 11 + var next : Int { + get { return x + 1 } + set(newValue) { x = newValue - 1 } + } +} + +class Bar { var x : Double = 1.3 } + +enum EnumValues { + case value1, value2 + case value3, value4, value5 +} + +enum EnumWithParams { + case nodata1(Void) + case intdata(Int) + case tuple(Int, String, Double) +} + +protocol MyProtocol { + var mustBeSettable: Int { get set } + var doesNotNeedToBeSettable: Int { get } + func random() -> Double +} + +func a_function(a_parameter : Int) {} + +var a_variable = 42 +var a_property : String { + get { + return "here" + } + set(newValue) {} +} + +print("some top level statement") + +class Baz { + var field: Int + init() { + field = 10 + } + + deinit { + field = 0 + } + + static prefix func +- (other: Baz) -> Baz { + return other + } +} + +prefix operator +- + +precedencegroup NewPrecedence { + higherThan: AdditionPrecedence + lowerThan: MultiplicationPrecedence + associativity: none + assignment: false +} + +infix operator +++ + +infix operator ***: NewPrecedence + +@propertyWrapper struct ZeroWrapper { + var wrappedValue: Int { + get { + return 0 + } + } +} + +func foo() -> Int { + @ZeroWrapper var x: Int + return x +} + +struct HasPropertyAndObserver { + var settableField: Int { + set { } + get { + return 0 + } + } + + // A field can be marked as read-only by dirctly implementing + // the getter between the braces. + var readOnlyField1: Int { + return 0 + } + + // Or by adding an access declaration + var readOnlyField2: Int { + get { + return 0 + } + } + + var normalField : Int + + subscript(x: Int) -> Int { + get { + return 0 + } + set { } + } + + subscript(x: Int, y : Int) -> Int { + return 0 + } + + var hasWillSet1 : Int { + willSet(newValue) { } + } + + var hasWillSet2 : Int { + willSet { } + } + + var hasDidSet1 : Int { + didSet(oldValue) { } + } + + var hasDidSet2 : Int { + didSet { } + } + + var hasBoth : Int { + willSet { } + + didSet { } + } +} \ No newline at end of file diff --git a/swift/ql/test/library-tests/parent/expressions.swift b/swift/ql/test/library-tests/parent/expressions.swift new file mode 100644 index 00000000000..bc720abe70f --- /dev/null +++ b/swift/ql/test/library-tests/parent/expressions.swift @@ -0,0 +1,155 @@ +let a = 15 +let b = 15.15 +let b1 = true +let b2 = false +let m = #file +let s = "hello world" +let s1 = "hello \(a)" +let n: Int? = nil + +enum AnError: Error { + case failed +} + +func failure(_ x: Int) throws { + guard x != 0 else { + throw AnError.failed + } +} + +try! failure(11) +try? failure(11) + +class Klass { + init() {} +} + +let klass = Klass() + +let d = ["1" : "2"] +_ = 15 +_ = 15 is Int +_ = 15 as Double +_ = 15 as? Double +_ = 15 as! Double +print(d["1"]) + +func closured(closure: (Int, Int) -> Int) { + closure(5, 7) +} + +closured { (x: Int, y: Int) -> Int in + return x + y +} +closured { x, y in + return x + y +} +closured { return $0 + $1 } +closured { $0 + $1 } + +struct S { + let x: Int +} + +_ = \S.x + +func unsafeFunction(pointer: UnsafePointer) { +} +var myNumber = 1234 +unsafeFunction(pointer: &myNumber) +withUnsafePointer(to: myNumber) { unsafeFunction(pointer: $0) } + +class FailingToInit { + init?(x: Int) { + if x < 0 { + return nil + } + } +} + +class Base { + let xx: Int + init(x: Int) { + xx = x + } +} + +class Derived: Base { + init() { + super.init(x: 22) + } +} + +let derived = Derived() +_ = derived.xx + +var opt: Int? +opt! +d["a"]! + +class ToPtr {} + +let opaque = Unmanaged.passRetained(ToPtr()).toOpaque() +Unmanaged.fromOpaque(opaque) + +struct HasProperty { + var settableField: Int { + set { } + get { + return 0 + } + } + + // A field can be marked as read-only by dirctly implementing + // the getter between the braces. + var readOnlyField1: Int { + return 0 + } + + // Or by adding an access declaration + var readOnlyField2: Int { + get { + return 0 + } + } + + var normalField : Int + + subscript(x: Int) -> Int { + get { + return 0 + } + set { } + } + + subscript(x: Int, y : Int) -> Int { + return 0 + } +} + +func testProperties(hp : inout HasProperty) -> Int { + hp.settableField = 42 + var x = hp.settableField + var y = hp.readOnlyField1 + var z = hp.readOnlyField2 + hp.normalField = 99 + var w = hp.normalField + hp[1] = 2 + return hp[3, 4] +} + +struct B { + var x : Int +} + +struct A { + var b : B + var bs : [B] + var mayB : B? +} + +func test(a : A, keyPathInt : WritableKeyPath, keyPathB : WritableKeyPath) { + var apply_keyPathInt = a[keyPath: keyPathInt] + var apply_keyPathB = a[keyPath: keyPathB] + var nested_apply = a[keyPath: keyPathB][keyPath: \B.x] +} \ No newline at end of file diff --git a/swift/ql/test/library-tests/parent/no_double_parents.expected b/swift/ql/test/library-tests/parent/no_double_parents.expected new file mode 100644 index 00000000000..e69de29bb2d diff --git a/swift/ql/test/library-tests/parent/no_double_parents.ql b/swift/ql/test/library-tests/parent/no_double_parents.ql new file mode 100644 index 00000000000..356a97e518a --- /dev/null +++ b/swift/ql/test/library-tests/parent/no_double_parents.ql @@ -0,0 +1,10 @@ +import swift + +from AstNode parent1, AstNode parent2, AstNode child +where + parent1 != parent2 and + not exists(parent1.getResolveStep()) and + not exists(parent2.getResolveStep()) and + child = parent1.getAChild() and + child = parent2.getAChild() +select parent1.getPrimaryQlClasses(), parent2.getPrimaryQlClasses(), child.getPrimaryQlClasses() diff --git a/swift/ql/test/library-tests/parent/parent.expected b/swift/ql/test/library-tests/parent/parent.expected new file mode 100644 index 00000000000..d160cbfdca5 --- /dev/null +++ b/swift/ql/test/library-tests/parent/parent.expected @@ -0,0 +1,1186 @@ +| declarations.swift:1:8:1:8 | deinit | ConstructorDecl | declarations.swift:1:8:1:8 | x | ParamDecl | +| declarations.swift:1:8:1:8 | deinit | ConstructorDecl | declarations.swift:1:8:1:8 | { ... } | BraceStmt | +| declarations.swift:1:8:1:8 | { ... } | BraceStmt | declarations.swift:1:8:1:8 | return | ReturnStmt | +| declarations.swift:2:3:2:11 | var ... = ... | PatternBindingDecl | declarations.swift:2:7:2:7 | x | NamedPattern | +| declarations.swift:2:3:2:11 | var ... = ... | PatternBindingDecl | declarations.swift:2:11:2:11 | 11 | IntegerLiteralExpr | +| declarations.swift:2:7:2:7 | (unnamed function decl) | AccessorDecl | declarations.swift:2:7:2:7 | { ... } | BraceStmt | +| declarations.swift:2:7:2:7 | get | AccessorDecl | declarations.swift:2:7:2:7 | { ... } | BraceStmt | +| declarations.swift:2:7:2:7 | set | AccessorDecl | declarations.swift:2:7:2:7 | value | ParamDecl | +| declarations.swift:2:7:2:7 | set | AccessorDecl | declarations.swift:2:7:2:7 | { ... } | BraceStmt | +| declarations.swift:2:7:2:7 | x | ConcreteVarDecl | declarations.swift:2:7:2:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:2:7:2:7 | x | ConcreteVarDecl | declarations.swift:2:7:2:7 | get | AccessorDecl | +| declarations.swift:2:7:2:7 | x | ConcreteVarDecl | declarations.swift:2:7:2:7 | set | AccessorDecl | +| declarations.swift:2:7:2:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:2:7:2:7 | { ... } | BraceStmt | declarations.swift:2:7:2:7 | yield ... | YieldStmt | +| declarations.swift:2:7:2:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:2:7:2:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:3:3:6:3 | var ... = ... | PatternBindingDecl | declarations.swift:3:7:3:14 | ... as ... | TypedPattern | +| declarations.swift:3:7:3:7 | (unnamed function decl) | AccessorDecl | declarations.swift:3:7:3:7 | { ... } | BraceStmt | +| declarations.swift:3:7:3:7 | next | ConcreteVarDecl | declarations.swift:3:7:3:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:3:7:3:7 | next | ConcreteVarDecl | declarations.swift:4:5:4:24 | get | AccessorDecl | +| declarations.swift:3:7:3:7 | next | ConcreteVarDecl | declarations.swift:5:5:5:38 | set | AccessorDecl | +| declarations.swift:3:7:3:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:3:7:3:7 | { ... } | BraceStmt | declarations.swift:3:7:3:7 | yield ... | YieldStmt | +| declarations.swift:3:7:3:14 | ... as ... | TypedPattern | declarations.swift:3:7:3:7 | next | NamedPattern | +| declarations.swift:3:7:3:14 | ... as ... | TypedPattern | declarations.swift:3:14:3:14 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:4:5:4:24 | get | AccessorDecl | declarations.swift:4:9:4:24 | { ... } | BraceStmt | +| declarations.swift:4:9:4:24 | { ... } | BraceStmt | declarations.swift:4:11:4:22 | return ... | ReturnStmt | +| declarations.swift:4:11:4:22 | return ... | ReturnStmt | declarations.swift:4:18:4:22 | ... call to + ... | BinaryExpr | +| declarations.swift:4:18:4:18 | .x | MemberRefExpr | declarations.swift:4:18:4:18 | self | DeclRefExpr | +| declarations.swift:4:18:4:22 | ... call to + ... | BinaryExpr | declarations.swift:4:20:4:20 | call to + | DotSyntaxCallExpr | +| declarations.swift:4:20:4:20 | Int.Type | TypeExpr | declarations.swift:4:20:4:20 | TBD (FixedTypeRepr) | FixedTypeRepr | +| declarations.swift:4:20:4:20 | call to + | DotSyntaxCallExpr | declarations.swift:4:20:4:20 | + | DeclRefExpr | +| declarations.swift:4:20:4:20 | call to + | DotSyntaxCallExpr | declarations.swift:4:20:4:20 | Int.Type | TypeExpr | +| declarations.swift:5:5:5:38 | set | AccessorDecl | declarations.swift:5:9:5:9 | newValue | ParamDecl | +| declarations.swift:5:5:5:38 | set | AccessorDecl | declarations.swift:5:19:5:38 | { ... } | BraceStmt | +| declarations.swift:5:19:5:38 | { ... } | BraceStmt | declarations.swift:5:21:5:36 | ... = ... | AssignExpr | +| declarations.swift:5:21:5:21 | .x | MemberRefExpr | declarations.swift:5:21:5:21 | self | DeclRefExpr | +| declarations.swift:5:21:5:36 | ... = ... | AssignExpr | declarations.swift:5:21:5:21 | .x | MemberRefExpr | +| declarations.swift:5:21:5:36 | ... = ... | AssignExpr | declarations.swift:5:25:5:36 | ... call to - ... | BinaryExpr | +| declarations.swift:5:25:5:36 | ... call to - ... | BinaryExpr | declarations.swift:5:34:5:34 | call to - | DotSyntaxCallExpr | +| declarations.swift:5:34:5:34 | Int.Type | TypeExpr | declarations.swift:5:34:5:34 | TBD (FixedTypeRepr) | FixedTypeRepr | +| declarations.swift:5:34:5:34 | call to - | DotSyntaxCallExpr | declarations.swift:5:34:5:34 | - | DeclRefExpr | +| declarations.swift:5:34:5:34 | call to - | DotSyntaxCallExpr | declarations.swift:5:34:5:34 | Int.Type | TypeExpr | +| declarations.swift:9:7:9:7 | deinit | ConstructorDecl | declarations.swift:9:7:9:7 | { ... } | BraceStmt | +| declarations.swift:9:7:9:7 | init | DestructorDecl | declarations.swift:9:7:9:7 | { ... } | BraceStmt | +| declarations.swift:9:7:9:7 | { ... } | BraceStmt | declarations.swift:9:7:9:7 | return | ReturnStmt | +| declarations.swift:9:13:9:30 | var ... = ... | PatternBindingDecl | declarations.swift:9:17:9:21 | ... as ... | TypedPattern | +| declarations.swift:9:13:9:30 | var ... = ... | PatternBindingDecl | declarations.swift:9:30:9:30 | 1.3 | FloatLiteralExpr | +| declarations.swift:9:17:9:17 | (unnamed function decl) | AccessorDecl | declarations.swift:9:17:9:17 | { ... } | BraceStmt | +| declarations.swift:9:17:9:17 | get | AccessorDecl | declarations.swift:9:17:9:17 | { ... } | BraceStmt | +| declarations.swift:9:17:9:17 | set | AccessorDecl | declarations.swift:9:17:9:17 | value | ParamDecl | +| declarations.swift:9:17:9:17 | set | AccessorDecl | declarations.swift:9:17:9:17 | { ... } | BraceStmt | +| declarations.swift:9:17:9:17 | x | ConcreteVarDecl | declarations.swift:9:17:9:17 | (unnamed function decl) | AccessorDecl | +| declarations.swift:9:17:9:17 | x | ConcreteVarDecl | declarations.swift:9:17:9:17 | get | AccessorDecl | +| declarations.swift:9:17:9:17 | x | ConcreteVarDecl | declarations.swift:9:17:9:17 | set | AccessorDecl | +| declarations.swift:9:17:9:17 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:9:17:9:17 | { ... } | BraceStmt | declarations.swift:9:17:9:17 | yield ... | YieldStmt | +| declarations.swift:9:17:9:17 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:9:17:9:17 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:9:17:9:21 | ... as ... | TypedPattern | declarations.swift:9:17:9:17 | x | NamedPattern | +| declarations.swift:9:17:9:21 | ... as ... | TypedPattern | declarations.swift:9:21:9:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:12:5:12:18 | case ... | EnumCaseDecl | declarations.swift:12:10:12:10 | value1 | EnumElementDecl | +| declarations.swift:12:5:12:18 | case ... | EnumCaseDecl | declarations.swift:12:18:12:18 | value2 | EnumElementDecl | +| declarations.swift:13:5:13:26 | case ... | EnumCaseDecl | declarations.swift:13:10:13:10 | value3 | EnumElementDecl | +| declarations.swift:13:5:13:26 | case ... | EnumCaseDecl | declarations.swift:13:18:13:18 | value4 | EnumElementDecl | +| declarations.swift:13:5:13:26 | case ... | EnumCaseDecl | declarations.swift:13:26:13:26 | value5 | EnumElementDecl | +| declarations.swift:17:5:17:22 | case ... | EnumCaseDecl | declarations.swift:17:10:17:22 | nodata1 | EnumElementDecl | +| declarations.swift:17:10:17:22 | nodata1 | EnumElementDecl | declarations.swift:17:18:17:18 | _ | ParamDecl | +| declarations.swift:18:5:18:21 | case ... | EnumCaseDecl | declarations.swift:18:10:18:21 | intdata | EnumElementDecl | +| declarations.swift:18:10:18:21 | intdata | EnumElementDecl | declarations.swift:18:18:18:18 | _ | ParamDecl | +| declarations.swift:19:5:19:35 | case ... | EnumCaseDecl | declarations.swift:19:10:19:35 | tuple | EnumElementDecl | +| declarations.swift:19:10:19:35 | tuple | EnumElementDecl | declarations.swift:19:16:19:16 | _ | ParamDecl | +| declarations.swift:19:10:19:35 | tuple | EnumElementDecl | declarations.swift:19:21:19:21 | _ | ParamDecl | +| declarations.swift:19:10:19:35 | tuple | EnumElementDecl | declarations.swift:19:29:19:29 | _ | ParamDecl | +| declarations.swift:23:5:23:39 | var ... = ... | PatternBindingDecl | declarations.swift:23:9:23:25 | ... as ... | TypedPattern | +| declarations.swift:23:9:23:9 | mustBeSettable | ConcreteVarDecl | declarations.swift:23:9:23:9 | (unnamed function decl) | AccessorDecl | +| declarations.swift:23:9:23:9 | mustBeSettable | ConcreteVarDecl | declarations.swift:23:31:23:31 | get | AccessorDecl | +| declarations.swift:23:9:23:9 | mustBeSettable | ConcreteVarDecl | declarations.swift:23:35:23:35 | set | AccessorDecl | +| declarations.swift:23:9:23:25 | ... as ... | TypedPattern | declarations.swift:23:9:23:9 | mustBeSettable | NamedPattern | +| declarations.swift:23:9:23:25 | ... as ... | TypedPattern | declarations.swift:23:25:23:25 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:23:35:23:35 | set | AccessorDecl | declarations.swift:23:35:23:35 | newValue | ParamDecl | +| declarations.swift:24:5:24:44 | var ... = ... | PatternBindingDecl | declarations.swift:24:9:24:34 | ... as ... | TypedPattern | +| declarations.swift:24:9:24:9 | doesNotNeedToBeSettable | ConcreteVarDecl | declarations.swift:24:40:24:40 | get | AccessorDecl | +| declarations.swift:24:9:24:34 | ... as ... | TypedPattern | declarations.swift:24:9:24:9 | doesNotNeedToBeSettable | NamedPattern | +| declarations.swift:24:9:24:34 | ... as ... | TypedPattern | declarations.swift:24:34:24:34 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:28:1:28:37 | a_function | ConcreteFuncDecl | declarations.swift:28:17:28:31 | a_parameter | ParamDecl | +| declarations.swift:28:1:28:37 | a_function | ConcreteFuncDecl | declarations.swift:28:36:28:37 | { ... } | BraceStmt | +| declarations.swift:30:1:30:18 | var ... = ... | PatternBindingDecl | declarations.swift:30:5:30:5 | a_variable | NamedPattern | +| declarations.swift:30:1:30:18 | var ... = ... | PatternBindingDecl | declarations.swift:30:18:30:18 | 42 | IntegerLiteralExpr | +| declarations.swift:30:1:30:18 | { ... } | BraceStmt | declarations.swift:30:1:30:18 | var ... = ... | PatternBindingDecl | +| declarations.swift:30:1:30:18 | { ... } | TopLevelCodeDecl | declarations.swift:30:1:30:18 | { ... } | BraceStmt | +| declarations.swift:31:1:36:1 | var ... = ... | PatternBindingDecl | declarations.swift:31:5:31:18 | ... as ... | TypedPattern | +| declarations.swift:31:1:36:1 | { ... } | BraceStmt | declarations.swift:31:1:36:1 | var ... = ... | PatternBindingDecl | +| declarations.swift:31:1:36:1 | { ... } | TopLevelCodeDecl | declarations.swift:31:1:36:1 | { ... } | BraceStmt | +| declarations.swift:31:5:31:5 | a_property | ConcreteVarDecl | declarations.swift:32:3:34:3 | get | AccessorDecl | +| declarations.swift:31:5:31:5 | a_property | ConcreteVarDecl | declarations.swift:35:3:35:18 | set | AccessorDecl | +| declarations.swift:31:5:31:18 | ... as ... | TypedPattern | declarations.swift:31:5:31:5 | a_property | NamedPattern | +| declarations.swift:31:5:31:18 | ... as ... | TypedPattern | declarations.swift:31:18:31:18 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:32:3:34:3 | get | AccessorDecl | declarations.swift:32:7:34:3 | { ... } | BraceStmt | +| declarations.swift:32:7:34:3 | { ... } | BraceStmt | declarations.swift:33:5:33:12 | return ... | ReturnStmt | +| declarations.swift:33:5:33:12 | return ... | ReturnStmt | declarations.swift:33:12:33:12 | here | StringLiteralExpr | +| declarations.swift:35:3:35:18 | set | AccessorDecl | declarations.swift:35:7:35:7 | newValue | ParamDecl | +| declarations.swift:35:3:35:18 | set | AccessorDecl | declarations.swift:35:17:35:18 | { ... } | BraceStmt | +| declarations.swift:38:1:38:33 | call to print | CallExpr | declarations.swift:38:1:38:1 | print | DeclRefExpr | +| declarations.swift:38:1:38:33 | { ... } | BraceStmt | declarations.swift:38:1:38:33 | call to print | CallExpr | +| declarations.swift:38:1:38:33 | { ... } | TopLevelCodeDecl | declarations.swift:38:1:38:33 | { ... } | BraceStmt | +| declarations.swift:38:7:38:7 | [...] | ArrayExpr | declarations.swift:38:7:38:7 | some top level statement | StringLiteralExpr | +| declarations.swift:38:7:38:7 | [...] | VarargExpansionExpr | declarations.swift:38:7:38:7 | [...] | ArrayExpr | +| declarations.swift:41:3:41:14 | var ... = ... | PatternBindingDecl | declarations.swift:41:7:41:14 | ... as ... | TypedPattern | +| declarations.swift:41:7:41:7 | (unnamed function decl) | AccessorDecl | declarations.swift:41:7:41:7 | { ... } | BraceStmt | +| declarations.swift:41:7:41:7 | field | ConcreteVarDecl | declarations.swift:41:7:41:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:41:7:41:7 | field | ConcreteVarDecl | declarations.swift:41:7:41:7 | get | AccessorDecl | +| declarations.swift:41:7:41:7 | field | ConcreteVarDecl | declarations.swift:41:7:41:7 | set | AccessorDecl | +| declarations.swift:41:7:41:7 | get | AccessorDecl | declarations.swift:41:7:41:7 | { ... } | BraceStmt | +| declarations.swift:41:7:41:7 | set | AccessorDecl | declarations.swift:41:7:41:7 | value | ParamDecl | +| declarations.swift:41:7:41:7 | set | AccessorDecl | declarations.swift:41:7:41:7 | { ... } | BraceStmt | +| declarations.swift:41:7:41:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:41:7:41:7 | { ... } | BraceStmt | declarations.swift:41:7:41:7 | yield ... | YieldStmt | +| declarations.swift:41:7:41:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:41:7:41:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:41:7:41:14 | ... as ... | TypedPattern | declarations.swift:41:7:41:7 | field | NamedPattern | +| declarations.swift:41:7:41:14 | ... as ... | TypedPattern | declarations.swift:41:14:41:14 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:42:3:44:3 | deinit | ConstructorDecl | declarations.swift:42:10:44:3 | { ... } | BraceStmt | +| declarations.swift:42:10:44:3 | { ... } | BraceStmt | declarations.swift:43:5:43:13 | ... = ... | AssignExpr | +| declarations.swift:42:10:44:3 | { ... } | BraceStmt | declarations.swift:44:3:44:3 | return | ReturnStmt | +| declarations.swift:43:5:43:5 | .field | MemberRefExpr | declarations.swift:43:5:43:5 | self | DeclRefExpr | +| declarations.swift:43:5:43:13 | ... = ... | AssignExpr | declarations.swift:43:5:43:5 | .field | MemberRefExpr | +| declarations.swift:43:5:43:13 | ... = ... | AssignExpr | declarations.swift:43:13:43:13 | 10 | IntegerLiteralExpr | +| declarations.swift:46:3:48:3 | init | DestructorDecl | declarations.swift:46:10:48:3 | { ... } | BraceStmt | +| declarations.swift:46:10:48:3 | { ... } | BraceStmt | declarations.swift:47:5:47:13 | ... = ... | AssignExpr | +| declarations.swift:47:5:47:5 | .field | MemberRefExpr | declarations.swift:47:5:47:5 | self | DeclRefExpr | +| declarations.swift:47:5:47:13 | ... = ... | AssignExpr | declarations.swift:47:5:47:5 | .field | MemberRefExpr | +| declarations.swift:47:5:47:13 | ... = ... | AssignExpr | declarations.swift:47:13:47:13 | 0 | IntegerLiteralExpr | +| declarations.swift:50:3:52:3 | +- | ConcreteFuncDecl | declarations.swift:50:26:50:33 | other | ParamDecl | +| declarations.swift:50:3:52:3 | +- | ConcreteFuncDecl | declarations.swift:50:45:52:3 | { ... } | BraceStmt | +| declarations.swift:50:45:52:3 | { ... } | BraceStmt | declarations.swift:51:5:51:12 | return ... | ReturnStmt | +| declarations.swift:51:5:51:12 | return ... | ReturnStmt | declarations.swift:51:12:51:12 | other | DeclRefExpr | +| declarations.swift:68:25:68:25 | deinit | ConstructorDecl | declarations.swift:68:25:68:25 | { ... } | BraceStmt | +| declarations.swift:68:25:68:25 | { ... } | BraceStmt | declarations.swift:68:25:68:25 | return | ReturnStmt | +| declarations.swift:69:3:73:3 | var ... = ... | PatternBindingDecl | declarations.swift:69:7:69:21 | ... as ... | TypedPattern | +| declarations.swift:69:7:69:7 | wrappedValue | ConcreteVarDecl | declarations.swift:70:5:72:5 | get | AccessorDecl | +| declarations.swift:69:7:69:21 | ... as ... | TypedPattern | declarations.swift:69:7:69:7 | wrappedValue | NamedPattern | +| declarations.swift:69:7:69:21 | ... as ... | TypedPattern | declarations.swift:69:21:69:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:70:5:72:5 | get | AccessorDecl | declarations.swift:70:9:72:5 | { ... } | BraceStmt | +| declarations.swift:70:9:72:5 | { ... } | BraceStmt | declarations.swift:71:7:71:14 | return ... | ReturnStmt | +| declarations.swift:71:7:71:14 | return ... | ReturnStmt | declarations.swift:71:14:71:14 | 0 | IntegerLiteralExpr | +| declarations.swift:76:1:79:1 | foo | ConcreteFuncDecl | declarations.swift:76:19:79:1 | { ... } | BraceStmt | +| declarations.swift:76:19:79:1 | { ... } | BraceStmt | declarations.swift:77:16:77:23 | var ... = ... | PatternBindingDecl | +| declarations.swift:76:19:79:1 | { ... } | BraceStmt | declarations.swift:77:20:77:20 | x | ConcreteVarDecl | +| declarations.swift:76:19:79:1 | { ... } | BraceStmt | declarations.swift:78:3:78:10 | return ... | ReturnStmt | +| declarations.swift:77:4:77:4 | ZeroWrapper.Type | TypeExpr | declarations.swift:77:4:77:4 | TBD (FixedTypeRepr) | FixedTypeRepr | +| declarations.swift:77:4:77:4 | call to ... | CallExpr | declarations.swift:77:4:77:4 | call to ... | ConstructorRefCallExpr | +| declarations.swift:77:4:77:4 | call to ... | ConstructorRefCallExpr | declarations.swift:77:4:77:4 | ZeroWrapper.Type | TypeExpr | +| declarations.swift:77:4:77:4 | call to ... | ConstructorRefCallExpr | declarations.swift:77:4:77:4 | deinit | DeclRefExpr | +| declarations.swift:77:16:77:23 | var ... = ... | PatternBindingDecl | declarations.swift:77:20:77:23 | ... as ... | TypedPattern | +| declarations.swift:77:20:77:20 | ... as ... | TypedPattern | declarations.swift:77:20:77:20 | _x | NamedPattern | +| declarations.swift:77:20:77:20 | get | AccessorDecl | declarations.swift:77:20:77:20 | { ... } | BraceStmt | +| declarations.swift:77:20:77:20 | x | ConcreteVarDecl | declarations.swift:77:20:77:20 | get | AccessorDecl | +| declarations.swift:77:20:77:20 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:77:20:77:23 | ... as ... | TypedPattern | declarations.swift:77:20:77:20 | x | NamedPattern | +| declarations.swift:77:20:77:23 | ... as ... | TypedPattern | declarations.swift:77:23:77:23 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:78:3:78:10 | return ... | ReturnStmt | declarations.swift:78:10:78:10 | x | DeclRefExpr | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | hasBoth | ParamDecl | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | hasDidSet1 | ParamDecl | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | hasDidSet2 | ParamDecl | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | hasWillSet1 | ParamDecl | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | hasWillSet2 | ParamDecl | +| declarations.swift:81:8:81:8 | deinit | ConstructorDecl | declarations.swift:81:8:81:8 | normalField | ParamDecl | +| declarations.swift:82:3:87:3 | var ... = ... | PatternBindingDecl | declarations.swift:82:7:82:22 | ... as ... | TypedPattern | +| declarations.swift:82:7:82:7 | (unnamed function decl) | AccessorDecl | declarations.swift:82:7:82:7 | { ... } | BraceStmt | +| declarations.swift:82:7:82:7 | settableField | ConcreteVarDecl | declarations.swift:82:7:82:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:82:7:82:7 | settableField | ConcreteVarDecl | declarations.swift:83:5:83:11 | set | AccessorDecl | +| declarations.swift:82:7:82:7 | settableField | ConcreteVarDecl | declarations.swift:84:5:86:5 | get | AccessorDecl | +| declarations.swift:82:7:82:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:82:7:82:7 | { ... } | BraceStmt | declarations.swift:82:7:82:7 | yield ... | YieldStmt | +| declarations.swift:82:7:82:22 | ... as ... | TypedPattern | declarations.swift:82:7:82:7 | settableField | NamedPattern | +| declarations.swift:82:7:82:22 | ... as ... | TypedPattern | declarations.swift:82:22:82:22 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:83:5:83:11 | set | AccessorDecl | declarations.swift:83:5:83:5 | newValue | ParamDecl | +| declarations.swift:83:5:83:11 | set | AccessorDecl | declarations.swift:83:9:83:11 | { ... } | BraceStmt | +| declarations.swift:84:5:86:5 | get | AccessorDecl | declarations.swift:84:9:86:5 | { ... } | BraceStmt | +| declarations.swift:84:9:86:5 | { ... } | BraceStmt | declarations.swift:85:7:85:14 | return ... | ReturnStmt | +| declarations.swift:85:7:85:14 | return ... | ReturnStmt | declarations.swift:85:14:85:14 | 0 | IntegerLiteralExpr | +| declarations.swift:91:3:93:3 | var ... = ... | PatternBindingDecl | declarations.swift:91:7:91:23 | ... as ... | TypedPattern | +| declarations.swift:91:7:91:7 | readOnlyField1 | ConcreteVarDecl | declarations.swift:91:27:93:3 | get | AccessorDecl | +| declarations.swift:91:7:91:23 | ... as ... | TypedPattern | declarations.swift:91:7:91:7 | readOnlyField1 | NamedPattern | +| declarations.swift:91:7:91:23 | ... as ... | TypedPattern | declarations.swift:91:23:91:23 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:91:27:93:3 | get | AccessorDecl | declarations.swift:91:27:93:3 | { ... } | BraceStmt | +| declarations.swift:91:27:93:3 | { ... } | BraceStmt | declarations.swift:92:5:92:12 | return ... | ReturnStmt | +| declarations.swift:92:5:92:12 | return ... | ReturnStmt | declarations.swift:92:12:92:12 | 0 | IntegerLiteralExpr | +| declarations.swift:96:3:100:3 | var ... = ... | PatternBindingDecl | declarations.swift:96:7:96:23 | ... as ... | TypedPattern | +| declarations.swift:96:7:96:7 | readOnlyField2 | ConcreteVarDecl | declarations.swift:97:5:99:5 | get | AccessorDecl | +| declarations.swift:96:7:96:23 | ... as ... | TypedPattern | declarations.swift:96:7:96:7 | readOnlyField2 | NamedPattern | +| declarations.swift:96:7:96:23 | ... as ... | TypedPattern | declarations.swift:96:23:96:23 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:97:5:99:5 | get | AccessorDecl | declarations.swift:97:9:99:5 | { ... } | BraceStmt | +| declarations.swift:97:9:99:5 | { ... } | BraceStmt | declarations.swift:98:7:98:14 | return ... | ReturnStmt | +| declarations.swift:98:7:98:14 | return ... | ReturnStmt | declarations.swift:98:14:98:14 | 0 | IntegerLiteralExpr | +| declarations.swift:102:3:102:21 | var ... = ... | PatternBindingDecl | declarations.swift:102:7:102:21 | ... as ... | TypedPattern | +| declarations.swift:102:7:102:7 | (unnamed function decl) | AccessorDecl | declarations.swift:102:7:102:7 | { ... } | BraceStmt | +| declarations.swift:102:7:102:7 | get | AccessorDecl | declarations.swift:102:7:102:7 | { ... } | BraceStmt | +| declarations.swift:102:7:102:7 | normalField | ConcreteVarDecl | declarations.swift:102:7:102:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:102:7:102:7 | normalField | ConcreteVarDecl | declarations.swift:102:7:102:7 | get | AccessorDecl | +| declarations.swift:102:7:102:7 | normalField | ConcreteVarDecl | declarations.swift:102:7:102:7 | set | AccessorDecl | +| declarations.swift:102:7:102:7 | set | AccessorDecl | declarations.swift:102:7:102:7 | value | ParamDecl | +| declarations.swift:102:7:102:7 | set | AccessorDecl | declarations.swift:102:7:102:7 | { ... } | BraceStmt | +| declarations.swift:102:7:102:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:102:7:102:7 | { ... } | BraceStmt | declarations.swift:102:7:102:7 | yield ... | YieldStmt | +| declarations.swift:102:7:102:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:102:7:102:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:102:7:102:21 | ... as ... | TypedPattern | declarations.swift:102:7:102:7 | normalField | NamedPattern | +| declarations.swift:102:7:102:21 | ... as ... | TypedPattern | declarations.swift:102:21:102:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:104:3:104:3 | (unnamed function decl) | AccessorDecl | declarations.swift:104:3:104:3 | { ... } | BraceStmt | +| declarations.swift:104:3:104:3 | (unnamed function decl) | AccessorDecl | file://:0:0:0:0 | x | ParamDecl | +| declarations.swift:104:3:104:3 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:104:3:104:3 | { ... } | BraceStmt | declarations.swift:104:3:104:3 | yield ... | YieldStmt | +| declarations.swift:104:3:109:3 | subscript ... | SubscriptDecl | declarations.swift:104:3:104:3 | (unnamed function decl) | AccessorDecl | +| declarations.swift:104:3:109:3 | subscript ... | SubscriptDecl | declarations.swift:104:13:104:16 | x | ParamDecl | +| declarations.swift:104:3:109:3 | subscript ... | SubscriptDecl | declarations.swift:105:5:107:5 | get | AccessorDecl | +| declarations.swift:104:3:109:3 | subscript ... | SubscriptDecl | declarations.swift:108:5:108:11 | set | AccessorDecl | +| declarations.swift:105:5:107:5 | get | AccessorDecl | declarations.swift:104:13:104:13 | x | ParamDecl | +| declarations.swift:105:5:107:5 | get | AccessorDecl | declarations.swift:105:9:107:5 | { ... } | BraceStmt | +| declarations.swift:105:9:107:5 | { ... } | BraceStmt | declarations.swift:106:7:106:14 | return ... | ReturnStmt | +| declarations.swift:106:7:106:14 | return ... | ReturnStmt | declarations.swift:106:14:106:14 | 0 | IntegerLiteralExpr | +| declarations.swift:108:5:108:11 | set | AccessorDecl | declarations.swift:104:13:104:13 | x | ParamDecl | +| declarations.swift:108:5:108:11 | set | AccessorDecl | declarations.swift:108:5:108:5 | newValue | ParamDecl | +| declarations.swift:108:5:108:11 | set | AccessorDecl | declarations.swift:108:9:108:11 | { ... } | BraceStmt | +| declarations.swift:111:3:113:3 | subscript ... | SubscriptDecl | declarations.swift:111:13:111:16 | x | ParamDecl | +| declarations.swift:111:3:113:3 | subscript ... | SubscriptDecl | declarations.swift:111:21:111:25 | y | ParamDecl | +| declarations.swift:111:3:113:3 | subscript ... | SubscriptDecl | declarations.swift:111:37:113:3 | get | AccessorDecl | +| declarations.swift:111:37:113:3 | get | AccessorDecl | declarations.swift:111:13:111:13 | x | ParamDecl | +| declarations.swift:111:37:113:3 | get | AccessorDecl | declarations.swift:111:21:111:21 | y | ParamDecl | +| declarations.swift:111:37:113:3 | get | AccessorDecl | declarations.swift:111:37:113:3 | { ... } | BraceStmt | +| declarations.swift:111:37:113:3 | { ... } | BraceStmt | declarations.swift:112:5:112:12 | return ... | ReturnStmt | +| declarations.swift:112:5:112:12 | return ... | ReturnStmt | declarations.swift:112:12:112:12 | 0 | IntegerLiteralExpr | +| declarations.swift:115:3:117:3 | var ... = ... | PatternBindingDecl | declarations.swift:115:7:115:21 | ... as ... | TypedPattern | +| declarations.swift:115:7:115:7 | (unnamed function decl) | AccessorDecl | declarations.swift:115:7:115:7 | { ... } | BraceStmt | +| declarations.swift:115:7:115:7 | get | AccessorDecl | declarations.swift:115:7:115:7 | { ... } | BraceStmt | +| declarations.swift:115:7:115:7 | hasWillSet1 | ConcreteVarDecl | declarations.swift:115:7:115:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:115:7:115:7 | hasWillSet1 | ConcreteVarDecl | declarations.swift:115:7:115:7 | get | AccessorDecl | +| declarations.swift:115:7:115:7 | hasWillSet1 | ConcreteVarDecl | declarations.swift:115:7:115:7 | set | AccessorDecl | +| declarations.swift:115:7:115:7 | hasWillSet1 | ConcreteVarDecl | declarations.swift:116:5:116:25 | willSet | AccessorDecl | +| declarations.swift:115:7:115:7 | set | AccessorDecl | declarations.swift:115:7:115:7 | value | ParamDecl | +| declarations.swift:115:7:115:7 | set | AccessorDecl | declarations.swift:115:7:115:7 | { ... } | BraceStmt | +| declarations.swift:115:7:115:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:115:7:115:7 | { ... } | BraceStmt | declarations.swift:115:7:115:7 | yield ... | YieldStmt | +| declarations.swift:115:7:115:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:115:7:115:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:115:7:115:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:115:7:115:21 | ... as ... | TypedPattern | declarations.swift:115:7:115:7 | hasWillSet1 | NamedPattern | +| declarations.swift:115:7:115:21 | ... as ... | TypedPattern | declarations.swift:115:21:115:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:116:5:116:25 | willSet | AccessorDecl | declarations.swift:116:13:116:13 | newValue | ParamDecl | +| declarations.swift:116:5:116:25 | willSet | AccessorDecl | declarations.swift:116:23:116:25 | { ... } | BraceStmt | +| declarations.swift:119:3:121:3 | var ... = ... | PatternBindingDecl | declarations.swift:119:7:119:21 | ... as ... | TypedPattern | +| declarations.swift:119:7:119:7 | (unnamed function decl) | AccessorDecl | declarations.swift:119:7:119:7 | { ... } | BraceStmt | +| declarations.swift:119:7:119:7 | get | AccessorDecl | declarations.swift:119:7:119:7 | { ... } | BraceStmt | +| declarations.swift:119:7:119:7 | hasWillSet2 | ConcreteVarDecl | declarations.swift:119:7:119:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:119:7:119:7 | hasWillSet2 | ConcreteVarDecl | declarations.swift:119:7:119:7 | get | AccessorDecl | +| declarations.swift:119:7:119:7 | hasWillSet2 | ConcreteVarDecl | declarations.swift:119:7:119:7 | set | AccessorDecl | +| declarations.swift:119:7:119:7 | hasWillSet2 | ConcreteVarDecl | declarations.swift:120:5:120:15 | willSet | AccessorDecl | +| declarations.swift:119:7:119:7 | set | AccessorDecl | declarations.swift:119:7:119:7 | value | ParamDecl | +| declarations.swift:119:7:119:7 | set | AccessorDecl | declarations.swift:119:7:119:7 | { ... } | BraceStmt | +| declarations.swift:119:7:119:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:119:7:119:7 | { ... } | BraceStmt | declarations.swift:119:7:119:7 | yield ... | YieldStmt | +| declarations.swift:119:7:119:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:119:7:119:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:119:7:119:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:119:7:119:21 | ... as ... | TypedPattern | declarations.swift:119:7:119:7 | hasWillSet2 | NamedPattern | +| declarations.swift:119:7:119:21 | ... as ... | TypedPattern | declarations.swift:119:21:119:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:120:5:120:15 | willSet | AccessorDecl | declarations.swift:120:5:120:5 | newValue | ParamDecl | +| declarations.swift:120:5:120:15 | willSet | AccessorDecl | declarations.swift:120:13:120:15 | { ... } | BraceStmt | +| declarations.swift:123:3:125:3 | var ... = ... | PatternBindingDecl | declarations.swift:123:7:123:20 | ... as ... | TypedPattern | +| declarations.swift:123:7:123:7 | (unnamed function decl) | AccessorDecl | declarations.swift:123:7:123:7 | { ... } | BraceStmt | +| declarations.swift:123:7:123:7 | get | AccessorDecl | declarations.swift:123:7:123:7 | { ... } | BraceStmt | +| declarations.swift:123:7:123:7 | hasDidSet1 | ConcreteVarDecl | declarations.swift:123:7:123:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:123:7:123:7 | hasDidSet1 | ConcreteVarDecl | declarations.swift:123:7:123:7 | get | AccessorDecl | +| declarations.swift:123:7:123:7 | hasDidSet1 | ConcreteVarDecl | declarations.swift:123:7:123:7 | set | AccessorDecl | +| declarations.swift:123:7:123:7 | hasDidSet1 | ConcreteVarDecl | declarations.swift:124:5:124:24 | didSet | AccessorDecl | +| declarations.swift:123:7:123:7 | set | AccessorDecl | declarations.swift:123:7:123:7 | value | ParamDecl | +| declarations.swift:123:7:123:7 | set | AccessorDecl | declarations.swift:123:7:123:7 | { ... } | BraceStmt | +| declarations.swift:123:7:123:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | declarations.swift:123:7:123:7 | yield ... | YieldStmt | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | file://:0:0:0:0 | tmp | ConcreteVarDecl | +| declarations.swift:123:7:123:7 | { ... } | BraceStmt | file://:0:0:0:0 | var ... = ... | PatternBindingDecl | +| declarations.swift:123:7:123:20 | ... as ... | TypedPattern | declarations.swift:123:7:123:7 | hasDidSet1 | NamedPattern | +| declarations.swift:123:7:123:20 | ... as ... | TypedPattern | declarations.swift:123:20:123:20 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:124:5:124:24 | didSet | AccessorDecl | declarations.swift:124:12:124:12 | oldValue | ParamDecl | +| declarations.swift:124:5:124:24 | didSet | AccessorDecl | declarations.swift:124:22:124:24 | { ... } | BraceStmt | +| declarations.swift:127:3:129:3 | var ... = ... | PatternBindingDecl | declarations.swift:127:7:127:20 | ... as ... | TypedPattern | +| declarations.swift:127:7:127:7 | (unnamed function decl) | AccessorDecl | declarations.swift:127:7:127:7 | { ... } | BraceStmt | +| declarations.swift:127:7:127:7 | get | AccessorDecl | declarations.swift:127:7:127:7 | { ... } | BraceStmt | +| declarations.swift:127:7:127:7 | hasDidSet2 | ConcreteVarDecl | declarations.swift:127:7:127:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:127:7:127:7 | hasDidSet2 | ConcreteVarDecl | declarations.swift:127:7:127:7 | get | AccessorDecl | +| declarations.swift:127:7:127:7 | hasDidSet2 | ConcreteVarDecl | declarations.swift:127:7:127:7 | set | AccessorDecl | +| declarations.swift:127:7:127:7 | hasDidSet2 | ConcreteVarDecl | declarations.swift:128:5:128:14 | didSet | AccessorDecl | +| declarations.swift:127:7:127:7 | set | AccessorDecl | declarations.swift:127:7:127:7 | value | ParamDecl | +| declarations.swift:127:7:127:7 | set | AccessorDecl | declarations.swift:127:7:127:7 | { ... } | BraceStmt | +| declarations.swift:127:7:127:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:127:7:127:7 | { ... } | BraceStmt | declarations.swift:127:7:127:7 | yield ... | YieldStmt | +| declarations.swift:127:7:127:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:127:7:127:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:127:7:127:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:127:7:127:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:127:7:127:20 | ... as ... | TypedPattern | declarations.swift:127:7:127:7 | hasDidSet2 | NamedPattern | +| declarations.swift:127:7:127:20 | ... as ... | TypedPattern | declarations.swift:127:20:127:20 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:128:5:128:14 | didSet | AccessorDecl | declarations.swift:128:12:128:14 | { ... } | BraceStmt | +| declarations.swift:131:3:135:3 | var ... = ... | PatternBindingDecl | declarations.swift:131:7:131:17 | ... as ... | TypedPattern | +| declarations.swift:131:7:131:7 | (unnamed function decl) | AccessorDecl | declarations.swift:131:7:131:7 | { ... } | BraceStmt | +| declarations.swift:131:7:131:7 | get | AccessorDecl | declarations.swift:131:7:131:7 | { ... } | BraceStmt | +| declarations.swift:131:7:131:7 | hasBoth | ConcreteVarDecl | declarations.swift:131:7:131:7 | (unnamed function decl) | AccessorDecl | +| declarations.swift:131:7:131:7 | hasBoth | ConcreteVarDecl | declarations.swift:131:7:131:7 | get | AccessorDecl | +| declarations.swift:131:7:131:7 | hasBoth | ConcreteVarDecl | declarations.swift:131:7:131:7 | set | AccessorDecl | +| declarations.swift:131:7:131:7 | hasBoth | ConcreteVarDecl | declarations.swift:132:5:132:15 | willSet | AccessorDecl | +| declarations.swift:131:7:131:7 | hasBoth | ConcreteVarDecl | declarations.swift:134:5:134:14 | didSet | AccessorDecl | +| declarations.swift:131:7:131:7 | set | AccessorDecl | declarations.swift:131:7:131:7 | value | ParamDecl | +| declarations.swift:131:7:131:7 | set | AccessorDecl | declarations.swift:131:7:131:7 | { ... } | BraceStmt | +| declarations.swift:131:7:131:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| declarations.swift:131:7:131:7 | { ... } | BraceStmt | declarations.swift:131:7:131:7 | yield ... | YieldStmt | +| declarations.swift:131:7:131:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| declarations.swift:131:7:131:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:131:7:131:7 | { ... } | BraceStmt | file://:0:0:0:0 | call to ... | CallExpr | +| declarations.swift:131:7:131:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| declarations.swift:131:7:131:17 | ... as ... | TypedPattern | declarations.swift:131:7:131:7 | hasBoth | NamedPattern | +| declarations.swift:131:7:131:17 | ... as ... | TypedPattern | declarations.swift:131:17:131:17 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| declarations.swift:132:5:132:15 | willSet | AccessorDecl | declarations.swift:132:5:132:5 | newValue | ParamDecl | +| declarations.swift:132:5:132:15 | willSet | AccessorDecl | declarations.swift:132:13:132:15 | { ... } | BraceStmt | +| declarations.swift:134:5:134:14 | didSet | AccessorDecl | declarations.swift:134:12:134:14 | { ... } | BraceStmt | +| expressions.swift:1:1:1:9 | var ... = ... | PatternBindingDecl | expressions.swift:1:5:1:5 | a | NamedPattern | +| expressions.swift:1:1:1:9 | var ... = ... | PatternBindingDecl | expressions.swift:1:9:1:9 | 15 | IntegerLiteralExpr | +| expressions.swift:1:1:1:9 | { ... } | BraceStmt | expressions.swift:1:1:1:9 | var ... = ... | PatternBindingDecl | +| expressions.swift:1:1:1:9 | { ... } | TopLevelCodeDecl | expressions.swift:1:1:1:9 | { ... } | BraceStmt | +| expressions.swift:2:1:2:9 | var ... = ... | PatternBindingDecl | expressions.swift:2:5:2:5 | b | NamedPattern | +| expressions.swift:2:1:2:9 | var ... = ... | PatternBindingDecl | expressions.swift:2:9:2:9 | 15.15 | FloatLiteralExpr | +| expressions.swift:2:1:2:9 | { ... } | BraceStmt | expressions.swift:2:1:2:9 | var ... = ... | PatternBindingDecl | +| expressions.swift:2:1:2:9 | { ... } | TopLevelCodeDecl | expressions.swift:2:1:2:9 | { ... } | BraceStmt | +| expressions.swift:3:1:3:10 | var ... = ... | PatternBindingDecl | expressions.swift:3:5:3:5 | b1 | NamedPattern | +| expressions.swift:3:1:3:10 | var ... = ... | PatternBindingDecl | expressions.swift:3:10:3:10 | true | BooleanLiteralExpr | +| expressions.swift:3:1:3:10 | { ... } | BraceStmt | expressions.swift:3:1:3:10 | var ... = ... | PatternBindingDecl | +| expressions.swift:3:1:3:10 | { ... } | TopLevelCodeDecl | expressions.swift:3:1:3:10 | { ... } | BraceStmt | +| expressions.swift:4:1:4:10 | var ... = ... | PatternBindingDecl | expressions.swift:4:5:4:5 | b2 | NamedPattern | +| expressions.swift:4:1:4:10 | var ... = ... | PatternBindingDecl | expressions.swift:4:10:4:10 | false | BooleanLiteralExpr | +| expressions.swift:4:1:4:10 | { ... } | BraceStmt | expressions.swift:4:1:4:10 | var ... = ... | PatternBindingDecl | +| expressions.swift:4:1:4:10 | { ... } | TopLevelCodeDecl | expressions.swift:4:1:4:10 | { ... } | BraceStmt | +| expressions.swift:5:1:5:9 | var ... = ... | PatternBindingDecl | expressions.swift:5:5:5:5 | m | NamedPattern | +| expressions.swift:5:1:5:9 | var ... = ... | PatternBindingDecl | expressions.swift:5:9:5:9 | #... | MagicIdentifierLiteralExpr | +| expressions.swift:5:1:5:9 | { ... } | BraceStmt | expressions.swift:5:1:5:9 | var ... = ... | PatternBindingDecl | +| expressions.swift:5:1:5:9 | { ... } | TopLevelCodeDecl | expressions.swift:5:1:5:9 | { ... } | BraceStmt | +| expressions.swift:6:1:6:9 | var ... = ... | PatternBindingDecl | expressions.swift:6:5:6:5 | s | NamedPattern | +| expressions.swift:6:1:6:9 | var ... = ... | PatternBindingDecl | expressions.swift:6:9:6:9 | hello world | StringLiteralExpr | +| expressions.swift:6:1:6:9 | { ... } | BraceStmt | expressions.swift:6:1:6:9 | var ... = ... | PatternBindingDecl | +| expressions.swift:6:1:6:9 | { ... } | TopLevelCodeDecl | expressions.swift:6:1:6:9 | { ... } | BraceStmt | +| expressions.swift:7:1:7:10 | var ... = ... | PatternBindingDecl | expressions.swift:7:5:7:5 | s1 | NamedPattern | +| expressions.swift:7:1:7:10 | var ... = ... | PatternBindingDecl | expressions.swift:7:10:7:10 | "..." | InterpolatedStringLiteralExpr | +| expressions.swift:7:1:7:10 | { ... } | BraceStmt | expressions.swift:7:1:7:10 | var ... = ... | PatternBindingDecl | +| expressions.swift:7:1:7:10 | { ... } | TopLevelCodeDecl | expressions.swift:7:1:7:10 | { ... } | BraceStmt | +| expressions.swift:7:10:7:10 | "..." | InterpolatedStringLiteralExpr | expressions.swift:7:10:7:10 | TapExpr | TapExpr | +| expressions.swift:7:10:7:10 | "..." | InterpolatedStringLiteralExpr | file://:0:0:0:0 | 1 | IntegerLiteralExpr | +| expressions.swift:7:10:7:10 | "..." | InterpolatedStringLiteralExpr | file://:0:0:0:0 | 6 | IntegerLiteralExpr | +| expressions.swift:7:10:7:10 | TapExpr | TapExpr | expressions.swift:7:10:7:10 | OpaqueValueExpr | OpaqueValueExpr | +| expressions.swift:7:10:7:10 | TapExpr | TapExpr | expressions.swift:7:10:7:10 | { ... } | BraceStmt | +| expressions.swift:7:10:7:10 | { ... } | BraceStmt | expressions.swift:7:11:7:10 | call to ... | CallExpr | +| expressions.swift:7:10:7:10 | { ... } | BraceStmt | expressions.swift:7:18:7:20 | call to ... | CallExpr | +| expressions.swift:7:10:7:10 | { ... } | BraceStmt | expressions.swift:7:21:7:21 | call to ... | CallExpr | +| expressions.swift:7:10:7:10 | { ... } | BraceStmt | file://:0:0:0:0 | $interpolation | ConcreteVarDecl | +| expressions.swift:7:11:7:10 | call to ... | CallExpr | expressions.swift:7:11:7:11 | call to appendLiteral | DotSyntaxCallExpr | +| expressions.swift:7:11:7:11 | &... | InOutExpr | expressions.swift:7:11:7:11 | $interpolation | DeclRefExpr | +| expressions.swift:7:11:7:11 | call to appendLiteral | DotSyntaxCallExpr | expressions.swift:7:11:7:11 | &... | InOutExpr | +| expressions.swift:7:11:7:11 | call to appendLiteral | DotSyntaxCallExpr | file://:0:0:0:0 | appendLiteral | DeclRefExpr | +| expressions.swift:7:18:7:18 | &... | InOutExpr | expressions.swift:7:18:7:18 | $interpolation | DeclRefExpr | +| expressions.swift:7:18:7:18 | call to appendInterpolation | DotSyntaxCallExpr | expressions.swift:7:18:7:18 | &... | InOutExpr | +| expressions.swift:7:18:7:18 | call to appendInterpolation | DotSyntaxCallExpr | expressions.swift:7:18:7:18 | appendInterpolation | DeclRefExpr | +| expressions.swift:7:18:7:20 | call to ... | CallExpr | expressions.swift:7:18:7:18 | call to appendInterpolation | DotSyntaxCallExpr | +| expressions.swift:7:21:7:21 | &... | InOutExpr | expressions.swift:7:21:7:21 | $interpolation | DeclRefExpr | +| expressions.swift:7:21:7:21 | call to ... | CallExpr | expressions.swift:7:21:7:21 | call to appendLiteral | DotSyntaxCallExpr | +| expressions.swift:7:21:7:21 | call to appendLiteral | DotSyntaxCallExpr | expressions.swift:7:21:7:21 | &... | InOutExpr | +| expressions.swift:7:21:7:21 | call to appendLiteral | DotSyntaxCallExpr | file://:0:0:0:0 | appendLiteral | DeclRefExpr | +| expressions.swift:8:1:8:15 | var ... = ... | PatternBindingDecl | expressions.swift:8:5:8:11 | ... as ... | TypedPattern | +| expressions.swift:8:1:8:15 | var ... = ... | PatternBindingDecl | expressions.swift:8:15:8:15 | nil | NilLiteralExpr | +| expressions.swift:8:1:8:15 | { ... } | BraceStmt | expressions.swift:8:1:8:15 | var ... = ... | PatternBindingDecl | +| expressions.swift:8:1:8:15 | { ... } | TopLevelCodeDecl | expressions.swift:8:1:8:15 | { ... } | BraceStmt | +| expressions.swift:8:5:8:11 | ... as ... | TypedPattern | expressions.swift:8:5:8:5 | n | NamedPattern | +| expressions.swift:8:5:8:11 | ... as ... | TypedPattern | expressions.swift:8:8:8:11 | ...? | OptionalTypeRepr | +| expressions.swift:8:5:8:11 | ... as ... | TypedPattern | expressions.swift:8:8:8:11 | TBD (OptionalTypeRepr) | OptionalTypeRepr | +| expressions.swift:11:3:11:8 | case ... | EnumCaseDecl | expressions.swift:11:8:11:8 | failed | EnumElementDecl | +| expressions.swift:14:1:18:1 | failure | ConcreteFuncDecl | expressions.swift:14:14:14:19 | x | ParamDecl | +| expressions.swift:14:1:18:1 | failure | ConcreteFuncDecl | expressions.swift:14:31:18:1 | { ... } | BraceStmt | +| expressions.swift:14:31:18:1 | { ... } | BraceStmt | expressions.swift:15:3:17:3 | guard ... else { ... } | GuardStmt | +| expressions.swift:15:3:17:3 | guard ... else { ... } | GuardStmt | expressions.swift:15:9:15:14 | StmtCondition | StmtCondition | +| expressions.swift:15:3:17:3 | guard ... else { ... } | GuardStmt | expressions.swift:15:21:17:3 | { ... } | BraceStmt | +| expressions.swift:15:9:15:14 | ... call to != ... | BinaryExpr | expressions.swift:15:11:15:11 | call to != | DotSyntaxCallExpr | +| expressions.swift:15:11:15:11 | Int.Type | TypeExpr | expressions.swift:15:11:15:11 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:15:11:15:11 | call to != | DotSyntaxCallExpr | expressions.swift:15:11:15:11 | != | DeclRefExpr | +| expressions.swift:15:11:15:11 | call to != | DotSyntaxCallExpr | expressions.swift:15:11:15:11 | Int.Type | TypeExpr | +| expressions.swift:15:21:17:3 | { ... } | BraceStmt | expressions.swift:16:5:16:19 | throw ... | ThrowStmt | +| expressions.swift:16:5:16:19 | throw ... | ThrowStmt | expressions.swift:16:11:16:19 | call to ... | DotSyntaxCallExpr | +| expressions.swift:16:11:16:11 | AnError.Type | TypeExpr | expressions.swift:16:11:16:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:16:11:16:19 | call to ... | DotSyntaxCallExpr | expressions.swift:16:11:16:11 | AnError.Type | TypeExpr | +| expressions.swift:16:11:16:19 | call to ... | DotSyntaxCallExpr | expressions.swift:16:19:16:19 | failed | DeclRefExpr | +| expressions.swift:20:1:20:16 | try! ... | ForceTryExpr | expressions.swift:20:6:20:16 | call to failure | CallExpr | +| expressions.swift:20:1:20:16 | { ... } | BraceStmt | expressions.swift:20:1:20:16 | try! ... | ForceTryExpr | +| expressions.swift:20:1:20:16 | { ... } | TopLevelCodeDecl | expressions.swift:20:1:20:16 | { ... } | BraceStmt | +| expressions.swift:20:6:20:16 | call to failure | CallExpr | expressions.swift:20:6:20:6 | failure | DeclRefExpr | +| expressions.swift:21:1:21:16 | try? ... | OptionalTryExpr | expressions.swift:21:6:21:16 | call to failure | CallExpr | +| expressions.swift:21:1:21:16 | { ... } | BraceStmt | expressions.swift:21:1:21:16 | try? ... | OptionalTryExpr | +| expressions.swift:21:1:21:16 | { ... } | TopLevelCodeDecl | expressions.swift:21:1:21:16 | { ... } | BraceStmt | +| expressions.swift:21:6:21:16 | call to failure | CallExpr | expressions.swift:21:6:21:6 | failure | DeclRefExpr | +| expressions.swift:23:7:23:7 | init | DestructorDecl | expressions.swift:23:7:23:7 | { ... } | BraceStmt | +| expressions.swift:24:3:24:11 | deinit | ConstructorDecl | expressions.swift:24:10:24:11 | { ... } | BraceStmt | +| expressions.swift:24:10:24:11 | { ... } | BraceStmt | expressions.swift:24:11:24:11 | return | ReturnStmt | +| expressions.swift:27:1:27:19 | var ... = ... | PatternBindingDecl | expressions.swift:27:5:27:5 | klass | NamedPattern | +| expressions.swift:27:1:27:19 | var ... = ... | PatternBindingDecl | expressions.swift:27:13:27:19 | call to ... | CallExpr | +| expressions.swift:27:1:27:19 | { ... } | BraceStmt | expressions.swift:27:1:27:19 | var ... = ... | PatternBindingDecl | +| expressions.swift:27:1:27:19 | { ... } | TopLevelCodeDecl | expressions.swift:27:1:27:19 | { ... } | BraceStmt | +| expressions.swift:27:13:27:13 | Klass.Type | TypeExpr | expressions.swift:27:13:27:13 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:27:13:27:13 | call to ... | ConstructorRefCallExpr | expressions.swift:27:13:27:13 | Klass.Type | TypeExpr | +| expressions.swift:27:13:27:13 | call to ... | ConstructorRefCallExpr | expressions.swift:27:13:27:13 | deinit | DeclRefExpr | +| expressions.swift:27:13:27:19 | call to ... | CallExpr | expressions.swift:27:13:27:13 | call to ... | ConstructorRefCallExpr | +| expressions.swift:29:1:29:19 | var ... = ... | PatternBindingDecl | expressions.swift:29:5:29:5 | d | NamedPattern | +| expressions.swift:29:1:29:19 | var ... = ... | PatternBindingDecl | expressions.swift:29:9:29:19 | [...] | DictionaryExpr | +| expressions.swift:29:1:29:19 | { ... } | BraceStmt | expressions.swift:29:1:29:19 | var ... = ... | PatternBindingDecl | +| expressions.swift:29:1:29:19 | { ... } | TopLevelCodeDecl | expressions.swift:29:1:29:19 | { ... } | BraceStmt | +| expressions.swift:29:9:29:19 | [...] | DictionaryExpr | expressions.swift:29:10:29:16 | (...) | TupleExpr | +| expressions.swift:29:10:29:16 | (...) | TupleExpr | expressions.swift:29:10:29:10 | 1 | StringLiteralExpr | +| expressions.swift:29:10:29:16 | (...) | TupleExpr | expressions.swift:29:16:29:16 | 2 | StringLiteralExpr | +| expressions.swift:30:1:30:5 | ... = ... | AssignExpr | expressions.swift:30:1:30:1 | _ | DiscardAssignmentExpr | +| expressions.swift:30:1:30:5 | ... = ... | AssignExpr | expressions.swift:30:5:30:5 | 15 | IntegerLiteralExpr | +| expressions.swift:30:1:30:5 | { ... } | BraceStmt | expressions.swift:30:1:30:5 | ... = ... | AssignExpr | +| expressions.swift:30:1:30:5 | { ... } | TopLevelCodeDecl | expressions.swift:30:1:30:5 | { ... } | BraceStmt | +| expressions.swift:31:1:31:11 | ... = ... | AssignExpr | expressions.swift:31:1:31:1 | _ | DiscardAssignmentExpr | +| expressions.swift:31:1:31:11 | ... = ... | AssignExpr | expressions.swift:31:5:31:5 | 15 | IntegerLiteralExpr | +| expressions.swift:31:1:31:11 | { ... } | BraceStmt | expressions.swift:31:1:31:11 | ... = ... | AssignExpr | +| expressions.swift:31:1:31:11 | { ... } | TopLevelCodeDecl | expressions.swift:31:1:31:11 | { ... } | BraceStmt | +| expressions.swift:32:1:32:11 | ... = ... | AssignExpr | expressions.swift:32:1:32:1 | _ | DiscardAssignmentExpr | +| expressions.swift:32:1:32:11 | ... = ... | AssignExpr | expressions.swift:32:5:32:5 | 15 | IntegerLiteralExpr | +| expressions.swift:32:1:32:11 | { ... } | BraceStmt | expressions.swift:32:1:32:11 | ... = ... | AssignExpr | +| expressions.swift:32:1:32:11 | { ... } | TopLevelCodeDecl | expressions.swift:32:1:32:11 | { ... } | BraceStmt | +| expressions.swift:33:1:33:12 | ... = ... | AssignExpr | expressions.swift:33:1:33:1 | _ | DiscardAssignmentExpr | +| expressions.swift:33:1:33:12 | ... = ... | AssignExpr | expressions.swift:33:5:33:5 | 15 | IntegerLiteralExpr | +| expressions.swift:33:1:33:12 | { ... } | BraceStmt | expressions.swift:33:1:33:12 | ... = ... | AssignExpr | +| expressions.swift:33:1:33:12 | { ... } | TopLevelCodeDecl | expressions.swift:33:1:33:12 | { ... } | BraceStmt | +| expressions.swift:34:1:34:12 | ... = ... | AssignExpr | expressions.swift:34:1:34:1 | _ | DiscardAssignmentExpr | +| expressions.swift:34:1:34:12 | ... = ... | AssignExpr | expressions.swift:34:5:34:5 | 15 | IntegerLiteralExpr | +| expressions.swift:34:1:34:12 | { ... } | BraceStmt | expressions.swift:34:1:34:12 | ... = ... | AssignExpr | +| expressions.swift:34:1:34:12 | { ... } | TopLevelCodeDecl | expressions.swift:34:1:34:12 | { ... } | BraceStmt | +| expressions.swift:35:1:35:13 | call to print | CallExpr | expressions.swift:35:1:35:1 | print | DeclRefExpr | +| expressions.swift:35:1:35:13 | { ... } | BraceStmt | expressions.swift:35:1:35:13 | call to print | CallExpr | +| expressions.swift:35:1:35:13 | { ... } | TopLevelCodeDecl | expressions.swift:35:1:35:13 | { ... } | BraceStmt | +| expressions.swift:35:7:35:12 | ...[...] | SubscriptExpr | expressions.swift:35:7:35:7 | d | DeclRefExpr | +| expressions.swift:35:7:35:12 | [...] | ArrayExpr | expressions.swift:35:7:35:12 | ...[...] | SubscriptExpr | +| expressions.swift:35:7:35:12 | [...] | VarargExpansionExpr | expressions.swift:35:7:35:12 | [...] | ArrayExpr | +| expressions.swift:37:1:39:1 | closured | ConcreteFuncDecl | expressions.swift:37:15:37:38 | closure | ParamDecl | +| expressions.swift:37:1:39:1 | closured | ConcreteFuncDecl | expressions.swift:37:43:39:1 | { ... } | BraceStmt | +| expressions.swift:37:43:39:1 | { ... } | BraceStmt | expressions.swift:38:3:38:15 | call to ... | CallExpr | +| expressions.swift:38:3:38:15 | call to ... | CallExpr | expressions.swift:38:3:38:3 | closure | DeclRefExpr | +| expressions.swift:41:1:43:1 | call to closured | CallExpr | expressions.swift:41:1:41:1 | closured | DeclRefExpr | +| expressions.swift:41:1:43:1 | { ... } | BraceStmt | expressions.swift:41:1:43:1 | call to closured | CallExpr | +| expressions.swift:41:1:43:1 | { ... } | TopLevelCodeDecl | expressions.swift:41:1:43:1 | { ... } | BraceStmt | +| expressions.swift:41:10:43:1 | { ... } | BraceStmt | expressions.swift:42:5:42:16 | return ... | ReturnStmt | +| expressions.swift:41:10:43:1 | { ... } | ClosureExpr | expressions.swift:41:10:43:1 | { ... } | BraceStmt | +| expressions.swift:42:5:42:16 | return ... | ReturnStmt | expressions.swift:42:12:42:16 | ... call to + ... | BinaryExpr | +| expressions.swift:42:12:42:16 | ... call to + ... | BinaryExpr | expressions.swift:42:14:42:14 | call to + | DotSyntaxCallExpr | +| expressions.swift:42:14:42:14 | Int.Type | TypeExpr | expressions.swift:42:14:42:14 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:42:14:42:14 | call to + | DotSyntaxCallExpr | expressions.swift:42:14:42:14 | + | DeclRefExpr | +| expressions.swift:42:14:42:14 | call to + | DotSyntaxCallExpr | expressions.swift:42:14:42:14 | Int.Type | TypeExpr | +| expressions.swift:44:1:46:1 | call to closured | CallExpr | expressions.swift:44:1:44:1 | closured | DeclRefExpr | +| expressions.swift:44:1:46:1 | { ... } | BraceStmt | expressions.swift:44:1:46:1 | call to closured | CallExpr | +| expressions.swift:44:1:46:1 | { ... } | TopLevelCodeDecl | expressions.swift:44:1:46:1 | { ... } | BraceStmt | +| expressions.swift:44:10:46:1 | { ... } | BraceStmt | expressions.swift:45:5:45:16 | return ... | ReturnStmt | +| expressions.swift:44:10:46:1 | { ... } | ClosureExpr | expressions.swift:44:10:46:1 | { ... } | BraceStmt | +| expressions.swift:45:5:45:16 | return ... | ReturnStmt | expressions.swift:45:12:45:16 | ... call to + ... | BinaryExpr | +| expressions.swift:45:12:45:16 | ... call to + ... | BinaryExpr | expressions.swift:45:14:45:14 | call to + | DotSyntaxCallExpr | +| expressions.swift:45:14:45:14 | Int.Type | TypeExpr | expressions.swift:45:14:45:14 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:45:14:45:14 | call to + | DotSyntaxCallExpr | expressions.swift:45:14:45:14 | + | DeclRefExpr | +| expressions.swift:45:14:45:14 | call to + | DotSyntaxCallExpr | expressions.swift:45:14:45:14 | Int.Type | TypeExpr | +| expressions.swift:47:1:47:27 | call to closured | CallExpr | expressions.swift:47:1:47:1 | closured | DeclRefExpr | +| expressions.swift:47:1:47:27 | { ... } | BraceStmt | expressions.swift:47:1:47:27 | call to closured | CallExpr | +| expressions.swift:47:1:47:27 | { ... } | TopLevelCodeDecl | expressions.swift:47:1:47:27 | { ... } | BraceStmt | +| expressions.swift:47:10:47:27 | { ... } | BraceStmt | expressions.swift:47:12:47:24 | return ... | ReturnStmt | +| expressions.swift:47:10:47:27 | { ... } | ClosureExpr | expressions.swift:47:10:47:27 | { ... } | BraceStmt | +| expressions.swift:47:12:47:24 | return ... | ReturnStmt | expressions.swift:47:19:47:24 | ... call to + ... | BinaryExpr | +| expressions.swift:47:19:47:24 | ... call to + ... | BinaryExpr | expressions.swift:47:22:47:22 | call to + | DotSyntaxCallExpr | +| expressions.swift:47:22:47:22 | Int.Type | TypeExpr | expressions.swift:47:22:47:22 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:47:22:47:22 | call to + | DotSyntaxCallExpr | expressions.swift:47:22:47:22 | + | DeclRefExpr | +| expressions.swift:47:22:47:22 | call to + | DotSyntaxCallExpr | expressions.swift:47:22:47:22 | Int.Type | TypeExpr | +| expressions.swift:48:1:48:20 | call to closured | CallExpr | expressions.swift:48:1:48:1 | closured | DeclRefExpr | +| expressions.swift:48:1:48:20 | { ... } | BraceStmt | expressions.swift:48:1:48:20 | call to closured | CallExpr | +| expressions.swift:48:1:48:20 | { ... } | TopLevelCodeDecl | expressions.swift:48:1:48:20 | { ... } | BraceStmt | +| expressions.swift:48:10:48:20 | { ... } | BraceStmt | expressions.swift:48:12:48:17 | return ... | ReturnStmt | +| expressions.swift:48:10:48:20 | { ... } | ClosureExpr | expressions.swift:48:10:48:20 | { ... } | BraceStmt | +| expressions.swift:48:12:48:17 | ... call to + ... | BinaryExpr | expressions.swift:48:15:48:15 | call to + | DotSyntaxCallExpr | +| expressions.swift:48:12:48:17 | return ... | ReturnStmt | expressions.swift:48:12:48:17 | ... call to + ... | BinaryExpr | +| expressions.swift:48:15:48:15 | Int.Type | TypeExpr | expressions.swift:48:15:48:15 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:48:15:48:15 | call to + | DotSyntaxCallExpr | expressions.swift:48:15:48:15 | + | DeclRefExpr | +| expressions.swift:48:15:48:15 | call to + | DotSyntaxCallExpr | expressions.swift:48:15:48:15 | Int.Type | TypeExpr | +| expressions.swift:50:8:50:8 | deinit | ConstructorDecl | expressions.swift:50:8:50:8 | x | ParamDecl | +| expressions.swift:51:3:51:10 | var ... = ... | PatternBindingDecl | expressions.swift:51:7:51:10 | ... as ... | TypedPattern | +| expressions.swift:51:7:51:7 | get | AccessorDecl | expressions.swift:51:7:51:7 | { ... } | BraceStmt | +| expressions.swift:51:7:51:7 | x | ConcreteVarDecl | expressions.swift:51:7:51:7 | get | AccessorDecl | +| expressions.swift:51:7:51:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:51:7:51:10 | ... as ... | TypedPattern | expressions.swift:51:7:51:7 | x | NamedPattern | +| expressions.swift:51:7:51:10 | ... as ... | TypedPattern | expressions.swift:51:10:51:10 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:54:1:54:8 | ... = ... | AssignExpr | expressions.swift:54:1:54:1 | _ | DiscardAssignmentExpr | +| expressions.swift:54:1:54:8 | ... = ... | AssignExpr | expressions.swift:54:5:54:8 | #keyPath(...) | KeyPathExpr | +| expressions.swift:54:1:54:8 | { ... } | BraceStmt | expressions.swift:54:1:54:8 | ... = ... | AssignExpr | +| expressions.swift:54:1:54:8 | { ... } | TopLevelCodeDecl | expressions.swift:54:1:54:8 | { ... } | BraceStmt | +| expressions.swift:54:5:54:8 | #keyPath(...) | KeyPathExpr | expressions.swift:54:6:54:8 | TBD (UnresolvedDotExpr) | UnresolvedDotExpr | +| expressions.swift:56:1:57:1 | unsafeFunction | ConcreteFuncDecl | expressions.swift:56:21:56:47 | pointer | ParamDecl | +| expressions.swift:56:1:57:1 | unsafeFunction | ConcreteFuncDecl | expressions.swift:56:50:57:1 | { ... } | BraceStmt | +| expressions.swift:58:1:58:16 | var ... = ... | PatternBindingDecl | expressions.swift:58:5:58:5 | myNumber | NamedPattern | +| expressions.swift:58:1:58:16 | var ... = ... | PatternBindingDecl | expressions.swift:58:16:58:16 | 1234 | IntegerLiteralExpr | +| expressions.swift:58:1:58:16 | { ... } | BraceStmt | expressions.swift:58:1:58:16 | var ... = ... | PatternBindingDecl | +| expressions.swift:58:1:58:16 | { ... } | TopLevelCodeDecl | expressions.swift:58:1:58:16 | { ... } | BraceStmt | +| expressions.swift:59:1:59:34 | call to unsafeFunction | CallExpr | expressions.swift:59:1:59:1 | unsafeFunction | DeclRefExpr | +| expressions.swift:59:1:59:34 | { ... } | BraceStmt | expressions.swift:59:1:59:34 | call to unsafeFunction | CallExpr | +| expressions.swift:59:1:59:34 | { ... } | TopLevelCodeDecl | expressions.swift:59:1:59:34 | { ... } | BraceStmt | +| expressions.swift:59:25:59:26 | &... | InOutExpr | expressions.swift:59:26:59:26 | myNumber | DeclRefExpr | +| expressions.swift:60:1:60:63 | call to withUnsafePointer | CallExpr | expressions.swift:60:1:60:1 | withUnsafePointer | DeclRefExpr | +| expressions.swift:60:1:60:63 | { ... } | BraceStmt | expressions.swift:60:1:60:63 | call to withUnsafePointer | CallExpr | +| expressions.swift:60:1:60:63 | { ... } | TopLevelCodeDecl | expressions.swift:60:1:60:63 | { ... } | BraceStmt | +| expressions.swift:60:33:60:63 | { ... } | BraceStmt | expressions.swift:60:35:60:61 | return ... | ReturnStmt | +| expressions.swift:60:33:60:63 | { ... } | ClosureExpr | expressions.swift:60:33:60:63 | { ... } | BraceStmt | +| expressions.swift:60:35:60:61 | call to unsafeFunction | CallExpr | expressions.swift:60:35:60:35 | unsafeFunction | DeclRefExpr | +| expressions.swift:60:35:60:61 | return ... | ReturnStmt | expressions.swift:60:35:60:61 | call to unsafeFunction | CallExpr | +| expressions.swift:62:7:62:7 | init | DestructorDecl | expressions.swift:62:7:62:7 | { ... } | BraceStmt | +| expressions.swift:63:3:67:3 | deinit | ConstructorDecl | expressions.swift:63:9:63:12 | x | ParamDecl | +| expressions.swift:63:3:67:3 | deinit | ConstructorDecl | expressions.swift:63:17:67:3 | { ... } | BraceStmt | +| expressions.swift:63:17:67:3 | { ... } | BraceStmt | expressions.swift:64:5:66:5 | if ... then { ... } | IfStmt | +| expressions.swift:63:17:67:3 | { ... } | BraceStmt | expressions.swift:67:3:67:3 | return | ReturnStmt | +| expressions.swift:64:5:66:5 | if ... then { ... } | IfStmt | expressions.swift:64:8:64:12 | StmtCondition | StmtCondition | +| expressions.swift:64:5:66:5 | if ... then { ... } | IfStmt | expressions.swift:64:14:66:5 | { ... } | BraceStmt | +| expressions.swift:64:8:64:12 | ... call to < ... | BinaryExpr | expressions.swift:64:10:64:10 | call to < | DotSyntaxCallExpr | +| expressions.swift:64:10:64:10 | Int.Type | TypeExpr | expressions.swift:64:10:64:10 | TBD (FixedTypeRepr) | FixedTypeRepr | +| expressions.swift:64:10:64:10 | call to < | DotSyntaxCallExpr | expressions.swift:64:10:64:10 | < | DeclRefExpr | +| expressions.swift:64:10:64:10 | call to < | DotSyntaxCallExpr | expressions.swift:64:10:64:10 | Int.Type | TypeExpr | +| expressions.swift:64:14:66:5 | { ... } | BraceStmt | expressions.swift:65:7:65:14 | TBD (FailStmt) | FailStmt | +| expressions.swift:64:14:66:5 | { ... } | BraceStmt | expressions.swift:65:7:65:14 | fail | FailStmt | +| expressions.swift:70:7:70:7 | init | DestructorDecl | expressions.swift:70:7:70:7 | { ... } | BraceStmt | +| expressions.swift:71:3:71:11 | var ... = ... | PatternBindingDecl | expressions.swift:71:7:71:11 | ... as ... | TypedPattern | +| expressions.swift:71:7:71:7 | get | AccessorDecl | expressions.swift:71:7:71:7 | { ... } | BraceStmt | +| expressions.swift:71:7:71:7 | xx | ConcreteVarDecl | expressions.swift:71:7:71:7 | get | AccessorDecl | +| expressions.swift:71:7:71:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:71:7:71:11 | ... as ... | TypedPattern | expressions.swift:71:7:71:7 | xx | NamedPattern | +| expressions.swift:71:7:71:11 | ... as ... | TypedPattern | expressions.swift:71:11:71:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:72:3:74:3 | deinit | ConstructorDecl | expressions.swift:72:8:72:11 | x | ParamDecl | +| expressions.swift:72:3:74:3 | deinit | ConstructorDecl | expressions.swift:72:16:74:3 | { ... } | BraceStmt | +| expressions.swift:72:16:74:3 | { ... } | BraceStmt | expressions.swift:73:5:73:10 | ... = ... | AssignExpr | +| expressions.swift:72:16:74:3 | { ... } | BraceStmt | expressions.swift:74:3:74:3 | return | ReturnStmt | +| expressions.swift:73:5:73:5 | .xx | MemberRefExpr | expressions.swift:73:5:73:5 | self | DeclRefExpr | +| expressions.swift:73:5:73:10 | ... = ... | AssignExpr | expressions.swift:73:5:73:5 | .xx | MemberRefExpr | +| expressions.swift:73:5:73:10 | ... = ... | AssignExpr | expressions.swift:73:10:73:10 | x | DeclRefExpr | +| expressions.swift:77:7:77:7 | call to _unimplementedInitializer | CallExpr | expressions.swift:77:7:77:7 | _unimplementedInitializer | DeclRefExpr | +| expressions.swift:77:7:77:7 | init | DestructorDecl | expressions.swift:77:7:77:7 | { ... } | BraceStmt | +| expressions.swift:77:21:77:21 | deinit | ConstructorDecl | file://:0:0:0:0 | x | ParamDecl | +| expressions.swift:77:21:77:21 | deinit | ConstructorDecl | file://:0:0:0:0 | { ... } | BraceStmt | +| expressions.swift:78:3:80:3 | deinit | ConstructorDecl | expressions.swift:78:10:80:3 | { ... } | BraceStmt | +| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | +| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:80:3:80:3 | return | ReturnStmt | +| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:5:79:5 | super | SuperRefExpr | +| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | TBD (OtherConstructorDeclRefExpr) | OtherConstructorDeclRefExpr | +| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | call to ... | OtherConstructorDeclRefExpr | +| expressions.swift:79:5:79:21 | call to ... | CallExpr | expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | +| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | expressions.swift:78:3:78:3 | self | ParamDecl | +| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | expressions.swift:79:5:79:21 | call to ... | CallExpr | +| expressions.swift:83:1:83:23 | var ... = ... | PatternBindingDecl | expressions.swift:83:5:83:5 | derived | NamedPattern | +| expressions.swift:83:1:83:23 | var ... = ... | PatternBindingDecl | expressions.swift:83:15:83:23 | call to ... | CallExpr | +| expressions.swift:83:1:83:23 | { ... } | BraceStmt | expressions.swift:83:1:83:23 | var ... = ... | PatternBindingDecl | +| expressions.swift:83:1:83:23 | { ... } | TopLevelCodeDecl | expressions.swift:83:1:83:23 | { ... } | BraceStmt | +| expressions.swift:83:15:83:15 | Derived.Type | TypeExpr | expressions.swift:83:15:83:15 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:83:15:83:15 | call to ... | ConstructorRefCallExpr | expressions.swift:83:15:83:15 | Derived.Type | TypeExpr | +| expressions.swift:83:15:83:15 | call to ... | ConstructorRefCallExpr | expressions.swift:83:15:83:15 | deinit | DeclRefExpr | +| expressions.swift:83:15:83:23 | call to ... | CallExpr | expressions.swift:83:15:83:15 | call to ... | ConstructorRefCallExpr | +| expressions.swift:84:1:84:13 | ... = ... | AssignExpr | expressions.swift:84:1:84:1 | _ | DiscardAssignmentExpr | +| expressions.swift:84:1:84:13 | ... = ... | AssignExpr | expressions.swift:84:5:84:13 | .xx | MemberRefExpr | +| expressions.swift:84:1:84:13 | { ... } | BraceStmt | expressions.swift:84:1:84:13 | ... = ... | AssignExpr | +| expressions.swift:84:1:84:13 | { ... } | TopLevelCodeDecl | expressions.swift:84:1:84:13 | { ... } | BraceStmt | +| expressions.swift:84:5:84:13 | .xx | MemberRefExpr | expressions.swift:84:5:84:5 | derived | DeclRefExpr | +| expressions.swift:86:1:86:13 | var ... = ... | PatternBindingDecl | expressions.swift:86:5:86:13 | ... as ... | TypedPattern | +| expressions.swift:86:1:86:13 | var ... = ... | PatternBindingDecl | file://:0:0:0:0 | nil | NilLiteralExpr | +| expressions.swift:86:1:86:13 | { ... } | BraceStmt | expressions.swift:86:1:86:13 | var ... = ... | PatternBindingDecl | +| expressions.swift:86:1:86:13 | { ... } | TopLevelCodeDecl | expressions.swift:86:1:86:13 | { ... } | BraceStmt | +| expressions.swift:86:5:86:13 | ... as ... | TypedPattern | expressions.swift:86:5:86:5 | opt | NamedPattern | +| expressions.swift:86:5:86:13 | ... as ... | TypedPattern | expressions.swift:86:10:86:13 | ...? | OptionalTypeRepr | +| expressions.swift:86:5:86:13 | ... as ... | TypedPattern | expressions.swift:86:10:86:13 | TBD (OptionalTypeRepr) | OptionalTypeRepr | +| expressions.swift:87:1:87:4 | ...! | ForceValueExpr | expressions.swift:87:1:87:1 | opt | DeclRefExpr | +| expressions.swift:87:1:87:4 | { ... } | BraceStmt | expressions.swift:87:1:87:4 | ...! | ForceValueExpr | +| expressions.swift:87:1:87:4 | { ... } | TopLevelCodeDecl | expressions.swift:87:1:87:4 | { ... } | BraceStmt | +| expressions.swift:88:1:88:6 | ...[...] | SubscriptExpr | expressions.swift:88:1:88:1 | d | DeclRefExpr | +| expressions.swift:88:1:88:7 | ...! | ForceValueExpr | expressions.swift:88:1:88:6 | ...[...] | SubscriptExpr | +| expressions.swift:88:1:88:7 | { ... } | BraceStmt | expressions.swift:88:1:88:7 | ...! | ForceValueExpr | +| expressions.swift:88:1:88:7 | { ... } | TopLevelCodeDecl | expressions.swift:88:1:88:7 | { ... } | BraceStmt | +| expressions.swift:90:7:90:7 | deinit | ConstructorDecl | expressions.swift:90:7:90:7 | { ... } | BraceStmt | +| expressions.swift:90:7:90:7 | init | DestructorDecl | expressions.swift:90:7:90:7 | { ... } | BraceStmt | +| expressions.swift:90:7:90:7 | { ... } | BraceStmt | expressions.swift:90:7:90:7 | return | ReturnStmt | +| expressions.swift:92:1:92:55 | var ... = ... | PatternBindingDecl | expressions.swift:92:5:92:5 | opaque | NamedPattern | +| expressions.swift:92:1:92:55 | var ... = ... | PatternBindingDecl | expressions.swift:92:14:92:55 | call to ... | CallExpr | +| expressions.swift:92:1:92:55 | { ... } | BraceStmt | expressions.swift:92:1:92:55 | var ... = ... | PatternBindingDecl | +| expressions.swift:92:1:92:55 | { ... } | TopLevelCodeDecl | expressions.swift:92:1:92:55 | { ... } | BraceStmt | +| expressions.swift:92:14:92:14 | Unmanaged.Type | TypeExpr | expressions.swift:92:14:92:14 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:92:14:92:24 | call to passRetained | DotSyntaxCallExpr | expressions.swift:92:14:92:14 | Unmanaged.Type | TypeExpr | +| expressions.swift:92:14:92:24 | call to passRetained | DotSyntaxCallExpr | expressions.swift:92:24:92:24 | passRetained | DeclRefExpr | +| expressions.swift:92:14:92:44 | call to ... | CallExpr | expressions.swift:92:14:92:24 | call to passRetained | DotSyntaxCallExpr | +| expressions.swift:92:14:92:46 | call to toOpaque | DotSyntaxCallExpr | expressions.swift:92:14:92:44 | call to ... | CallExpr | +| expressions.swift:92:14:92:46 | call to toOpaque | DotSyntaxCallExpr | expressions.swift:92:46:92:46 | toOpaque | DeclRefExpr | +| expressions.swift:92:14:92:55 | call to ... | CallExpr | expressions.swift:92:14:92:46 | call to toOpaque | DotSyntaxCallExpr | +| expressions.swift:92:37:92:37 | ToPtr.Type | TypeExpr | expressions.swift:92:37:92:37 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:92:37:92:37 | call to ... | ConstructorRefCallExpr | expressions.swift:92:37:92:37 | ToPtr.Type | TypeExpr | +| expressions.swift:92:37:92:37 | call to ... | ConstructorRefCallExpr | expressions.swift:92:37:92:37 | deinit | DeclRefExpr | +| expressions.swift:92:37:92:43 | call to ... | CallExpr | expressions.swift:92:37:92:37 | call to ... | ConstructorRefCallExpr | +| expressions.swift:93:1:93:16 | Unmanaged.Type | TypeExpr | expressions.swift:93:1:93:16 | ...<...> | GenericIdentTypeRepr | +| expressions.swift:93:1:93:16 | Unmanaged.Type | TypeExpr | expressions.swift:93:1:93:16 | TBD (GenericIdentTypeRepr) | GenericIdentTypeRepr | +| expressions.swift:93:1:93:18 | call to fromOpaque | DotSyntaxCallExpr | expressions.swift:93:1:93:16 | Unmanaged.Type | TypeExpr | +| expressions.swift:93:1:93:18 | call to fromOpaque | DotSyntaxCallExpr | expressions.swift:93:18:93:18 | fromOpaque | DeclRefExpr | +| expressions.swift:93:1:93:35 | call to ... | CallExpr | expressions.swift:93:1:93:18 | call to fromOpaque | DotSyntaxCallExpr | +| expressions.swift:93:1:93:35 | { ... } | BraceStmt | expressions.swift:93:1:93:35 | call to ... | CallExpr | +| expressions.swift:93:1:93:35 | { ... } | TopLevelCodeDecl | expressions.swift:93:1:93:35 | { ... } | BraceStmt | +| expressions.swift:95:8:95:8 | deinit | ConstructorDecl | expressions.swift:95:8:95:8 | normalField | ParamDecl | +| expressions.swift:96:3:101:3 | var ... = ... | PatternBindingDecl | expressions.swift:96:7:96:22 | ... as ... | TypedPattern | +| expressions.swift:96:7:96:7 | (unnamed function decl) | AccessorDecl | expressions.swift:96:7:96:7 | { ... } | BraceStmt | +| expressions.swift:96:7:96:7 | settableField | ConcreteVarDecl | expressions.swift:96:7:96:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:96:7:96:7 | settableField | ConcreteVarDecl | expressions.swift:97:5:97:11 | set | AccessorDecl | +| expressions.swift:96:7:96:7 | settableField | ConcreteVarDecl | expressions.swift:98:5:100:5 | get | AccessorDecl | +| expressions.swift:96:7:96:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:96:7:96:7 | { ... } | BraceStmt | expressions.swift:96:7:96:7 | yield ... | YieldStmt | +| expressions.swift:96:7:96:22 | ... as ... | TypedPattern | expressions.swift:96:7:96:7 | settableField | NamedPattern | +| expressions.swift:96:7:96:22 | ... as ... | TypedPattern | expressions.swift:96:22:96:22 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:97:5:97:11 | set | AccessorDecl | expressions.swift:97:5:97:5 | newValue | ParamDecl | +| expressions.swift:97:5:97:11 | set | AccessorDecl | expressions.swift:97:9:97:11 | { ... } | BraceStmt | +| expressions.swift:98:5:100:5 | get | AccessorDecl | expressions.swift:98:9:100:5 | { ... } | BraceStmt | +| expressions.swift:98:9:100:5 | { ... } | BraceStmt | expressions.swift:99:7:99:14 | return ... | ReturnStmt | +| expressions.swift:99:7:99:14 | return ... | ReturnStmt | expressions.swift:99:14:99:14 | 0 | IntegerLiteralExpr | +| expressions.swift:105:3:107:3 | var ... = ... | PatternBindingDecl | expressions.swift:105:7:105:23 | ... as ... | TypedPattern | +| expressions.swift:105:7:105:7 | readOnlyField1 | ConcreteVarDecl | expressions.swift:105:27:107:3 | get | AccessorDecl | +| expressions.swift:105:7:105:23 | ... as ... | TypedPattern | expressions.swift:105:7:105:7 | readOnlyField1 | NamedPattern | +| expressions.swift:105:7:105:23 | ... as ... | TypedPattern | expressions.swift:105:23:105:23 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:105:27:107:3 | get | AccessorDecl | expressions.swift:105:27:107:3 | { ... } | BraceStmt | +| expressions.swift:105:27:107:3 | { ... } | BraceStmt | expressions.swift:106:5:106:12 | return ... | ReturnStmt | +| expressions.swift:106:5:106:12 | return ... | ReturnStmt | expressions.swift:106:12:106:12 | 0 | IntegerLiteralExpr | +| expressions.swift:110:3:114:3 | var ... = ... | PatternBindingDecl | expressions.swift:110:7:110:23 | ... as ... | TypedPattern | +| expressions.swift:110:7:110:7 | readOnlyField2 | ConcreteVarDecl | expressions.swift:111:5:113:5 | get | AccessorDecl | +| expressions.swift:110:7:110:23 | ... as ... | TypedPattern | expressions.swift:110:7:110:7 | readOnlyField2 | NamedPattern | +| expressions.swift:110:7:110:23 | ... as ... | TypedPattern | expressions.swift:110:23:110:23 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:111:5:113:5 | get | AccessorDecl | expressions.swift:111:9:113:5 | { ... } | BraceStmt | +| expressions.swift:111:9:113:5 | { ... } | BraceStmt | expressions.swift:112:7:112:14 | return ... | ReturnStmt | +| expressions.swift:112:7:112:14 | return ... | ReturnStmt | expressions.swift:112:14:112:14 | 0 | IntegerLiteralExpr | +| expressions.swift:116:3:116:21 | var ... = ... | PatternBindingDecl | expressions.swift:116:7:116:21 | ... as ... | TypedPattern | +| expressions.swift:116:7:116:7 | (unnamed function decl) | AccessorDecl | expressions.swift:116:7:116:7 | { ... } | BraceStmt | +| expressions.swift:116:7:116:7 | get | AccessorDecl | expressions.swift:116:7:116:7 | { ... } | BraceStmt | +| expressions.swift:116:7:116:7 | normalField | ConcreteVarDecl | expressions.swift:116:7:116:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:116:7:116:7 | normalField | ConcreteVarDecl | expressions.swift:116:7:116:7 | get | AccessorDecl | +| expressions.swift:116:7:116:7 | normalField | ConcreteVarDecl | expressions.swift:116:7:116:7 | set | AccessorDecl | +| expressions.swift:116:7:116:7 | set | AccessorDecl | expressions.swift:116:7:116:7 | value | ParamDecl | +| expressions.swift:116:7:116:7 | set | AccessorDecl | expressions.swift:116:7:116:7 | { ... } | BraceStmt | +| expressions.swift:116:7:116:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:116:7:116:7 | { ... } | BraceStmt | expressions.swift:116:7:116:7 | yield ... | YieldStmt | +| expressions.swift:116:7:116:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| expressions.swift:116:7:116:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:116:7:116:21 | ... as ... | TypedPattern | expressions.swift:116:7:116:7 | normalField | NamedPattern | +| expressions.swift:116:7:116:21 | ... as ... | TypedPattern | expressions.swift:116:21:116:21 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:118:3:118:3 | (unnamed function decl) | AccessorDecl | expressions.swift:118:3:118:3 | { ... } | BraceStmt | +| expressions.swift:118:3:118:3 | (unnamed function decl) | AccessorDecl | file://:0:0:0:0 | x | ParamDecl | +| expressions.swift:118:3:118:3 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:118:3:118:3 | { ... } | BraceStmt | expressions.swift:118:3:118:3 | yield ... | YieldStmt | +| expressions.swift:118:3:123:3 | subscript ... | SubscriptDecl | expressions.swift:118:3:118:3 | (unnamed function decl) | AccessorDecl | +| expressions.swift:118:3:123:3 | subscript ... | SubscriptDecl | expressions.swift:118:13:118:16 | x | ParamDecl | +| expressions.swift:118:3:123:3 | subscript ... | SubscriptDecl | expressions.swift:119:5:121:5 | get | AccessorDecl | +| expressions.swift:118:3:123:3 | subscript ... | SubscriptDecl | expressions.swift:122:5:122:11 | set | AccessorDecl | +| expressions.swift:119:5:121:5 | get | AccessorDecl | expressions.swift:118:13:118:13 | x | ParamDecl | +| expressions.swift:119:5:121:5 | get | AccessorDecl | expressions.swift:119:9:121:5 | { ... } | BraceStmt | +| expressions.swift:119:9:121:5 | { ... } | BraceStmt | expressions.swift:120:7:120:14 | return ... | ReturnStmt | +| expressions.swift:120:7:120:14 | return ... | ReturnStmt | expressions.swift:120:14:120:14 | 0 | IntegerLiteralExpr | +| expressions.swift:122:5:122:11 | set | AccessorDecl | expressions.swift:118:13:118:13 | x | ParamDecl | +| expressions.swift:122:5:122:11 | set | AccessorDecl | expressions.swift:122:5:122:5 | newValue | ParamDecl | +| expressions.swift:122:5:122:11 | set | AccessorDecl | expressions.swift:122:9:122:11 | { ... } | BraceStmt | +| expressions.swift:125:3:127:3 | subscript ... | SubscriptDecl | expressions.swift:125:13:125:16 | x | ParamDecl | +| expressions.swift:125:3:127:3 | subscript ... | SubscriptDecl | expressions.swift:125:21:125:25 | y | ParamDecl | +| expressions.swift:125:3:127:3 | subscript ... | SubscriptDecl | expressions.swift:125:37:127:3 | get | AccessorDecl | +| expressions.swift:125:37:127:3 | get | AccessorDecl | expressions.swift:125:13:125:13 | x | ParamDecl | +| expressions.swift:125:37:127:3 | get | AccessorDecl | expressions.swift:125:21:125:21 | y | ParamDecl | +| expressions.swift:125:37:127:3 | get | AccessorDecl | expressions.swift:125:37:127:3 | { ... } | BraceStmt | +| expressions.swift:125:37:127:3 | { ... } | BraceStmt | expressions.swift:126:5:126:12 | return ... | ReturnStmt | +| expressions.swift:126:5:126:12 | return ... | ReturnStmt | expressions.swift:126:12:126:12 | 0 | IntegerLiteralExpr | +| expressions.swift:130:1:139:1 | testProperties | ConcreteFuncDecl | expressions.swift:130:21:130:32 | hp | ParamDecl | +| expressions.swift:130:1:139:1 | testProperties | ConcreteFuncDecl | expressions.swift:130:52:139:1 | { ... } | BraceStmt | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:131:3:131:22 | ... = ... | AssignExpr | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:132:3:132:14 | var ... = ... | PatternBindingDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:132:7:132:7 | x | ConcreteVarDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:133:3:133:14 | var ... = ... | PatternBindingDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:133:7:133:7 | y | ConcreteVarDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:134:3:134:14 | var ... = ... | PatternBindingDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:134:7:134:7 | z | ConcreteVarDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:135:3:135:20 | ... = ... | AssignExpr | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:136:3:136:14 | var ... = ... | PatternBindingDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:136:7:136:7 | w | ConcreteVarDecl | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:137:3:137:11 | ... = ... | AssignExpr | +| expressions.swift:130:52:139:1 | { ... } | BraceStmt | expressions.swift:138:3:138:17 | return ... | ReturnStmt | +| expressions.swift:131:3:131:6 | .settableField | MemberRefExpr | expressions.swift:131:3:131:3 | hp | DeclRefExpr | +| expressions.swift:131:3:131:22 | ... = ... | AssignExpr | expressions.swift:131:3:131:6 | .settableField | MemberRefExpr | +| expressions.swift:131:3:131:22 | ... = ... | AssignExpr | expressions.swift:131:22:131:22 | 42 | IntegerLiteralExpr | +| expressions.swift:132:3:132:14 | var ... = ... | PatternBindingDecl | expressions.swift:132:7:132:7 | x | NamedPattern | +| expressions.swift:132:3:132:14 | var ... = ... | PatternBindingDecl | expressions.swift:132:11:132:14 | .settableField | MemberRefExpr | +| expressions.swift:132:11:132:14 | .settableField | MemberRefExpr | expressions.swift:132:11:132:11 | hp | DeclRefExpr | +| expressions.swift:133:3:133:14 | var ... = ... | PatternBindingDecl | expressions.swift:133:7:133:7 | y | NamedPattern | +| expressions.swift:133:3:133:14 | var ... = ... | PatternBindingDecl | expressions.swift:133:11:133:14 | .readOnlyField1 | MemberRefExpr | +| expressions.swift:133:11:133:14 | .readOnlyField1 | MemberRefExpr | expressions.swift:133:11:133:11 | hp | DeclRefExpr | +| expressions.swift:134:3:134:14 | var ... = ... | PatternBindingDecl | expressions.swift:134:7:134:7 | z | NamedPattern | +| expressions.swift:134:3:134:14 | var ... = ... | PatternBindingDecl | expressions.swift:134:11:134:14 | .readOnlyField2 | MemberRefExpr | +| expressions.swift:134:11:134:14 | .readOnlyField2 | MemberRefExpr | expressions.swift:134:11:134:11 | hp | DeclRefExpr | +| expressions.swift:135:3:135:6 | .normalField | MemberRefExpr | expressions.swift:135:3:135:3 | hp | DeclRefExpr | +| expressions.swift:135:3:135:20 | ... = ... | AssignExpr | expressions.swift:135:3:135:6 | .normalField | MemberRefExpr | +| expressions.swift:135:3:135:20 | ... = ... | AssignExpr | expressions.swift:135:20:135:20 | 99 | IntegerLiteralExpr | +| expressions.swift:136:3:136:14 | var ... = ... | PatternBindingDecl | expressions.swift:136:7:136:7 | w | NamedPattern | +| expressions.swift:136:3:136:14 | var ... = ... | PatternBindingDecl | expressions.swift:136:11:136:14 | .normalField | MemberRefExpr | +| expressions.swift:136:11:136:14 | .normalField | MemberRefExpr | expressions.swift:136:11:136:11 | hp | DeclRefExpr | +| expressions.swift:137:3:137:3 | &... | InOutExpr | expressions.swift:137:3:137:3 | hp | DeclRefExpr | +| expressions.swift:137:3:137:7 | ...[...] | SubscriptExpr | expressions.swift:137:3:137:3 | &... | InOutExpr | +| expressions.swift:137:3:137:11 | ... = ... | AssignExpr | expressions.swift:137:3:137:7 | ...[...] | SubscriptExpr | +| expressions.swift:137:3:137:11 | ... = ... | AssignExpr | expressions.swift:137:11:137:11 | 2 | IntegerLiteralExpr | +| expressions.swift:138:3:138:17 | return ... | ReturnStmt | expressions.swift:138:10:138:17 | ...[...] | SubscriptExpr | +| expressions.swift:138:10:138:17 | ...[...] | SubscriptExpr | expressions.swift:138:10:138:10 | hp | DeclRefExpr | +| expressions.swift:141:8:141:8 | deinit | ConstructorDecl | expressions.swift:141:8:141:8 | x | ParamDecl | +| expressions.swift:142:3:142:11 | var ... = ... | PatternBindingDecl | expressions.swift:142:7:142:11 | ... as ... | TypedPattern | +| expressions.swift:142:7:142:7 | (unnamed function decl) | AccessorDecl | expressions.swift:142:7:142:7 | { ... } | BraceStmt | +| expressions.swift:142:7:142:7 | get | AccessorDecl | expressions.swift:142:7:142:7 | { ... } | BraceStmt | +| expressions.swift:142:7:142:7 | set | AccessorDecl | expressions.swift:142:7:142:7 | value | ParamDecl | +| expressions.swift:142:7:142:7 | set | AccessorDecl | expressions.swift:142:7:142:7 | { ... } | BraceStmt | +| expressions.swift:142:7:142:7 | x | ConcreteVarDecl | expressions.swift:142:7:142:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:142:7:142:7 | x | ConcreteVarDecl | expressions.swift:142:7:142:7 | get | AccessorDecl | +| expressions.swift:142:7:142:7 | x | ConcreteVarDecl | expressions.swift:142:7:142:7 | set | AccessorDecl | +| expressions.swift:142:7:142:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:142:7:142:7 | { ... } | BraceStmt | expressions.swift:142:7:142:7 | yield ... | YieldStmt | +| expressions.swift:142:7:142:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| expressions.swift:142:7:142:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:142:7:142:11 | ... as ... | TypedPattern | expressions.swift:142:7:142:7 | x | NamedPattern | +| expressions.swift:142:7:142:11 | ... as ... | TypedPattern | expressions.swift:142:11:142:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:145:8:145:8 | deinit | ConstructorDecl | expressions.swift:145:8:145:8 | b | ParamDecl | +| expressions.swift:145:8:145:8 | deinit | ConstructorDecl | expressions.swift:145:8:145:8 | bs | ParamDecl | +| expressions.swift:145:8:145:8 | deinit | ConstructorDecl | expressions.swift:145:8:145:8 | mayB | ParamDecl | +| expressions.swift:146:3:146:11 | var ... = ... | PatternBindingDecl | expressions.swift:146:7:146:11 | ... as ... | TypedPattern | +| expressions.swift:146:7:146:7 | (unnamed function decl) | AccessorDecl | expressions.swift:146:7:146:7 | { ... } | BraceStmt | +| expressions.swift:146:7:146:7 | b | ConcreteVarDecl | expressions.swift:146:7:146:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:146:7:146:7 | b | ConcreteVarDecl | expressions.swift:146:7:146:7 | get | AccessorDecl | +| expressions.swift:146:7:146:7 | b | ConcreteVarDecl | expressions.swift:146:7:146:7 | set | AccessorDecl | +| expressions.swift:146:7:146:7 | get | AccessorDecl | expressions.swift:146:7:146:7 | { ... } | BraceStmt | +| expressions.swift:146:7:146:7 | set | AccessorDecl | expressions.swift:146:7:146:7 | value | ParamDecl | +| expressions.swift:146:7:146:7 | set | AccessorDecl | expressions.swift:146:7:146:7 | { ... } | BraceStmt | +| expressions.swift:146:7:146:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:146:7:146:7 | { ... } | BraceStmt | expressions.swift:146:7:146:7 | yield ... | YieldStmt | +| expressions.swift:146:7:146:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| expressions.swift:146:7:146:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:146:7:146:11 | ... as ... | TypedPattern | expressions.swift:146:7:146:7 | b | NamedPattern | +| expressions.swift:146:7:146:11 | ... as ... | TypedPattern | expressions.swift:146:11:146:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| expressions.swift:147:3:147:14 | var ... = ... | PatternBindingDecl | expressions.swift:147:7:147:14 | ... as ... | TypedPattern | +| expressions.swift:147:7:147:7 | (unnamed function decl) | AccessorDecl | expressions.swift:147:7:147:7 | { ... } | BraceStmt | +| expressions.swift:147:7:147:7 | bs | ConcreteVarDecl | expressions.swift:147:7:147:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:147:7:147:7 | bs | ConcreteVarDecl | expressions.swift:147:7:147:7 | get | AccessorDecl | +| expressions.swift:147:7:147:7 | bs | ConcreteVarDecl | expressions.swift:147:7:147:7 | set | AccessorDecl | +| expressions.swift:147:7:147:7 | get | AccessorDecl | expressions.swift:147:7:147:7 | { ... } | BraceStmt | +| expressions.swift:147:7:147:7 | set | AccessorDecl | expressions.swift:147:7:147:7 | value | ParamDecl | +| expressions.swift:147:7:147:7 | set | AccessorDecl | expressions.swift:147:7:147:7 | { ... } | BraceStmt | +| expressions.swift:147:7:147:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:147:7:147:7 | { ... } | BraceStmt | expressions.swift:147:7:147:7 | yield ... | YieldStmt | +| expressions.swift:147:7:147:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| expressions.swift:147:7:147:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:147:7:147:14 | ... as ... | TypedPattern | expressions.swift:147:7:147:7 | bs | NamedPattern | +| expressions.swift:147:7:147:14 | ... as ... | TypedPattern | expressions.swift:147:12:147:14 | TBD (ArrayTypeRepr) | ArrayTypeRepr | +| expressions.swift:147:7:147:14 | ... as ... | TypedPattern | expressions.swift:147:12:147:14 | [...] | ArrayTypeRepr | +| expressions.swift:148:3:148:15 | var ... = ... | PatternBindingDecl | expressions.swift:148:7:148:15 | ... as ... | TypedPattern | +| expressions.swift:148:3:148:15 | var ... = ... | PatternBindingDecl | file://:0:0:0:0 | nil | NilLiteralExpr | +| expressions.swift:148:7:148:7 | (unnamed function decl) | AccessorDecl | expressions.swift:148:7:148:7 | { ... } | BraceStmt | +| expressions.swift:148:7:148:7 | get | AccessorDecl | expressions.swift:148:7:148:7 | { ... } | BraceStmt | +| expressions.swift:148:7:148:7 | mayB | ConcreteVarDecl | expressions.swift:148:7:148:7 | (unnamed function decl) | AccessorDecl | +| expressions.swift:148:7:148:7 | mayB | ConcreteVarDecl | expressions.swift:148:7:148:7 | get | AccessorDecl | +| expressions.swift:148:7:148:7 | mayB | ConcreteVarDecl | expressions.swift:148:7:148:7 | set | AccessorDecl | +| expressions.swift:148:7:148:7 | set | AccessorDecl | expressions.swift:148:7:148:7 | value | ParamDecl | +| expressions.swift:148:7:148:7 | set | AccessorDecl | expressions.swift:148:7:148:7 | { ... } | BraceStmt | +| expressions.swift:148:7:148:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| expressions.swift:148:7:148:7 | { ... } | BraceStmt | expressions.swift:148:7:148:7 | yield ... | YieldStmt | +| expressions.swift:148:7:148:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| expressions.swift:148:7:148:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| expressions.swift:148:7:148:15 | ... as ... | TypedPattern | expressions.swift:148:7:148:7 | mayB | NamedPattern | +| expressions.swift:148:7:148:15 | ... as ... | TypedPattern | expressions.swift:148:14:148:15 | ...? | OptionalTypeRepr | +| expressions.swift:148:7:148:15 | ... as ... | TypedPattern | expressions.swift:148:14:148:15 | TBD (OptionalTypeRepr) | OptionalTypeRepr | +| expressions.swift:151:1:155:1 | test | ConcreteFuncDecl | expressions.swift:151:11:151:15 | a | ParamDecl | +| expressions.swift:151:1:155:1 | test | ConcreteFuncDecl | expressions.swift:151:18:151:53 | keyPathInt | ParamDecl | +| expressions.swift:151:1:155:1 | test | ConcreteFuncDecl | expressions.swift:151:56:151:87 | keyPathB | ParamDecl | +| expressions.swift:151:1:155:1 | test | ConcreteFuncDecl | expressions.swift:151:90:155:1 | { ... } | BraceStmt | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:152:3:152:47 | var ... = ... | PatternBindingDecl | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:152:7:152:7 | apply_keyPathInt | ConcreteVarDecl | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:153:3:153:43 | var ... = ... | PatternBindingDecl | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:153:7:153:7 | apply_keyPathB | ConcreteVarDecl | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:154:3:154:56 | var ... = ... | PatternBindingDecl | +| expressions.swift:151:90:155:1 | { ... } | BraceStmt | expressions.swift:154:7:154:7 | nested_apply | ConcreteVarDecl | +| expressions.swift:152:3:152:47 | var ... = ... | PatternBindingDecl | expressions.swift:152:7:152:7 | apply_keyPathInt | NamedPattern | +| expressions.swift:152:3:152:47 | var ... = ... | PatternBindingDecl | expressions.swift:152:26:152:47 | \\...[...] | KeyPathApplicationExpr | +| expressions.swift:152:26:152:47 | \\...[...] | KeyPathApplicationExpr | expressions.swift:152:26:152:26 | a | DeclRefExpr | +| expressions.swift:152:26:152:47 | \\...[...] | KeyPathApplicationExpr | expressions.swift:152:37:152:37 | keyPathInt | DeclRefExpr | +| expressions.swift:153:3:153:43 | var ... = ... | PatternBindingDecl | expressions.swift:153:7:153:7 | apply_keyPathB | NamedPattern | +| expressions.swift:153:3:153:43 | var ... = ... | PatternBindingDecl | expressions.swift:153:24:153:43 | \\...[...] | KeyPathApplicationExpr | +| expressions.swift:153:24:153:43 | \\...[...] | KeyPathApplicationExpr | expressions.swift:153:24:153:24 | a | DeclRefExpr | +| expressions.swift:153:24:153:43 | \\...[...] | KeyPathApplicationExpr | expressions.swift:153:35:153:35 | keyPathB | DeclRefExpr | +| expressions.swift:154:3:154:56 | var ... = ... | PatternBindingDecl | expressions.swift:154:7:154:7 | nested_apply | NamedPattern | +| expressions.swift:154:3:154:56 | var ... = ... | PatternBindingDecl | expressions.swift:154:22:154:56 | \\...[...] | KeyPathApplicationExpr | +| expressions.swift:154:22:154:41 | \\...[...] | KeyPathApplicationExpr | expressions.swift:154:22:154:22 | a | DeclRefExpr | +| expressions.swift:154:22:154:41 | \\...[...] | KeyPathApplicationExpr | expressions.swift:154:33:154:33 | keyPathB | DeclRefExpr | +| expressions.swift:154:22:154:56 | \\...[...] | KeyPathApplicationExpr | expressions.swift:154:22:154:41 | \\...[...] | KeyPathApplicationExpr | +| expressions.swift:154:22:154:56 | \\...[...] | KeyPathApplicationExpr | expressions.swift:154:52:154:55 | #keyPath(...) | KeyPathExpr | +| expressions.swift:154:52:154:55 | #keyPath(...) | KeyPathExpr | expressions.swift:154:53:154:55 | TBD (UnresolvedDotExpr) | UnresolvedDotExpr | +| patterns.swift:1:1:7:1 | basic_patterns | ConcreteFuncDecl | patterns.swift:1:23:7:1 | { ... } | BraceStmt | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:2:5:2:18 | var ... = ... | PatternBindingDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:2:9:2:9 | an_int | ConcreteVarDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:3:5:3:28 | var ... = ... | PatternBindingDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:3:9:3:9 | a_string | ConcreteVarDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:4:5:4:29 | var ... = ... | PatternBindingDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:4:10:4:10 | x | ConcreteVarDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:4:13:4:13 | y | ConcreteVarDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:4:16:4:16 | z | ConcreteVarDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:5:5:5:13 | var ... = ... | PatternBindingDecl | +| patterns.swift:1:23:7:1 | { ... } | BraceStmt | patterns.swift:6:5:6:15 | var ... = ... | PatternBindingDecl | +| patterns.swift:2:5:2:18 | var ... = ... | PatternBindingDecl | patterns.swift:2:9:2:9 | an_int | NamedPattern | +| patterns.swift:2:5:2:18 | var ... = ... | PatternBindingDecl | patterns.swift:2:18:2:18 | 42 | IntegerLiteralExpr | +| patterns.swift:3:5:3:28 | var ... = ... | PatternBindingDecl | patterns.swift:3:9:3:19 | ... as ... | TypedPattern | +| patterns.swift:3:5:3:28 | var ... = ... | PatternBindingDecl | patterns.swift:3:28:3:28 | here | StringLiteralExpr | +| patterns.swift:3:9:3:19 | ... as ... | TypedPattern | patterns.swift:3:9:3:9 | a_string | NamedPattern | +| patterns.swift:3:9:3:19 | ... as ... | TypedPattern | patterns.swift:3:19:3:19 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| patterns.swift:4:5:4:29 | var ... = ... | PatternBindingDecl | patterns.swift:4:9:4:17 | (...) | TuplePattern | +| patterns.swift:4:5:4:29 | var ... = ... | PatternBindingDecl | patterns.swift:4:21:4:29 | (...) | TupleExpr | +| patterns.swift:4:9:4:17 | (...) | TuplePattern | patterns.swift:4:10:4:10 | x | NamedPattern | +| patterns.swift:4:9:4:17 | (...) | TuplePattern | patterns.swift:4:13:4:13 | y | NamedPattern | +| patterns.swift:4:9:4:17 | (...) | TuplePattern | patterns.swift:4:16:4:16 | z | NamedPattern | +| patterns.swift:4:21:4:29 | (...) | TupleExpr | patterns.swift:4:22:4:22 | 1 | IntegerLiteralExpr | +| patterns.swift:4:21:4:29 | (...) | TupleExpr | patterns.swift:4:25:4:25 | 2 | IntegerLiteralExpr | +| patterns.swift:4:21:4:29 | (...) | TupleExpr | patterns.swift:4:28:4:28 | 3 | IntegerLiteralExpr | +| patterns.swift:5:5:5:13 | var ... = ... | PatternBindingDecl | patterns.swift:5:9:5:9 | _ | AnyPattern | +| patterns.swift:5:5:5:13 | var ... = ... | PatternBindingDecl | patterns.swift:5:13:5:13 | any | StringLiteralExpr | +| patterns.swift:6:5:6:15 | var ... = ... | PatternBindingDecl | patterns.swift:6:10:6:10 | _ | AnyPattern | +| patterns.swift:6:5:6:15 | var ... = ... | PatternBindingDecl | patterns.swift:6:15:6:15 | paren | StringLiteralExpr | +| patterns.swift:9:1:52:1 | switch_patterns | ConcreteFuncDecl | patterns.swift:9:24:52:1 | { ... } | BraceStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:10:5:10:22 | var ... = ... | PatternBindingDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:10:9:10:9 | point | ConcreteVarDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:11:5:13:5 | switch point { ... } | SwitchStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:15:5:18:5 | switch 3 { ... } | SwitchStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:20:5:22:5 | Foo | EnumDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:24:5:24:19 | var ... = ... | PatternBindingDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:24:9:24:9 | v | ConcreteVarDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:26:5:29:5 | switch v { ... } | SwitchStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:31:5:31:19 | var ... = ... | PatternBindingDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:31:9:31:9 | w | ConcreteVarDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:33:5:36:5 | switch w { ... } | SwitchStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:38:5:38:18 | var ... = ... | PatternBindingDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:38:9:38:9 | a | ConcreteVarDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:40:5:44:5 | switch a { ... } | SwitchStmt | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:46:5:46:13 | var ... = ... | PatternBindingDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:46:9:46:9 | b | ConcreteVarDecl | +| patterns.swift:9:24:52:1 | { ... } | BraceStmt | patterns.swift:48:5:51:5 | switch b { ... } | SwitchStmt | +| patterns.swift:10:5:10:22 | var ... = ... | PatternBindingDecl | patterns.swift:10:9:10:9 | point | NamedPattern | +| patterns.swift:10:5:10:22 | var ... = ... | PatternBindingDecl | patterns.swift:10:17:10:22 | (...) | TupleExpr | +| patterns.swift:10:17:10:22 | (...) | TupleExpr | patterns.swift:10:18:10:18 | 1 | IntegerLiteralExpr | +| patterns.swift:10:17:10:22 | (...) | TupleExpr | patterns.swift:10:21:10:21 | 2 | IntegerLiteralExpr | +| patterns.swift:11:5:13:5 | switch point { ... } | SwitchStmt | patterns.swift:11:12:11:12 | point | DeclRefExpr | +| patterns.swift:11:5:13:5 | switch point { ... } | SwitchStmt | patterns.swift:12:5:12:24 | case ... | CaseStmt | +| patterns.swift:12:5:12:24 | case ... | CaseStmt | patterns.swift:12:10:12:21 | let ... | CaseLabelItem | +| patterns.swift:12:5:12:24 | case ... | CaseStmt | patterns.swift:12:24:12:24 | { ... } | BraceStmt | +| patterns.swift:12:10:12:21 | let ... | BindingPattern | patterns.swift:12:14:12:21 | (...) | TuplePattern | +| patterns.swift:12:10:12:21 | let ... | CaseLabelItem | patterns.swift:12:10:12:21 | let ... | BindingPattern | +| patterns.swift:12:14:12:21 | (...) | TuplePattern | patterns.swift:12:15:12:15 | xx | NamedPattern | +| patterns.swift:12:14:12:21 | (...) | TuplePattern | patterns.swift:12:19:12:19 | yy | NamedPattern | +| patterns.swift:12:24:12:24 | { ... } | BraceStmt | patterns.swift:12:24:12:24 | binding | StringLiteralExpr | +| patterns.swift:15:5:18:5 | switch 3 { ... } | SwitchStmt | patterns.swift:15:12:15:12 | 3 | IntegerLiteralExpr | +| patterns.swift:15:5:18:5 | switch 3 { ... } | SwitchStmt | patterns.swift:16:5:16:17 | case ... | CaseStmt | +| patterns.swift:15:5:18:5 | switch 3 { ... } | SwitchStmt | patterns.swift:17:5:17:13 | case ... | CaseStmt | +| patterns.swift:16:5:16:17 | case ... | CaseStmt | patterns.swift:16:10:16:14 | TBD (SequenceExpr) | CaseLabelItem | +| patterns.swift:16:5:16:17 | case ... | CaseStmt | patterns.swift:16:17:16:17 | { ... } | BraceStmt | +| patterns.swift:16:10:16:14 | TBD (SequenceExpr) | CaseLabelItem | patterns.swift:16:10:16:14 | TBD (SequenceExpr) | ExprPattern | +| patterns.swift:16:10:16:14 | TBD (SequenceExpr) | ExprPattern | patterns.swift:16:10:16:14 | TBD (SequenceExpr) | SequenceExpr | +| patterns.swift:16:17:16:17 | { ... } | BraceStmt | patterns.swift:16:17:16:17 | expr | StringLiteralExpr | +| patterns.swift:17:5:17:13 | case ... | CaseStmt | patterns.swift:17:10:17:10 | _ | CaseLabelItem | +| patterns.swift:17:5:17:13 | case ... | CaseStmt | patterns.swift:17:13:17:13 | { ... } | BraceStmt | +| patterns.swift:17:10:17:10 | _ | CaseLabelItem | patterns.swift:17:10:17:10 | _ | AnyPattern | +| patterns.swift:17:13:17:13 | { ... } | BraceStmt | patterns.swift:17:13:17:13 | | StringLiteralExpr | +| patterns.swift:21:9:21:34 | case ... | EnumCaseDecl | patterns.swift:21:14:21:14 | bar | EnumElementDecl | +| patterns.swift:21:9:21:34 | case ... | EnumCaseDecl | patterns.swift:21:19:21:34 | baz | EnumElementDecl | +| patterns.swift:21:19:21:34 | baz | EnumElementDecl | patterns.swift:21:23:21:23 | _ | ParamDecl | +| patterns.swift:21:19:21:34 | baz | EnumElementDecl | patterns.swift:21:28:21:28 | _ | ParamDecl | +| patterns.swift:24:5:24:19 | var ... = ... | PatternBindingDecl | patterns.swift:24:9:24:12 | ... as ... | TypedPattern | +| patterns.swift:24:5:24:19 | var ... = ... | PatternBindingDecl | patterns.swift:24:18:24:19 | call to ... | DotSyntaxCallExpr | +| patterns.swift:24:9:24:12 | ... as ... | TypedPattern | patterns.swift:24:9:24:9 | v | NamedPattern | +| patterns.swift:24:9:24:12 | ... as ... | TypedPattern | patterns.swift:24:12:24:12 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| patterns.swift:24:18:24:18 | Foo.Type | TypeExpr | patterns.swift:24:18:24:18 | TBD (FixedTypeRepr) | FixedTypeRepr | +| patterns.swift:24:18:24:19 | call to ... | DotSyntaxCallExpr | patterns.swift:24:18:24:18 | Foo.Type | TypeExpr | +| patterns.swift:24:18:24:19 | call to ... | DotSyntaxCallExpr | patterns.swift:24:19:24:19 | bar | DeclRefExpr | +| patterns.swift:26:5:29:5 | switch v { ... } | SwitchStmt | patterns.swift:26:12:26:12 | v | DeclRefExpr | +| patterns.swift:26:5:29:5 | switch v { ... } | SwitchStmt | patterns.swift:27:5:27:16 | case ... | CaseStmt | +| patterns.swift:26:5:29:5 | switch v { ... } | SwitchStmt | patterns.swift:28:5:28:26 | case ... | CaseStmt | +| patterns.swift:27:5:27:16 | case ... | CaseStmt | patterns.swift:27:10:27:11 | .bar | CaseLabelItem | +| patterns.swift:27:5:27:16 | case ... | CaseStmt | patterns.swift:27:16:27:16 | { ... } | BraceStmt | +| patterns.swift:27:10:27:11 | .bar | CaseLabelItem | patterns.swift:27:10:27:11 | .bar | EnumElementPattern | +| patterns.swift:27:16:27:16 | { ... } | BraceStmt | patterns.swift:27:16:27:16 | bar | StringLiteralExpr | +| patterns.swift:28:5:28:26 | case ... | CaseStmt | patterns.swift:28:10:28:23 | let ... | CaseLabelItem | +| patterns.swift:28:5:28:26 | case ... | CaseStmt | patterns.swift:28:26:28:26 | { ... } | BraceStmt | +| patterns.swift:28:10:28:23 | let ... | BindingPattern | patterns.swift:28:14:28:23 | .baz(...) | EnumElementPattern | +| patterns.swift:28:10:28:23 | let ... | CaseLabelItem | patterns.swift:28:10:28:23 | let ... | BindingPattern | +| patterns.swift:28:14:28:23 | .baz(...) | EnumElementPattern | patterns.swift:28:18:28:23 | (...) | TuplePattern | +| patterns.swift:28:18:28:23 | (...) | TuplePattern | patterns.swift:28:19:28:19 | i | NamedPattern | +| patterns.swift:28:18:28:23 | (...) | TuplePattern | patterns.swift:28:22:28:22 | s | NamedPattern | +| patterns.swift:28:26:28:26 | { ... } | BraceStmt | patterns.swift:28:26:28:26 | i | DeclRefExpr | +| patterns.swift:31:5:31:19 | var ... = ... | PatternBindingDecl | patterns.swift:31:9:31:15 | ... as ... | TypedPattern | +| patterns.swift:31:5:31:19 | var ... = ... | PatternBindingDecl | patterns.swift:31:19:31:19 | nil | NilLiteralExpr | +| patterns.swift:31:9:31:15 | ... as ... | TypedPattern | patterns.swift:31:9:31:9 | w | NamedPattern | +| patterns.swift:31:9:31:15 | ... as ... | TypedPattern | patterns.swift:31:12:31:15 | ...? | OptionalTypeRepr | +| patterns.swift:31:9:31:15 | ... as ... | TypedPattern | patterns.swift:31:12:31:15 | TBD (OptionalTypeRepr) | OptionalTypeRepr | +| patterns.swift:33:5:36:5 | switch w { ... } | SwitchStmt | patterns.swift:33:12:33:12 | w | DeclRefExpr | +| patterns.swift:33:5:36:5 | switch w { ... } | SwitchStmt | patterns.swift:34:5:34:18 | case ... | CaseStmt | +| patterns.swift:33:5:36:5 | switch w { ... } | SwitchStmt | patterns.swift:35:5:35:13 | case ... | CaseStmt | +| patterns.swift:34:5:34:18 | case ... | CaseStmt | patterns.swift:34:10:34:15 | let ... | CaseLabelItem | +| patterns.swift:34:5:34:18 | case ... | CaseStmt | patterns.swift:34:18:34:18 | { ... } | BraceStmt | +| patterns.swift:34:10:34:15 | let ... | BindingPattern | patterns.swift:34:14:34:15 | let ...? | OptionalSomePattern | +| patterns.swift:34:10:34:15 | let ... | CaseLabelItem | patterns.swift:34:10:34:15 | let ... | BindingPattern | +| patterns.swift:34:14:34:15 | let ...? | OptionalSomePattern | patterns.swift:34:14:34:14 | n | NamedPattern | +| patterns.swift:34:18:34:18 | { ... } | BraceStmt | patterns.swift:34:18:34:18 | n | DeclRefExpr | +| patterns.swift:35:5:35:13 | case ... | CaseStmt | patterns.swift:35:10:35:10 | _ | CaseLabelItem | +| patterns.swift:35:5:35:13 | case ... | CaseStmt | patterns.swift:35:13:35:13 | { ... } | BraceStmt | +| patterns.swift:35:10:35:10 | _ | CaseLabelItem | patterns.swift:35:10:35:10 | _ | AnyPattern | +| patterns.swift:35:13:35:13 | { ... } | BraceStmt | patterns.swift:35:13:35:13 | none | StringLiteralExpr | +| patterns.swift:38:5:38:18 | var ... = ... | PatternBindingDecl | patterns.swift:38:9:38:12 | ... as ... | TypedPattern | +| patterns.swift:38:5:38:18 | var ... = ... | PatternBindingDecl | patterns.swift:38:18:38:18 | any | StringLiteralExpr | +| patterns.swift:38:9:38:12 | ... as ... | TypedPattern | patterns.swift:38:9:38:9 | a | NamedPattern | +| patterns.swift:38:9:38:12 | ... as ... | TypedPattern | patterns.swift:38:12:38:12 | TBD (CompositionTypeRepr) | CompositionTypeRepr | +| patterns.swift:40:5:44:5 | switch a { ... } | SwitchStmt | patterns.swift:40:12:40:12 | a | DeclRefExpr | +| patterns.swift:40:5:44:5 | switch a { ... } | SwitchStmt | patterns.swift:41:5:41:18 | case ... | CaseStmt | +| patterns.swift:40:5:44:5 | switch a { ... } | SwitchStmt | patterns.swift:42:5:42:27 | case ... | CaseStmt | +| patterns.swift:40:5:44:5 | switch a { ... } | SwitchStmt | patterns.swift:43:5:43:13 | case ... | CaseStmt | +| patterns.swift:41:5:41:18 | case ... | CaseStmt | patterns.swift:41:10:41:13 | ... is ... | CaseLabelItem | +| patterns.swift:41:5:41:18 | case ... | CaseStmt | patterns.swift:41:18:41:18 | { ... } | BraceStmt | +| patterns.swift:41:10:41:13 | ... is ... | CaseLabelItem | patterns.swift:41:10:41:13 | ... is ... | IsPattern | +| patterns.swift:41:18:41:18 | { ... } | BraceStmt | patterns.swift:41:18:41:18 | is pattern | StringLiteralExpr | +| patterns.swift:42:5:42:27 | case ... | CaseStmt | patterns.swift:42:10:42:19 | let ... | CaseLabelItem | +| patterns.swift:42:5:42:27 | case ... | CaseStmt | patterns.swift:42:27:42:27 | { ... } | BraceStmt | +| patterns.swift:42:10:42:19 | let ... | BindingPattern | patterns.swift:42:14:42:19 | ... is ... | IsPattern | +| patterns.swift:42:10:42:19 | let ... | CaseLabelItem | patterns.swift:42:10:42:19 | let ... | BindingPattern | +| patterns.swift:42:27:42:27 | { ... } | BraceStmt | patterns.swift:42:27:42:27 | as pattern | StringLiteralExpr | +| patterns.swift:43:5:43:13 | case ... | CaseStmt | patterns.swift:43:10:43:10 | _ | CaseLabelItem | +| patterns.swift:43:5:43:13 | case ... | CaseStmt | patterns.swift:43:13:43:13 | { ... } | BraceStmt | +| patterns.swift:43:10:43:10 | _ | CaseLabelItem | patterns.swift:43:10:43:10 | _ | AnyPattern | +| patterns.swift:43:13:43:13 | { ... } | BraceStmt | patterns.swift:43:13:43:13 | other | StringLiteralExpr | +| patterns.swift:46:5:46:13 | var ... = ... | PatternBindingDecl | patterns.swift:46:9:46:9 | b | NamedPattern | +| patterns.swift:46:5:46:13 | var ... = ... | PatternBindingDecl | patterns.swift:46:13:46:13 | true | BooleanLiteralExpr | +| patterns.swift:48:5:51:5 | switch b { ... } | SwitchStmt | patterns.swift:48:12:48:12 | b | DeclRefExpr | +| patterns.swift:48:5:51:5 | switch b { ... } | SwitchStmt | patterns.swift:49:5:49:16 | case ... | CaseStmt | +| patterns.swift:48:5:51:5 | switch b { ... } | SwitchStmt | patterns.swift:50:5:50:17 | case ... | CaseStmt | +| patterns.swift:49:5:49:16 | case ... | CaseStmt | patterns.swift:49:10:49:10 | true | CaseLabelItem | +| patterns.swift:49:5:49:16 | case ... | CaseStmt | patterns.swift:49:16:49:16 | { ... } | BraceStmt | +| patterns.swift:49:10:49:10 | true | CaseLabelItem | patterns.swift:49:10:49:10 | true | BoolPattern | +| patterns.swift:49:16:49:16 | { ... } | BraceStmt | patterns.swift:49:16:49:16 | true | StringLiteralExpr | +| patterns.swift:50:5:50:17 | case ... | CaseStmt | patterns.swift:50:10:50:10 | false | CaseLabelItem | +| patterns.swift:50:5:50:17 | case ... | CaseStmt | patterns.swift:50:17:50:17 | { ... } | BraceStmt | +| patterns.swift:50:10:50:10 | false | CaseLabelItem | patterns.swift:50:10:50:10 | false | BoolPattern | +| patterns.swift:50:17:50:17 | { ... } | BraceStmt | patterns.swift:50:17:50:17 | false | StringLiteralExpr | +| statements.swift:1:1:32:1 | loop | ConcreteFuncDecl | statements.swift:1:13:32:1 | { ... } | BraceStmt | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:2:3:8:3 | for ... in ... { ... } | ForEachStmt | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:9:3:9:11 | var ... = ... | PatternBindingDecl | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:9:7:9:7 | i | ConcreteVarDecl | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:10:3:12:3 | while ... { ... } | WhileStmt | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:14:3:14:7 | ... = ... | AssignExpr | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:15:3:17:18 | repeat { ... } while ... | RepeatWhileStmt | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:19:3:23:3 | do { ... } catch { ... } | DoCatchStmt | +| statements.swift:1:13:32:1 | { ... } | BraceStmt | statements.swift:25:3:31:3 | do { ... } catch { ... } | DoCatchStmt | +| statements.swift:2:3:8:3 | for ... in ... { ... } | ForEachStmt | statements.swift:2:15:2:15 | i | NamedPattern | +| statements.swift:2:3:8:3 | for ... in ... { ... } | ForEachStmt | statements.swift:2:20:2:24 | ... call to ... ... | BinaryExpr | +| statements.swift:2:3:8:3 | for ... in ... { ... } | ForEachStmt | statements.swift:2:26:8:3 | { ... } | BraceStmt | +| statements.swift:2:20:2:24 | ... call to ... ... | BinaryExpr | statements.swift:2:21:2:21 | call to ... | DotSyntaxCallExpr | +| statements.swift:2:21:2:21 | Int.Type | TypeExpr | statements.swift:2:21:2:21 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:2:21:2:21 | call to ... | DotSyntaxCallExpr | statements.swift:2:21:2:21 | ... | DeclRefExpr | +| statements.swift:2:21:2:21 | call to ... | DotSyntaxCallExpr | statements.swift:2:21:2:21 | Int.Type | TypeExpr | +| statements.swift:2:26:8:3 | { ... } | BraceStmt | statements.swift:3:5:7:5 | if ... then { ... } else { ... } | IfStmt | +| statements.swift:3:5:7:5 | if ... then { ... } else { ... } | IfStmt | statements.swift:3:8:3:13 | StmtCondition | StmtCondition | +| statements.swift:3:5:7:5 | if ... then { ... } else { ... } | IfStmt | statements.swift:3:15:5:5 | { ... } | BraceStmt | +| statements.swift:3:5:7:5 | if ... then { ... } else { ... } | IfStmt | statements.swift:5:12:7:5 | { ... } | BraceStmt | +| statements.swift:3:8:3:13 | ... call to == ... | BinaryExpr | statements.swift:3:10:3:10 | call to == | DotSyntaxCallExpr | +| statements.swift:3:10:3:10 | Int.Type | TypeExpr | statements.swift:3:10:3:10 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:3:10:3:10 | call to == | DotSyntaxCallExpr | statements.swift:3:10:3:10 | == | DeclRefExpr | +| statements.swift:3:10:3:10 | call to == | DotSyntaxCallExpr | statements.swift:3:10:3:10 | Int.Type | TypeExpr | +| statements.swift:3:15:5:5 | { ... } | BraceStmt | statements.swift:4:9:4:9 | break | BreakStmt | +| statements.swift:5:12:7:5 | { ... } | BraceStmt | statements.swift:6:9:6:9 | continue | ContinueStmt | +| statements.swift:9:3:9:11 | var ... = ... | PatternBindingDecl | statements.swift:9:7:9:7 | i | NamedPattern | +| statements.swift:9:3:9:11 | var ... = ... | PatternBindingDecl | statements.swift:9:11:9:11 | 0 | IntegerLiteralExpr | +| statements.swift:10:3:12:3 | while ... { ... } | WhileStmt | statements.swift:10:17:10:24 | StmtCondition | StmtCondition | +| statements.swift:10:3:12:3 | while ... { ... } | WhileStmt | statements.swift:10:26:12:3 | { ... } | BraceStmt | +| statements.swift:10:18:10:22 | ... call to < ... | BinaryExpr | statements.swift:10:20:10:20 | call to < | DotSyntaxCallExpr | +| statements.swift:10:20:10:20 | Int.Type | TypeExpr | statements.swift:10:20:10:20 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:10:20:10:20 | call to < | DotSyntaxCallExpr | statements.swift:10:20:10:20 | < | DeclRefExpr | +| statements.swift:10:20:10:20 | call to < | DotSyntaxCallExpr | statements.swift:10:20:10:20 | Int.Type | TypeExpr | +| statements.swift:10:26:12:3 | { ... } | BraceStmt | statements.swift:11:5:11:13 | ... = ... | AssignExpr | +| statements.swift:11:5:11:13 | ... = ... | AssignExpr | statements.swift:11:5:11:5 | i | DeclRefExpr | +| statements.swift:11:5:11:13 | ... = ... | AssignExpr | statements.swift:11:9:11:13 | ... call to + ... | BinaryExpr | +| statements.swift:11:9:11:13 | ... call to + ... | BinaryExpr | statements.swift:11:11:11:11 | call to + | DotSyntaxCallExpr | +| statements.swift:11:11:11:11 | Int.Type | TypeExpr | statements.swift:11:11:11:11 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:11:11:11:11 | call to + | DotSyntaxCallExpr | statements.swift:11:11:11:11 | + | DeclRefExpr | +| statements.swift:11:11:11:11 | call to + | DotSyntaxCallExpr | statements.swift:11:11:11:11 | Int.Type | TypeExpr | +| statements.swift:14:3:14:7 | ... = ... | AssignExpr | statements.swift:14:3:14:3 | i | DeclRefExpr | +| statements.swift:14:3:14:7 | ... = ... | AssignExpr | statements.swift:14:7:14:7 | 0 | IntegerLiteralExpr | +| statements.swift:15:3:17:18 | repeat { ... } while ... | RepeatWhileStmt | statements.swift:15:18:17:3 | { ... } | BraceStmt | +| statements.swift:15:3:17:18 | repeat { ... } while ... | RepeatWhileStmt | statements.swift:17:12:17:16 | ... call to < ... | BinaryExpr | +| statements.swift:15:18:17:3 | { ... } | BraceStmt | statements.swift:16:5:16:13 | ... = ... | AssignExpr | +| statements.swift:16:5:16:13 | ... = ... | AssignExpr | statements.swift:16:5:16:5 | i | DeclRefExpr | +| statements.swift:16:5:16:13 | ... = ... | AssignExpr | statements.swift:16:9:16:13 | ... call to + ... | BinaryExpr | +| statements.swift:16:9:16:13 | ... call to + ... | BinaryExpr | statements.swift:16:11:16:11 | call to + | DotSyntaxCallExpr | +| statements.swift:16:11:16:11 | Int.Type | TypeExpr | statements.swift:16:11:16:11 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:16:11:16:11 | call to + | DotSyntaxCallExpr | statements.swift:16:11:16:11 | + | DeclRefExpr | +| statements.swift:16:11:16:11 | call to + | DotSyntaxCallExpr | statements.swift:16:11:16:11 | Int.Type | TypeExpr | +| statements.swift:17:12:17:16 | ... call to < ... | BinaryExpr | statements.swift:17:14:17:14 | call to < | DotSyntaxCallExpr | +| statements.swift:17:14:17:14 | Int.Type | TypeExpr | statements.swift:17:14:17:14 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:17:14:17:14 | call to < | DotSyntaxCallExpr | statements.swift:17:14:17:14 | < | DeclRefExpr | +| statements.swift:17:14:17:14 | call to < | DotSyntaxCallExpr | statements.swift:17:14:17:14 | Int.Type | TypeExpr | +| statements.swift:19:3:23:3 | do { ... } catch { ... } | DoCatchStmt | statements.swift:19:6:21:3 | { ... } | BraceStmt | +| statements.swift:19:3:23:3 | do { ... } catch { ... } | DoCatchStmt | statements.swift:21:5:23:3 | case ... | CaseStmt | +| statements.swift:19:6:21:3 | { ... } | BraceStmt | statements.swift:20:5:20:19 | try ... | TryExpr | +| statements.swift:20:5:20:19 | try ... | TryExpr | statements.swift:20:9:20:19 | call to failure | CallExpr | +| statements.swift:20:9:20:19 | call to failure | CallExpr | statements.swift:20:9:20:9 | failure | DeclRefExpr | +| statements.swift:21:5:23:3 | case ... | CaseStmt | statements.swift:21:11:21:11 | let ... | CaseLabelItem | +| statements.swift:21:5:23:3 | case ... | CaseStmt | statements.swift:21:11:23:3 | { ... } | BraceStmt | +| statements.swift:21:11:21:11 | let ... | BindingPattern | statements.swift:21:11:21:11 | error | NamedPattern | +| statements.swift:21:11:21:11 | let ... | CaseLabelItem | statements.swift:21:11:21:11 | let ... | BindingPattern | +| statements.swift:21:11:23:3 | { ... } | BraceStmt | statements.swift:22:5:22:18 | call to print | CallExpr | +| statements.swift:22:5:22:18 | call to print | CallExpr | statements.swift:22:5:22:5 | print | DeclRefExpr | +| statements.swift:22:11:22:11 | [...] | ArrayExpr | statements.swift:22:11:22:11 | error | StringLiteralExpr | +| statements.swift:22:11:22:11 | [...] | VarargExpansionExpr | statements.swift:22:11:22:11 | [...] | ArrayExpr | +| statements.swift:25:3:31:3 | do { ... } catch { ... } | DoCatchStmt | statements.swift:25:6:27:3 | { ... } | BraceStmt | +| statements.swift:25:3:31:3 | do { ... } catch { ... } | DoCatchStmt | statements.swift:27:5:29:3 | case ... | CaseStmt | +| statements.swift:25:3:31:3 | do { ... } catch { ... } | DoCatchStmt | statements.swift:29:5:31:3 | case ... | CaseStmt | +| statements.swift:25:6:27:3 | { ... } | BraceStmt | statements.swift:26:5:26:19 | try ... | TryExpr | +| statements.swift:26:5:26:19 | try ... | TryExpr | statements.swift:26:9:26:19 | call to failure | CallExpr | +| statements.swift:26:9:26:19 | call to failure | CallExpr | statements.swift:26:9:26:9 | failure | DeclRefExpr | +| statements.swift:27:5:29:3 | case ... | CaseStmt | statements.swift:27:11:27:11 | ... is ... | CaseLabelItem | +| statements.swift:27:5:29:3 | case ... | CaseStmt | statements.swift:27:26:29:3 | { ... } | BraceStmt | +| statements.swift:27:11:27:11 | ... is ... | CaseLabelItem | statements.swift:27:11:27:11 | ... is ... | IsPattern | +| statements.swift:27:26:29:3 | { ... } | BraceStmt | statements.swift:28:5:28:27 | call to print | CallExpr | +| statements.swift:28:5:28:27 | call to print | CallExpr | statements.swift:28:5:28:5 | print | DeclRefExpr | +| statements.swift:28:11:28:11 | [...] | ArrayExpr | statements.swift:28:11:28:11 | AnError.failed | StringLiteralExpr | +| statements.swift:28:11:28:11 | [...] | VarargExpansionExpr | statements.swift:28:11:28:11 | [...] | ArrayExpr | +| statements.swift:29:5:31:3 | case ... | CaseStmt | statements.swift:29:11:29:11 | let ... | CaseLabelItem | +| statements.swift:29:5:31:3 | case ... | CaseStmt | statements.swift:29:11:31:3 | { ... } | BraceStmt | +| statements.swift:29:11:29:11 | let ... | BindingPattern | statements.swift:29:11:29:11 | error | NamedPattern | +| statements.swift:29:11:29:11 | let ... | CaseLabelItem | statements.swift:29:11:29:11 | let ... | BindingPattern | +| statements.swift:29:11:31:3 | { ... } | BraceStmt | statements.swift:30:5:30:18 | call to print | CallExpr | +| statements.swift:30:5:30:18 | call to print | CallExpr | statements.swift:30:5:30:5 | print | DeclRefExpr | +| statements.swift:30:11:30:11 | [...] | ArrayExpr | statements.swift:30:11:30:11 | error | StringLiteralExpr | +| statements.swift:30:11:30:11 | [...] | VarargExpansionExpr | statements.swift:30:11:30:11 | [...] | ArrayExpr | +| statements.swift:35:3:35:8 | case ... | EnumCaseDecl | statements.swift:35:8:35:8 | failed | EnumElementDecl | +| statements.swift:38:1:42:1 | failure | ConcreteFuncDecl | statements.swift:38:14:38:19 | x | ParamDecl | +| statements.swift:38:1:42:1 | failure | ConcreteFuncDecl | statements.swift:38:31:42:1 | { ... } | BraceStmt | +| statements.swift:38:31:42:1 | { ... } | BraceStmt | statements.swift:39:3:41:3 | guard ... else { ... } | GuardStmt | +| statements.swift:39:3:41:3 | guard ... else { ... } | GuardStmt | statements.swift:39:9:39:14 | StmtCondition | StmtCondition | +| statements.swift:39:3:41:3 | guard ... else { ... } | GuardStmt | statements.swift:39:21:41:3 | { ... } | BraceStmt | +| statements.swift:39:9:39:14 | ... call to != ... | BinaryExpr | statements.swift:39:11:39:11 | call to != | DotSyntaxCallExpr | +| statements.swift:39:11:39:11 | Int.Type | TypeExpr | statements.swift:39:11:39:11 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:39:11:39:11 | call to != | DotSyntaxCallExpr | statements.swift:39:11:39:11 | != | DeclRefExpr | +| statements.swift:39:11:39:11 | call to != | DotSyntaxCallExpr | statements.swift:39:11:39:11 | Int.Type | TypeExpr | +| statements.swift:39:21:41:3 | { ... } | BraceStmt | statements.swift:40:5:40:19 | throw ... | ThrowStmt | +| statements.swift:40:5:40:19 | throw ... | ThrowStmt | statements.swift:40:11:40:19 | call to ... | DotSyntaxCallExpr | +| statements.swift:40:11:40:11 | AnError.Type | TypeExpr | statements.swift:40:11:40:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| statements.swift:40:11:40:19 | call to ... | DotSyntaxCallExpr | statements.swift:40:11:40:11 | AnError.Type | TypeExpr | +| statements.swift:40:11:40:19 | call to ... | DotSyntaxCallExpr | statements.swift:40:19:40:19 | failed | DeclRefExpr | +| statements.swift:44:1:46:1 | defer { ... } | DeferStmt | statements.swift:44:7:46:1 | { ... } | BraceStmt | +| statements.swift:44:1:46:1 | { ... } | BraceStmt | statements.swift:44:1:46:1 | defer { ... } | DeferStmt | +| statements.swift:44:1:46:1 | { ... } | TopLevelCodeDecl | statements.swift:44:1:46:1 | { ... } | BraceStmt | +| statements.swift:44:7:46:1 | { ... } | BraceStmt | statements.swift:45:3:45:15 | call to print | CallExpr | +| statements.swift:45:3:45:15 | call to print | CallExpr | statements.swift:45:3:45:3 | print | DeclRefExpr | +| statements.swift:45:9:45:9 | [...] | ArrayExpr | statements.swift:45:9:45:9 | done | StringLiteralExpr | +| statements.swift:45:9:45:9 | [...] | VarargExpansionExpr | statements.swift:45:9:45:9 | [...] | ArrayExpr | +| statements.swift:48:1:50:1 | do { ... } | DoStmt | statements.swift:48:4:50:1 | { ... } | BraceStmt | +| statements.swift:48:1:50:1 | { ... } | BraceStmt | statements.swift:48:1:50:1 | do { ... } | DoStmt | +| statements.swift:48:1:50:1 | { ... } | TopLevelCodeDecl | statements.swift:48:1:50:1 | { ... } | BraceStmt | +| statements.swift:48:4:50:1 | { ... } | BraceStmt | statements.swift:49:3:49:16 | call to print | CallExpr | +| statements.swift:49:3:49:16 | call to print | CallExpr | statements.swift:49:3:49:3 | print | DeclRefExpr | +| statements.swift:49:9:49:9 | [...] | ArrayExpr | statements.swift:49:9:49:9 | doing | StringLiteralExpr | +| statements.swift:49:9:49:9 | [...] | VarargExpansionExpr | statements.swift:49:9:49:9 | [...] | ArrayExpr | +| statements.swift:52:1:52:13 | var ... = ... | PatternBindingDecl | statements.swift:52:5:52:5 | index | NamedPattern | +| statements.swift:52:1:52:13 | var ... = ... | PatternBindingDecl | statements.swift:52:13:52:13 | 42 | IntegerLiteralExpr | +| statements.swift:52:1:52:13 | { ... } | BraceStmt | statements.swift:52:1:52:13 | var ... = ... | PatternBindingDecl | +| statements.swift:52:1:52:13 | { ... } | TopLevelCodeDecl | statements.swift:52:1:52:13 | { ... } | BraceStmt | +| statements.swift:53:1:62:1 | switch index { ... } | SwitchStmt | statements.swift:53:8:53:8 | index | DeclRefExpr | +| statements.swift:53:1:62:1 | switch index { ... } | SwitchStmt | statements.swift:54:4:56:7 | case ... | CaseStmt | +| statements.swift:53:1:62:1 | switch index { ... } | SwitchStmt | statements.swift:57:4:59:7 | case ... | CaseStmt | +| statements.swift:53:1:62:1 | switch index { ... } | SwitchStmt | statements.swift:60:4:61:22 | case ... | CaseStmt | +| statements.swift:53:1:62:1 | { ... } | BraceStmt | statements.swift:53:1:62:1 | switch index { ... } | SwitchStmt | +| statements.swift:53:1:62:1 | { ... } | TopLevelCodeDecl | statements.swift:53:1:62:1 | { ... } | BraceStmt | +| statements.swift:54:4:56:7 | case ... | CaseStmt | statements.swift:54:9:54:9 | 1 | CaseLabelItem | +| statements.swift:54:4:56:7 | case ... | CaseStmt | statements.swift:55:7:56:7 | { ... } | BraceStmt | +| statements.swift:54:9:54:9 | 1 | CaseLabelItem | statements.swift:54:9:54:9 | 1 | ExprPattern | +| statements.swift:54:9:54:9 | 1 | ExprPattern | statements.swift:54:9:54:9 | 1 | IntegerLiteralExpr | +| statements.swift:55:7:55:16 | call to print | CallExpr | statements.swift:55:7:55:7 | print | DeclRefExpr | +| statements.swift:55:7:56:7 | { ... } | BraceStmt | statements.swift:55:7:55:16 | call to print | CallExpr | +| statements.swift:55:7:56:7 | { ... } | BraceStmt | statements.swift:56:7:56:7 | fallthrough | FallthroughStmt | +| statements.swift:55:13:55:13 | [...] | ArrayExpr | statements.swift:55:13:55:13 | 1 | StringLiteralExpr | +| statements.swift:55:13:55:13 | [...] | VarargExpansionExpr | statements.swift:55:13:55:13 | [...] | ArrayExpr | +| statements.swift:57:4:59:7 | case ... | CaseStmt | statements.swift:57:9:57:9 | 5 | CaseLabelItem | +| statements.swift:57:4:59:7 | case ... | CaseStmt | statements.swift:57:12:57:12 | 10 | CaseLabelItem | +| statements.swift:57:4:59:7 | case ... | CaseStmt | statements.swift:58:7:59:7 | { ... } | BraceStmt | +| statements.swift:57:9:57:9 | 5 | CaseLabelItem | statements.swift:57:9:57:9 | 5 | ExprPattern | +| statements.swift:57:9:57:9 | 5 | ExprPattern | statements.swift:57:9:57:9 | 5 | IntegerLiteralExpr | +| statements.swift:57:12:57:12 | 10 | CaseLabelItem | statements.swift:57:12:57:12 | 10 | ExprPattern | +| statements.swift:57:12:57:12 | 10 | ExprPattern | statements.swift:57:12:57:12 | 10 | IntegerLiteralExpr | +| statements.swift:58:7:58:20 | call to print | CallExpr | statements.swift:58:7:58:7 | print | DeclRefExpr | +| statements.swift:58:7:59:7 | { ... } | BraceStmt | statements.swift:58:7:58:20 | call to print | CallExpr | +| statements.swift:58:7:59:7 | { ... } | BraceStmt | statements.swift:59:7:59:7 | break | BreakStmt | +| statements.swift:58:13:58:13 | [...] | ArrayExpr | statements.swift:58:13:58:13 | 5, 10 | StringLiteralExpr | +| statements.swift:58:13:58:13 | [...] | VarargExpansionExpr | statements.swift:58:13:58:13 | [...] | ArrayExpr | +| statements.swift:60:4:60:4 | _ | CaseLabelItem | statements.swift:60:4:60:4 | _ | AnyPattern | +| statements.swift:60:4:61:22 | case ... | CaseStmt | statements.swift:60:4:60:4 | _ | CaseLabelItem | +| statements.swift:60:4:61:22 | case ... | CaseStmt | statements.swift:61:7:61:22 | { ... } | BraceStmt | +| statements.swift:61:7:61:22 | call to print | CallExpr | statements.swift:61:7:61:7 | print | DeclRefExpr | +| statements.swift:61:7:61:22 | { ... } | BraceStmt | statements.swift:61:7:61:22 | call to print | CallExpr | +| statements.swift:61:13:61:13 | [...] | ArrayExpr | statements.swift:61:13:61:13 | default | StringLiteralExpr | +| statements.swift:61:13:61:13 | [...] | VarargExpansionExpr | statements.swift:61:13:61:13 | [...] | ArrayExpr | +| statements.swift:64:1:64:15 | var ... = ... | PatternBindingDecl | statements.swift:64:5:64:11 | ... as ... | TypedPattern | +| statements.swift:64:1:64:15 | var ... = ... | PatternBindingDecl | statements.swift:64:15:64:15 | 4 | IntegerLiteralExpr | +| statements.swift:64:1:64:15 | { ... } | BraceStmt | statements.swift:64:1:64:15 | var ... = ... | PatternBindingDecl | +| statements.swift:64:1:64:15 | { ... } | TopLevelCodeDecl | statements.swift:64:1:64:15 | { ... } | BraceStmt | +| statements.swift:64:5:64:11 | ... as ... | TypedPattern | statements.swift:64:5:64:5 | x | NamedPattern | +| statements.swift:64:5:64:11 | ... as ... | TypedPattern | statements.swift:64:8:64:11 | ...? | OptionalTypeRepr | +| statements.swift:64:5:64:11 | ... as ... | TypedPattern | statements.swift:64:8:64:11 | TBD (OptionalTypeRepr) | OptionalTypeRepr | +| statements.swift:65:1:66:1 | if ... then { ... } | IfStmt | statements.swift:65:4:65:19 | StmtCondition | StmtCondition | +| statements.swift:65:1:66:1 | if ... then { ... } | IfStmt | statements.swift:65:21:66:1 | { ... } | BraceStmt | +| statements.swift:65:1:66:1 | { ... } | BraceStmt | statements.swift:65:1:66:1 | if ... then { ... } | IfStmt | +| statements.swift:65:1:66:1 | { ... } | TopLevelCodeDecl | statements.swift:65:1:66:1 | { ... } | BraceStmt | +| statements.swift:65:9:65:15 | let ... | BindingPattern | statements.swift:65:13:65:15 | let ...? | OptionalSomePattern | +| statements.swift:65:13:65:15 | let ...? | OptionalSomePattern | statements.swift:65:13:65:13 | xx | NamedPattern | +| statements.swift:67:1:68:1 | if ... then { ... } | IfStmt | statements.swift:67:4:67:20 | StmtCondition | StmtCondition | +| statements.swift:67:1:68:1 | if ... then { ... } | IfStmt | statements.swift:67:22:68:1 | { ... } | BraceStmt | +| statements.swift:67:1:68:1 | { ... } | BraceStmt | statements.swift:67:1:68:1 | if ... then { ... } | IfStmt | +| statements.swift:67:1:68:1 | { ... } | TopLevelCodeDecl | statements.swift:67:1:68:1 | { ... } | BraceStmt | +| statements.swift:67:9:67:16 | .some(...) | EnumElementPattern | statements.swift:67:15:67:15 | _ | AnyPattern | +| statements.swift:70:1:70:23 | var ... = ... | PatternBindingDecl | statements.swift:70:5:70:5 | numbers | NamedPattern | +| statements.swift:70:1:70:23 | var ... = ... | PatternBindingDecl | statements.swift:70:15:70:23 | [...] | ArrayExpr | +| statements.swift:70:1:70:23 | { ... } | BraceStmt | statements.swift:70:1:70:23 | var ... = ... | PatternBindingDecl | +| statements.swift:70:1:70:23 | { ... } | TopLevelCodeDecl | statements.swift:70:1:70:23 | { ... } | BraceStmt | +| statements.swift:70:15:70:23 | [...] | ArrayExpr | statements.swift:70:16:70:16 | 1 | IntegerLiteralExpr | +| statements.swift:70:15:70:23 | [...] | ArrayExpr | statements.swift:70:19:70:19 | 2 | IntegerLiteralExpr | +| statements.swift:70:15:70:23 | [...] | ArrayExpr | statements.swift:70:22:70:22 | 3 | IntegerLiteralExpr | +| statements.swift:71:1:72:1 | for ... in ... where ... { ... } | ForEachStmt | statements.swift:71:5:71:5 | number | NamedPattern | +| statements.swift:71:1:72:1 | for ... in ... where ... { ... } | ForEachStmt | statements.swift:71:15:71:15 | numbers | DeclRefExpr | +| statements.swift:71:1:72:1 | for ... in ... where ... { ... } | ForEachStmt | statements.swift:71:29:71:43 | ... call to == ... | BinaryExpr | +| statements.swift:71:1:72:1 | for ... in ... where ... { ... } | ForEachStmt | statements.swift:71:45:72:1 | { ... } | BraceStmt | +| statements.swift:71:1:72:1 | { ... } | BraceStmt | statements.swift:71:1:72:1 | for ... in ... where ... { ... } | ForEachStmt | +| statements.swift:71:1:72:1 | { ... } | TopLevelCodeDecl | statements.swift:71:1:72:1 | { ... } | BraceStmt | +| statements.swift:71:29:71:38 | ... call to % ... | BinaryExpr | statements.swift:71:36:71:36 | call to % | DotSyntaxCallExpr | +| statements.swift:71:29:71:43 | ... call to == ... | BinaryExpr | statements.swift:71:40:71:40 | call to == | DotSyntaxCallExpr | +| statements.swift:71:36:71:36 | Int.Type | TypeExpr | statements.swift:71:36:71:36 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:71:36:71:36 | call to % | DotSyntaxCallExpr | statements.swift:71:36:71:36 | % | DeclRefExpr | +| statements.swift:71:36:71:36 | call to % | DotSyntaxCallExpr | statements.swift:71:36:71:36 | Int.Type | TypeExpr | +| statements.swift:71:40:71:40 | Int.Type | TypeExpr | statements.swift:71:40:71:40 | TBD (FixedTypeRepr) | FixedTypeRepr | +| statements.swift:71:40:71:40 | call to == | DotSyntaxCallExpr | statements.swift:71:40:71:40 | == | DeclRefExpr | +| statements.swift:71:40:71:40 | call to == | DotSyntaxCallExpr | statements.swift:71:40:71:40 | Int.Type | TypeExpr | +| statements.swift:74:8:74:8 | deinit | ConstructorDecl | statements.swift:74:8:74:8 | x | ParamDecl | +| statements.swift:75:3:75:11 | var ... = ... | PatternBindingDecl | statements.swift:75:7:75:11 | ... as ... | TypedPattern | +| statements.swift:75:7:75:7 | (unnamed function decl) | AccessorDecl | statements.swift:75:7:75:7 | { ... } | BraceStmt | +| statements.swift:75:7:75:7 | get | AccessorDecl | statements.swift:75:7:75:7 | { ... } | BraceStmt | +| statements.swift:75:7:75:7 | set | AccessorDecl | statements.swift:75:7:75:7 | value | ParamDecl | +| statements.swift:75:7:75:7 | set | AccessorDecl | statements.swift:75:7:75:7 | { ... } | BraceStmt | +| statements.swift:75:7:75:7 | x | ConcreteVarDecl | statements.swift:75:7:75:7 | (unnamed function decl) | AccessorDecl | +| statements.swift:75:7:75:7 | x | ConcreteVarDecl | statements.swift:75:7:75:7 | get | AccessorDecl | +| statements.swift:75:7:75:7 | x | ConcreteVarDecl | statements.swift:75:7:75:7 | set | AccessorDecl | +| statements.swift:75:7:75:7 | yield ... | YieldStmt | file://:0:0:0:0 | &... | InOutExpr | +| statements.swift:75:7:75:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| statements.swift:75:7:75:7 | { ... } | BraceStmt | file://:0:0:0:0 | return ... | ReturnStmt | +| statements.swift:75:7:75:7 | { ... } | BraceStmt | statements.swift:75:7:75:7 | yield ... | YieldStmt | +| statements.swift:75:7:75:11 | ... as ... | TypedPattern | statements.swift:75:7:75:7 | x | NamedPattern | +| statements.swift:75:7:75:11 | ... as ... | TypedPattern | statements.swift:75:11:75:11 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| statements.swift:76:3:84:3 | var ... = ... | PatternBindingDecl | statements.swift:76:7:76:19 | ... as ... | TypedPattern | +| statements.swift:76:7:76:7 | hasModify | ConcreteVarDecl | statements.swift:76:7:76:7 | set | AccessorDecl | +| statements.swift:76:7:76:7 | hasModify | ConcreteVarDecl | statements.swift:77:5:79:5 | (unnamed function decl) | AccessorDecl | +| statements.swift:76:7:76:7 | hasModify | ConcreteVarDecl | statements.swift:81:5:83:5 | get | AccessorDecl | +| statements.swift:76:7:76:7 | set | AccessorDecl | statements.swift:76:7:76:7 | value | ParamDecl | +| statements.swift:76:7:76:7 | set | AccessorDecl | statements.swift:76:7:76:7 | { ... } | BraceStmt | +| statements.swift:76:7:76:7 | { ... } | BraceStmt | file://:0:0:0:0 | ... = ... | AssignExpr | +| statements.swift:76:7:76:19 | ... as ... | TypedPattern | statements.swift:76:7:76:7 | hasModify | NamedPattern | +| statements.swift:76:7:76:19 | ... as ... | TypedPattern | statements.swift:76:19:76:19 | TBD (SimpleIdentTypeRepr) | SimpleIdentTypeRepr | +| statements.swift:77:5:79:5 | (unnamed function decl) | AccessorDecl | statements.swift:77:13:79:5 | { ... } | BraceStmt | +| statements.swift:77:13:79:5 | { ... } | BraceStmt | statements.swift:78:7:78:14 | yield ... | YieldStmt | +| statements.swift:78:7:78:14 | yield ... | YieldStmt | statements.swift:78:13:78:14 | &... | InOutExpr | +| statements.swift:78:13:78:14 | &... | InOutExpr | statements.swift:78:14:78:14 | .x | MemberRefExpr | +| statements.swift:78:14:78:14 | .x | MemberRefExpr | statements.swift:78:14:78:14 | self | DeclRefExpr | +| statements.swift:81:5:83:5 | get | AccessorDecl | statements.swift:81:9:83:5 | { ... } | BraceStmt | +| statements.swift:81:9:83:5 | { ... } | BraceStmt | statements.swift:82:7:82:14 | return ... | ReturnStmt | +| statements.swift:82:7:82:14 | return ... | ReturnStmt | statements.swift:82:14:82:14 | 0 | IntegerLiteralExpr | diff --git a/swift/ql/test/library-tests/parent/parent.ql b/swift/ql/test/library-tests/parent/parent.ql new file mode 100644 index 00000000000..2b56b81bb63 --- /dev/null +++ b/swift/ql/test/library-tests/parent/parent.ql @@ -0,0 +1,6 @@ +import swift + +from AstNode parent, AstNode child +where + parent = child.getParent() and parent.getLocation().getFile().getName().matches("%swift/ql/test%") +select parent, parent.getPrimaryQlClasses(), child, child.getPrimaryQlClasses() diff --git a/swift/ql/test/library-tests/parent/patterns.swift b/swift/ql/test/library-tests/parent/patterns.swift new file mode 100644 index 00000000000..ebc369310c9 --- /dev/null +++ b/swift/ql/test/library-tests/parent/patterns.swift @@ -0,0 +1,52 @@ +func basic_patterns() { + var an_int = 42 + var a_string: String = "here" + let (x, y, z) = (1, 2, 3) + let _ = "any" + let (_) = "paren" +} + +func switch_patterns() { + let point = (1, 2) + switch point { + case let (xx, yy): "binding" + } + + switch 3 { + case 1 + 2: "expr" + case _: "" + } + + enum Foo { + case bar, baz(Int, String) + } + + let v: Foo = .bar + + switch v { + case .bar: "bar" + case let .baz(i, s): i + } + + let w: Int? = nil + + switch w { + case let n?: n + case _: "none" + } + + let a: Any = "any" + + switch a { + case is Int: "is pattern" + case let x as String: "as pattern" + case _: "other" + } + + let b = true + + switch b { + case true: "true" + case false: "false" + } +} diff --git a/swift/ql/test/library-tests/parent/statements.swift b/swift/ql/test/library-tests/parent/statements.swift new file mode 100644 index 00000000000..7c56d149e4e --- /dev/null +++ b/swift/ql/test/library-tests/parent/statements.swift @@ -0,0 +1,85 @@ +func loop() { + label1: for i in 1...5 { + if i == 3 { + break + } else { + continue + } + } + var i = 0 + label2: while (i < 12) { + i = i + 1 + } + + i = 0 + label3: repeat { + i = i + 1 + } while (i < 12) + + do { + try failure(11) + } catch { + print("error") + } + + do { + try failure(11) + } catch AnError.failed { + print("AnError.failed") + } catch { + print("error") + } +} + +enum AnError: Error { + case failed +} + +func failure(_ x: Int) throws { + guard x != 0 else { + throw AnError.failed + } +} + +defer { + print("done") +} + +do { + print("doing") +} + +let index = 42 +switch index { + case 1: + print("1") + fallthrough + case 5, 10: + print("5, 10") + break + default: + print("default") +} + +let x: Int? = 4 +if case let xx? = x { +} +if case .some(_) = x { +} + +let numbers = [1, 2, 3] +for number in numbers where number % 2 == 0 { +} + +struct HasModifyAccessorDecl { + var x : Int + var hasModify : Int { + _modify { + yield &x + } + + get { + return 0 + } + } +} \ No newline at end of file diff --git a/swift/tools/qltest.sh b/swift/tools/qltest.sh index 9da3a32b6d7..538f8e2a01d 100755 --- a/swift/tools/qltest.sh +++ b/swift/tools/qltest.sh @@ -6,4 +6,6 @@ QLTEST_LOG="$CODEQL_EXTRACTOR_SWIFT_LOG_DIR"/qltest.log export LD_LIBRARY_PATH="$CODEQL_EXTRACTOR_SWIFT_ROOT/tools/$CODEQL_PLATFORM" -exec "$CODEQL_EXTRACTOR_SWIFT_ROOT/tools/$CODEQL_PLATFORM/extractor" -sdk "$CODEQL_EXTRACTOR_SWIFT_ROOT/qltest/$CODEQL_PLATFORM/sdk" -c *.swift >> $QLTEST_LOG 2>&1 +for src in *.swift; do + "$CODEQL_EXTRACTOR_SWIFT_ROOT/tools/$CODEQL_PLATFORM/extractor" -sdk "$CODEQL_EXTRACTOR_SWIFT_ROOT/qltest/$CODEQL_PLATFORM/sdk" -c $src >> $QLTEST_LOG 2>&1 +done