Swift: Support BuiltinFixedArrayType

This commit is contained in:
Jeroen Ketema
2025-05-02 14:32:04 +02:00
parent c74fca929a
commit 98384bf4c2
16 changed files with 161 additions and 9 deletions

View File

@@ -285,8 +285,8 @@ MAP(swift::TypeBase, TypeTag)
MAP(swift::BuiltinVectorType, BuiltinVectorTypeTag)
MAP(swift::BuiltinPackIndexType, void) // SIL type, cannot really appear in the frontend run
MAP(swift::BuiltinNonDefaultDistributedActorStorageType, void) // Does not appear in AST/SIL, only used during IRGen
MAP(swift::BuiltinFixedArrayType, void) // TODO swift 6.1
MAP(swift::BuiltinUnboundGenericType, void) // TODO swift 6.1
MAP(swift::BuiltinFixedArrayType, BuiltinFixedArrayTypeTag)
MAP(swift::BuiltinUnboundGenericType, void) // Only used during type resolution
MAP(swift::TupleType, TupleTypeTag)
MAP(swift::ReferenceStorageType, ReferenceStorageTypeTag)
MAP(swift::WeakStorageType, WeakStorageTypeTag)

View File

@@ -537,6 +537,7 @@ lib/codeql/swift/elements/type/BoundGenericType.qll 089e5e8d09c62a23d575dcab68cd
lib/codeql/swift/elements/type/BuiltinBridgeObjectType.qll b0064e09b53efe801b0bf950ff00698a84e2f714e853e4859ed5f3246025a1bd aa14b6ae2ec510c4ddd2cc073bf971809536ab8fd8763fd05bd171b0bbe83860
lib/codeql/swift/elements/type/BuiltinDefaultActorStorageType.qll e867a9d0b2c61b7eb61f5143c78e31f8d98d3245d79e0e3281d4c172175f496b 265e87f2e37ca968af572cc619294d1ee91dd66ebb0d1bb1ba9ab7159de52f0b
lib/codeql/swift/elements/type/BuiltinExecutorType.qll 2b141553bbc02a00d97579ba9d0e38fa0978d40ce954b0caf64826aa259dbc08 a81465fd0e87ad5b8e418d8f21c337b3e96388a3b92b3332f0d6b0ff7663e5c7
lib/codeql/swift/elements/type/BuiltinFixedArrayType.qll 24a57f15a53070e6308841cd5dac4d55059e84d9fb18a77eec1130647dcdc97c 9f4167ef5190cbeee71abd068bdb0a280b690a16349cd408244d4cf9edfb357a
lib/codeql/swift/elements/type/BuiltinFloatType.qll 81f49325077b75cea682904ddab24d1b2fdc5c93b0b28830c08e866d5c9307a7 e26a348d66e3824ccd92729624ce2b2ebc82a844aa47035e0a963a62b08b772d
lib/codeql/swift/elements/type/BuiltinIntegerLiteralType.qll 34ee35733cf26f90d799a79f8a2362b199ea2ecb6ba83eb5678dda9eb3ed255f e33fdb27d3c22d441277b66ba74136cb88e1da25a2146391b258c68f7fbf5dd3
lib/codeql/swift/elements/type/BuiltinIntegerType.qll b931e79a40fb379a8de377ae4ea1c85befb7b07dbfe913f0ea7f5adf5514b217 5d7e6f21284b8c5ff70773bb64f896a40541c9064bfdd336798ccfda4cb4fb9e
@@ -615,6 +616,8 @@ lib/codeql/swift/elements/type/internal/BuiltinDefaultActorStorageTypeConstructo
lib/codeql/swift/elements/type/internal/BuiltinDefaultActorStorageTypeImpl.qll 1bf51a54fa58bbf89aaecbf631e44f7be014594c2a595e51c8ac54e790b3c05d a715240732615d22623a70b09c6c4d48d7b1d93dd0dc5a30d207136b3b4c4efc
lib/codeql/swift/elements/type/internal/BuiltinExecutorTypeConstructor.qll 2f9aea7e019b4c696294660a89b94d254b6d7bbd5b6d54991a1fc2e3306fed50 28c28b2d2a05a0e415e1b56f743d66b7f5e6a1aa2e6087d8a2743b7e34a602c4
lib/codeql/swift/elements/type/internal/BuiltinExecutorTypeImpl.qll 0a5f8edd92f68cf8a8f0036f52f454f0279771d3bef5e748e61f1f3eaeb51758 92624449d217fe69c6c9e40488039c59306db5f22066ff245ba7d4957a705043
lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeConstructor.qll 0d5af4926703f1c8989c2f8960885e769efe86e0b623e843b788242499771565 2449589a1c1d5748d7ead874cc1dc98ffb49a065a0dc8963f741f66845785a74
lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeImpl.qll 6b69ba8b271646bcd699e338f41c186f3e4e7d401830918407e392312b2f0ad1 ecaca3d762264423094f7c2cb63e33b5d72d970946766eec33d984fa977950b4
lib/codeql/swift/elements/type/internal/BuiltinFloatTypeConstructor.qll f1dab7b9d36213e57083a6effec1b2d859553831394c0e746c592c96a20db6de cceeaa864cfc84511b3cdad6a88d44fc14ea1c8e38db72b0854c3f217a3f9c44
lib/codeql/swift/elements/type/internal/BuiltinFloatTypeImpl.qll 1dc7f7817c4a238751875b0cee98d060a1ea975a22fd90ceef0f9874b85824d6 d98f743c28174fb3294f0ff60232600a4fc80aeefe72e5cc15bb56e09880ec1e
lib/codeql/swift/elements/type/internal/BuiltinIntegerLiteralTypeConstructor.qll 3885775f78e18286aa8dc99ab5b6f386a278b34b47f93da28d67faac918e6087 93be2ad0b7235bab613b74582bc1de0ca8b2a4da7a387d09a9b8ef9b38095534
@@ -713,7 +716,7 @@ lib/codeql/swift/elements/type/internal/UnresolvedTypeImpl.qll ee1499dd568753898
lib/codeql/swift/elements/type/internal/VariadicSequenceTypeConstructor.qll fc74a5a2a2effa28ef24509b20ee4373d97cf6e8c71840121bb031c6adedf584 c9b2effc1d01c13c5e6a74a111122fa79a2f6554dda3cb016d68ba397e566ec4
lib/codeql/swift/elements/type/internal/WeakStorageTypeConstructor.qll 5fdce3716aba6318522174a2c455a63480970222ae81c732fb19c6dd3ae2d271 60ea79d6943e129deba0deccb566cf9d73f78398b0f7f0212674d91287d6b2ae
lib/codeql/swift/elements/type/internal/WeakStorageTypeImpl.qll 74f79b458f3204ec2519bd654de21bc4fb6b76816bd8ca01990fe897563a1383 34e1810f74cecda5b580ed050438ae1d914b97a36b8f4e2de1c25254c0cac633
lib/codeql/swift/elements.qll 67832d269392e0c8226bd03918be9b3e4cf11213e54dd3acfe153dd8f8cd33c7 67832d269392e0c8226bd03918be9b3e4cf11213e54dd3acfe153dd8f8cd33c7
lib/codeql/swift/elements.qll 2c093130866888903f5a97cc41072ad94c795d296fca6492d6db481b1ca39d94 2c093130866888903f5a97cc41072ad94c795d296fca6492d6db481b1ca39d94
lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99
lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de
lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119
@@ -730,12 +733,12 @@ lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fd
lib/codeql/swift/generated/Location.qll 5e20316c3e480ddfe632b7e88e016c19f10a67df1f6ae9c8f128755a6907d6f5 5a0af2d070bcb2ed53d6d0282bf9c60dc64c2dce89c21fdd485e9c7893c1c8fa
lib/codeql/swift/generated/MacroRole.qll facf907e75490d69cd401c491215e4719324d751f40ea46c86ccf24cf3663c1f 969d8d4b44e3f1a9c193a152a4d83a303e56d2dbb871fc920c47a33f699cf018
lib/codeql/swift/generated/OtherAvailabilitySpec.qll d9feaa2a71acff3184ca389045b0a49d09156210df0e034923d715b432ad594b 046737621a8bcf69bf805afb0cff476bd15259f12f0d77fce3206dd01b31518f
lib/codeql/swift/generated/ParentChild.qll 3b7e2e04c92f395f446fbf2dcf62f97a1b066523a5feb90c1cede9a1e644d4e4 58b8a96626a061b11ea0783b0356467358ef80bc9148666f78d6b64a0457a899
lib/codeql/swift/generated/ParentChild.qll d66e5c28e93a3085fbae0ada238a96577ad21fd64a37ce967032bf5df8bdfb1d 2d440ad9c0304f658d54c6c53a8b1db1d3e032ee5522b51c46116413d0cf5dbb
lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec
lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4
lib/codeql/swift/generated/Raw.qll ca16e576312f595283994e8b02a32693826712c76c471f7969271dc09361d13e 3d86c741064a075810e1e92d2c3bdc2a77755b9142904dee95709117af3c29a1
lib/codeql/swift/generated/Synth.qll a8462dd9e84e0059f6ca4d9c9f42ac75d0d3fd7b65702e1409c583a89665f18c 051e02492cba3ddda863cd80507a49884d73d57c834f00f6d3547e2143c48dbe
lib/codeql/swift/generated/SynthConstructors.qll 9dc761332663708d16ee6303930557858ea56049ce2dbac4b14f995e6c02977d 9dc761332663708d16ee6303930557858ea56049ce2dbac4b14f995e6c02977d
lib/codeql/swift/generated/Raw.qll 96d5f8778f25cd396b5cc56c38dce597c5a9a5c2b1e9ed8b9a4d2eca89e49323 d65072b5c508dad1dd813e19f7431087d8bfc0e5d85aa3d19beffbcbbec585ec
lib/codeql/swift/generated/Synth.qll 2b0f1a8911c1981ff50b78331bdd1f3f6023ad87a4ae3a92088901f493bb62c0 bc94ca1d86033e04b0999da84b61955ea1d8f4ac2379be527802512a42a16964
lib/codeql/swift/generated/SynthConstructors.qll d30b83f9d8d310414bb1261af386b70502df48159d06579bb2610e18ef546c3d d30b83f9d8d310414bb1261af386b70502df48159d06579bb2610e18ef546c3d
lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d
lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd
lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022
@@ -970,6 +973,7 @@ lib/codeql/swift/generated/type/BoundGenericType.qll 5e7a2210b766437ca301f9675f7
lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll 97f30768a8788ec4547ce8a8f06fdd165286177e3819bf2e6590b9479f5bada4 ea3161c34d1d18783b38deac43c73048e4510015307d93f77cd95c149e988846
lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll 10e49de9a8bc3e67285c111f7869c8baceb70e478661d5557ebc8c86f41b4aec 1a0ce85eb325f666fbc2ac49c6f994efd552de6f2105e0a7ba9a10e39f3d1591
lib/codeql/swift/generated/type/BuiltinExecutorType.qll 8f58d4d413910aded894bfa9b54748adfc2b78f4ee271ac6db5f5b0214f36a66 69da70d76146155529b7b2426b3a459abe318f887240aac1aed5719fda5f386a
lib/codeql/swift/generated/type/BuiltinFixedArrayType.qll 9bd26596da9137b07324222c9ed39ec0781e44673314fba96a0c7cf16f65cc7d cc2d40961b070a89f3350ab95b92ae33372277e499d7b2a9ea34721cc1fe1923
lib/codeql/swift/generated/type/BuiltinFloatType.qll 6306a806107bba052fe0b1335c8c4d4391cdb6aa5f42f14c70743113928c4c36 3265d571630c0437e5d81ba20a0b6112b7e88ee3ffca737557186001cf8aa04a
lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll 3f49aac9b81c440b902a658294cf95aff5cb79b0d6cee8b1abd8a08ad45c7966 6c184dcf5d9376f193f07fe4722ea7cab51f1dfdef4d72c3042842d73cca31fe
lib/codeql/swift/generated/type/BuiltinIntegerType.qll 3cfcbc4ebea6051d1f6dedcf098888c72c02bf697cebb52a0060c1885bea61f0 1c78df7a184e3615024d6e361b88dd619828a0aa7d342564610a95b02cc67d1e

4
swift/ql/.gitattributes generated vendored
View File

@@ -539,6 +539,7 @@
/lib/codeql/swift/elements/type/BuiltinBridgeObjectType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinDefaultActorStorageType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinExecutorType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinFixedArrayType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinFloatType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinIntegerLiteralType.qll linguist-generated
/lib/codeql/swift/elements/type/BuiltinIntegerType.qll linguist-generated
@@ -617,6 +618,8 @@
/lib/codeql/swift/elements/type/internal/BuiltinDefaultActorStorageTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinExecutorTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinExecutorTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinFixedArrayTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinFloatTypeConstructor.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinFloatTypeImpl.qll linguist-generated
/lib/codeql/swift/elements/type/internal/BuiltinIntegerLiteralTypeConstructor.qll linguist-generated
@@ -972,6 +975,7 @@
/lib/codeql/swift/generated/type/BuiltinBridgeObjectType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinDefaultActorStorageType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinExecutorType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinFixedArrayType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinFloatType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinIntegerLiteralType.qll linguist-generated
/lib/codeql/swift/generated/type/BuiltinIntegerType.qll linguist-generated

View File

@@ -250,6 +250,7 @@ import codeql.swift.elements.type.BoundGenericType
import codeql.swift.elements.type.BuiltinBridgeObjectType
import codeql.swift.elements.type.BuiltinDefaultActorStorageType
import codeql.swift.elements.type.BuiltinExecutorType
import codeql.swift.elements.type.BuiltinFixedArrayType
import codeql.swift.elements.type.BuiltinFloatType
import codeql.swift.elements.type.BuiltinIntegerLiteralType
import codeql.swift.elements.type.BuiltinIntegerType

View File

@@ -0,0 +1,12 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the public class `BuiltinFixedArrayType`.
*/
private import internal.BuiltinFixedArrayTypeImpl
import codeql.swift.elements.type.BuiltinType
/**
* A builtin type representing N values stored contiguously.
*/
final class BuiltinFixedArrayType = Impl::BuiltinFixedArrayType;

View File

@@ -0,0 +1,14 @@
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
/**
* This module defines the hook used internally to tweak the characteristic predicate of
* `BuiltinFixedArrayType` synthesized instances.
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.Raw
/**
* The characteristic predicate of `BuiltinFixedArrayType` synthesized instances.
* INTERNAL: Do not use.
*/
predicate constructBuiltinFixedArrayType(Raw::BuiltinFixedArrayType id) { any() }

View File

@@ -0,0 +1,19 @@
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `BuiltinFixedArrayType`.
*
* INTERNAL: Do not use.
*/
private import codeql.swift.generated.type.BuiltinFixedArrayType
/**
* INTERNAL: This module contains the customizable definition of `BuiltinFixedArrayType` and should not
* be referenced directly.
*/
module Impl {
/**
* A builtin type representing N values stored contiguously.
*/
class BuiltinFixedArrayType extends Generated::BuiltinFixedArrayType { }
}

View File

@@ -4564,6 +4564,22 @@ private module Impl {
)
}
private Element getImmediateChildOfBuiltinFixedArrayType(
BuiltinFixedArrayType e, int index, string partialPredicateCall
) {
exists(int b, int bBuiltinType, int n |
b = 0 and
bBuiltinType =
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfBuiltinType(e, i, _)) | i) and
n = bBuiltinType and
(
none()
or
result = getImmediateChildOfBuiltinType(e, index - b, partialPredicateCall)
)
)
}
private Element getImmediateChildOfBuiltinFloatType(
BuiltinFloatType e, int index, string partialPredicateCall
) {
@@ -5679,6 +5695,8 @@ private module Impl {
or
result = getImmediateChildOfBuiltinExecutorType(e, index, partialAccessor)
or
result = getImmediateChildOfBuiltinFixedArrayType(e, index, partialAccessor)
or
result = getImmediateChildOfBuiltinFloatType(e, index, partialAccessor)
or
result = getImmediateChildOfBuiltinJobType(e, index, partialAccessor)

View File

@@ -3546,6 +3546,14 @@ module Raw {
override string toString() { result = "BuiltinExecutorType" }
}
/**
* INTERNAL: Do not use.
* A builtin type representing N values stored contiguously.
*/
class BuiltinFixedArrayType extends @builtin_fixed_array_type, BuiltinType {
override string toString() { result = "BuiltinFixedArrayType" }
}
/**
* INTERNAL: Do not use.
*/

View File

@@ -900,6 +900,10 @@ module Synth {
* INTERNAL: Do not use.
*/
TBuiltinExecutorType(Raw::BuiltinExecutorType id) { constructBuiltinExecutorType(id) } or
/**
* INTERNAL: Do not use.
*/
TBuiltinFixedArrayType(Raw::BuiltinFixedArrayType id) { constructBuiltinFixedArrayType(id) } or
/**
* INTERNAL: Do not use.
*/
@@ -1389,8 +1393,8 @@ module Synth {
*/
class TBuiltinType =
TAnyBuiltinIntegerType or TBuiltinBridgeObjectType or TBuiltinDefaultActorStorageType or
TBuiltinExecutorType or TBuiltinFloatType or TBuiltinJobType or TBuiltinNativeObjectType or
TBuiltinRawPointerType or TBuiltinRawUnsafeContinuationType or
TBuiltinExecutorType or TBuiltinFixedArrayType or TBuiltinFloatType or TBuiltinJobType or
TBuiltinNativeObjectType or TBuiltinRawPointerType or TBuiltinRawUnsafeContinuationType or
TBuiltinUnsafeValueBufferType or TBuiltinVectorType;
/**
@@ -2861,6 +2865,14 @@ module Synth {
result = TBuiltinExecutorType(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TBuiltinFixedArrayType`, if possible.
*/
TBuiltinFixedArrayType convertBuiltinFixedArrayTypeFromRaw(Raw::Element e) {
result = TBuiltinFixedArrayType(e)
}
/**
* INTERNAL: Do not use.
* Converts a raw element to a synthesized `TBuiltinFloatType`, if possible.
@@ -4022,6 +4034,8 @@ module Synth {
or
result = convertBuiltinExecutorTypeFromRaw(e)
or
result = convertBuiltinFixedArrayTypeFromRaw(e)
or
result = convertBuiltinFloatTypeFromRaw(e)
or
result = convertBuiltinJobTypeFromRaw(e)
@@ -5593,6 +5607,14 @@ module Synth {
e = TBuiltinExecutorType(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TBuiltinFixedArrayType` to a raw DB element, if possible.
*/
Raw::Element convertBuiltinFixedArrayTypeToRaw(TBuiltinFixedArrayType e) {
e = TBuiltinFixedArrayType(result)
}
/**
* INTERNAL: Do not use.
* Converts a synthesized `TBuiltinFloatType` to a raw DB element, if possible.
@@ -6754,6 +6776,8 @@ module Synth {
or
result = convertBuiltinExecutorTypeToRaw(e)
or
result = convertBuiltinFixedArrayTypeToRaw(e)
or
result = convertBuiltinFloatTypeToRaw(e)
or
result = convertBuiltinJobTypeToRaw(e)

View File

@@ -207,6 +207,7 @@ import codeql.swift.elements.type.internal.BoundGenericStructTypeConstructor
import codeql.swift.elements.type.internal.BuiltinBridgeObjectTypeConstructor
import codeql.swift.elements.type.internal.BuiltinDefaultActorStorageTypeConstructor
import codeql.swift.elements.type.internal.BuiltinExecutorTypeConstructor
import codeql.swift.elements.type.internal.BuiltinFixedArrayTypeConstructor
import codeql.swift.elements.type.internal.BuiltinFloatTypeConstructor
import codeql.swift.elements.type.internal.BuiltinIntegerLiteralTypeConstructor
import codeql.swift.elements.type.internal.BuiltinIntegerTypeConstructor

View File

@@ -0,0 +1,24 @@
// generated by codegen/codegen.py, do not edit
/**
* This module provides the generated definition of `BuiltinFixedArrayType`.
* INTERNAL: Do not import directly.
*/
private import codeql.swift.generated.Synth
private import codeql.swift.generated.Raw
import codeql.swift.elements.type.internal.BuiltinTypeImpl::Impl as BuiltinTypeImpl
/**
* INTERNAL: This module contains the fully generated definition of `BuiltinFixedArrayType` and should not
* be referenced directly.
*/
module Generated {
/**
* A builtin type representing N values stored contiguously.
* INTERNAL: Do not reference the `Generated::BuiltinFixedArrayType` class directly.
* Use the subclass `BuiltinFixedArrayType`, where the following predicates are available.
*/
class BuiltinFixedArrayType extends Synth::TBuiltinFixedArrayType, BuiltinTypeImpl::BuiltinType {
override string getAPrimaryQlClass() { result = "BuiltinFixedArrayType" }
}
}

View File

@@ -2220,6 +2220,7 @@ any_generic_type_parents( //dir=type
| @builtin_bridge_object_type
| @builtin_default_actor_storage_type
| @builtin_executor_type
| @builtin_fixed_array_type
| @builtin_float_type
| @builtin_job_type
| @builtin_native_object_type
@@ -2402,6 +2403,10 @@ builtin_executor_types( //dir=type
unique int id: @builtin_executor_type
);
builtin_fixed_array_types( //dir=type
unique int id: @builtin_fixed_array_type
);
builtin_float_types( //dir=type
unique int id: @builtin_float_type
);

View File

@@ -2,6 +2,9 @@
| Builtin.Executor | BuiltinExecutorType | getName: | Executor | getCanonicalType: | Builtin.Executor |
| Builtin.FPIEEE32 | BuiltinFloatType | getName: | FPIEEE32 | getCanonicalType: | Builtin.FPIEEE32 |
| Builtin.FPIEEE64 | BuiltinFloatType | getName: | FPIEEE64 | getCanonicalType: | Builtin.FPIEEE64 |
| Builtin.FixedArray<4, Int> | BuiltinFixedArrayType | getName: | FixedArray<4, Int> | getCanonicalType: | Builtin.FixedArray<4, Int> |
| Builtin.FixedArray<N, T> | BuiltinFixedArrayType | getName: | FixedArray<N, T> | getCanonicalType: | Builtin.FixedArray<N, T> |
| Builtin.FixedArray<\u03c4_0_0, \u03c4_0_1> | BuiltinFixedArrayType | getName: | FixedArray<\u03c4_0_0, \u03c4_0_1> | getCanonicalType: | Builtin.FixedArray<\u03c4_0_0, \u03c4_0_1> |
| Builtin.IntLiteral | BuiltinIntegerLiteralType | getName: | IntLiteral | getCanonicalType: | Builtin.IntLiteral |
| Builtin.Job | BuiltinJobType | getName: | Job | getCanonicalType: | Builtin.Job |
| Builtin.NativeObject | BuiltinNativeObjectType | getName: | NativeObject | getCanonicalType: | Builtin.NativeObject |

View File

@@ -0,0 +1,9 @@
//codeql-extractor-options: -enable-experimental-feature BuiltinModule -enable-experimental-feature ValueGenerics -disable-availability-checking
import Builtin
struct A<let N: Int, T: AnyObject> {
var x: Builtin.FixedArray<N, T>
}
func f(x: Builtin.FixedArray<4, Int>) {}

View File

@@ -1475,3 +1475,9 @@ class TypeValueExpr(Expr):
class IntegerType(Type):
value: string
class BuiltinFixedArrayType(BuiltinType):
"""
A builtin type representing N values stored contiguously.
"""
pass