File tree Expand file tree Collapse file tree 10 files changed +46
-4
lines changed Expand file tree Collapse file tree 10 files changed +46
-4
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,13 @@ codeql::PrefixUnaryExpr ExprTranslator::translatePrefixUnaryExpr(
84
84
return entry;
85
85
}
86
86
87
+ codeql::PostfixUnaryExpr ExprTranslator::translatePostfixUnaryExpr (
88
+ const swift::PostfixUnaryExpr& expr) {
89
+ auto entry = createExprEntry (expr);
90
+ fillApplyExpr (expr, entry);
91
+ return entry;
92
+ }
93
+
87
94
codeql::DeclRefExpr ExprTranslator::translateDeclRefExpr (const swift::DeclRefExpr& expr) {
88
95
auto entry = createExprEntry (expr);
89
96
entry.decl = dispatcher.fetchLabel (expr.getDecl ());
@@ -518,4 +525,5 @@ codeql::UnresolvedPatternExpr ExprTranslator::translateUnresolvedPatternExpr(
518
525
entry.sub_pattern = dispatcher.fetchLabel (expr.getSubPattern ());
519
526
return entry;
520
527
}
528
+
521
529
} // namespace codeql
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
20
20
codeql::NilLiteralExpr translateNilLiteralExpr (const swift::NilLiteralExpr& expr);
21
21
codeql::CallExpr translateCallExpr (const swift::CallExpr& expr);
22
22
codeql::PrefixUnaryExpr translatePrefixUnaryExpr (const swift::PrefixUnaryExpr& expr);
23
+ codeql::PostfixUnaryExpr translatePostfixUnaryExpr (const swift::PostfixUnaryExpr& expr);
23
24
codeql::DeclRefExpr translateDeclRefExpr (const swift::DeclRefExpr& expr);
24
25
codeql::AssignExpr translateAssignExpr (const swift::AssignExpr& expr);
25
26
codeql::BindOptionalExpr translateBindOptionalExpr (const swift::BindOptionalExpr& expr);
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ | postfix.swift:1:5:1:6 | call to ...(_:) | getFunction: | postfix.swift:1:6:1:6 | ....(_:) |
2
+ | postfix.swift:7:1:7:2 | call to **(_:) | getFunction: | postfix.swift:7:2:7:2 | **(_:) |
Original file line number Diff line number Diff line change
1
+ // generated by codegen/codegen.py
2
+ import codeql.swift.elements
3
+ import TestUtils
4
+
5
+ from PostfixUnaryExpr x , Expr getFunction
6
+ where
7
+ toBeTested ( x ) and
8
+ not x .isUnknown ( ) and
9
+ getFunction = x .getFunction ( )
10
+ select x , "getFunction:" , getFunction
Original file line number Diff line number Diff line change
1
+ | postfix.swift:1:5:1:6 | call to ...(_:) | 0 | postfix.swift:1:5:1:5 | : 3 |
2
+ | postfix.swift:7:1:7:2 | call to **(_:) | 0 | postfix.swift:7:1:7:1 | : 3 |
Original file line number Diff line number Diff line change
1
+ // generated by codegen/codegen.py
2
+ import codeql.swift.elements
3
+ import TestUtils
4
+
5
+ from PostfixUnaryExpr x , int index
6
+ where toBeTested ( x ) and not x .isUnknown ( )
7
+ select x , index , x .getArgument ( index )
Original file line number Diff line number Diff line change
1
+ | postfix.swift:1:5:1:6 | call to ...(_:) | PartialRangeFrom<Int> |
2
+ | postfix.swift:7:1:7:2 | call to **(_:) | () |
Original file line number Diff line number Diff line change
1
+ // generated by codegen/codegen.py
2
+ import codeql.swift.elements
3
+ import TestUtils
4
+
5
+ from PostfixUnaryExpr x
6
+ where toBeTested ( x ) and not x .isUnknown ( )
7
+ select x , x .getType ( )
Original file line number Diff line number Diff line change
1
+ _ = 3 ...
2
+
3
+ postfix operator **
4
+
5
+ postfix func ** ( _ n: Int ) { }
6
+
7
+ 3 **
You can’t perform that action at this time.
0 commit comments