mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Swift: NestedArchetypeType was removed
This commit is contained in:
1218
swift/codegen/schema.yml
Normal file
1218
swift/codegen/schema.yml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -234,15 +234,6 @@ void TypeVisitor::emitAnyGenericType(swift::AnyGenericType* type,
|
||||
}
|
||||
}
|
||||
|
||||
codeql::NestedArchetypeType TypeVisitor::translateNestedArchetypeType(
|
||||
const swift::NestedArchetypeType& type) {
|
||||
auto entry = createTypeEntry(type);
|
||||
entry.parent = dispatcher_.fetchLabel(type.getParent());
|
||||
entry.associated_type_declaration = dispatcher_.fetchLabel(type.getAssocType());
|
||||
fillArchetypeType(type, entry);
|
||||
return entry;
|
||||
}
|
||||
|
||||
void TypeVisitor::fillType(const swift::TypeBase& type, codeql::Type& entry) {
|
||||
entry.name = type.getString();
|
||||
entry.canonical_type = dispatcher_.fetchLabel(type.getCanonicalType());
|
||||
|
||||
@@ -39,7 +39,6 @@ class TypeVisitor : public TypeVisitorBase<TypeVisitor> {
|
||||
void visitBoundGenericType(swift::BoundGenericType* type);
|
||||
codeql::PrimaryArchetypeType translatePrimaryArchetypeType(
|
||||
const swift::PrimaryArchetypeType& type);
|
||||
codeql::NestedArchetypeType translateNestedArchetypeType(const swift::NestedArchetypeType& type);
|
||||
codeql::ExistentialType translateExistentialType(const swift::ExistentialType& type);
|
||||
codeql::DynamicSelfType translateDynamicSelfType(const swift::DynamicSelfType& type);
|
||||
codeql::VariadicSequenceType translateVariadicSequenceType(
|
||||
|
||||
@@ -254,7 +254,6 @@ import codeql.swift.elements.type.InOutType
|
||||
import codeql.swift.elements.type.LValueType
|
||||
import codeql.swift.elements.type.MetatypeType
|
||||
import codeql.swift.elements.type.ModuleType
|
||||
import codeql.swift.elements.type.NestedArchetypeType
|
||||
import codeql.swift.elements.type.NominalOrBoundGenericNominalType
|
||||
import codeql.swift.elements.type.NominalType
|
||||
import codeql.swift.elements.type.OpaqueTypeArchetypeType
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
|
||||
private import codeql.swift.generated.type.NestedArchetypeType
|
||||
|
||||
class NestedArchetypeType extends NestedArchetypeTypeBase { }
|
||||
@@ -1,4 +0,0 @@
|
||||
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
|
||||
private import codeql.swift.generated.Raw
|
||||
|
||||
predicate constructNestedArchetypeType(Raw::NestedArchetypeType id) { any() }
|
||||
@@ -4526,22 +4526,6 @@ private module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfNestedArchetypeType(
|
||||
NestedArchetypeType e, int index, string partialPredicateCall
|
||||
) {
|
||||
exists(int b, int bArchetypeType, int n |
|
||||
b = 0 and
|
||||
bArchetypeType =
|
||||
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfArchetypeType(e, i, _)) | i) and
|
||||
n = bArchetypeType and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfArchetypeType(e, index - b, partialPredicateCall)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfNominalType(
|
||||
NominalType e, int index, string partialPredicateCall
|
||||
) {
|
||||
@@ -5240,8 +5224,6 @@ private module Impl {
|
||||
or
|
||||
result = getImmediateChildOfDictionaryType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfNestedArchetypeType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfOpaqueTypeArchetypeType(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfOpenedArchetypeType(e, index, partialAccessor)
|
||||
|
||||
@@ -1437,14 +1437,6 @@ module Raw {
|
||||
Type getValueType() { dictionary_types(this, _, result) }
|
||||
}
|
||||
|
||||
class NestedArchetypeType extends @nested_archetype_type, ArchetypeType {
|
||||
override string toString() { result = "NestedArchetypeType" }
|
||||
|
||||
ArchetypeType getParent() { nested_archetype_types(this, result, _) }
|
||||
|
||||
AssociatedTypeDecl getAssociatedTypeDeclaration() { nested_archetype_types(this, _, result) }
|
||||
}
|
||||
|
||||
class NominalType extends @nominal_type, NominalOrBoundGenericNominalType { }
|
||||
|
||||
class OpaqueTypeArchetypeType extends @opaque_type_archetype_type, ArchetypeType {
|
||||
|
||||
@@ -277,7 +277,6 @@ module Synth {
|
||||
TLValueType(Raw::LValueType id) { constructLValueType(id) } or
|
||||
TMetatypeType(Raw::MetatypeType id) { constructMetatypeType(id) } or
|
||||
TModuleType(Raw::ModuleType id) { constructModuleType(id) } or
|
||||
TNestedArchetypeType(Raw::NestedArchetypeType id) { constructNestedArchetypeType(id) } or
|
||||
TOpaqueTypeArchetypeType(Raw::OpaqueTypeArchetypeType id) {
|
||||
constructOpaqueTypeArchetypeType(id)
|
||||
} or
|
||||
@@ -441,8 +440,8 @@ module Synth {
|
||||
class TAnyMetatypeType = TExistentialMetatypeType or TMetatypeType;
|
||||
|
||||
class TArchetypeType =
|
||||
TNestedArchetypeType or TOpaqueTypeArchetypeType or TOpenedArchetypeType or
|
||||
TPrimaryArchetypeType or TSequenceArchetypeType;
|
||||
TOpaqueTypeArchetypeType or TOpenedArchetypeType or TPrimaryArchetypeType or
|
||||
TSequenceArchetypeType;
|
||||
|
||||
class TBoundGenericType =
|
||||
TBoundGenericClassType or TBoundGenericEnumType or TBoundGenericStructType;
|
||||
@@ -1285,11 +1284,6 @@ module Synth {
|
||||
cached
|
||||
TModuleType convertModuleTypeFromRaw(Raw::Element e) { result = TModuleType(e) }
|
||||
|
||||
cached
|
||||
TNestedArchetypeType convertNestedArchetypeTypeFromRaw(Raw::Element e) {
|
||||
result = TNestedArchetypeType(e)
|
||||
}
|
||||
|
||||
cached
|
||||
TOpaqueTypeArchetypeType convertOpaqueTypeArchetypeTypeFromRaw(Raw::Element e) {
|
||||
result = TOpaqueTypeArchetypeType(e)
|
||||
@@ -2000,8 +1994,6 @@ module Synth {
|
||||
|
||||
cached
|
||||
TArchetypeType convertArchetypeTypeFromRaw(Raw::Element e) {
|
||||
result = convertNestedArchetypeTypeFromRaw(e)
|
||||
or
|
||||
result = convertOpaqueTypeArchetypeTypeFromRaw(e)
|
||||
or
|
||||
result = convertOpenedArchetypeTypeFromRaw(e)
|
||||
@@ -2961,11 +2953,6 @@ module Synth {
|
||||
cached
|
||||
Raw::Element convertModuleTypeToRaw(TModuleType e) { e = TModuleType(result) }
|
||||
|
||||
cached
|
||||
Raw::Element convertNestedArchetypeTypeToRaw(TNestedArchetypeType e) {
|
||||
e = TNestedArchetypeType(result)
|
||||
}
|
||||
|
||||
cached
|
||||
Raw::Element convertOpaqueTypeArchetypeTypeToRaw(TOpaqueTypeArchetypeType e) {
|
||||
e = TOpaqueTypeArchetypeType(result)
|
||||
@@ -3676,8 +3663,6 @@ module Synth {
|
||||
|
||||
cached
|
||||
Raw::Element convertArchetypeTypeToRaw(TArchetypeType e) {
|
||||
result = convertNestedArchetypeTypeToRaw(e)
|
||||
or
|
||||
result = convertOpaqueTypeArchetypeTypeToRaw(e)
|
||||
or
|
||||
result = convertOpenedArchetypeTypeToRaw(e)
|
||||
|
||||
@@ -205,7 +205,6 @@ import codeql.swift.elements.type.InOutTypeConstructor
|
||||
import codeql.swift.elements.type.LValueTypeConstructor
|
||||
import codeql.swift.elements.type.MetatypeTypeConstructor
|
||||
import codeql.swift.elements.type.ModuleTypeConstructor
|
||||
import codeql.swift.elements.type.NestedArchetypeTypeConstructor
|
||||
import codeql.swift.elements.type.OpaqueTypeArchetypeTypeConstructor
|
||||
import codeql.swift.elements.type.OpenedArchetypeTypeConstructor
|
||||
import codeql.swift.elements.type.OptionalTypeConstructor
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
private import codeql.swift.generated.Synth
|
||||
private import codeql.swift.generated.Raw
|
||||
import codeql.swift.elements.type.ArchetypeType
|
||||
import codeql.swift.elements.decl.AssociatedTypeDecl
|
||||
|
||||
class NestedArchetypeTypeBase extends Synth::TNestedArchetypeType, ArchetypeType {
|
||||
override string getAPrimaryQlClass() { result = "NestedArchetypeType" }
|
||||
|
||||
ArchetypeType getImmediateParent() {
|
||||
result =
|
||||
Synth::convertArchetypeTypeFromRaw(Synth::convertNestedArchetypeTypeToRaw(this)
|
||||
.(Raw::NestedArchetypeType)
|
||||
.getParent())
|
||||
}
|
||||
|
||||
final ArchetypeType getParent() { result = getImmediateParent().resolve() }
|
||||
|
||||
AssociatedTypeDecl getImmediateAssociatedTypeDeclaration() {
|
||||
result =
|
||||
Synth::convertAssociatedTypeDeclFromRaw(Synth::convertNestedArchetypeTypeToRaw(this)
|
||||
.(Raw::NestedArchetypeType)
|
||||
.getAssociatedTypeDeclaration())
|
||||
}
|
||||
|
||||
final AssociatedTypeDecl getAssociatedTypeDeclaration() {
|
||||
result = getImmediateAssociatedTypeDeclaration().resolve()
|
||||
}
|
||||
}
|
||||
@@ -2007,8 +2007,7 @@ unresolved_types( //dir=type
|
||||
;
|
||||
|
||||
@archetype_type =
|
||||
@nested_archetype_type
|
||||
| @opaque_type_archetype_type
|
||||
@opaque_type_archetype_type
|
||||
| @opened_archetype_type
|
||||
| @primary_archetype_type
|
||||
| @sequence_archetype_type
|
||||
@@ -2169,12 +2168,6 @@ dictionary_types( //dir=type
|
||||
int value_type: @type ref
|
||||
);
|
||||
|
||||
nested_archetype_types( //dir=type
|
||||
unique int id: @nested_archetype_type,
|
||||
int parent: @archetype_type ref,
|
||||
int associated_type_declaration: @associated_type_decl ref
|
||||
);
|
||||
|
||||
@nominal_type =
|
||||
@class_type
|
||||
| @enum_type
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from
|
||||
NestedArchetypeType x, string getName, Type getCanonicalType, Type getInterfaceType,
|
||||
ArchetypeType getParent, AssociatedTypeDecl getAssociatedTypeDeclaration
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
getName = x.getName() and
|
||||
getCanonicalType = x.getCanonicalType() and
|
||||
getInterfaceType = x.getInterfaceType() and
|
||||
getParent = x.getParent() and
|
||||
getAssociatedTypeDeclaration = x.getAssociatedTypeDeclaration()
|
||||
select x, "getName:", getName, "getCanonicalType:", getCanonicalType, "getInterfaceType:",
|
||||
getInterfaceType, "getParent:", getParent, "getAssociatedTypeDeclaration:",
|
||||
getAssociatedTypeDeclaration
|
||||
@@ -1,7 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from NestedArchetypeType x, int index
|
||||
where toBeTested(x) and not x.isUnknown()
|
||||
select x, index, x.getProtocol(index)
|
||||
@@ -1,7 +0,0 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from NestedArchetypeType x
|
||||
where toBeTested(x) and not x.isUnknown()
|
||||
select x, x.getSuperclass()
|
||||
Reference in New Issue
Block a user