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(
8484 return entry;
8585}
8686
87+ codeql::PostfixUnaryExpr ExprTranslator::translatePostfixUnaryExpr (
88+ const swift::PostfixUnaryExpr& expr) {
89+ auto entry = createExprEntry (expr);
90+ fillApplyExpr (expr, entry);
91+ return entry;
92+ }
93+
8794codeql::DeclRefExpr ExprTranslator::translateDeclRefExpr (const swift::DeclRefExpr& expr) {
8895 auto entry = createExprEntry (expr);
8996 entry.decl = dispatcher.fetchLabel (expr.getDecl ());
@@ -518,4 +525,5 @@ codeql::UnresolvedPatternExpr ExprTranslator::translateUnresolvedPatternExpr(
518525 entry.sub_pattern = dispatcher.fetchLabel (expr.getSubPattern ());
519526 return entry;
520527}
528+
521529} // namespace codeql
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ class ExprTranslator : public AstTranslatorBase<ExprTranslator> {
2020 codeql::NilLiteralExpr translateNilLiteralExpr (const swift::NilLiteralExpr& expr);
2121 codeql::CallExpr translateCallExpr (const swift::CallExpr& expr);
2222 codeql::PrefixUnaryExpr translatePrefixUnaryExpr (const swift::PrefixUnaryExpr& expr);
23+ codeql::PostfixUnaryExpr translatePostfixUnaryExpr (const swift::PostfixUnaryExpr& expr);
2324 codeql::DeclRefExpr translateDeclRefExpr (const swift::DeclRefExpr& expr);
2425 codeql::AssignExpr translateAssignExpr (const swift::AssignExpr& expr);
2526 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