mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Merge pull request #11855 from d10c/swift/extract-captures
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
||||
description: Revert adding closure capture information
|
||||
compatibility: full
|
||||
|
||||
callable_captures.rel: delete
|
||||
captured_decls.rel: delete
|
||||
captured_decl_is_direct.rel: delete
|
||||
captured_decl_is_escaping.rel: delete
|
||||
@@ -29,7 +29,8 @@ class SwiftDispatcher {
|
||||
const swift::Expr*,
|
||||
const swift::Pattern*,
|
||||
const swift::TypeRepr*,
|
||||
const swift::TypeBase*>;
|
||||
const swift::TypeBase*,
|
||||
const swift::CapturedValue*>;
|
||||
|
||||
template <typename E>
|
||||
static constexpr bool IsStorable = std::is_constructible_v<Store::Handle, const E&>;
|
||||
@@ -218,6 +219,10 @@ class SwiftDispatcher {
|
||||
attachLocation(locatable->getStartLoc(), locatable->getEndLoc(), locatableLabel);
|
||||
}
|
||||
|
||||
void attachLocation(const swift::CapturedValue* capture, TrapLabel<LocatableTag> locatableLabel) {
|
||||
attachLocation(capture->getLoc(), locatableLabel);
|
||||
}
|
||||
|
||||
void attachLocation(const swift::IfConfigClause* clause, TrapLabel<LocatableTag> locatableLabel) {
|
||||
attachLocation(clause->Loc, clause->Loc, locatableLabel);
|
||||
}
|
||||
@@ -364,6 +369,7 @@ class SwiftDispatcher {
|
||||
virtual void visit(const swift::Pattern* pattern) = 0;
|
||||
virtual void visit(const swift::TypeRepr* typeRepr, swift::Type type) = 0;
|
||||
virtual void visit(const swift::TypeBase* type) = 0;
|
||||
virtual void visit(const swift::CapturedValue* capture) = 0;
|
||||
|
||||
const swift::SourceManager& sourceManager;
|
||||
TrapDomain& trap;
|
||||
|
||||
@@ -32,6 +32,7 @@ MAP(std::filesystem::path, DbFileTag)
|
||||
MAP(swift::StmtCondition, StmtConditionTag)
|
||||
MAP(swift::StmtConditionElement, ConditionElementTag)
|
||||
MAP(swift::CaseLabelItem, CaseLabelItemTag)
|
||||
MAP(swift::CapturedValue, CapturedDeclTag)
|
||||
|
||||
MAP(swift::Stmt, StmtTag)
|
||||
MAP(swift::BraceStmt, BraceStmtTag)
|
||||
|
||||
@@ -334,6 +334,7 @@ void DeclTranslator::fillAbstractFunctionDecl(const swift::AbstractFunctionDecl&
|
||||
entry.params = dispatcher.fetchRepeatedLabels(*decl.getParameters());
|
||||
auto self = const_cast<swift::ParamDecl* const>(decl.getImplicitSelfDecl());
|
||||
entry.self_param = dispatcher.fetchOptionalLabel(self);
|
||||
entry.captures = dispatcher.fetchRepeatedLabels(decl.getCaptureInfo().getCaptures());
|
||||
fillValueDecl(decl, entry);
|
||||
fillGenericContext(decl, entry);
|
||||
}
|
||||
@@ -439,4 +440,14 @@ codeql::MissingMemberDecl DeclTranslator::translateMissingMemberDecl(
|
||||
entry.name = decl.getName().getBaseName().userFacingName().str();
|
||||
return entry;
|
||||
}
|
||||
|
||||
codeql::CapturedDecl DeclTranslator::translateCapturedValue(const swift::CapturedValue& capture) {
|
||||
codeql::CapturedDecl entry{dispatcher.template assignNewLabel(capture)};
|
||||
auto decl = capture.getDecl();
|
||||
entry.decl = dispatcher.fetchLabel(decl);
|
||||
entry.module = dispatcher.fetchLabel(decl->getModuleContext());
|
||||
entry.is_direct = capture.isDirect();
|
||||
entry.is_escaping = !capture.isNoEscape();
|
||||
return entry;
|
||||
}
|
||||
} // namespace codeql
|
||||
|
||||
@@ -48,6 +48,7 @@ class DeclTranslator : public AstTranslatorBase<DeclTranslator> {
|
||||
std::optional<codeql::OpaqueTypeDecl> translateOpaqueTypeDecl(const swift::OpaqueTypeDecl& decl);
|
||||
codeql::PoundDiagnosticDecl translatePoundDiagnosticDecl(const swift::PoundDiagnosticDecl& decl);
|
||||
codeql::MissingMemberDecl translateMissingMemberDecl(const swift::MissingMemberDecl& decl);
|
||||
codeql::CapturedDecl translateCapturedValue(const swift::CapturedValue& capture);
|
||||
|
||||
private:
|
||||
std::string mangledName(const swift::ValueDecl& decl);
|
||||
|
||||
@@ -477,6 +477,7 @@ void ExprTranslator::fillAbstractClosureExpr(const swift::AbstractClosureExpr& e
|
||||
assert(expr.getParameters() && "AbstractClosureExpr has getParameters()");
|
||||
entry.params = dispatcher.fetchRepeatedLabels(*expr.getParameters());
|
||||
entry.body = dispatcher.fetchLabel(expr.getBody());
|
||||
entry.captures = dispatcher.fetchRepeatedLabels(expr.getCaptureInfo().getCaptures());
|
||||
}
|
||||
|
||||
TrapLabel<ArgumentTag> ExprTranslator::emitArgument(const swift::Argument& arg) {
|
||||
|
||||
@@ -39,6 +39,10 @@ class SwiftVisitor : private SwiftDispatcher {
|
||||
typeTranslator.translateAndEmit(*typeRepr, type);
|
||||
}
|
||||
|
||||
void visit(const swift::CapturedValue* capture) override {
|
||||
declTranslator.translateAndEmit(*capture);
|
||||
}
|
||||
|
||||
DeclTranslator declTranslator{*this};
|
||||
ExprTranslator exprTranslator{*this};
|
||||
StmtTranslator stmtTranslator{*this};
|
||||
|
||||
@@ -118,6 +118,10 @@ class AstTranslatorBase : private swift::ASTVisitor<CrtpSubclass>,
|
||||
swift::ASTVisitor<CrtpSubclass>::visit(const_cast<E*>(&entity));
|
||||
}
|
||||
|
||||
void translateAndEmit(const swift::CapturedValue& e) {
|
||||
dispatcher.emit(static_cast<CrtpSubclass*>(this)->translateCapturedValue(e));
|
||||
}
|
||||
|
||||
private:
|
||||
friend class swift::ASTVisitor<CrtpSubclass>;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ ql/lib/codeql/swift/elements/decl/AbstractTypeParamDecl.qll 83950437007703c0f35e
|
||||
ql/lib/codeql/swift/elements/decl/AccessorDeclConstructor.qll 08376434fd14a2b07280e931d3e22d3eafd2063d745f7c78cad0f9fd7e6156ba 6f74d15a88433953998a07eb2131841679a88cb13efb0569ed9b5502c4a2e362
|
||||
ql/lib/codeql/swift/elements/decl/AssociatedTypeDecl.qll ae6107c8d9ee9affa7e8430a4d8cd58879578eafcfba668275af4d20f8ea9c53 e81dc740623b4e2c75f83104acaa3d2b6cc6d001dd36a8520c381e0de10e15c4
|
||||
ql/lib/codeql/swift/elements/decl/AssociatedTypeDeclConstructor.qll ec9007ea072ff22c367f40da69db2f0a8463bb411bbfd33e2d6c8b489a496027 631f688a8410ddcfbaa575fa2f8ffcdbc1b51ee37639b337c804ca1d5af56e0c
|
||||
ql/lib/codeql/swift/elements/decl/CapturedDeclConstructor.qll 4a33802b047de8d52778c262329f17b88de79c2b3162ebfa3d2b1d40dbf97041 0ed1c94469236252cf81e014138a6b2e6478e3b194512ba36e2a43e03e46cc4a
|
||||
ql/lib/codeql/swift/elements/decl/ClassDecl.qll 225405ad04e5e959319fbc1ea086ec4eab0b66f5671ebc58290cce45e4103c51 ac681bdc1770a823ea529456f32b1da7b389621254ccd9102e6a49136c53854b
|
||||
ql/lib/codeql/swift/elements/decl/ClassDeclConstructor.qll 0092ab4b76cd858489d76be94a43442c0e5f395b1d5684309674957e107979b7 9bc496e483feb88552ca0d48e32039aa4566f4612fc27073fea48ad954985d46
|
||||
ql/lib/codeql/swift/elements/decl/ConcreteFuncDecl.qll 7dd23b6145977ec6ca60dd39cf9db09673e0340cdb8de2080279c83599ccd831 3a07a73dc11ef06ddaeb3d401748ef14a1ee66447c86d2e8c8f187dda92b34a2
|
||||
@@ -363,9 +364,9 @@ ql/lib/codeql/swift/elements/type/VariadicSequenceType.qll 5bca77dd661d3b2653d31
|
||||
ql/lib/codeql/swift/elements/type/VariadicSequenceTypeConstructor.qll 0d1d2328a3b5e503a883e7e6d7efd0ca5e7f2633abead9e4c94a9f98ed3cb223 69bff81c1b9413949eacb9298d2efb718ea808e68364569a1090c9878c4af856
|
||||
ql/lib/codeql/swift/elements/type/WeakStorageType.qll 87a28616eea3600fb0156fffcd65eeddc1ea74ce9c0ba5886c6365b9359e00ce 9c968414d7cc8d672f3754bced5d4f83f43a6d7872d0d263d79ff60483e1f996
|
||||
ql/lib/codeql/swift/elements/type/WeakStorageTypeConstructor.qll d88b031ef44d6de14b3ddcff2eb47b53dbd11550c37250ff2edb42e5d21ec3e9 26d855c33492cf7a118e439f7baeed0e5425cfaf058b1dcc007eca7ed765c897
|
||||
ql/lib/codeql/swift/elements.qll 1cab985d76142988a328bdcbbf47c12dad09fa950333ec4c15f220b199ef75ef 1cab985d76142988a328bdcbbf47c12dad09fa950333ec4c15f220b199ef75ef
|
||||
ql/lib/codeql/swift/elements.qll 3d387d94fce53782d0729062e3b4f0235e8a92365371410bfd4850b0b5bf2972 3d387d94fce53782d0729062e3b4f0235e8a92365371410bfd4850b0b5bf2972
|
||||
ql/lib/codeql/swift/generated/AstNode.qll 02ca56d82801f942ae6265c6079d92ccafdf6b532f6bcebd98a04029ddf696e4 6216fda240e45bd4302fa0cf0f08f5f945418b144659264cdda84622b0420aa2
|
||||
ql/lib/codeql/swift/generated/Callable.qll cc67625a86b62f91d1480e284a946aa5274a21a7da03d7ad9f1dc2197927d394 7ee41be3d36c74ed5662d7c1babe591942429f87020d09d7ba2c447ba058fb0a
|
||||
ql/lib/codeql/swift/generated/Callable.qll 042b4f975f1e416c48b5bf26bee257549eec13fb262f11025375560f75a73582 0434788243bc54e48fec49e4cce93509b9a2333f2079dacb6ffc12c972853540
|
||||
ql/lib/codeql/swift/generated/Comment.qll f58b49f6e68c21f87c51e2ff84c8a64b09286d733e86f70d67d3a98fe6260bd6 975bbb599a2a7adc35179f6ae06d9cbc56ea8a03b972ef2ee87604834bc6deb1
|
||||
ql/lib/codeql/swift/generated/DbFile.qll a49b2a2cb2788cb49c861ebcd458b8daead7b15adb19c3a9f4db3bf39a0051fc a49b2a2cb2788cb49c861ebcd458b8daead7b15adb19c3a9f4db3bf39a0051fc
|
||||
ql/lib/codeql/swift/generated/DbLocation.qll b9baea963d9fa82068986512c0649d1050897654eee3df51dba17cf6b1170873 b9baea963d9fa82068986512c0649d1050897654eee3df51dba17cf6b1170873
|
||||
@@ -375,11 +376,11 @@ ql/lib/codeql/swift/generated/ErrorElement.qll 4b032abe8ffb71376a29c63e470a52943
|
||||
ql/lib/codeql/swift/generated/File.qll 61454459f5f1ae378bd4970ad1da4f39f3e696bac8a5eebdd162f131995c5316 3e6805f8858cd55dd0e0d0e5aeab923d6a55292dbf98b0029db1ae0208efe684
|
||||
ql/lib/codeql/swift/generated/Locatable.qll bdc98b9fb7788f44a4bf7e487ee5bd329473409950a8e9f116d61995615ad849 0b36b4fe45e2aa195e4bb70c50ea95f32f141b8e01e5f23466c6427dd9ab88fb
|
||||
ql/lib/codeql/swift/generated/Location.qll 851766e474cdfdfa67da42e0031fc42dd60196ff5edd39d82f08d3e32deb84c1 b29b2c37672f5acff15f1d3c5727d902f193e51122327b31bd27ec5f877bca3b
|
||||
ql/lib/codeql/swift/generated/ParentChild.qll 254455f775de22e625d349fb0a953a86894233ad40aabd8ae8877bebbd1d8432 c77bd5423d79b08354fe8905b9f262abe0d48f8ed22b41263d12ee8e1e202b00
|
||||
ql/lib/codeql/swift/generated/ParentChild.qll a5ae2e7054de7c2250ffd4ce1e6cbcff125f0f87fc75797467054ac54426cbe2 a945a9b8a1790587d7926062799fe51af60f53db159a9bf4d86bbfd5910e5c58
|
||||
ql/lib/codeql/swift/generated/PureSynthConstructors.qll 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98 173c0dd59396a1de26fe870e3bc2766c46de689da2a4d8807cb62023bbce1a98
|
||||
ql/lib/codeql/swift/generated/Raw.qll 5452ceffbcdc1959e152e321f74363448ac39bf52f6c7d0dab39e7d7593c3c40 9e540580dd52ca67e85d5ceb38fae6179c042a6efd49fd8fdfa3941d690b9331
|
||||
ql/lib/codeql/swift/generated/Synth.qll 2ef42ec87a7943f3c6ebcc95a0db78be227f51d3333f1926cdce65107ec1ba0a a08ff724b500797f68b3cdf91ce7d70ac60b4844d91d5014d0489d963d1c54b0
|
||||
ql/lib/codeql/swift/generated/SynthConstructors.qll 62360813f1419e111732e42e209535a40644997009890d09e4cc70f3918fbf86 62360813f1419e111732e42e209535a40644997009890d09e4cc70f3918fbf86
|
||||
ql/lib/codeql/swift/generated/Raw.qll 737b3a9bb3a67ad83c182dd06b76f633b4377837c2ea886659d07051cac49d17 0a264590d516bea7a15fbf4781d90d377b174994205a3483f890c62fc1919966
|
||||
ql/lib/codeql/swift/generated/Synth.qll 51621505f034f24980e7a940062970b82a74dbf1cd1df507dd50fb00876f6b7c 2ab724386c2eff89cf3894b7dbe91fad27f828eabc01455b9ac2f4b6b44c881e
|
||||
ql/lib/codeql/swift/generated/SynthConstructors.qll 79e4ffbc85a80b1d2c74c45449cd077fbf33d4498ccf93a51351ad0c7cc461ea 79e4ffbc85a80b1d2c74c45449cd077fbf33d4498ccf93a51351ad0c7cc461ea
|
||||
ql/lib/codeql/swift/generated/UnknownFile.qll 0fcf9beb8de79440bcdfff4bb6ab3dd139bd273e6c32754e05e6a632651e85f6 0fcf9beb8de79440bcdfff4bb6ab3dd139bd273e6c32754e05e6a632651e85f6
|
||||
ql/lib/codeql/swift/generated/UnknownLocation.qll e50efefa02a0ec1ff635a00951b5924602fc8cab57e5756e4a039382c69d3882 e50efefa02a0ec1ff635a00951b5924602fc8cab57e5756e4a039382c69d3882
|
||||
ql/lib/codeql/swift/generated/UnspecifiedElement.qll dbc6ca4018012977b26ca184a88044c55b0661e3998cd14d46295b62a8d69625 184c9a0ce18c2ac881943b0fb400613d1401ed1d5564f90716b6c310ba5afe71
|
||||
@@ -388,6 +389,7 @@ ql/lib/codeql/swift/generated/decl/AbstractStorageDecl.qll 882e95e6887741c0cdac4
|
||||
ql/lib/codeql/swift/generated/decl/AbstractTypeParamDecl.qll 1e268b00d0f2dbbd85aa70ac206c5e4a4612f06ba0091e5253483635f486ccf9 5479e13e99f68f1f347283535f8098964f7fd4a34326ff36ad5711b2de1ab0d0
|
||||
ql/lib/codeql/swift/generated/decl/AccessorDecl.qll 443cb9888dbdbaee680bf24469ce097a8292806dc53f0b109d492db621fa00aa 0dbe38cbbd3f3cd880c1569d9d42165e7cf0358da0cc7cb63e89890310ad40a0
|
||||
ql/lib/codeql/swift/generated/decl/AssociatedTypeDecl.qll 4169d083104f9c089223ed3c5968f757b8cd6c726887bbb6fbaf21f5ed7ee144 4169d083104f9c089223ed3c5968f757b8cd6c726887bbb6fbaf21f5ed7ee144
|
||||
ql/lib/codeql/swift/generated/decl/CapturedDecl.qll 18ce5a5d548abb86787096e26ffd4d2432eda3076356d50707a3490e9d3d8459 42708248ba4bcd00a628e836ea192a4b438c0ffe91e31d4e98e497ef896fabac
|
||||
ql/lib/codeql/swift/generated/decl/ClassDecl.qll a60e8af2fdbcd20cfa2049660c8bcbbc00508fbd3dde72b4778317dfc23c5ae4 a60e8af2fdbcd20cfa2049660c8bcbbc00508fbd3dde72b4778317dfc23c5ae4
|
||||
ql/lib/codeql/swift/generated/decl/ConcreteFuncDecl.qll c7192e79ce67f77df36575cceb942f11b182c26c93899469654316de2d543cf9 c7192e79ce67f77df36575cceb942f11b182c26c93899469654316de2d543cf9
|
||||
ql/lib/codeql/swift/generated/decl/ConcreteVarDecl.qll 4801ccc477480c4bc4fc117976fbab152e081064e064c97fbb0f37199cb1d0a8 4d7cfbf5b39b307dd673781adc220fdef04213f2e3d080004fa658ba6d3acb8d
|
||||
@@ -651,8 +653,9 @@ ql/lib/codeql/swift/generated/type/WeakStorageType.qll dda4397a49f537ec44117a86d
|
||||
ql/test/extractor-tests/generated/Comment/MISSING_SOURCE.txt 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd 7e714762ffb48c436102027d560fb5addc1f7dc6dd6936b06e0d3cca031d67fd
|
||||
ql/test/extractor-tests/generated/Diagnostics/Diagnostics.ql 6a4a9480cc929381e0337b181e5ac519a7abc6d597ebe24fb6701acf79ced86f 199c5bf8bd38e161d989e0e4db1ea1d3ddcb4d7cf571afd9112ce3ed8d9b8d2a
|
||||
ql/test/extractor-tests/generated/File/File.ql ab0968ae31b749da2b66462bd04e4dfb30604dba405a84594b575abfc4fa4c35 bcc0ff648b28c5ecd567e196e700272883756bbcc65296bbb880a979e3162628
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl.ql 18937cb9ff06912f624e9b26318fd5286b0f2532062b6af339c45ae111aed9fd 674912a0c75c096823f20a36d76804db0c68d8097abab48c9cec6fe7a7fb08f1
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl.ql 5c017af7e6b16ee68990eec12affe81eb114338bac4d445f4b231fe0f110eccc db86c828a892b0acd150a780914e7e48c280cad473d3680a453bdee03aee1e9d
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getBody.ql 1d42eb1a5b832cfaf1949b61a01a6a11448a6d4369a44f2511bb31d1d7fc10a8 b326a6743121353f8a66410d3d9151ca969939abcbbe5c411872ca290da45123
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getCapture.ql 17f9903978c9a8fc607d970532270090cea030ff57c2f6699c37672707ce5c70 cdd7ce47691a84aa5402a8946d4027f7b9dbce930057dfd62c14b470a5710cb0
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getGenericTypeParam.ql 8648679e9403477c7f97b6df450a0fa623dc9aff0777021ee33f9cc96eef2611 59c384c35804bf205c3c63e8b956e6bc89d3ded7952911c40e7bf156acb56bf8
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getMember.ql 826f3cd3a3737938ade950555a36506d970894c3c761c07d36f0a6252672e9bc 0e681a49e07b69bf0df10c14864da946b04b2dea2412bdc93c9b5567c77f819a
|
||||
ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getName.ql a8f7b6cbb8ab43ed612cfbb36b48b5d6dd23b1dbe94a99d95fedf80e3c95f89f d70eb32403c4983c58448fe5c9e2d88bc873ab61e0e310c38356a9a144b42978
|
||||
@@ -661,12 +664,15 @@ ql/test/extractor-tests/generated/decl/AccessorDecl/AccessorDecl_getSelfParam.ql
|
||||
ql/test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl.ql 74579a1907817168b5014ebcb69ab9a85687189c73145f1a7c2d4b334af4eb30 5d1f265f0e6c1d2392a9e37a42a8e184a16e473836c1a45b5dbc4daccc4aeabb
|
||||
ql/test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl_getBaseType.ql 39d26252c242eec5aaef23951bd76755a4d3cdceff7349b15067fefb2ece14b3 214fdbaa77d32ee6f21bcccf112d46c9d26006552081cc1f90cbb00a527a9d7f
|
||||
ql/test/extractor-tests/generated/decl/AssociatedTypeDecl/AssociatedTypeDecl_getMember.ql e662e651d84bddcf49445d7bf5732d0dad30242d32b90f86e40de0010d48fd9c a6b7028468490a12c0a9f4c535cbd5e6c50a6c3519c9d2552d34f9411f904718
|
||||
ql/test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl.ql 950e94dc10f8a8589a6b6ead39faaecfb5739c1e40f381e09c5e015d14507a25 38ab48ca3e647c60bee985732631c6e43116180c36d90132a25fe4f620087482
|
||||
ql/test/extractor-tests/generated/decl/CapturedDecl/CapturedDecl_getMember.ql fcb4dd4da4d4b13db46f20458513334fb54bcfcec3ddf8cc86798eefe49f31e3 545096ab96006aa9e9058b9cd0c62d2f102f2fe6813880cf9c4eb42374b7ad9c
|
||||
ql/test/extractor-tests/generated/decl/ClassDecl/ClassDecl.ql a76c9710142c368206ceb26df38e9d182833641d1c5f2df178b03eb196b812f2 6661f2af1e7cddcc44735d2bbc7ecc40af69587024b7d8db74ff205dd8db2e6d
|
||||
ql/test/extractor-tests/generated/decl/ClassDecl/ClassDecl_getBaseType.ql 5f4fddbb3fb3d003f1485dc4c5a56f7d0d26dfc1d691540085654c4c66e70e69 0b5a5b757ca92e664ef136d26ac682aa5a0e071494d9f09d85f66cd13807e81d
|
||||
ql/test/extractor-tests/generated/decl/ClassDecl/ClassDecl_getGenericTypeParam.ql ca0b73a4f31eea47def7a1de017de36b5fdaec96ae98edb03ff00611bfcac572 f9badd62887a30113484496532b3ff9b67ff5047eb5a311aa2ec2e4d91321e0e
|
||||
ql/test/extractor-tests/generated/decl/ClassDecl/ClassDecl_getMember.ql f73881b14bb4eaf83dacf60b9e46d440227f90566e2dfb8908a55567626ccdda f78a7261f7ccfe01ca55f7279bd5a1a302fc65ba36b13e779426d173c7465b84
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl.ql 71eec396eef782de51746fc192b6451421c09ba89a9639aeee558f20949a67b3 e9291ca7340fa625eae7b9677a46a7338c01b2327ade4bebfa6c4d6be6bb9736
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl.ql 97813e8d28abdafa300278a7bdef824ca2cf62b0677e31cb7293f2063ffe69de c3c5f8784d1a0f4f38b691cec5b870587ae1c6587d4862681a9bc6ce10ffa73f
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl_getBody.ql 3c742b9c8d8d8c23d1bef03f559e1b91f0d3848084ba5819f118c323dd1920a2 340d4e4a6312ffaf4c47bbc753828c1e478d84a2d399c66220288c081c8357ca
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl_getCapture.ql d3fe4c473661944cd3868ee5c2ef9cc7e7da0b414c4b4f7018456b1a4ee44c02 491a3271a4e15c99d5a8b9429a07c63bbf2e311ac2e72604d3118163ba309ba9
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl_getGenericTypeParam.ql b5e64bf02a5991a1549794af0aaab9ae654c88b5d52a3e04b7ac525b3a64af5e 034a7d0bf7500afa952a28d184d1d073e71c3dcec3bc26fcefaed70aef9de3ce
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl_getMember.ql aaba9cb097602d761c48de09de059ef2fe112e0c6c64a5f6988a95cddc9155d8 6e6b76a51bd1d9d4ec25865a1c229e5859ca55f11639ccee414a8cac7de1662a
|
||||
ql/test/extractor-tests/generated/decl/ConcreteFuncDecl/ConcreteFuncDecl_getName.ql d80c7dfdde294264b6763a7129e666efd98111dbf203a9739c24942659d7f832 396e44281e4f4af2188a4f7d246872b7058132b12f508b88dc60d5bdd14e2092
|
||||
|
||||
@@ -18,6 +18,7 @@ import codeql.swift.elements.decl.AbstractStorageDecl
|
||||
import codeql.swift.elements.decl.AbstractTypeParamDecl
|
||||
import codeql.swift.elements.decl.AccessorDecl
|
||||
import codeql.swift.elements.decl.AssociatedTypeDecl
|
||||
import codeql.swift.elements.decl.CapturedDecl
|
||||
import codeql.swift.elements.decl.ClassDecl
|
||||
import codeql.swift.elements.decl.ConcreteFuncDecl
|
||||
import codeql.swift.elements.decl.ConcreteVarDecl
|
||||
|
||||
5
swift/ql/lib/codeql/swift/elements/decl/CapturedDecl.qll
Normal file
5
swift/ql/lib/codeql/swift/elements/decl/CapturedDecl.qll
Normal file
@@ -0,0 +1,5 @@
|
||||
private import codeql.swift.generated.decl.CapturedDecl
|
||||
|
||||
class CapturedDecl extends Generated::CapturedDecl {
|
||||
override string toString() { result = this.getDecl().toString() }
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
|
||||
private import codeql.swift.generated.Raw
|
||||
|
||||
predicate constructCapturedDecl(Raw::CapturedDecl id) { any() }
|
||||
@@ -2,6 +2,7 @@
|
||||
private import codeql.swift.generated.Synth
|
||||
private import codeql.swift.generated.Raw
|
||||
import codeql.swift.elements.stmt.BraceStmt
|
||||
import codeql.swift.elements.decl.CapturedDecl
|
||||
import codeql.swift.elements.Element
|
||||
import codeql.swift.elements.decl.ParamDecl
|
||||
|
||||
@@ -90,5 +91,33 @@ module Generated {
|
||||
* Holds if `getBody()` exists.
|
||||
*/
|
||||
final predicate hasBody() { exists(getBody()) }
|
||||
|
||||
/**
|
||||
* Gets the `index`th capture of this callable (0-based).
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
CapturedDecl getImmediateCapture(int index) {
|
||||
result =
|
||||
Synth::convertCapturedDeclFromRaw(Synth::convertCallableToRaw(this)
|
||||
.(Raw::Callable)
|
||||
.getCapture(index))
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the `index`th capture of this callable (0-based).
|
||||
*/
|
||||
final CapturedDecl getCapture(int index) { result = getImmediateCapture(index).resolve() }
|
||||
|
||||
/**
|
||||
* Gets any of the captures of this callable.
|
||||
*/
|
||||
final CapturedDecl getACapture() { result = getCapture(_) }
|
||||
|
||||
/**
|
||||
* Gets the number of captures of this callable.
|
||||
*/
|
||||
final int getNumberOfCaptures() { result = count(int i | exists(getCapture(i))) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,13 +8,14 @@ private module Impl {
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfCallable(Callable e, int index, string partialPredicateCall) {
|
||||
exists(int b, int bElement, int n, int nSelfParam, int nParam, int nBody |
|
||||
exists(int b, int bElement, int n, int nSelfParam, int nParam, int nBody, int nCapture |
|
||||
b = 0 and
|
||||
bElement = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfElement(e, i, _)) | i) and
|
||||
n = bElement and
|
||||
nSelfParam = n + 1 and
|
||||
nParam = nSelfParam + 1 + max(int i | i = -1 or exists(e.getImmediateParam(i)) | i) and
|
||||
nBody = nParam + 1 and
|
||||
nCapture = nBody + 1 + max(int i | i = -1 or exists(e.getImmediateCapture(i)) | i) and
|
||||
(
|
||||
none()
|
||||
or
|
||||
@@ -26,6 +27,9 @@ private module Impl {
|
||||
partialPredicateCall = "Param(" + (index - nSelfParam).toString() + ")"
|
||||
or
|
||||
index = nParam and result = e.getImmediateBody() and partialPredicateCall = "Body()"
|
||||
or
|
||||
result = e.getImmediateCapture(index - nBody) and
|
||||
partialPredicateCall = "Capture(" + (index - nBody).toString() + ")"
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -234,6 +238,21 @@ private module Impl {
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfCapturedDecl(
|
||||
CapturedDecl e, int index, string partialPredicateCall
|
||||
) {
|
||||
exists(int b, int bDecl, int n |
|
||||
b = 0 and
|
||||
bDecl = b + 1 + max(int i | i = -1 or exists(getImmediateChildOfDecl(e, i, _)) | i) and
|
||||
n = bDecl and
|
||||
(
|
||||
none()
|
||||
or
|
||||
result = getImmediateChildOfDecl(e, index - b, partialPredicateCall)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
private Element getImmediateChildOfEnumCaseDecl(
|
||||
EnumCaseDecl e, int index, string partialPredicateCall
|
||||
) {
|
||||
@@ -4738,6 +4757,8 @@ private module Impl {
|
||||
or
|
||||
result = getImmediateChildOfUnspecifiedElement(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfCapturedDecl(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfEnumCaseDecl(e, index, partialAccessor)
|
||||
or
|
||||
result = getImmediateChildOfExtensionDecl(e, index, partialAccessor)
|
||||
|
||||
@@ -13,6 +13,8 @@ module Raw {
|
||||
ParamDecl getParam(int index) { callable_params(this, index, result) }
|
||||
|
||||
BraceStmt getBody() { callable_bodies(this, result) }
|
||||
|
||||
CapturedDecl getCapture(int index) { callable_captures(this, index, result) }
|
||||
}
|
||||
|
||||
class File extends @file, Element {
|
||||
@@ -85,6 +87,16 @@ module Raw {
|
||||
}
|
||||
}
|
||||
|
||||
class CapturedDecl extends @captured_decl, Decl {
|
||||
override string toString() { result = "CapturedDecl" }
|
||||
|
||||
ValueDecl getDecl() { captured_decls(this, result) }
|
||||
|
||||
predicate isDirect() { captured_decl_is_direct(this) }
|
||||
|
||||
predicate isEscaping() { captured_decl_is_escaping(this) }
|
||||
}
|
||||
|
||||
class EnumCaseDecl extends @enum_case_decl, Decl {
|
||||
override string toString() { result = "EnumCaseDecl" }
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ module Synth {
|
||||
TUnspecifiedElement(Raw::UnspecifiedElement id) { constructUnspecifiedElement(id) } or
|
||||
TAccessorDecl(Raw::AccessorDecl id) { constructAccessorDecl(id) } or
|
||||
TAssociatedTypeDecl(Raw::AssociatedTypeDecl id) { constructAssociatedTypeDecl(id) } or
|
||||
TCapturedDecl(Raw::CapturedDecl id) { constructCapturedDecl(id) } or
|
||||
TClassDecl(Raw::ClassDecl id) { constructClassDecl(id) } or
|
||||
TConcreteFuncDecl(Raw::ConcreteFuncDecl id) { constructConcreteFuncDecl(id) } or
|
||||
TConcreteVarDecl(Raw::ConcreteVarDecl id) { constructConcreteVarDecl(id) } or
|
||||
@@ -327,9 +328,9 @@ module Synth {
|
||||
class TAbstractTypeParamDecl = TAssociatedTypeDecl or TGenericTypeParamDecl;
|
||||
|
||||
class TDecl =
|
||||
TEnumCaseDecl or TExtensionDecl or TIfConfigDecl or TImportDecl or TMissingMemberDecl or
|
||||
TOperatorDecl or TPatternBindingDecl or TPoundDiagnosticDecl or TPrecedenceGroupDecl or
|
||||
TTopLevelCodeDecl or TValueDecl;
|
||||
TCapturedDecl or TEnumCaseDecl or TExtensionDecl or TIfConfigDecl or TImportDecl or
|
||||
TMissingMemberDecl or TOperatorDecl or TPatternBindingDecl or TPoundDiagnosticDecl or
|
||||
TPrecedenceGroupDecl or TTopLevelCodeDecl or TValueDecl;
|
||||
|
||||
class TFuncDecl = TAccessorDecl or TConcreteFuncDecl;
|
||||
|
||||
@@ -494,6 +495,9 @@ module Synth {
|
||||
result = TAssociatedTypeDecl(e)
|
||||
}
|
||||
|
||||
cached
|
||||
TCapturedDecl convertCapturedDeclFromRaw(Raw::Element e) { result = TCapturedDecl(e) }
|
||||
|
||||
cached
|
||||
TClassDecl convertClassDeclFromRaw(Raw::Element e) { result = TClassDecl(e) }
|
||||
|
||||
@@ -1465,6 +1469,8 @@ module Synth {
|
||||
|
||||
cached
|
||||
TDecl convertDeclFromRaw(Raw::Element e) {
|
||||
result = convertCapturedDeclFromRaw(e)
|
||||
or
|
||||
result = convertEnumCaseDeclFromRaw(e)
|
||||
or
|
||||
result = convertExtensionDeclFromRaw(e)
|
||||
@@ -2125,6 +2131,9 @@ module Synth {
|
||||
e = TAssociatedTypeDecl(result)
|
||||
}
|
||||
|
||||
cached
|
||||
Raw::Element convertCapturedDeclToRaw(TCapturedDecl e) { e = TCapturedDecl(result) }
|
||||
|
||||
cached
|
||||
Raw::Element convertClassDeclToRaw(TClassDecl e) { e = TClassDecl(result) }
|
||||
|
||||
@@ -3094,6 +3103,8 @@ module Synth {
|
||||
|
||||
cached
|
||||
Raw::Element convertDeclToRaw(TDecl e) {
|
||||
result = convertCapturedDeclToRaw(e)
|
||||
or
|
||||
result = convertEnumCaseDeclToRaw(e)
|
||||
or
|
||||
result = convertExtensionDeclToRaw(e)
|
||||
|
||||
@@ -6,6 +6,7 @@ import codeql.swift.elements.DiagnosticsConstructor
|
||||
import codeql.swift.elements.UnspecifiedElementConstructor
|
||||
import codeql.swift.elements.decl.AccessorDeclConstructor
|
||||
import codeql.swift.elements.decl.AssociatedTypeDeclConstructor
|
||||
import codeql.swift.elements.decl.CapturedDeclConstructor
|
||||
import codeql.swift.elements.decl.ClassDeclConstructor
|
||||
import codeql.swift.elements.decl.ConcreteFuncDeclConstructor
|
||||
import codeql.swift.elements.decl.ConcreteVarDeclConstructor
|
||||
|
||||
41
swift/ql/lib/codeql/swift/generated/decl/CapturedDecl.qll
Normal file
41
swift/ql/lib/codeql/swift/generated/decl/CapturedDecl.qll
Normal file
@@ -0,0 +1,41 @@
|
||||
// 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.ValueDecl
|
||||
|
||||
module Generated {
|
||||
class CapturedDecl extends Synth::TCapturedDecl, Decl {
|
||||
override string getAPrimaryQlClass() { result = "CapturedDecl" }
|
||||
|
||||
/**
|
||||
* Gets the the declaration captured by the parent closure.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
ValueDecl getImmediateDecl() {
|
||||
result =
|
||||
Synth::convertValueDeclFromRaw(Synth::convertCapturedDeclToRaw(this)
|
||||
.(Raw::CapturedDecl)
|
||||
.getDecl())
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the the declaration captured by the parent closure.
|
||||
*/
|
||||
final ValueDecl getDecl() { result = getImmediateDecl().resolve() }
|
||||
|
||||
/**
|
||||
* Holds if this captured declaration is direct.
|
||||
*/
|
||||
predicate isDirect() { Synth::convertCapturedDeclToRaw(this).(Raw::CapturedDecl).isDirect() }
|
||||
|
||||
/**
|
||||
* Holds if this captured declaration is escaping.
|
||||
*/
|
||||
predicate isEscaping() {
|
||||
Synth::convertCapturedDeclToRaw(this).(Raw::CapturedDecl).isEscaping()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,13 @@ callable_bodies(
|
||||
int body: @brace_stmt_or_none ref
|
||||
);
|
||||
|
||||
#keyset[id, index]
|
||||
callable_captures(
|
||||
int id: @callable ref,
|
||||
int index: int ref,
|
||||
int capture: @captured_decl_or_none ref
|
||||
);
|
||||
|
||||
@file =
|
||||
@db_file
|
||||
;
|
||||
@@ -157,7 +164,8 @@ unspecified_element_indices(
|
||||
);
|
||||
|
||||
@decl =
|
||||
@enum_case_decl
|
||||
@captured_decl
|
||||
| @enum_case_decl
|
||||
| @extension_decl
|
||||
| @if_config_decl
|
||||
| @import_decl
|
||||
@@ -197,6 +205,21 @@ generic_context_generic_type_params( //dir=decl
|
||||
int generic_type_param: @generic_type_param_decl_or_none ref
|
||||
);
|
||||
|
||||
captured_decls( //dir=decl
|
||||
unique int id: @captured_decl,
|
||||
int decl: @value_decl_or_none ref
|
||||
);
|
||||
|
||||
#keyset[id]
|
||||
captured_decl_is_direct( //dir=decl
|
||||
int id: @captured_decl ref
|
||||
);
|
||||
|
||||
#keyset[id]
|
||||
captured_decl_is_escaping( //dir=decl
|
||||
int id: @captured_decl ref
|
||||
);
|
||||
|
||||
enum_case_decls( //dir=decl
|
||||
unique int id: @enum_case_decl
|
||||
);
|
||||
@@ -2363,6 +2386,11 @@ variadic_sequence_types( //dir=type
|
||||
| @unspecified_element
|
||||
;
|
||||
|
||||
@captured_decl_or_none =
|
||||
@captured_decl
|
||||
| @unspecified_element
|
||||
;
|
||||
|
||||
@case_label_item_or_none =
|
||||
@case_label_item
|
||||
| @unspecified_element
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
||||
description: Add closure capture information
|
||||
compatibility: partial
|
||||
@@ -1,36 +1,36 @@
|
||||
| accessors.swift:2:9:2:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:2:9:2:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:2:9:2:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:3:9:3:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:4:9:4:28 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:5:9:5:42 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:8:9:8:29 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:12:9:12:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:16:9:16:28 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:20:9:20:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:24:9:24:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:26:9:26:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:29:9:29:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:29:9:29:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:30:9:32:9 | _read | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | yes | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:33:9:35:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:39:9:41:9 | unsafeAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> UnsafePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | yes | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:42:9:44:9 | unsafeMutableAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> UnsafeMutablePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | yes |
|
||||
| accessors.swift:2:9:2:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:2:9:2:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:2:9:2:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:3:9:3:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:4:9:4:28 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:5:9:5:42 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:7:9:7:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:8:9:8:29 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:11:9:11:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:12:9:12:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:15:9:15:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:16:9:16:28 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:19:9:19:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:20:9:20:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:23:9:23:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:24:9:24:19 | willSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | no | isWillSet: | yes | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:26:9:26:18 | didSet | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | yes | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:29:9:29:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:29:9:29:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:30:9:32:9 | _read | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | yes | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:33:9:35:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | _modify | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> () | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | yes | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | get | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> Int | isGetter: | yes | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:38:9:38:9 | set | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> (Int) -> () | isGetter: | no | isSetter: | yes | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:39:9:41:9 | unsafeAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (Foo) -> () -> UnsafePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | yes | isUnsafeMutableAddress: | no |
|
||||
| accessors.swift:42:9:44:9 | unsafeMutableAddress | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | accessors | getNumberOfMembers: | 0 | getInterfaceType: | (inout Foo) -> () -> UnsafeMutablePointer<Int> | isGetter: | no | isSetter: | no | isWillSet: | no | isDidSet: | no | isRead: | no | isModify: | no | isUnsafeAddress: | no | isUnsafeMutableAddress: | yes |
|
||||
|
||||
@@ -4,9 +4,10 @@ import TestUtils
|
||||
|
||||
from
|
||||
AccessorDecl x, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
|
||||
int getNumberOfGenericTypeParams, ModuleDecl getModule, int getNumberOfMembers,
|
||||
Type getInterfaceType, string isGetter, string isSetter, string isWillSet, string isDidSet,
|
||||
string isRead, string isModify, string isUnsafeAddress, string isUnsafeMutableAddress
|
||||
int getNumberOfCaptures, int getNumberOfGenericTypeParams, ModuleDecl getModule,
|
||||
int getNumberOfMembers, Type getInterfaceType, string isGetter, string isSetter, string isWillSet,
|
||||
string isDidSet, string isRead, string isModify, string isUnsafeAddress,
|
||||
string isUnsafeMutableAddress
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
@@ -14,6 +15,7 @@ where
|
||||
(if x.hasSelfParam() then hasSelfParam = "yes" else hasSelfParam = "no") and
|
||||
getNumberOfParams = x.getNumberOfParams() and
|
||||
(if x.hasBody() then hasBody = "yes" else hasBody = "no") and
|
||||
getNumberOfCaptures = x.getNumberOfCaptures() and
|
||||
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
|
||||
getModule = x.getModule() and
|
||||
getNumberOfMembers = x.getNumberOfMembers() and
|
||||
@@ -29,8 +31,9 @@ where
|
||||
then isUnsafeMutableAddress = "yes"
|
||||
else isUnsafeMutableAddress = "no"
|
||||
select x, "hasName:", hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:",
|
||||
getNumberOfParams, "hasBody:", hasBody, "getNumberOfGenericTypeParams:",
|
||||
getNumberOfGenericTypeParams, "getModule:", getModule, "getNumberOfMembers:", getNumberOfMembers,
|
||||
"getInterfaceType:", getInterfaceType, "isGetter:", isGetter, "isSetter:", isSetter, "isWillSet:",
|
||||
isWillSet, "isDidSet:", isDidSet, "isRead:", isRead, "isModify:", isModify, "isUnsafeAddress:",
|
||||
isUnsafeAddress, "isUnsafeMutableAddress:", isUnsafeMutableAddress
|
||||
getNumberOfParams, "hasBody:", hasBody, "getNumberOfCaptures:", getNumberOfCaptures,
|
||||
"getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
|
||||
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType, "isGetter:",
|
||||
isGetter, "isSetter:", isSetter, "isWillSet:", isWillSet, "isDidSet:", isDidSet, "isRead:",
|
||||
isRead, "isModify:", isModify, "isUnsafeAddress:", isUnsafeAddress, "isUnsafeMutableAddress:",
|
||||
isUnsafeMutableAddress
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from AccessorDecl x, int index
|
||||
where toBeTested(x) and not x.isUnknown()
|
||||
select x, index, x.getCapture(index)
|
||||
@@ -0,0 +1,5 @@
|
||||
| closures.swift:8:12:8:12 | x | getModule: | file://:0:0:0:0 | closures | getNumberOfMembers: | 0 | getDecl: | closures.swift:7:6:7:6 | x | isDirect: | yes | isEscaping: | no |
|
||||
| closures.swift:9:12:9:12 | y | getModule: | file://:0:0:0:0 | closures | getNumberOfMembers: | 0 | getDecl: | closures.swift:6:7:6:7 | y | isDirect: | yes | isEscaping: | no |
|
||||
| closures.swift:17:5:17:5 | x | getModule: | file://:0:0:0:0 | closures | getNumberOfMembers: | 0 | getDecl: | closures.swift:15:7:15:7 | x | isDirect: | yes | isEscaping: | yes |
|
||||
| closures.swift:20:3:20:3 | escape | getModule: | file://:0:0:0:0 | closures | getNumberOfMembers: | 0 | getDecl: | closures.swift:12:5:12:5 | escape | isDirect: | yes | isEscaping: | yes |
|
||||
| closures.swift:25:3:25:3 | escape | getModule: | file://:0:0:0:0 | closures | getNumberOfMembers: | 0 | getDecl: | closures.swift:12:5:12:5 | escape | isDirect: | yes | isEscaping: | yes |
|
||||
@@ -0,0 +1,17 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from
|
||||
CapturedDecl x, ModuleDecl getModule, int getNumberOfMembers, ValueDecl getDecl, string isDirect,
|
||||
string isEscaping
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
getModule = x.getModule() and
|
||||
getNumberOfMembers = x.getNumberOfMembers() and
|
||||
getDecl = x.getDecl() and
|
||||
(if x.isDirect() then isDirect = "yes" else isDirect = "no") and
|
||||
if x.isEscaping() then isEscaping = "yes" else isEscaping = "no"
|
||||
select x, "getModule:", getModule, "getNumberOfMembers:", getNumberOfMembers, "getDecl:", getDecl,
|
||||
"isDirect:", isDirect, "isEscaping:", isEscaping
|
||||
@@ -0,0 +1,7 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from CapturedDecl x, int index
|
||||
where toBeTested(x) and not x.isUnknown()
|
||||
select x, index, x.getMember(index)
|
||||
@@ -0,0 +1,108 @@
|
||||
closures.swift:
|
||||
# 1| [ConcreteFuncDecl] bar()
|
||||
# 1| InterfaceType = () -> String
|
||||
# 1| getBody(): [BraceStmt] { ... }
|
||||
# 2| getElement(0): [ReturnStmt] return ...
|
||||
# 2| getResult(): [StringLiteralExpr] Hello world!
|
||||
# 5| [ConcreteFuncDecl] foo()
|
||||
# 5| InterfaceType = () -> ()
|
||||
# 5| getBody(): [BraceStmt] { ... }
|
||||
# 6| getElement(0): [PatternBindingDecl] var ... = ...
|
||||
# 6| getInit(0): [IntegerLiteralExpr] 123
|
||||
# 6| getPattern(0): [NamedPattern] y
|
||||
# 6| getElement(1): [ConcreteVarDecl] y
|
||||
# 6| Type = Int
|
||||
# 7| getElement(2): [CallExpr] call to ...
|
||||
# 7| getFunction(): [CaptureListExpr] { ... }
|
||||
# 7| getBindingDecl(0): [PatternBindingDecl] var ... = ...
|
||||
# 7| getInit(0): [CallExpr] call to bar()
|
||||
# 7| getFunction(): [DeclRefExpr] bar()
|
||||
# 7| getPattern(0): [NamedPattern] x
|
||||
# 7| getClosureBody(): [ClosureExpr] { ... }
|
||||
# 7| getBody(): [BraceStmt] { ... }
|
||||
# 8| getElement(0): [CallExpr] call to print(_:separator:terminator:)
|
||||
# 8| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
||||
# 8| getArgument(0): [Argument] : [...]
|
||||
# 8| getExpr(): [VarargExpansionExpr] [...]
|
||||
# 8| getSubExpr(): [ArrayExpr] [...]
|
||||
# 8| getElement(0): [DeclRefExpr] x
|
||||
# 8| getElement(0).getFullyConverted(): [ErasureExpr] (Any) ...
|
||||
# 8| getArgument(1): [Argument] separator: default separator
|
||||
# 8| getExpr(): [DefaultArgumentExpr] default separator
|
||||
# 8| getArgument(2): [Argument] terminator: default terminator
|
||||
# 8| getExpr(): [DefaultArgumentExpr] default terminator
|
||||
# 9| getElement(1): [CallExpr] call to print(_:separator:terminator:)
|
||||
# 9| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
||||
# 9| getArgument(0): [Argument] : [...]
|
||||
# 9| getExpr(): [VarargExpansionExpr] [...]
|
||||
# 9| getSubExpr(): [ArrayExpr] [...]
|
||||
# 9| getElement(0): [DeclRefExpr] y
|
||||
# 9| getElement(0).getFullyConverted(): [ErasureExpr] (Any) ...
|
||||
# 9| getArgument(1): [Argument] separator: default separator
|
||||
# 9| getExpr(): [DefaultArgumentExpr] default separator
|
||||
# 9| getArgument(2): [Argument] terminator: default terminator
|
||||
# 9| getExpr(): [DefaultArgumentExpr] default terminator
|
||||
# 8| getCapture(0): [CapturedDecl] x
|
||||
# 9| getCapture(1): [CapturedDecl] y
|
||||
# 7| [ConcreteVarDecl] x
|
||||
# 7| Type = String
|
||||
# 12| [TopLevelCodeDecl] { ... }
|
||||
# 12| getBody(): [BraceStmt] { ... }
|
||||
# 12| getElement(0): [PatternBindingDecl] var ... = ...
|
||||
# 12| getInit(0): [NilLiteralExpr] nil
|
||||
# 12| getPattern(0): [TypedPattern] ... as ...
|
||||
# 12| getSubPattern(): [NamedPattern] escape
|
||||
# 12| getTypeRepr(): [TypeRepr] (() -> ())?
|
||||
# 12| [ConcreteVarDecl] escape
|
||||
# 12| Type = (() -> ())?
|
||||
# 14| [ConcreteFuncDecl] baz()
|
||||
# 14| InterfaceType = () -> ()
|
||||
# 14| getBody(): [BraceStmt] { ... }
|
||||
# 15| getElement(0): [PatternBindingDecl] var ... = ...
|
||||
# 15| getInit(0): [IntegerLiteralExpr] 0
|
||||
# 15| getPattern(0): [NamedPattern] x
|
||||
# 15| getElement(1): [ConcreteVarDecl] x
|
||||
# 15| Type = Int
|
||||
# 16| getElement(2): [ConcreteFuncDecl] quux()
|
||||
# 16| InterfaceType = () -> ()
|
||||
# 16| getBody(): [BraceStmt] { ... }
|
||||
# 17| getElement(0): [BinaryExpr] ... .+=(_:_:) ...
|
||||
# 17| getFunction(): [MethodLookupExpr] .+=(_:_:)
|
||||
# 17| getBase(): [TypeExpr] Int.Type
|
||||
# 17| getTypeRepr(): [TypeRepr] Int
|
||||
# 17| getMethodRef(): [DeclRefExpr] +=(_:_:)
|
||||
# 17| getArgument(0): [Argument] : &...
|
||||
# 17| getExpr(): [InOutExpr] &...
|
||||
# 17| getSubExpr(): [DeclRefExpr] x
|
||||
# 17| getArgument(1): [Argument] : 1
|
||||
# 17| getExpr(): [IntegerLiteralExpr] 1
|
||||
# 18| getElement(1): [CallExpr] call to print(_:separator:terminator:)
|
||||
# 18| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
||||
# 18| getArgument(0): [Argument] : [...]
|
||||
# 18| getExpr(): [VarargExpansionExpr] [...]
|
||||
# 18| getSubExpr(): [ArrayExpr] [...]
|
||||
# 18| getElement(0): [DeclRefExpr] x
|
||||
# 18| getElement(0).getFullyConverted(): [ErasureExpr] (Any) ...
|
||||
# 18| getImmediateSubExpr(): [LoadExpr] (Int) ...
|
||||
# 18| getArgument(1): [Argument] separator: default separator
|
||||
# 18| getExpr(): [DefaultArgumentExpr] default separator
|
||||
# 18| getArgument(2): [Argument] terminator: default terminator
|
||||
# 18| getExpr(): [DefaultArgumentExpr] default terminator
|
||||
# 17| getCapture(0): [CapturedDecl] x
|
||||
# 20| getElement(3): [AssignExpr] ... = ...
|
||||
# 20| getDest(): [DeclRefExpr] escape
|
||||
# 20| getSource(): [DeclRefExpr] quux()
|
||||
# 20| getSource().getFullyConverted(): [InjectIntoOptionalExpr] ((() -> ())?) ...
|
||||
# 20| getCapture(0): [CapturedDecl] escape
|
||||
# 23| [ConcreteFuncDecl] callEscape()
|
||||
# 23| InterfaceType = () -> ()
|
||||
# 23| getBody(): [BraceStmt] { ... }
|
||||
# 24| getElement(0): [CallExpr] call to baz()
|
||||
# 24| getFunction(): [DeclRefExpr] baz()
|
||||
# 25| getElement(1): [OptionalEvaluationExpr] OptionalEvaluationExpr
|
||||
# 25| getSubExpr(): [CallExpr] call to ...
|
||||
# 25| getFunction(): [BindOptionalExpr] ...?
|
||||
# 25| getSubExpr(): [DeclRefExpr] escape
|
||||
# 25| getFunction().getFullyConverted(): [LoadExpr] ((() -> ())) ...
|
||||
# 25| getSubExpr().getFullyConverted(): [InjectIntoOptionalExpr] (()?) ...
|
||||
# 25| getCapture(0): [CapturedDecl] escape
|
||||
@@ -0,0 +1 @@
|
||||
library-tests/ast/PrintAst.ql
|
||||
@@ -0,0 +1,26 @@
|
||||
func bar() -> String {
|
||||
return "Hello world!"
|
||||
}
|
||||
|
||||
func foo() {
|
||||
let y = 123
|
||||
{ [x = bar()] () in
|
||||
print(x)
|
||||
print(y) }()
|
||||
}
|
||||
|
||||
var escape: (() -> ())? = nil
|
||||
|
||||
func baz() {
|
||||
var x = 0
|
||||
func quux() {
|
||||
x += 1
|
||||
print(x)
|
||||
}
|
||||
escape = quux
|
||||
}
|
||||
|
||||
func callEscape() {
|
||||
baz()
|
||||
escape?()
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
| functions.swift:1:1:3:1 | foo() | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | () -> Int |
|
||||
| functions.swift:5:1:7:1 | bar(_:d:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int, Double) -> Int |
|
||||
| functions.swift:10:5:10:28 | noBody(x:) | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | no | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int |
|
||||
| functions.swift:13:1:15:1 | variadic(_:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int...) -> () |
|
||||
| functions.swift:17:1:19:1 | generic(x:y:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfGenericTypeParams: | 2 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <X, Y> (x: X, y: Y) -> () |
|
||||
| functions.swift:1:1:3:1 | foo() | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 0 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | () -> Int |
|
||||
| functions.swift:5:1:7:1 | bar(_:d:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int, Double) -> Int |
|
||||
| functions.swift:10:5:10:28 | noBody(x:) | hasName: | yes | hasSelfParam: | yes | getNumberOfParams: | 1 | hasBody: | no | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <Self where Self : Beep> (Self) -> (Int) -> Int |
|
||||
| functions.swift:13:1:15:1 | variadic(_:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 1 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 0 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | (Int...) -> () |
|
||||
| functions.swift:17:1:19:1 | generic(x:y:) | hasName: | yes | hasSelfParam: | no | getNumberOfParams: | 2 | hasBody: | yes | getNumberOfCaptures: | 0 | getNumberOfGenericTypeParams: | 2 | getModule: | file://:0:0:0:0 | functions | getNumberOfMembers: | 0 | getInterfaceType: | <X, Y> (x: X, y: Y) -> () |
|
||||
|
||||
@@ -4,8 +4,8 @@ import TestUtils
|
||||
|
||||
from
|
||||
ConcreteFuncDecl x, string hasName, string hasSelfParam, int getNumberOfParams, string hasBody,
|
||||
int getNumberOfGenericTypeParams, ModuleDecl getModule, int getNumberOfMembers,
|
||||
Type getInterfaceType
|
||||
int getNumberOfCaptures, int getNumberOfGenericTypeParams, ModuleDecl getModule,
|
||||
int getNumberOfMembers, Type getInterfaceType
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
@@ -13,11 +13,12 @@ where
|
||||
(if x.hasSelfParam() then hasSelfParam = "yes" else hasSelfParam = "no") and
|
||||
getNumberOfParams = x.getNumberOfParams() and
|
||||
(if x.hasBody() then hasBody = "yes" else hasBody = "no") and
|
||||
getNumberOfCaptures = x.getNumberOfCaptures() and
|
||||
getNumberOfGenericTypeParams = x.getNumberOfGenericTypeParams() and
|
||||
getModule = x.getModule() and
|
||||
getNumberOfMembers = x.getNumberOfMembers() and
|
||||
getInterfaceType = x.getInterfaceType()
|
||||
select x, "hasName:", hasName, "hasSelfParam:", hasSelfParam, "getNumberOfParams:",
|
||||
getNumberOfParams, "hasBody:", hasBody, "getNumberOfGenericTypeParams:",
|
||||
getNumberOfGenericTypeParams, "getModule:", getModule, "getNumberOfMembers:", getNumberOfMembers,
|
||||
"getInterfaceType:", getInterfaceType
|
||||
getNumberOfParams, "hasBody:", hasBody, "getNumberOfCaptures:", getNumberOfCaptures,
|
||||
"getNumberOfGenericTypeParams:", getNumberOfGenericTypeParams, "getModule:", getModule,
|
||||
"getNumberOfMembers:", getNumberOfMembers, "getInterfaceType:", getInterfaceType
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// generated by codegen/codegen.py
|
||||
import codeql.swift.elements
|
||||
import TestUtils
|
||||
|
||||
from ConcreteFuncDecl x, int index
|
||||
where toBeTested(x) and not x.isUnknown()
|
||||
select x, index, x.getCapture(index)
|
||||
@@ -266,6 +266,7 @@ cfg.swift:
|
||||
# 47| getExpr(): [DeclRefExpr] s
|
||||
# 47| getArgument(1): [Argument] :
|
||||
# 47| getExpr(): [StringLiteralExpr]
|
||||
# 47| getCapture(0): [CapturedDecl] s
|
||||
# 51| [ConcreteFuncDecl] createClosure2(x:)
|
||||
# 51| InterfaceType = (Int) -> (Int) -> Int
|
||||
# 51| getParam(0): [ParamDecl] x
|
||||
@@ -286,6 +287,7 @@ cfg.swift:
|
||||
# 53| getExpr(): [DeclRefExpr] x
|
||||
# 53| getArgument(1): [Argument] : y
|
||||
# 53| getExpr(): [DeclRefExpr] y
|
||||
# 53| getCapture(0): [CapturedDecl] x
|
||||
# 55| getElement(1): [ReturnStmt] return ...
|
||||
# 55| getResult(): [DeclRefExpr] f(y:)
|
||||
# 58| [ConcreteFuncDecl] createClosure3(x:)
|
||||
@@ -308,6 +310,7 @@ cfg.swift:
|
||||
# 60| getExpr(): [DeclRefExpr] x
|
||||
# 60| getArgument(1): [Argument] : y
|
||||
# 60| getExpr(): [DeclRefExpr] y
|
||||
# 60| getCapture(0): [CapturedDecl] x
|
||||
# 64| [ConcreteFuncDecl] callClosures()
|
||||
# 64| InterfaceType = () -> ()
|
||||
# 64| getBody(): [BraceStmt] { ... }
|
||||
@@ -758,6 +761,7 @@ cfg.swift:
|
||||
# 144| getExpr(): [DeclRefExpr] x
|
||||
# 144| getArgument(1): [Argument] : 5
|
||||
# 144| getExpr(): [IntegerLiteralExpr] 5
|
||||
# 144| getCapture(0): [CapturedDecl] x
|
||||
# 146| getCase(2): [CaseStmt] case ...
|
||||
# 147| getBody(): [BraceStmt] { ... }
|
||||
# 147| getElement(0): [ReturnStmt] return ...
|
||||
@@ -944,6 +948,7 @@ cfg.swift:
|
||||
# 185| getExpr(): [DeclRefExpr] x
|
||||
# 185| getArgument(1): [Argument] : 0
|
||||
# 185| getExpr(): [IntegerLiteralExpr] 0
|
||||
# 185| getCapture(0): [CapturedDecl] x
|
||||
# 185| getArgument(1): [Argument] : { ... }
|
||||
# 185| getExpr(): [AutoClosureExpr] { ... }
|
||||
# 185| getBody(): [BraceStmt] { ... }
|
||||
@@ -964,6 +969,7 @@ cfg.swift:
|
||||
# 185| getArgument(1): [Argument] : 5
|
||||
# 185| getExpr(): [IntegerLiteralExpr] 5
|
||||
# 185| getExpr().getFullyConverted(): [ParenExpr] (...)
|
||||
# 185| getCapture(0): [CapturedDecl] x
|
||||
# 185| getThen(): [BraceStmt] { ... }
|
||||
# 186| getElement(0): [CallExpr] call to print(_:separator:terminator:)
|
||||
# 186| getFunction(): [DeclRefExpr] print(_:separator:terminator:)
|
||||
@@ -1178,6 +1184,7 @@ cfg.swift:
|
||||
# 238| getBody(): [BraceStmt] { ... }
|
||||
# 238| getElement(0): [ReturnStmt] return ...
|
||||
# 238| getResult(): [DeclRefExpr] b2
|
||||
# 238| getCapture(0): [CapturedDecl] b2
|
||||
# 238| getBoolean().getFullyConverted(): [ParenExpr] (...)
|
||||
# 238| getThen(): [BraceStmt] { ... }
|
||||
# 239| getElement(0): [CallExpr] call to print(_:separator:terminator:)
|
||||
@@ -2412,6 +2419,7 @@ cfg.swift:
|
||||
# 368| getBody(): [BraceStmt] { ... }
|
||||
# 369| getElement(0): [ReturnStmt] return ...
|
||||
# 369| getResult(): [DeclRefExpr] z
|
||||
# 369| getCapture(0): [CapturedDecl] z
|
||||
# 368| [ConcreteVarDecl] z
|
||||
# 368| Type = Int
|
||||
# 373| [ConcreteFuncDecl] testTupleElement(t:)
|
||||
@@ -3578,6 +3586,7 @@ declarations.swift:
|
||||
#-----| getElement(0): [ReturnStmt] return ...
|
||||
#-----| getResult(): [MemberRefExpr] .wrappedValue
|
||||
#-----| getBase(): [DeclRefExpr] _x
|
||||
#-----| getCapture(0): [CapturedDecl] _x
|
||||
#-----| getPropertyWrapperBackingVarBinding(): [PatternBindingDecl] var ... = ...
|
||||
# 77| getInit(0): [CallExpr] call to ZeroWrapper.init()
|
||||
# 77| getFunction(): [MethodLookupExpr] ZeroWrapper.init()
|
||||
|
||||
@@ -136,6 +136,7 @@ methodlookup.swift:
|
||||
# 27| getFunction(): [MethodLookupExpr] .instanceMethod()
|
||||
#-----| getBase(): [DeclRefExpr] self
|
||||
# 27| getMethodRef(): [DeclRefExpr] instanceMethod()
|
||||
#-----| getCapture(0): [CapturedDecl] self
|
||||
# 27| getArgument(0): [Argument] : foo
|
||||
# 27| getExpr(): [DeclRefExpr] foo
|
||||
# 29| getElement(5): [CallExpr] call to classMethod()
|
||||
@@ -244,6 +245,7 @@ methodlookup.swift:
|
||||
# 48| getFunction(): [MethodLookupExpr] .instanceMethod()
|
||||
#-----| getBase(): [DeclRefExpr] self
|
||||
# 48| getMethodRef(): [DeclRefExpr] instanceMethod()
|
||||
#-----| getCapture(0): [CapturedDecl] self
|
||||
# 48| getArgument(0): [Argument] : baz
|
||||
# 48| getExpr(): [DeclRefExpr] baz
|
||||
# 48| getElement(4).getFullyConverted(): [AwaitExpr] await ...
|
||||
|
||||
@@ -229,6 +229,7 @@ class Callable(Element):
|
||||
self_param: optional[ParamDecl] | child
|
||||
params: list[ParamDecl] | child
|
||||
body: optional["BraceStmt"] | child | desc("The body is absent within protocol declarations.")
|
||||
captures: list["CapturedDecl"] | child
|
||||
|
||||
class AbstractFunctionDecl(GenericContext, ValueDecl, Callable):
|
||||
pass
|
||||
@@ -362,6 +363,11 @@ class AssignExpr(Expr):
|
||||
class BindOptionalExpr(Expr):
|
||||
sub_expr: Expr | child
|
||||
|
||||
class CapturedDecl(Decl):
|
||||
decl: ValueDecl | doc("the declaration captured by the parent closure")
|
||||
is_direct: predicate
|
||||
is_escaping: predicate
|
||||
|
||||
class CaptureListExpr(Expr):
|
||||
binding_decls: list[PatternBindingDecl] | child
|
||||
closure_body: "ClosureExpr" | child
|
||||
|
||||
Reference in New Issue
Block a user