Skip to content

Commit 13fe02e

Browse files
committed
Swift: NestedArchetypeType was removed
1 parent 61d5cdc commit 13fe02e

File tree

15 files changed

+1221
-132
lines changed

15 files changed

+1221
-132
lines changed

swift/codegen/schema.yml

Lines changed: 1218 additions & 0 deletions
Large diffs are not rendered by default.

swift/extractor/visitors/TypeVisitor.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,6 @@ void TypeVisitor::emitAnyGenericType(swift::AnyGenericType* type,
234234
}
235235
}
236236

237-
codeql::NestedArchetypeType TypeVisitor::translateNestedArchetypeType(
238-
const swift::NestedArchetypeType& type) {
239-
auto entry = createTypeEntry(type);
240-
entry.parent = dispatcher_.fetchLabel(type.getParent());
241-
entry.associated_type_declaration = dispatcher_.fetchLabel(type.getAssocType());
242-
fillArchetypeType(type, entry);
243-
return entry;
244-
}
245-
246237
void TypeVisitor::fillType(const swift::TypeBase& type, codeql::Type& entry) {
247238
entry.name = type.getString();
248239
entry.canonical_type = dispatcher_.fetchLabel(type.getCanonicalType());

swift/extractor/visitors/TypeVisitor.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class TypeVisitor : public TypeVisitorBase<TypeVisitor> {
3939
void visitBoundGenericType(swift::BoundGenericType* type);
4040
codeql::PrimaryArchetypeType translatePrimaryArchetypeType(
4141
const swift::PrimaryArchetypeType& type);
42-
codeql::NestedArchetypeType translateNestedArchetypeType(const swift::NestedArchetypeType& type);
4342
codeql::ExistentialType translateExistentialType(const swift::ExistentialType& type);
4443
codeql::DynamicSelfType translateDynamicSelfType(const swift::DynamicSelfType& type);
4544
codeql::VariadicSequenceType translateVariadicSequenceType(

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ import codeql.swift.elements.type.InOutType
254254
import codeql.swift.elements.type.LValueType
255255
import codeql.swift.elements.type.MetatypeType
256256
import codeql.swift.elements.type.ModuleType
257-
import codeql.swift.elements.type.NestedArchetypeType
258257
import codeql.swift.elements.type.NominalOrBoundGenericNominalType
259258
import codeql.swift.elements.type.NominalType
260259
import codeql.swift.elements.type.OpaqueTypeArchetypeType

swift/ql/lib/codeql/swift/elements/type/NestedArchetypeType.qll

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

swift/ql/lib/codeql/swift/elements/type/NestedArchetypeTypeConstructor.qll

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

swift/ql/lib/codeql/swift/generated/ParentChild.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4526,22 +4526,6 @@ private module Impl {
45264526
)
45274527
}
45284528

4529-
private Element getImmediateChildOfNestedArchetypeType(
4530-
NestedArchetypeType e, int index, string partialPredicateCall
4531-
) {
4532-
exists(int b, int bArchetypeType, int n |
4533-
b = 0 and
4534-
bArchetypeType =
4535-
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfArchetypeType(e, i, _)) | i) and
4536-
n = bArchetypeType and
4537-
(
4538-
none()
4539-
or
4540-
result = getImmediateChildOfArchetypeType(e, index - b, partialPredicateCall)
4541-
)
4542-
)
4543-
}
4544-
45454529
private Element getImmediateChildOfNominalType(
45464530
NominalType e, int index, string partialPredicateCall
45474531
) {
@@ -5240,8 +5224,6 @@ private module Impl {
52405224
or
52415225
result = getImmediateChildOfDictionaryType(e, index, partialAccessor)
52425226
or
5243-
result = getImmediateChildOfNestedArchetypeType(e, index, partialAccessor)
5244-
or
52455227
result = getImmediateChildOfOpaqueTypeArchetypeType(e, index, partialAccessor)
52465228
or
52475229
result = getImmediateChildOfOpenedArchetypeType(e, index, partialAccessor)

swift/ql/lib/codeql/swift/generated/Raw.qll

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,14 +1437,6 @@ module Raw {
14371437
Type getValueType() { dictionary_types(this, _, result) }
14381438
}
14391439

1440-
class NestedArchetypeType extends @nested_archetype_type, ArchetypeType {
1441-
override string toString() { result = "NestedArchetypeType" }
1442-
1443-
ArchetypeType getParent() { nested_archetype_types(this, result, _) }
1444-
1445-
AssociatedTypeDecl getAssociatedTypeDeclaration() { nested_archetype_types(this, _, result) }
1446-
}
1447-
14481440
class NominalType extends @nominal_type, NominalOrBoundGenericNominalType { }
14491441

14501442
class OpaqueTypeArchetypeType extends @opaque_type_archetype_type, ArchetypeType {

swift/ql/lib/codeql/swift/generated/Synth.qll

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ module Synth {
277277
TLValueType(Raw::LValueType id) { constructLValueType(id) } or
278278
TMetatypeType(Raw::MetatypeType id) { constructMetatypeType(id) } or
279279
TModuleType(Raw::ModuleType id) { constructModuleType(id) } or
280-
TNestedArchetypeType(Raw::NestedArchetypeType id) { constructNestedArchetypeType(id) } or
281280
TOpaqueTypeArchetypeType(Raw::OpaqueTypeArchetypeType id) {
282281
constructOpaqueTypeArchetypeType(id)
283282
} or
@@ -441,8 +440,8 @@ module Synth {
441440
class TAnyMetatypeType = TExistentialMetatypeType or TMetatypeType;
442441

443442
class TArchetypeType =
444-
TNestedArchetypeType or TOpaqueTypeArchetypeType or TOpenedArchetypeType or
445-
TPrimaryArchetypeType or TSequenceArchetypeType;
443+
TOpaqueTypeArchetypeType or TOpenedArchetypeType or TPrimaryArchetypeType or
444+
TSequenceArchetypeType;
446445

447446
class TBoundGenericType =
448447
TBoundGenericClassType or TBoundGenericEnumType or TBoundGenericStructType;
@@ -1285,11 +1284,6 @@ module Synth {
12851284
cached
12861285
TModuleType convertModuleTypeFromRaw(Raw::Element e) { result = TModuleType(e) }
12871286

1288-
cached
1289-
TNestedArchetypeType convertNestedArchetypeTypeFromRaw(Raw::Element e) {
1290-
result = TNestedArchetypeType(e)
1291-
}
1292-
12931287
cached
12941288
TOpaqueTypeArchetypeType convertOpaqueTypeArchetypeTypeFromRaw(Raw::Element e) {
12951289
result = TOpaqueTypeArchetypeType(e)
@@ -2000,8 +1994,6 @@ module Synth {
20001994

20011995
cached
20021996
TArchetypeType convertArchetypeTypeFromRaw(Raw::Element e) {
2003-
result = convertNestedArchetypeTypeFromRaw(e)
2004-
or
20051997
result = convertOpaqueTypeArchetypeTypeFromRaw(e)
20061998
or
20071999
result = convertOpenedArchetypeTypeFromRaw(e)
@@ -2961,11 +2953,6 @@ module Synth {
29612953
cached
29622954
Raw::Element convertModuleTypeToRaw(TModuleType e) { e = TModuleType(result) }
29632955

2964-
cached
2965-
Raw::Element convertNestedArchetypeTypeToRaw(TNestedArchetypeType e) {
2966-
e = TNestedArchetypeType(result)
2967-
}
2968-
29692956
cached
29702957
Raw::Element convertOpaqueTypeArchetypeTypeToRaw(TOpaqueTypeArchetypeType e) {
29712958
e = TOpaqueTypeArchetypeType(result)
@@ -3676,8 +3663,6 @@ module Synth {
36763663

36773664
cached
36783665
Raw::Element convertArchetypeTypeToRaw(TArchetypeType e) {
3679-
result = convertNestedArchetypeTypeToRaw(e)
3680-
or
36813666
result = convertOpaqueTypeArchetypeTypeToRaw(e)
36823667
or
36833668
result = convertOpenedArchetypeTypeToRaw(e)

swift/ql/lib/codeql/swift/generated/SynthConstructors.qll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ import codeql.swift.elements.type.InOutTypeConstructor
205205
import codeql.swift.elements.type.LValueTypeConstructor
206206
import codeql.swift.elements.type.MetatypeTypeConstructor
207207
import codeql.swift.elements.type.ModuleTypeConstructor
208-
import codeql.swift.elements.type.NestedArchetypeTypeConstructor
209208
import codeql.swift.elements.type.OpaqueTypeArchetypeTypeConstructor
210209
import codeql.swift.elements.type.OpenedArchetypeTypeConstructor
211210
import codeql.swift.elements.type.OptionalTypeConstructor

0 commit comments

Comments
 (0)