Skip to content

Commit c785cd9

Browse files
committed
Swift: Revert Impl rename for manually added files
1 parent 4ab5a1a commit c785cd9

13 files changed

+55
-51
lines changed

swift/ql/lib/codeql/swift/elements/decl/ClassOrStructDeclImpl.qll renamed to swift/ql/lib/codeql/swift/elements/decl/ClassOrStructDecl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ private import codeql.swift.elements.decl.NominalTypeDecl
1414
* }
1515
* ```
1616
*/
17-
class ClassOrStructDecl extends NominalTypeDecl {
17+
final class ClassOrStructDecl extends NominalTypeDecl {
1818
ClassOrStructDecl() {
1919
this instanceof ClassDecl
2020
or

swift/ql/lib/codeql/swift/elements/decl/MethodImpl.qll renamed to swift/ql/lib/codeql/swift/elements/decl/Method.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ private Decl getAMember(Decl ctx) {
1212
/**
1313
* A function that is a member of a class, struct, enum or protocol.
1414
*/
15-
class Method extends Function {
15+
final class Method extends Function {
1616
Method() {
1717
this = getAMember(any(ClassDecl c))
1818
or

swift/ql/lib/codeql/swift/elements/expr/ArithmeticOperationImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/ArithmeticOperation.qll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private import codeql.swift.elements.expr.DotSyntaxCallExpr
99
* a + b
1010
* ```
1111
*/
12-
class ArithmeticOperation extends Expr {
12+
final class ArithmeticOperation extends Expr {
1313
ArithmeticOperation() {
1414
this instanceof BinaryArithmeticOperation or
1515
this instanceof UnaryArithmeticOperation
@@ -31,7 +31,7 @@ class ArithmeticOperation extends Expr {
3131
* a + b
3232
* ```
3333
*/
34-
class BinaryArithmeticOperation extends BinaryExpr {
34+
final class BinaryArithmeticOperation extends BinaryExpr {
3535
BinaryArithmeticOperation() {
3636
this instanceof AddExpr or
3737
this instanceof SubExpr or
@@ -48,7 +48,7 @@ class BinaryArithmeticOperation extends BinaryExpr {
4848
* a &+ b
4949
* ```
5050
*/
51-
class AddExpr extends BinaryExpr {
51+
final class AddExpr extends BinaryExpr {
5252
AddExpr() { this.getStaticTarget().getName() = ["+(_:_:)", "&+(_:_:)"] }
5353
}
5454

@@ -59,7 +59,7 @@ class AddExpr extends BinaryExpr {
5959
* a &- b
6060
* ```
6161
*/
62-
class SubExpr extends BinaryExpr {
62+
final class SubExpr extends BinaryExpr {
6363
SubExpr() { this.getStaticTarget().getName() = ["-(_:_:)", "&-(_:_:)"] }
6464
}
6565

@@ -70,7 +70,7 @@ class SubExpr extends BinaryExpr {
7070
* a &* b
7171
* ```
7272
*/
73-
class MulExpr extends BinaryExpr {
73+
final class MulExpr extends BinaryExpr {
7474
MulExpr() { this.getStaticTarget().getName() = ["*(_:_:)", "&*(_:_:)"] }
7575
}
7676

@@ -80,7 +80,7 @@ class MulExpr extends BinaryExpr {
8080
* a / b
8181
* ```
8282
*/
83-
class DivExpr extends BinaryExpr {
83+
final class DivExpr extends BinaryExpr {
8484
DivExpr() { this.getStaticTarget().getName() = "/(_:_:)" }
8585
}
8686

@@ -90,7 +90,7 @@ class DivExpr extends BinaryExpr {
9090
* a % b
9191
* ```
9292
*/
93-
class RemExpr extends BinaryExpr {
93+
final class RemExpr extends BinaryExpr {
9494
RemExpr() { this.getStaticTarget().getName() = "%(_:_:)" }
9595
}
9696

@@ -100,7 +100,7 @@ class RemExpr extends BinaryExpr {
100100
* -a
101101
* ```
102102
*/
103-
class UnaryArithmeticOperation extends PrefixUnaryExpr {
103+
final class UnaryArithmeticOperation extends PrefixUnaryExpr {
104104
UnaryArithmeticOperation() {
105105
this instanceof UnaryMinusExpr or
106106
this instanceof UnaryPlusExpr
@@ -113,7 +113,7 @@ class UnaryArithmeticOperation extends PrefixUnaryExpr {
113113
* -a
114114
* ```
115115
*/
116-
class UnaryMinusExpr extends PrefixUnaryExpr {
116+
final class UnaryMinusExpr extends PrefixUnaryExpr {
117117
UnaryMinusExpr() { this.getStaticTarget().getName() = "-(_:)" }
118118
}
119119

@@ -123,6 +123,6 @@ class UnaryMinusExpr extends PrefixUnaryExpr {
123123
* +a
124124
* ```
125125
*/
126-
class UnaryPlusExpr extends PrefixUnaryExpr {
126+
final class UnaryPlusExpr extends PrefixUnaryExpr {
127127
UnaryPlusExpr() { this.getStaticTarget().getName() = "+(_:)" }
128128
}

swift/ql/lib/codeql/swift/elements/expr/BitwiseOperationImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/BitwiseOperation.qll

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ private import codeql.swift.elements.expr.PrefixUnaryExpr
1010
* ~a
1111
* ```
1212
*/
13-
class BitwiseOperation extends Expr {
13+
final class BitwiseOperation extends Expr {
1414
BitwiseOperation() {
1515
this instanceof BinaryBitwiseOperation or
1616
this instanceof UnaryBitwiseOperation
@@ -33,7 +33,7 @@ class BitwiseOperation extends Expr {
3333
* a .^ b
3434
* ```
3535
*/
36-
class BinaryBitwiseOperation extends BinaryExpr {
36+
final class BinaryBitwiseOperation extends BinaryExpr {
3737
BinaryBitwiseOperation() {
3838
this instanceof AndBitwiseExpr or
3939
this instanceof OrBitwiseExpr or
@@ -52,7 +52,7 @@ class BinaryBitwiseOperation extends BinaryExpr {
5252
* a & b
5353
* ```
5454
*/
55-
class AndBitwiseExpr extends BinaryExpr {
55+
final class AndBitwiseExpr extends BinaryExpr {
5656
AndBitwiseExpr() { this.getStaticTarget().getName() = "&(_:_:)" }
5757
}
5858

@@ -62,7 +62,7 @@ class AndBitwiseExpr extends BinaryExpr {
6262
* a | b
6363
* ```
6464
*/
65-
class OrBitwiseExpr extends BinaryExpr {
65+
final class OrBitwiseExpr extends BinaryExpr {
6666
OrBitwiseExpr() { this.getStaticTarget().getName() = "|(_:_:)" }
6767
}
6868

@@ -72,7 +72,7 @@ class OrBitwiseExpr extends BinaryExpr {
7272
* a ^ b
7373
* ```
7474
*/
75-
class XorBitwiseExpr extends BinaryExpr {
75+
final class XorBitwiseExpr extends BinaryExpr {
7676
XorBitwiseExpr() { this.getStaticTarget().getName() = "^(_:_:)" }
7777
}
7878

@@ -82,7 +82,7 @@ class XorBitwiseExpr extends BinaryExpr {
8282
* a .& b
8383
* ```
8484
*/
85-
class PointwiseAndExpr extends BinaryExpr {
85+
final class PointwiseAndExpr extends BinaryExpr {
8686
PointwiseAndExpr() { this.getOperator().getName() = ".&(_:_:)" }
8787
}
8888

@@ -92,7 +92,7 @@ class PointwiseAndExpr extends BinaryExpr {
9292
* a .| b
9393
* ```
9494
*/
95-
class PointwiseOrExpr extends BinaryExpr {
95+
final class PointwiseOrExpr extends BinaryExpr {
9696
PointwiseOrExpr() { this.getOperator().getName() = ".|(_:_:)" }
9797
}
9898

@@ -102,7 +102,7 @@ class PointwiseOrExpr extends BinaryExpr {
102102
* a .^ b
103103
* ```
104104
*/
105-
class PointwiseXorExpr extends BinaryExpr {
105+
final class PointwiseXorExpr extends BinaryExpr {
106106
PointwiseXorExpr() { this.getOperator().getName() = ".^(_:_:)" }
107107
}
108108

@@ -113,7 +113,7 @@ class PointwiseXorExpr extends BinaryExpr {
113113
* a &<<
114114
* ```
115115
*/
116-
class ShiftLeftBitwiseExpr extends BinaryExpr {
116+
final class ShiftLeftBitwiseExpr extends BinaryExpr {
117117
ShiftLeftBitwiseExpr() { this.getStaticTarget().getName() = ["<<(_:_:)", "&<<(_:_:)"] }
118118
}
119119

@@ -124,7 +124,7 @@ class ShiftLeftBitwiseExpr extends BinaryExpr {
124124
* a &>>
125125
* ```
126126
*/
127-
class ShiftRightBitwiseExpr extends BinaryExpr {
127+
final class ShiftRightBitwiseExpr extends BinaryExpr {
128128
ShiftRightBitwiseExpr() { this.getStaticTarget().getName() = [">>(_:_:)", "&>>(_:_:)"] }
129129
}
130130

@@ -134,14 +134,14 @@ class ShiftRightBitwiseExpr extends BinaryExpr {
134134
* ~a
135135
* ```
136136
*/
137-
class UnaryBitwiseOperation extends PrefixUnaryExpr instanceof NotBitwiseExpr { }
137+
final class UnaryBitwiseOperation extends PrefixUnaryExpr instanceof NotBitwiseExpr { }
138138

139139
/**
140140
* A bitwise NOT expression.
141141
* ```
142142
* ~a
143143
* ```
144144
*/
145-
class NotBitwiseExpr extends PrefixUnaryExpr {
145+
final class NotBitwiseExpr extends PrefixUnaryExpr {
146146
NotBitwiseExpr() { this.getStaticTarget().getName() = "~(_:)" }
147147
}

swift/ql/lib/codeql/swift/elements/expr/EnumElementExprImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/EnumElementExpr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private import codeql.swift.elements.decl.EnumElementDecl
1919
* ...
2020
* ```
2121
*/
22-
class EnumElementExpr extends Expr {
22+
final class EnumElementExpr extends Expr {
2323
EnumElementDecl decl;
2424

2525
EnumElementExpr() {

swift/ql/lib/codeql/swift/elements/expr/InitializerCallExprImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/InitializerCallExpr.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ private import codeql.swift.elements.expr.MethodCallExpr
22
private import codeql.swift.elements.expr.InitializerLookupExpr
33
private import codeql.swift.elements.decl.Initializer
44

5-
class InitializerCallExpr extends MethodCallExpr {
5+
final class InitializerCallExpr extends MethodCallExpr {
66
InitializerCallExpr() { this.getFunction() instanceof InitializerLookupExpr }
77

8-
override Initializer getStaticTarget() { result = super.getStaticTarget() }
8+
Initializer getStaticTarget() { result = super.getStaticTarget() }
99
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
private import codeql.swift.elements.expr.MethodLookupExpr
2+
private import codeql.swift.elements.expr.MethodLookupExprImpl::Impl as Impl
3+
private import codeql.swift.elements.decl.Initializer
4+
5+
final private class InitializerLookupExprImpl extends Impl::MethodLookupExpr {
6+
InitializerLookupExprImpl() { super.getMethod() instanceof Initializer }
7+
8+
override string toString() { result = this.getMember().toString() }
9+
}
10+
11+
final class InitializerLookupExpr extends MethodLookupExpr, InitializerLookupExprImpl {
12+
Initializer getMethod() { result = super.getMethod() }
13+
}

swift/ql/lib/codeql/swift/elements/expr/InitializerLookupExprImpl.qll

Lines changed: 0 additions & 10 deletions
This file was deleted.

swift/ql/lib/codeql/swift/elements/expr/LogicalOperationImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/LogicalOperation.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ private predicate unaryHasName(PrefixUnaryExpr e, string name) {
1010

1111
private predicate binaryHasName(BinaryExpr e, string name) { e.getStaticTarget().getName() = name }
1212

13-
class LogicalAndExpr extends BinaryExpr {
13+
final class LogicalAndExpr extends BinaryExpr {
1414
LogicalAndExpr() { binaryHasName(this, "&&(_:_:)") }
1515
}
1616

17-
class LogicalOrExpr extends BinaryExpr {
17+
final class LogicalOrExpr extends BinaryExpr {
1818
LogicalOrExpr() { binaryHasName(this, "||(_:_:)") }
1919
}
2020

21-
class BinaryLogicalOperation extends BinaryExpr {
21+
final class BinaryLogicalOperation extends BinaryExpr {
2222
BinaryLogicalOperation() {
2323
this instanceof LogicalAndExpr or
2424
this instanceof LogicalOrExpr
2525
}
2626
}
2727

28-
class NotExpr extends PrefixUnaryExpr {
28+
final class NotExpr extends PrefixUnaryExpr {
2929
NotExpr() { unaryHasName(this, "!(_:)") }
3030
}
3131

32-
class UnaryLogicalOperation extends PrefixUnaryExpr instanceof NotExpr { }
32+
final class UnaryLogicalOperation extends PrefixUnaryExpr instanceof NotExpr { }
3333

34-
class LogicalOperation extends Expr {
34+
final class LogicalOperation extends Expr {
3535
LogicalOperation() {
3636
this instanceof BinaryLogicalOperation or
3737
this instanceof UnaryLogicalOperation

swift/ql/lib/codeql/swift/elements/expr/MethodCallExprImpl.qll renamed to swift/ql/lib/codeql/swift/elements/expr/MethodCallExpr.qll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
private import ApplyExprExt
12
private import codeql.swift.elements.expr.CallExpr
23
private import codeql.swift.elements.expr.ApplyExpr
34
private import codeql.swift.elements.expr.SuperRefExpr
45
private import codeql.swift.elements.expr.SelfRefExpr
56

6-
class MethodCallExpr extends CallExpr, MethodApplyExpr {
7+
final class MethodCallExpr extends CallExpr, MethodApplyExpr {
78
predicate isSelfCall() { this.getQualifier() instanceof SelfRefExpr }
89

910
predicate isSuperCall() { this.getQualifier() instanceof SuperRefExpr }

0 commit comments

Comments
 (0)