Swift: make AnyGenericType::getDecl's type more specific

As shown by the extractor's code not needing any change, the DB values
already had that more specific type, which is why the upgrade/downgrade
scripts are actually no-ops.
This commit is contained in:
Paolo Tranquilli
2023-03-14 11:48:54 +01:00
parent de1ecf943e
commit 54b6c6f8f7
11 changed files with 10420 additions and 9 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Revert making the type of AnyGenericType::getDecl more specific
compatibility: full

View File

@@ -385,7 +385,7 @@ ql/lib/codeql/swift/generated/OtherAvailabilitySpec.qll 0e26a203b26ff0581b7396b0
ql/lib/codeql/swift/generated/ParentChild.qll adf8af53ce18086eb28e5fe204ad2089f2ab516622c16055ccfdd1335f5ac72b 6f7464ecd8ca04b6aa261139b36a162e5b0636237d514b8431ef4f97a1c603dc
ql/lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll f82d9ca416fe8bd59b5531b65b1c74c9f317b3297a6101544a11339a1cffce38 7f5c6d3309e66c134107afe55bae76dfc9a72cb7cdd6d4c3706b6b34cee09fa0
ql/lib/codeql/swift/generated/PureSynthConstructors.qll 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98
ql/lib/codeql/swift/generated/Raw.qll 30813233f18677b073e78713fbf144cd6e85a2fcafcd7bb29573f1ac1915784e 7c63093ca4f7643567151516341f4ba74f935813928b6af274b19d44d0f24941
ql/lib/codeql/swift/generated/Raw.qll df9a9211952260c0213dec8f0bc4865f09ad2f88c970099fb0f09e4c86aea7ac ed9d462267df50194d7d2adfff591306eac86b04dfd4ab92a43366f1febe58bb
ql/lib/codeql/swift/generated/Synth.qll af02e0b49fe7b488592687996cc74d9525d4e3fbc9d324820b310b356f4d2612 5c740a660721173e9e4e45eb701d373ca19ff14d61cdaea309b65871e0deea90
ql/lib/codeql/swift/generated/SynthConstructors.qll a1b3ca33017f82124286ccad317a05484fee144fb9c3cdd2e500ce38e5efcec4 a1b3ca33017f82124286ccad317a05484fee144fb9c3cdd2e500ce38e5efcec4
ql/lib/codeql/swift/generated/UnknownFile.qll 0fcf9beb8de79440bcdfff4bb6ab3dd139bd273e6c32754e05e6a632651e85f6 0fcf9beb8de79440bcdfff4bb6ab3dd139bd273e6c32754e05e6a632651e85f6
@@ -595,7 +595,7 @@ ql/lib/codeql/swift/generated/stmt/WhileStmt.qll 1ac3c3638899386a953905f98f432b7
ql/lib/codeql/swift/generated/stmt/YieldStmt.qll 8b1e8b7b19f94232eb877e1f8956033f6ca51db30d2542642bf3892a20eb1069 87355acc75a95a08e4f2894609c3093321904f62b9033620700ccd4427a9ca70
ql/lib/codeql/swift/generated/type/AnyBuiltinIntegerType.qll a263451163e027c4c4223ec288e090b7e0d399cc46eb962013342bfeac5f6b86 d850ec1ee1902945b172ddd0ecd8884e399e963f939c04bc8bfaadacebdf55a9
ql/lib/codeql/swift/generated/type/AnyFunctionType.qll 28f01d61d199ae6b28800151a923c2c74983aebec6951e6945973292a7d774b1 473b5e0067c5809c7927acf3670acc1e4b9f5fdfcda070954b6c108c7efd409a
ql/lib/codeql/swift/generated/type/AnyGenericType.qll af3e8060bec6128f3135960da1703a72c51c461e85737b9a336d72910fd33e7a 470e51991d606170482dba555bf4067a442e8fec25706a481ef38bdedb1531b1
ql/lib/codeql/swift/generated/type/AnyGenericType.qll ae127c259d9881f240a9b77fb139f16084af53c29aee9abf1af3bcc698bcd611 4cb9e1d9effc7d829e5bc85455c44e4143a4f288454dd58eb25111cd5c1dd95e
ql/lib/codeql/swift/generated/type/AnyMetatypeType.qll 6805a6895e748e02502105d844b66fab5111dbb0d727534d305a0396dacc9465 58e0794b8d6dccd9809f5b83bf64b162e69f3f84b5f3161b88aed10f16a8ede8
ql/lib/codeql/swift/generated/type/ArchetypeType.qll 3c3d88c43a746b54cd09562756768538675ee1bae31c58fca4b8c6af7ccc8656 6dd41b2a89176342a27d3ffa7abc60dc9e53f2a6c132941fb7c79f9aa1b189db
ql/lib/codeql/swift/generated/type/ArraySliceType.qll 72d0409e2704e89ebca364ae28d55c874152f55dd1deaac6c954617f6566f3c2 72d0409e2704e89ebca364ae28d55c874152f55dd1deaac6c954617f6566f3c2

View File

@@ -2143,7 +2143,7 @@ module Raw {
/**
* Gets the declaration of this any generic type.
*/
Decl getDeclaration() { any_generic_types(this, result) }
GenericTypeDecl getDeclaration() { any_generic_types(this, result) }
}
class AnyMetatypeType extends @any_metatype_type, Type { }

View File

@@ -1,7 +1,7 @@
// generated by codegen/codegen.py
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.decl.Decl
import codeql.swift.elements.decl.GenericTypeDecl
import codeql.swift.elements.type.Type
module Generated {
@@ -35,9 +35,9 @@ module Generated {
* This includes nodes from the "hidden" AST. It can be overridden in subclasses to change the
* behavior of both the `Immediate` and non-`Immediate` versions.
*/
Decl getImmediateDeclaration() {
GenericTypeDecl getImmediateDeclaration() {
result =
Synth::convertDeclFromRaw(Synth::convertAnyGenericTypeToRaw(this)
Synth::convertGenericTypeDeclFromRaw(Synth::convertAnyGenericTypeToRaw(this)
.(Raw::AnyGenericType)
.getDeclaration())
}
@@ -45,6 +45,6 @@ module Generated {
/**
* Gets the declaration of this any generic type.
*/
final Decl getDeclaration() { result = getImmediateDeclaration().resolve() }
final GenericTypeDecl getDeclaration() { result = getImmediateDeclaration().resolve() }
}
}

View File

@@ -2028,7 +2028,7 @@ any_function_type_is_async( //dir=type
#keyset[id]
any_generic_types( //dir=type
int id: @any_generic_type ref,
int declaration: @decl_or_none ref
int declaration: @generic_type_decl_or_none ref
);
#keyset[id]
@@ -2487,6 +2487,11 @@ variadic_sequence_types( //dir=type
| @unspecified_element
;
@generic_type_decl_or_none =
@generic_type_decl
| @unspecified_element
;
@generic_type_param_decl_or_none =
@generic_type_param_decl
| @unspecified_element

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Make the type of AnyGenericType::getDecl more specific
compatibility: full

View File

@@ -955,7 +955,7 @@ class AnyFunctionType(Type):
class AnyGenericType(Type):
parent: optional[Type]
declaration: Decl
declaration: GenericTypeDecl
class AnyMetatypeType(Type):
pass