File tree Expand file tree Collapse file tree 8 files changed +24
-8
lines changed Expand file tree Collapse file tree 8 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ OptionalEvaluationExpr:
471
471
sub_expr : Expr
472
472
473
473
OtherConstructorDeclRefExpr :
474
+ constructor_decl : ConstructorDecl
474
475
_extends : Expr
475
476
476
477
OverloadSetRefExpr :
Original file line number Diff line number Diff line change @@ -518,13 +518,21 @@ class ExprVisitor : public AstVisitorBase<ExprVisitor> {
518
518
auto label = dispatcher_.assignNewLabel (expr);
519
519
assert (expr->getBase () && " KeyPathApplicationExpr has getBase()" );
520
520
assert (expr->getKeyPath () && " KeyPathApplicationExpr has getKeyPath()" );
521
-
521
+
522
522
auto baseLabel = dispatcher_.fetchLabel (expr->getBase ());
523
523
auto keyPathLabel = dispatcher_.fetchLabel (expr->getKeyPath ());
524
524
525
525
dispatcher_.emit (KeyPathApplicationExprsTrap{label, baseLabel, keyPathLabel});
526
526
}
527
527
528
+ void visitOtherConstructorDeclRefExpr (swift::OtherConstructorDeclRefExpr* expr) {
529
+ auto label = dispatcher_.assignNewLabel (expr);
530
+ assert (expr->getDecl () && " OtherConstructorDeclRefExpr has getDecl()" );
531
+
532
+ auto ctorLabel = dispatcher_.fetchLabel (expr->getDecl ());
533
+ dispatcher_.emit (OtherConstructorDeclRefExprsTrap{label, ctorLabel});
534
+ }
535
+
528
536
private:
529
537
TrapLabel<ArgumentTag> emitArgument (const swift::Argument& arg) {
530
538
auto argLabel = dispatcher_.createLabel <ArgumentTag>();
Original file line number Diff line number Diff line change @@ -1292,6 +1292,10 @@ module Exprs {
1292
1292
DeclRefExprLValueTree ( ) { isLValue ( ast ) }
1293
1293
}
1294
1294
1295
+ class OtherConstructorDeclRefTree extends AstLeafTree {
1296
+ override OtherConstructorDeclRefExpr ast ;
1297
+ }
1298
+
1295
1299
abstract class DeclRefExprRValueTree extends AstControlFlowTree {
1296
1300
override DeclRefExpr ast ;
1297
1301
Original file line number Diff line number Diff line change 1
1
// generated by codegen/codegen.py
2
+ import codeql.swift.elements.decl.ConstructorDecl
2
3
import codeql.swift.elements.expr.Expr
3
4
4
5
class OtherConstructorDeclRefExprBase extends @other_constructor_decl_ref_expr, Expr {
5
6
override string getAPrimaryQlClass ( ) { result = "OtherConstructorDeclRefExpr" }
7
+
8
+ ConstructorDecl getConstructorDecl ( ) {
9
+ exists ( ConstructorDecl x |
10
+ other_constructor_decl_ref_exprs ( this , x ) and
11
+ result = x .resolve ( )
12
+ )
13
+ }
6
14
}
Original file line number Diff line number Diff line change @@ -975,7 +975,8 @@ optional_evaluation_exprs(
975
975
);
976
976
977
977
other_constructor_decl_ref_exprs(
978
- unique int id: @other_constructor_decl_ref_expr
978
+ unique int id: @other_constructor_decl_ref_expr,
979
+ int constructor_decl: @constructor_decl ref
979
980
);
980
981
981
982
@overload_set_ref_expr =
Original file line number Diff line number Diff line change 162
162
| expressions.swift:79:5:79:11 | call to ... |
163
163
| expressions.swift:79:5:79:21 | call to ... |
164
164
| expressions.swift:79:5:79:21 | self = ... |
165
- | expressions.swift:79:11:79:11 | TBD (OtherConstructorDeclRefExpr) |
166
165
| expressions.swift:79:11:79:11 | call to ... |
167
166
| expressions.swift:79:19:79:19 | 22 |
168
167
| expressions.swift:83:15:83:15 | Derived.Type |
Original file line number Diff line number Diff line change @@ -4944,7 +4944,6 @@ cfg.swift:
4944
4944
4945
4945
# 378| init
4946
4946
#-----| -> call to ...
4947
- #-----| -> TBD (OtherConstructorDeclRefExpr)
4948
4947
4949
4948
# 379| super
4950
4949
#-----| -> call to ...
@@ -4961,9 +4960,6 @@ cfg.swift:
4961
4960
# 379| call to ...
4962
4961
#-----| -> super
4963
4962
4964
- # 379| TBD (OtherConstructorDeclRefExpr)
4965
- #-----| -> super
4966
-
4967
4963
# 379| 0
4968
4964
#-----| -> call to ...
4969
4965
Original file line number Diff line number Diff line change 566
566
| expressions.swift:78:3:80:3 | init | ConstructorDecl | expressions.swift:78:10:80:3 | { ... } | BraceStmt |
567
567
| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr |
568
568
| expressions.swift:78:10:80:3 | { ... } | BraceStmt | expressions.swift:80:3:80:3 | return | ReturnStmt |
569
- | expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | TBD (OtherConstructorDeclRefExpr) | OtherConstructorDeclRefExpr |
570
569
| expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr | expressions.swift:79:11:79:11 | call to ... | OtherConstructorDeclRefExpr |
571
570
| expressions.swift:79:5:79:21 | call to ... | CallExpr | expressions.swift:79:5:79:11 | call to ... | DotSyntaxCallExpr |
572
571
| expressions.swift:79:5:79:21 | self = ... | RebindSelfInConstructorExpr | expressions.swift:78:3:78:3 | self | ParamDecl |
You can’t perform that action at this time.
0 commit comments