Skip to content

Commit 53346fd

Browse files
authored
Merge pull request #24285 from benlangmuir/digest-attr
[api-digester] Force lazy attribute calculations as workaround
2 parents 54cb9df + 8fbd71c commit 53346fd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/swift-api-digester/ModuleAnalyzerNodes.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,6 +1158,16 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
11581158
IsImplicit(D->isImplicit()),
11591159
IsDeprecated(D->getAttrs().getDeprecated(D->getASTContext())),
11601160
IsABIPlaceholder(isABIPlaceholderRecursive(D)) {
1161+
1162+
// Force some attributes that are lazily computed.
1163+
// FIXME: we should use these AST predicates directly instead of looking at
1164+
// the attributes rdar://50217247.
1165+
if (auto *VD = dyn_cast<ValueDecl>(D)) {
1166+
(void) VD->isObjC();
1167+
(void) VD->isFinal();
1168+
(void) VD->isDynamic();
1169+
}
1170+
11611171
// Capture all attributes.
11621172
auto AllAttrs = D->getAttrs();
11631173
std::transform(AllAttrs.begin(), AllAttrs.end(), std::back_inserter(DeclAttrs),

0 commit comments

Comments
 (0)