mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Swift: Fix AvailabilitySpec trap generation
This commit is contained in:
@@ -36,9 +36,15 @@ void StmtTranslator::translateAndEmit(const swift::PoundAvailableInfo& availabil
|
||||
}
|
||||
|
||||
void StmtTranslator::translateAndEmit(const swift::AvailabilitySpec& spec) {
|
||||
// auto entry = dispatcher.createEntry(spec);
|
||||
// TODO: Swift 6.2 platform version/wildcard
|
||||
// dispatcher.emit(entry);
|
||||
auto entry = dispatcher.createEntry(spec);
|
||||
entry.is_wildcard = spec.isWildcard();
|
||||
if (!spec.isWildcard()) {
|
||||
auto domain = spec.getDomainOrIdentifier().getAsDomain();
|
||||
entry.platform =
|
||||
swift::platformString(domain ? domain->getPlatformKind() : swift::PlatformKind::none).str();
|
||||
entry.version = spec.getRawVersion().getAsString();
|
||||
}
|
||||
dispatcher.emit(entry);
|
||||
}
|
||||
|
||||
codeql::BraceStmt StmtTranslator::translateBraceStmt(const swift::BraceStmt& stmt) {
|
||||
|
||||
23
swift/ql/.generated.list
generated
23
swift/ql/.generated.list
generated
@@ -13,8 +13,6 @@ lib/codeql/swift/elements/KeyPathComponent.qll cc64d5a3cc6e6aa12faee7dfc95e6b5e1
|
||||
lib/codeql/swift/elements/Locatable.qll a4e01abd3f337a60e3741705cede50be974ccffcb707a53f2b378972838c5977 89ba4dbebcfa291797407c27087d91a18b1ec1bc97140a14ec08dbb12cef7395
|
||||
lib/codeql/swift/elements/Location.qll db213e8e27f8d732ad472c16929f2c503634c622d4d7b6b6977ed8b7b3c71c5b 9b951af94891848ecea9a690741e4a401c4b7ad676fd1fcee703fce4dcee2da4
|
||||
lib/codeql/swift/elements/MacroRole.qll d55500010c47fab14fb2110db0afadef5f1f01115d05c803c9fd114508aca6da 858a7fe124cb8874e1fe62b3b36153740b0bb1cd1e9ed0005b36d01040960ed8
|
||||
lib/codeql/swift/elements/OtherAvailabilitySpec.qll b3e3aafc7b1f7b1ff2efa2bc9ff64370cc6847760a46ff5594f5144caee858ab 6630e73998c9359b6cefd265222cb72274b4484d6904b4a9f949bdb7a2781c0f
|
||||
lib/codeql/swift/elements/PlatformVersionAvailabilitySpec.qll 1a94d317cbb1731844986b57bbdc4095d90957c671d5248bc581bc1fdbb18f8b 3888eb1afc641d365c30fa514962f1a31b9b9c04383836e0062445e566003d34
|
||||
lib/codeql/swift/elements/UnknownFile.qll 29e9f59c24c3ee6c2b01ea19390dd6730192628e5e4a541c3c00a42d16daad78 0ec046d67ebdc1722915b0d952468d1d3c3dfdf2c61e7fa215c7ba2fb91de04c
|
||||
lib/codeql/swift/elements/UnknownLocation.qll a03b4ff4f3505a35fbf25e150944e217030d187b8ab314bf0657bcab67ea40cc 2e3a1271f0df925c1deae232b26ba031322611f87f0326fe747475445c0e2485
|
||||
lib/codeql/swift/elements/UnspecifiedElement.qll b1f597cae6585531aec383b669bda76b710dc2b61caf352347786584faf63ff4 858a15ed565231c15d09aa2e15acd4842a23ef8b0f76de792297fa8062e2f287
|
||||
@@ -433,7 +431,7 @@ lib/codeql/swift/elements/expr/internal/UnsafeCastExprConstructor.qll f8771eb8f6
|
||||
lib/codeql/swift/elements/expr/internal/UnsafeCastExprImpl.qll 787104ce97d702c0c3efa81a0f8416584f35c454d3b2ffe7bd0917861589612b 50496a0f3f3a9e3d5a2e6cbcd5eb16b634cf3fd5e0878bdf017678243dbfd8a0
|
||||
lib/codeql/swift/elements/expr/internal/VarargExpansionExprConstructor.qll 917701083da11fce895c53d5f3e0a52b8e3142e9aacdf1d8536a4216ef377b16 b72ca103ced9cbb45f2ef9387387b8aaf3134e358ae5a03fa3ea242896954c81
|
||||
lib/codeql/swift/elements/internal/AvailabilityInfoConstructor.qll 89c731f266122a3434b88dfd573d68c50b5c4fa5e13c2443c54f78e682190d1e 86beb6f684e08b6f557b7d67bc164113e9f5270c09bbe95fbd81c558d77f7f84
|
||||
lib/codeql/swift/elements/internal/AvailabilitySpecImpl.qll 9ac9285e731938747c574c3f270aaead323656162bd34a6630c1babfaaf25a6a 900b2e638639f427506b2d0eb2806b6ee119ea63ea4ce44758e0c36f2ce915ac
|
||||
lib/codeql/swift/elements/internal/AvailabilitySpecConstructor.qll cca46cd2908923a08b7f6a8bea0c0c11071523bcc421bfe141d0e0bafd8dfcb4 cbb1494346379083c0f275111eca78617591568894258a6b73efda34f3fba1ba
|
||||
lib/codeql/swift/elements/internal/CommentConstructor.qll 46891994c032546e7323f343947fd57cabb6c0e2ad1ca78f113c5b04436be203 e05b3ba3e00437488fdf53361211c6e5c3ae14ad1fdaf32093b02bdea2076abe
|
||||
lib/codeql/swift/elements/internal/DbFileConstructor.qll b5b680f255180d0d38223d6ac4422f192271573dca62f2967dde874147e710df a9c8d1c7abb5516c1d22ee9e020266297e52a2cd84f892792c1e6476517a6737
|
||||
lib/codeql/swift/elements/internal/DbFileImpl.qll 09cbe97ad1d1d464bd9a374111e4e6bee0781595e5474809c415aade04431d90 b204d164e7a10ec4a77e0052710339a2c96ba6d42da547cc03cd23c1bd898261
|
||||
@@ -443,8 +441,6 @@ lib/codeql/swift/elements/internal/DiagnosticsConstructor.qll 5212997161b95b0b10
|
||||
lib/codeql/swift/elements/internal/ErrorElementImpl.qll 4ddf6e99bec6125bc5b24bc65d83cca131dd05748f71a85c8f0284659c3a0c49 db606ce97fdf2d2f38a66c7a4ef1437c8a3f6a57b71e426ec2bb0329d9e8a193
|
||||
lib/codeql/swift/elements/internal/KeyPathComponentConstructor.qll ff71795157639520f56ce99ed49bf25486c125a0f27a3bb3ba2c8492feca13b2 5875187267cf91e37426d817a6c0c5e7ba9ddb0bd840ad358338ba003e0a877c
|
||||
lib/codeql/swift/elements/internal/MacroRoleConstructor.qll c45c189fd441e2c23b1c94dec9f357192f5e392051e0becf52c020d830e38e54 e281ef4ba76a6e4b2b689e00f542ef585cec7a540911ccd7fbb59f3232f08a3d
|
||||
lib/codeql/swift/elements/internal/OtherAvailabilitySpecConstructor.qll c5638ae4f3993c7a111fb2a516667190642c1948f18806cf29f78b7067021d10 cc93ac54741ba952b32385db0fe072576a9c8697cd793bcb8faed98f0fb6bda0
|
||||
lib/codeql/swift/elements/internal/PlatformVersionAvailabilitySpecConstructor.qll 015280737e71fe1084da6056410fd73dc4473a3b3296d0e46c0ca64f07dd5b7f c735c42e45ebdc308a1f02ff15d65d4d1154071e55645a9ae763d6c021d7f601
|
||||
lib/codeql/swift/elements/internal/UnspecifiedElementConstructor.qll f7e232dae7362d0c3f9f33f952d9106da3d273f16b124008919fba6e40a944b6 eb30f05ae09f2c7bc93d758c0870b63f16bf61d0d2446ed827250f89772596ab
|
||||
lib/codeql/swift/elements/pattern/AnyPattern.qll b0ccc58de123e61705dde8bb655da0cb02ea981fcb4d4f8d0e205dfbd2a9bedc 55751b143f758968cd006cc70f1d90a9917d9ac7eb319364b2485282944d2835
|
||||
lib/codeql/swift/elements/pattern/BindingPattern.qll eca835e58ecbb2096615c88b659c8782158c636501e7f21d38e303fff7a6a2fe 8cc4040c7c5357904389b61e98837d9da2c4aad65039b99ade3f4f9fac4d4479
|
||||
@@ -716,10 +712,10 @@ 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 a3ab2329ee38bd9afe1e790bd5803ee694505c8f4ad2393b0bf60123c0a22073 a3ab2329ee38bd9afe1e790bd5803ee694505c8f4ad2393b0bf60123c0a22073
|
||||
lib/codeql/swift/elements.qll 84a5704b697f4a3f224ec2b99d49f4d2a6ee2655aa86c72ea1cbc901b8231879 84a5704b697f4a3f224ec2b99d49f4d2a6ee2655aa86c72ea1cbc901b8231879
|
||||
lib/codeql/swift/generated/AstNode.qll 6fb80e9b230a1e3ae8193af40744f253d5cc81dc4239156924e5ab606c491efc e5c28418e9a38bde08f323a3986a199620189fc4a8a4dc8f670610a5d3d65b99
|
||||
lib/codeql/swift/generated/AvailabilityInfo.qll e3a5274c43e72ff124b6988fd8be0c83a41b89337e11104150dd0ca7f51d8a11 889563791ca8d9758dbbccf64a0731c4bdbf721cad32bc6cd723f1072b6aa1de
|
||||
lib/codeql/swift/generated/AvailabilitySpec.qll bc64d5c690c4d18800f0a48cc76a6a9ee4f832041343666da2d8df2aae04ed7e d03bf874293ac0ab09c025f75c0f392473d47bebe3223143adcc13882a366119
|
||||
lib/codeql/swift/generated/AvailabilitySpec.qll 1bd2a0ee085f802c99090e681ab3339fc5013024d79deef39f376de12ab76d37 658f2eb51860726cfa6808b3e3501d624e0734750d1420f7a25c89782f1f6c7e
|
||||
lib/codeql/swift/generated/Callable.qll 6213871affd0e1fb176a36b28ae5d0c1af9f9927428d07c23660cde9e3b0bf64 02eaaef87c919f9ceb92e59fa895f5133904bce6d23ea9381e1210377573ddf4
|
||||
lib/codeql/swift/generated/Comment.qll 64625f47ebddb1ec7e1c81790dd8120087a76958cba5cebe31f8d1f221740cb9 4d87eed099c645b43272ae806106a8d787e84e5e55ea4f1bbc7b79bf0b127d15
|
||||
lib/codeql/swift/generated/DbFile.qll cc0d2b9efbee36080bde2e26e424a40efb763eaee55874fb6c4a5db36938f3df 33e215d838cfa36e3dd0e62879e896d988430d1470a87ce1bb45aad70886212b
|
||||
@@ -732,13 +728,11 @@ lib/codeql/swift/generated/KeyPathComponent.qll 5276acdc9a4ff0ec0cc8af615c040433
|
||||
lib/codeql/swift/generated/Locatable.qll 1d37fa20de71c0b9986bfd7a7c0cb82ab7bf3fda2d2008700f955ad82ce109a7 e97d4d4fb8a4800e0008cc00f60c8ed9b1ebd5f1140fd85e68b034616178d721
|
||||
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 6b458321a55aaca9f8ca7c88b036a84c0313db75d4e5d721b9f18e0f10852256 be30f676ae498b8240042ed62a9781a1bf8cc999040d4bcbe9098af0fa5b571e
|
||||
lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll dc17b49a90a18a8f7607adf2433bc8f0c194fa3e803aa3822f809d4d4fbd6793 be48ea9f8ae17354c8508aaed24337a9e57ce01f288fece3dcecd99776cabcec
|
||||
lib/codeql/swift/generated/ParentChild.qll 88a8941821b1f511925eb8955ff25065a6004c61aa866854ee941d7556b1eb6d 6e32b4902cea8a78a9b2775826d64300987932c406212d841deeab7c48a5ef8b
|
||||
lib/codeql/swift/generated/PureSynthConstructors.qll bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4 bc31a6c4d142fa3fbdcae69d5ba6f1cec00eb9ad92b46c8d7b91ebfa7ef6c1f4
|
||||
lib/codeql/swift/generated/Raw.qll c1efe67c8c2004d2f5bc036868dff166da77984663171f1a5a5a29e7747e8d71 c3d50dd2389d8b1117a6a8ddd4f59781b59b0f618352ff8877a784b03b3376ad
|
||||
lib/codeql/swift/generated/Synth.qll a5bc201d9ed53a64ad2e29a20192cc22456d3096c3af1b71cb023152545c2efe 2cc9f90e58f23a70f44e9187a0c7d4eac743944ca78042fccd258d7d1c89d432
|
||||
lib/codeql/swift/generated/SynthConstructors.qll 09b5e8736a1aa900ff465868275e090516f4fd9ec50c64e24d4106566f5a52cd 09b5e8736a1aa900ff465868275e090516f4fd9ec50c64e24d4106566f5a52cd
|
||||
lib/codeql/swift/generated/Raw.qll 5d41235611a54943ded38965a2e474a6bdc7b2479823b880ed4d6c5431744117 6548a2ac345502c89a210d91f398d8d3b9625af9d24ebc37e43b55ba6e4efdac
|
||||
lib/codeql/swift/generated/Synth.qll a472fca73084eedab9ca8bb2fb82e7573d525444bb8d3729a3d18e06647fd96d b19984583774e30dae481d3d5cc95ebf2843c04dd952eb16cbf8a702ae52bbd8
|
||||
lib/codeql/swift/generated/SynthConstructors.qll f3687a56d2fd9bc38d95d9ca335f558a91c865bd0bd1c7c73affedefd7514183 f3687a56d2fd9bc38d95d9ca335f558a91c865bd0bd1c7c73affedefd7514183
|
||||
lib/codeql/swift/generated/UnknownFile.qll 247ddf2ebb49ce5ed4bf7bf91a969ddff37de6c78d43d8affccaf7eb586e06f2 452b29f0465ef45e978ef8b647b75e5a2a1e53f2a568fc003bc8f52f73b3fa4d
|
||||
lib/codeql/swift/generated/UnknownLocation.qll d871000b4f53ffca4f67ea23ca5626e5dcce125d62a4d4b9969e08cc974af6fc b05971d7774e60790362fb810fb7086314f40a2de747b8cb1bc823ec6494a4dd
|
||||
lib/codeql/swift/generated/UnspecifiedElement.qll d9ad4ba1ffff90cc465e8ba0dea8c4e8ba67dce5529b53b63ab6dc8e13c85e67 025218e1fee8ee382b63ad38009dfec73dc604d2ba80b9ad956c7c96eeed7022
|
||||
@@ -1033,12 +1027,11 @@ lib/codeql/swift/generated/type/UnresolvedType.qll 3b99e19ca7177619fb79e6e8511df
|
||||
lib/codeql/swift/generated/type/VariadicSequenceType.qll 7ece2c953e24d1c51715610f2813bd97f6d9fc6e58e5df0aacadad31e1fd1d8f be0005d973fd7c4c937fc340711fafe7ceba592ac407b88731bc35a1c2800aeb
|
||||
lib/codeql/swift/generated/type/WeakStorageType.qll d46b67f2b7bcc8aa7599e38506e91c219f894df4668ff1f0b5b66c1858040f5b c8e34ec9df085d938e36492d172fbf84ca56fc9d805713b8ada92e1b4c7bef54
|
||||
test/extractor-tests/generated/AvailabilityInfo/AvailabilityInfo.ql 0bb0cfe3f8c38af3b870f8c404c16a5715e80d5ea8fd7939cc13032d7b824809 142ae1e76138b287aa66e091683aae545d139ef2971624e2dfdd3ea454bc2d05
|
||||
test/extractor-tests/generated/AvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
|
||||
test/extractor-tests/generated/Comment/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
|
||||
test/extractor-tests/generated/Diagnostics/Diagnostics.ql c1f8be2c283e13c1a4dadaa008e42f660ea09d9ee1de22b0e8493ef76384546e d84efa40eaecbce6b928a5b235e10bf1e4409a9d0778c365ec19d2fade7ab3ab
|
||||
test/extractor-tests/generated/File/File.ql a1385ef2080e04e8757f61b8e1d0129df9f955edf03fbb3b83cc9cb5498b4e95 0364d8c7f108d01b2641f996efedab7084956307e875e6bc078ea677d04267e0
|
||||
test/extractor-tests/generated/KeyPathComponent/KeyPathComponent.ql 3fa617f8ed1b308d0c56f429ee8abe6d33ef60bf57d87f6dc89fdc8fe969a102 c2fa3153077dbe9e0fc608524dc03c82ff4ed460364d341ee6a817b0d75291c3
|
||||
test/extractor-tests/generated/OtherAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
|
||||
test/extractor-tests/generated/PlatformVersionAvailabilitySpec/MISSING_SOURCE.txt 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d 35fb32ea5393152eb7a875b20b4e3e4b8c7a997a8959c32417140d57a16a052d
|
||||
test/extractor-tests/generated/decl/Accessor/Accessor.ql 7e50dd3c4119162bbfa3e2461300d876c60321d4b6473ddd35e0cb992108570e eb81ed8db92bff46974079e0f1100cf94bd639191a36db45ee9e65467abb6e38
|
||||
test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl.ql 55a78a6b96a17532178a39bd39aa4df23295f98019bb00de041ba15dfd4f84d9 51dbcd86203d5d031d748f77943a81c2c50de4ff559af20a4a1a682a19978d4f
|
||||
test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl.ql fd62be6c38d39f371c20e8c2f233e37a9da5aa234588920634f5db67e8beb3bd d51d35d4fd6a21cd596e064e0221d0c86e36312412a9bd4e64f431c123f3019a
|
||||
|
||||
11
swift/ql/.gitattributes
generated
vendored
11
swift/ql/.gitattributes
generated
vendored
@@ -15,8 +15,6 @@
|
||||
/lib/codeql/swift/elements/Locatable.qll linguist-generated
|
||||
/lib/codeql/swift/elements/Location.qll linguist-generated
|
||||
/lib/codeql/swift/elements/MacroRole.qll linguist-generated
|
||||
/lib/codeql/swift/elements/OtherAvailabilitySpec.qll linguist-generated
|
||||
/lib/codeql/swift/elements/PlatformVersionAvailabilitySpec.qll linguist-generated
|
||||
/lib/codeql/swift/elements/UnknownFile.qll linguist-generated
|
||||
/lib/codeql/swift/elements/UnknownLocation.qll linguist-generated
|
||||
/lib/codeql/swift/elements/UnspecifiedElement.qll linguist-generated
|
||||
@@ -435,7 +433,7 @@
|
||||
/lib/codeql/swift/elements/expr/internal/UnsafeCastExprImpl.qll linguist-generated
|
||||
/lib/codeql/swift/elements/expr/internal/VarargExpansionExprConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/AvailabilityInfoConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/AvailabilitySpecImpl.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/AvailabilitySpecConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/CommentConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/DbFileConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/DbFileImpl.qll linguist-generated
|
||||
@@ -445,8 +443,6 @@
|
||||
/lib/codeql/swift/elements/internal/ErrorElementImpl.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/KeyPathComponentConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/MacroRoleConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/OtherAvailabilitySpecConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/PlatformVersionAvailabilitySpecConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/internal/UnspecifiedElementConstructor.qll linguist-generated
|
||||
/lib/codeql/swift/elements/pattern/AnyPattern.qll linguist-generated
|
||||
/lib/codeql/swift/elements/pattern/BindingPattern.qll linguist-generated
|
||||
@@ -734,9 +730,7 @@
|
||||
/lib/codeql/swift/generated/Locatable.qll linguist-generated
|
||||
/lib/codeql/swift/generated/Location.qll linguist-generated
|
||||
/lib/codeql/swift/generated/MacroRole.qll linguist-generated
|
||||
/lib/codeql/swift/generated/OtherAvailabilitySpec.qll linguist-generated
|
||||
/lib/codeql/swift/generated/ParentChild.qll linguist-generated
|
||||
/lib/codeql/swift/generated/PlatformVersionAvailabilitySpec.qll linguist-generated
|
||||
/lib/codeql/swift/generated/PureSynthConstructors.qll linguist-generated
|
||||
/lib/codeql/swift/generated/Raw.qll linguist-generated
|
||||
/lib/codeql/swift/generated/Synth.qll linguist-generated
|
||||
@@ -1035,12 +1029,11 @@
|
||||
/lib/codeql/swift/generated/type/VariadicSequenceType.qll linguist-generated
|
||||
/lib/codeql/swift/generated/type/WeakStorageType.qll linguist-generated
|
||||
/test/extractor-tests/generated/AvailabilityInfo/AvailabilityInfo.ql linguist-generated
|
||||
/test/extractor-tests/generated/AvailabilitySpec/MISSING_SOURCE.txt linguist-generated
|
||||
/test/extractor-tests/generated/Comment/MISSING_SOURCE.txt linguist-generated
|
||||
/test/extractor-tests/generated/Diagnostics/Diagnostics.ql linguist-generated
|
||||
/test/extractor-tests/generated/File/File.ql linguist-generated
|
||||
/test/extractor-tests/generated/KeyPathComponent/KeyPathComponent.ql linguist-generated
|
||||
/test/extractor-tests/generated/OtherAvailabilitySpec/MISSING_SOURCE.txt linguist-generated
|
||||
/test/extractor-tests/generated/PlatformVersionAvailabilitySpec/MISSING_SOURCE.txt linguist-generated
|
||||
/test/extractor-tests/generated/decl/Accessor/Accessor.ql linguist-generated
|
||||
/test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl.ql linguist-generated
|
||||
/test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl.ql linguist-generated
|
||||
|
||||
2
swift/ql/lib/codeql/swift/elements.qll
generated
2
swift/ql/lib/codeql/swift/elements.qll
generated
@@ -18,8 +18,6 @@ import codeql.swift.elements.KeyPathComponent
|
||||
import codeql.swift.elements.Locatable
|
||||
import codeql.swift.elements.Location
|
||||
import codeql.swift.elements.MacroRole
|
||||
import codeql.swift.elements.OtherAvailabilitySpec
|
||||
import codeql.swift.elements.PlatformVersionAvailabilitySpec
|
||||
import codeql.swift.elements.UnknownFile
|
||||
import codeql.swift.elements.UnknownLocation
|
||||
import codeql.swift.elements.UnspecifiedElement
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the public class `OtherAvailabilitySpec`.
|
||||
*/
|
||||
|
||||
private import internal.OtherAvailabilitySpecImpl
|
||||
import codeql.swift.elements.AvailabilitySpec
|
||||
|
||||
/**
|
||||
* A wildcard availability spec `*`
|
||||
*/
|
||||
final class OtherAvailabilitySpec = Impl::OtherAvailabilitySpec;
|
||||
@@ -1,12 +0,0 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the public class `PlatformVersionAvailabilitySpec`.
|
||||
*/
|
||||
|
||||
private import internal.PlatformVersionAvailabilitySpecImpl
|
||||
import codeql.swift.elements.AvailabilitySpec
|
||||
|
||||
/**
|
||||
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
*/
|
||||
final class PlatformVersionAvailabilitySpec = Impl::PlatformVersionAvailabilitySpec;
|
||||
@@ -1,14 +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
|
||||
* `OtherAvailabilitySpec` synthesized instances.
|
||||
* `AvailabilitySpec` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Raw
|
||||
|
||||
/**
|
||||
* The characteristic predicate of `OtherAvailabilitySpec` synthesized instances.
|
||||
* The characteristic predicate of `AvailabilitySpec` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
predicate constructOtherAvailabilitySpec(Raw::OtherAvailabilitySpec id) { any() }
|
||||
predicate constructAvailabilitySpec(Raw::AvailabilitySpec id) { any() }
|
||||
@@ -1,10 +1,3 @@
|
||||
// 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 `AvailabilitySpec`.
|
||||
*
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.AvailabilitySpec
|
||||
|
||||
/**
|
||||
@@ -12,11 +5,18 @@ private import codeql.swift.generated.AvailabilitySpec
|
||||
* be referenced directly.
|
||||
*/
|
||||
module Impl {
|
||||
// the following QLdoc is generated: if you need to edit it, do it in the schema file
|
||||
/**
|
||||
* An availability spec, that is, part of an `AvailabilityInfo` condition. For example `iOS 12` and `*` in:
|
||||
* ```
|
||||
* if #available(iOS 12, *)
|
||||
* ```
|
||||
*/
|
||||
class AvailabilitySpec extends Generated::AvailabilitySpec { }
|
||||
class AvailabilitySpec extends Generated::AvailabilitySpec {
|
||||
override string toStringImpl() {
|
||||
if this.isWildcard()
|
||||
then result = "*"
|
||||
else result = this.getPlatform() + " " + this.getVersion()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
private import codeql.swift.generated.OtherAvailabilitySpec
|
||||
|
||||
module Impl {
|
||||
// the following QLdoc is generated: if you need to edit it, do it in the schema file
|
||||
/**
|
||||
* A wildcard availability spec `*`
|
||||
*/
|
||||
class OtherAvailabilitySpec extends Generated::OtherAvailabilitySpec {
|
||||
override string toStringImpl() { result = "*" }
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
// 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
|
||||
* `PlatformVersionAvailabilitySpec` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Raw
|
||||
|
||||
/**
|
||||
* The characteristic predicate of `PlatformVersionAvailabilitySpec` synthesized instances.
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
predicate constructPlatformVersionAvailabilitySpec(Raw::PlatformVersionAvailabilitySpec id) {
|
||||
any()
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
private import codeql.swift.generated.PlatformVersionAvailabilitySpec
|
||||
|
||||
module Impl {
|
||||
// the following QLdoc is generated: if you need to edit it, do it in the schema file
|
||||
/**
|
||||
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
*/
|
||||
class PlatformVersionAvailabilitySpec extends Generated::PlatformVersionAvailabilitySpec {
|
||||
override string toStringImpl() { result = this.getPlatform() + " " + this.getVersion() }
|
||||
}
|
||||
}
|
||||
@@ -21,5 +21,38 @@ module Generated {
|
||||
* INTERNAL: Do not reference the `Generated::AvailabilitySpec` class directly.
|
||||
* Use the subclass `AvailabilitySpec`, where the following predicates are available.
|
||||
*/
|
||||
class AvailabilitySpec extends Synth::TAvailabilitySpec, AstNodeImpl::AstNode { }
|
||||
class AvailabilitySpec extends Synth::TAvailabilitySpec, AstNodeImpl::AstNode {
|
||||
override string getAPrimaryQlClass() { result = "AvailabilitySpec" }
|
||||
|
||||
/**
|
||||
* Gets the platform of this availability spec, if it exists.
|
||||
*/
|
||||
string getPlatform() {
|
||||
result = Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).getPlatform()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getPlatform()` exists.
|
||||
*/
|
||||
final predicate hasPlatform() { exists(this.getPlatform()) }
|
||||
|
||||
/**
|
||||
* Gets the version of this availability spec, if it exists.
|
||||
*/
|
||||
string getVersion() {
|
||||
result = Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).getVersion()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if `getVersion()` exists.
|
||||
*/
|
||||
final predicate hasVersion() { exists(this.getVersion()) }
|
||||
|
||||
/**
|
||||
* Holds if this availability spec is wildcard.
|
||||
*/
|
||||
predicate isWildcard() {
|
||||
Synth::convertAvailabilitySpecToRaw(this).(Raw::AvailabilitySpec).isWildcard()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the generated definition of `OtherAvailabilitySpec`.
|
||||
* INTERNAL: Do not import directly.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Synth
|
||||
private import codeql.swift.generated.Raw
|
||||
import codeql.swift.elements.internal.AvailabilitySpecImpl::Impl as AvailabilitySpecImpl
|
||||
|
||||
/**
|
||||
* INTERNAL: This module contains the fully generated definition of `OtherAvailabilitySpec` and should not
|
||||
* be referenced directly.
|
||||
*/
|
||||
module Generated {
|
||||
/**
|
||||
* A wildcard availability spec `*`
|
||||
* INTERNAL: Do not reference the `Generated::OtherAvailabilitySpec` class directly.
|
||||
* Use the subclass `OtherAvailabilitySpec`, where the following predicates are available.
|
||||
*/
|
||||
class OtherAvailabilitySpec extends Synth::TOtherAvailabilitySpec,
|
||||
AvailabilitySpecImpl::AvailabilitySpec
|
||||
{
|
||||
override string getAPrimaryQlClass() { result = "OtherAvailabilitySpec" }
|
||||
}
|
||||
}
|
||||
24
swift/ql/lib/codeql/swift/generated/ParentChild.qll
generated
24
swift/ql/lib/codeql/swift/generated/ParentChild.qll
generated
@@ -55,6 +55,12 @@ private module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfAvailabilitySpec(
|
||||
AvailabilitySpec e, int index, string partialPredicateCall
|
||||
) {
|
||||
none()
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfKeyPathComponent(
|
||||
KeyPathComponent e, int index, string partialPredicateCall
|
||||
) {
|
||||
@@ -89,18 +95,6 @@ private module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfOtherAvailabilitySpec(
|
||||
OtherAvailabilitySpec e, int index, string partialPredicateCall
|
||||
) {
|
||||
none()
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfPlatformVersionAvailabilitySpec(
|
||||
PlatformVersionAvailabilitySpec e, int index, string partialPredicateCall
|
||||
) {
|
||||
none()
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfCapturedDecl(
|
||||
CapturedDecl e, int index, string partialPredicateCall
|
||||
) {
|
||||
@@ -3188,16 +3182,14 @@ private module Impl {
|
||||
or
|
||||
result = getImmediateChildOfAvailabilityInfo(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfAvailabilitySpec(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfKeyPathComponent(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfMacroRole(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfUnspecifiedElement(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfOtherAvailabilitySpec(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfPlatformVersionAvailabilitySpec(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfCapturedDecl(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfEnumCaseDecl(e, index, partialAccessor)
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
/**
|
||||
* This module provides the generated definition of `PlatformVersionAvailabilitySpec`.
|
||||
* INTERNAL: Do not import directly.
|
||||
*/
|
||||
|
||||
private import codeql.swift.generated.Synth
|
||||
private import codeql.swift.generated.Raw
|
||||
import codeql.swift.elements.internal.AvailabilitySpecImpl::Impl as AvailabilitySpecImpl
|
||||
|
||||
/**
|
||||
* INTERNAL: This module contains the fully generated definition of `PlatformVersionAvailabilitySpec` and should not
|
||||
* be referenced directly.
|
||||
*/
|
||||
module Generated {
|
||||
/**
|
||||
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
* INTERNAL: Do not reference the `Generated::PlatformVersionAvailabilitySpec` class directly.
|
||||
* Use the subclass `PlatformVersionAvailabilitySpec`, where the following predicates are available.
|
||||
*/
|
||||
class PlatformVersionAvailabilitySpec extends Synth::TPlatformVersionAvailabilitySpec,
|
||||
AvailabilitySpecImpl::AvailabilitySpec
|
||||
{
|
||||
override string getAPrimaryQlClass() { result = "PlatformVersionAvailabilitySpec" }
|
||||
|
||||
/**
|
||||
* Gets the platform of this platform version availability spec.
|
||||
*/
|
||||
string getPlatform() {
|
||||
result =
|
||||
Synth::convertPlatformVersionAvailabilitySpecToRaw(this)
|
||||
.(Raw::PlatformVersionAvailabilitySpec)
|
||||
.getPlatform()
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version of this platform version availability spec.
|
||||
*/
|
||||
string getVersion() {
|
||||
result =
|
||||
Synth::convertPlatformVersionAvailabilitySpecToRaw(this)
|
||||
.(Raw::PlatformVersionAvailabilitySpec)
|
||||
.getVersion()
|
||||
}
|
||||
}
|
||||
}
|
||||
47
swift/ql/lib/codeql/swift/generated/Raw.qll
generated
47
swift/ql/lib/codeql/swift/generated/Raw.qll
generated
@@ -161,7 +161,24 @@ module Raw {
|
||||
* if #available(iOS 12, *)
|
||||
* ```
|
||||
*/
|
||||
class AvailabilitySpec extends @availability_spec, AstNode { }
|
||||
class AvailabilitySpec extends @availability_spec, AstNode {
|
||||
override string toString() { result = "AvailabilitySpec" }
|
||||
|
||||
/**
|
||||
* Gets the platform of this availability spec, if it exists.
|
||||
*/
|
||||
string getPlatform() { availability_spec_platforms(this, result) }
|
||||
|
||||
/**
|
||||
* Gets the version of this availability spec, if it exists.
|
||||
*/
|
||||
string getVersion() { availability_spec_versions(this, result) }
|
||||
|
||||
/**
|
||||
* Holds if this availability spec is wildcard.
|
||||
*/
|
||||
predicate isWildcard() { availability_spec_is_wildcard(this) }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
@@ -308,34 +325,6 @@ module Raw {
|
||||
AstNode getChild(int index) { unspecified_element_children(this, index, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* A wildcard availability spec `*`
|
||||
*/
|
||||
class OtherAvailabilitySpec extends @other_availability_spec, AvailabilitySpec {
|
||||
override string toString() { result = "OtherAvailabilitySpec" }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
*/
|
||||
class PlatformVersionAvailabilitySpec extends @platform_version_availability_spec,
|
||||
AvailabilitySpec
|
||||
{
|
||||
override string toString() { result = "PlatformVersionAvailabilitySpec" }
|
||||
|
||||
/**
|
||||
* Gets the platform of this platform version availability spec.
|
||||
*/
|
||||
string getPlatform() { platform_version_availability_specs(this, result, _) }
|
||||
|
||||
/**
|
||||
* Gets the version of this platform version availability spec.
|
||||
*/
|
||||
string getVersion() { platform_version_availability_specs(this, _, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
|
||||
83
swift/ql/lib/codeql/swift/generated/Synth.qll
generated
83
swift/ql/lib/codeql/swift/generated/Synth.qll
generated
@@ -18,6 +18,10 @@ module Synth {
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TAvailabilityInfo(Raw::AvailabilityInfo id) { constructAvailabilityInfo(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TAvailabilitySpec(Raw::AvailabilitySpec id) { constructAvailabilitySpec(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
@@ -42,16 +46,6 @@ module Synth {
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TMacroRole(Raw::MacroRole id) { constructMacroRole(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TOtherAvailabilitySpec(Raw::OtherAvailabilitySpec id) { constructOtherAvailabilitySpec(id) } or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
TPlatformVersionAvailabilitySpec(Raw::PlatformVersionAvailabilitySpec id) {
|
||||
constructPlatformVersionAvailabilitySpec(id)
|
||||
} or
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
@@ -1123,11 +1117,6 @@ module Synth {
|
||||
TDecl or TExpr or TKeyPathComponent or TMacroRole or TPattern or TStmt or TStmtCondition or
|
||||
TTypeRepr;
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
class TAvailabilitySpec = TOtherAvailabilitySpec or TPlatformVersionAvailabilitySpec;
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
*/
|
||||
@@ -1455,6 +1444,12 @@ module Synth {
|
||||
*/
|
||||
TAvailabilityInfo convertAvailabilityInfoFromRaw(Raw::Element e) { result = TAvailabilityInfo(e) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TAvailabilitySpec`, if possible.
|
||||
*/
|
||||
TAvailabilitySpec convertAvailabilitySpecFromRaw(Raw::Element e) { result = TAvailabilitySpec(e) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TComment`, if possible.
|
||||
@@ -1491,22 +1486,6 @@ module Synth {
|
||||
*/
|
||||
TMacroRole convertMacroRoleFromRaw(Raw::Element e) { result = TMacroRole(e) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TOtherAvailabilitySpec`, if possible.
|
||||
*/
|
||||
TOtherAvailabilitySpec convertOtherAvailabilitySpecFromRaw(Raw::Element e) {
|
||||
result = TOtherAvailabilitySpec(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TPlatformVersionAvailabilitySpec`, if possible.
|
||||
*/
|
||||
TPlatformVersionAvailabilitySpec convertPlatformVersionAvailabilitySpecFromRaw(Raw::Element e) {
|
||||
result = TPlatformVersionAvailabilitySpec(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw element to a synthesized `TUnknownFile`, if possible.
|
||||
@@ -3241,16 +3220,6 @@ module Synth {
|
||||
result = convertTypeReprFromRaw(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw DB element to a synthesized `TAvailabilitySpec`, if possible.
|
||||
*/
|
||||
TAvailabilitySpec convertAvailabilitySpecFromRaw(Raw::Element e) {
|
||||
result = convertOtherAvailabilitySpecFromRaw(e)
|
||||
or
|
||||
result = convertPlatformVersionAvailabilitySpecFromRaw(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a raw DB element to a synthesized `TCallable`, if possible.
|
||||
@@ -4199,6 +4168,12 @@ module Synth {
|
||||
*/
|
||||
Raw::Element convertAvailabilityInfoToRaw(TAvailabilityInfo e) { e = TAvailabilityInfo(result) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TAvailabilitySpec` to a raw DB element, if possible.
|
||||
*/
|
||||
Raw::Element convertAvailabilitySpecToRaw(TAvailabilitySpec e) { e = TAvailabilitySpec(result) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TComment` to a raw DB element, if possible.
|
||||
@@ -4235,22 +4210,6 @@ module Synth {
|
||||
*/
|
||||
Raw::Element convertMacroRoleToRaw(TMacroRole e) { e = TMacroRole(result) }
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TOtherAvailabilitySpec` to a raw DB element, if possible.
|
||||
*/
|
||||
Raw::Element convertOtherAvailabilitySpecToRaw(TOtherAvailabilitySpec e) {
|
||||
e = TOtherAvailabilitySpec(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TPlatformVersionAvailabilitySpec` to a raw DB element, if possible.
|
||||
*/
|
||||
Raw::Element convertPlatformVersionAvailabilitySpecToRaw(TPlatformVersionAvailabilitySpec e) {
|
||||
e = TPlatformVersionAvailabilitySpec(result)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TUnknownFile` to a raw DB element, if possible.
|
||||
@@ -5983,16 +5942,6 @@ module Synth {
|
||||
result = convertTypeReprToRaw(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TAvailabilitySpec` to a raw DB element, if possible.
|
||||
*/
|
||||
Raw::Element convertAvailabilitySpecToRaw(TAvailabilitySpec e) {
|
||||
result = convertOtherAvailabilitySpecToRaw(e)
|
||||
or
|
||||
result = convertPlatformVersionAvailabilitySpecToRaw(e)
|
||||
}
|
||||
|
||||
/**
|
||||
* INTERNAL: Do not use.
|
||||
* Converts a synthesized `TCallable` to a raw DB element, if possible.
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
*/
|
||||
|
||||
import codeql.swift.elements.internal.AvailabilityInfoConstructor
|
||||
import codeql.swift.elements.internal.AvailabilitySpecConstructor
|
||||
import codeql.swift.elements.internal.CommentConstructor
|
||||
import codeql.swift.elements.internal.DbFileConstructor
|
||||
import codeql.swift.elements.internal.DbLocationConstructor
|
||||
import codeql.swift.elements.internal.DiagnosticsConstructor
|
||||
import codeql.swift.elements.internal.KeyPathComponentConstructor
|
||||
import codeql.swift.elements.internal.MacroRoleConstructor
|
||||
import codeql.swift.elements.internal.OtherAvailabilitySpecConstructor
|
||||
import codeql.swift.elements.internal.PlatformVersionAvailabilitySpecConstructor
|
||||
import codeql.swift.elements.internal.UnspecifiedElementConstructor
|
||||
import codeql.swift.elements.decl.internal.AccessorConstructor
|
||||
import codeql.swift.elements.decl.internal.AssociatedTypeDeclConstructor
|
||||
|
||||
34
swift/ql/lib/swift.dbscheme
generated
34
swift/ql/lib/swift.dbscheme
generated
@@ -133,10 +133,26 @@ availability_info_specs(
|
||||
int spec: @availability_spec_or_none ref
|
||||
);
|
||||
|
||||
@availability_spec =
|
||||
@other_availability_spec
|
||||
| @platform_version_availability_spec
|
||||
;
|
||||
availability_specs(
|
||||
unique int id: @availability_spec
|
||||
);
|
||||
|
||||
#keyset[id]
|
||||
availability_spec_platforms(
|
||||
int id: @availability_spec ref,
|
||||
string platform: string ref
|
||||
);
|
||||
|
||||
#keyset[id]
|
||||
availability_spec_versions(
|
||||
int id: @availability_spec ref,
|
||||
string version: string ref
|
||||
);
|
||||
|
||||
#keyset[id]
|
||||
availability_spec_is_wildcard(
|
||||
int id: @availability_spec ref
|
||||
);
|
||||
|
||||
@callable =
|
||||
@closure_expr
|
||||
@@ -245,16 +261,6 @@ unspecified_element_children(
|
||||
int child: @ast_node_or_none ref
|
||||
);
|
||||
|
||||
other_availability_specs(
|
||||
unique int id: @other_availability_spec
|
||||
);
|
||||
|
||||
platform_version_availability_specs(
|
||||
unique int id: @platform_version_availability_spec,
|
||||
string platform: string ref,
|
||||
string version: string ref
|
||||
);
|
||||
|
||||
@decl =
|
||||
@captured_decl
|
||||
| @enum_case_decl
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
// generated by codegen/codegen.py, do not edit
|
||||
|
||||
After a source file is added in this directory and codegen/codegen.py is run again, test queries
|
||||
will appear and this file will be deleted
|
||||
@@ -905,20 +905,9 @@ class AvailabilitySpec(AstNode):
|
||||
if #available(iOS 12, *)
|
||||
```
|
||||
"""
|
||||
pass
|
||||
|
||||
class PlatformVersionAvailabilitySpec(AvailabilitySpec):
|
||||
"""
|
||||
An availability spec based on platform and version, for example `macOS 12` or `watchOS 14`
|
||||
"""
|
||||
platform: string
|
||||
version: string
|
||||
|
||||
class OtherAvailabilitySpec(AvailabilitySpec):
|
||||
"""
|
||||
A wildcard availability spec `*`
|
||||
"""
|
||||
pass
|
||||
platform: optional[string]
|
||||
version: optional[string]
|
||||
is_wildcard: predicate
|
||||
|
||||
class AvailabilityInfo(AstNode):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user