Skip to content

Commit b0668ee

Browse files
committed
Swift: remove unused decl properties
1 parent 553930d commit b0668ee

File tree

5 files changed

+4
-24
lines changed

5 files changed

+4
-24
lines changed

swift/codegen/schema.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,6 @@ BoundGenericStructType:
898898

899899
ClassType:
900900
_extends: NominalType
901-
decl: ClassDecl
902901

903902
EnumType:
904903
_extends: NominalType
@@ -908,7 +907,6 @@ ProtocolType:
908907

909908
StructType:
910909
_extends: NominalType
911-
decl: StructDecl
912910

913911
ArraySliceType:
914912
_extends: UnarySyntaxSugarType

swift/extractor/visitors/TypeVisitor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ class TypeVisitor : public TypeVisitorBase<TypeVisitor> {
2828

2929
void visitStructType(swift::StructType* type) {
3030
auto label = dispatcher_.assignNewLabel(type);
31-
dispatcher_.emit(StructTypesTrap{label, dispatcher_.fetchLabel(type->getDecl())});
31+
dispatcher_.emit(StructTypesTrap{label});
3232
emitAnyGenericType(type, label);
3333
}
3434

3535
void visitClassType(swift::ClassType* type) {
3636
auto label = dispatcher_.assignNewLabel(type);
37-
dispatcher_.emit(ClassTypesTrap{label, dispatcher_.fetchLabel(type->getDecl())});
37+
dispatcher_.emit(ClassTypesTrap{label});
3838
emitAnyGenericType(type, label);
3939
}
4040

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
// generated by codegen/codegen.py
2-
import codeql.swift.elements.decl.ClassDecl
32
import codeql.swift.elements.type.NominalType
43

54
class ClassTypeBase extends @class_type, NominalType {
65
override string getAPrimaryQlClass() { result = "ClassType" }
7-
8-
ClassDecl getDecl() {
9-
exists(ClassDecl x |
10-
class_types(this, x) and
11-
result = x.resolve()
12-
)
13-
}
146
}
Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
// generated by codegen/codegen.py
22
import codeql.swift.elements.type.NominalType
3-
import codeql.swift.elements.decl.StructDecl
43

54
class StructTypeBase extends @struct_type, NominalType {
65
override string getAPrimaryQlClass() { result = "StructType" }
7-
8-
StructDecl getDecl() {
9-
exists(StructDecl x |
10-
struct_types(this, x) and
11-
result = x.resolve()
12-
)
13-
}
146
}

swift/ql/lib/swift.dbscheme

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,8 +1774,7 @@ bound_generic_struct_types(
17741774
);
17751775

17761776
class_types(
1777-
unique int id: @class_type,
1778-
int decl: @class_decl ref
1777+
unique int id: @class_type
17791778
);
17801779

17811780
enum_types(
@@ -1787,8 +1786,7 @@ protocol_types(
17871786
);
17881787

17891788
struct_types(
1790-
unique int id: @struct_type,
1791-
int decl: @struct_decl ref
1789+
unique int id: @struct_type
17921790
);
17931791

17941792
array_slice_types(

0 commit comments

Comments
 (0)