Skip to content

Commit 755c56d

Browse files
authored
Swift: autoformat
1 parent fca1afa commit 755c56d

File tree

6 files changed

+10
-19
lines changed

6 files changed

+10
-19
lines changed

swift/ql/lib/codeql/swift/controlflow/CfgNodes.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,4 @@ class ApplyExprCfgNode extends ExprCfgNode {
113113

114114
class CallExprCfgNode extends ApplyExprCfgNode {
115115
override CallExpr e;
116-
}
116+
}

swift/ql/lib/codeql/swift/dataflow/Ssa.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ module Ssa {
7272
)
7373
}
7474

75-
cached predicate isInoutDef(ExprCfgNode argument) {
75+
cached
76+
predicate isInoutDef(ExprCfgNode argument) {
7677
exists(
7778
CallExpr c, BasicBlock bb, int blockIndex, int argIndex, VarDecl v, InOutExpr argExpr // TODO: use CFG node for assignment expr
7879
|

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowDispatch.qll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ class ParamReturnKind extends ReturnKind, TParamReturnKind {
3737

3838
ParamReturnKind() { this = TParamReturnKind(index) }
3939

40-
int getIndex() {
41-
result = index
42-
}
40+
int getIndex() { result = index }
4341

4442
override string toString() { result = "param(" + index + ")" }
4543
}
@@ -51,9 +49,8 @@ class ParamReturnKind extends ReturnKind, TParamReturnKind {
5149
class DataFlowCallable extends TDataFlowCallable {
5250
AbstractFunctionDecl func;
5351

54-
DataFlowCallable() {
55-
this = TDataFlowFunc(func)
56-
}
52+
DataFlowCallable() { this = TDataFlowFunc(func) }
53+
5754
/** Gets a textual representation of this callable. */
5855
string toString() { result = func.toString() }
5956

swift/ql/lib/codeql/swift/dataflow/internal/DataFlowPublic.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ class SsaDefinitionNode extends Node, TSsaDefinitionNode {
8282
}
8383

8484
class InoutReturnNode extends Node instanceof InoutReturnNodeImpl {
85-
8685
ParamDecl getParameter() { result = super.getParameter() }
87-
8886
}
8987

9088
/**
Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
private import codeql.swift.generated.decl.ParamDecl
22
private import codeql.swift.elements.decl.AbstractFunctionDecl
33

4-
class ParamDecl extends ParamDeclBase {
4+
class ParamDecl extends ParamDeclBase {
55
/** Gets the function which declares this parameter. */
6-
AbstractFunctionDecl getDeclaringFunction() {
7-
result.getAParam() = this
8-
}
6+
AbstractFunctionDecl getDeclaringFunction() { result.getAParam() = this }
97

108
/** Gets the index of this parameter in its declaring function's parameter list. */
11-
int getIndex() {
12-
exists(AbstractFunctionDecl func |
13-
func.getParam(result) = this
14-
)
15-
}
9+
int getIndex() { exists(AbstractFunctionDecl func | func.getParam(result) = this) }
1610
}

swift/ql/test/library-tests/dataflow/dataflow/DataFlow.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
22
* @kind path-problem
33
*/
4+
45
import swift
56
import codeql.swift.dataflow.DataFlow
67
import DataFlow::PathGraph

0 commit comments

Comments
 (0)