Skip to content

Commit 0ad799d

Browse files
committed
[IDE] Use getExpandedAttrs instead of getSemanticAttrs to get custom attributes of a declaration
`getSemanticAttrs` runs a couple queries that we don’t actually need to run to get all the custom attributes, such as getting the actor isolation of the declaration. Running these things can amount to 5%-7% of the index-while-building overhead. Just running `getExpandedAttrs` should be sufficient here.
1 parent 9ae142c commit 0ad799d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/IDE/SourceEntityWalker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ bool SemaAnnotator::handleCustomAttributes(Decl *D) {
728728

729729
ModuleDecl *MD = D->getModuleContext();
730730
for (auto *customAttr :
731-
D->getSemanticAttrs().getAttributes<CustomAttr, true>()) {
731+
D->getExpandedAttrs().getAttributes<CustomAttr, true>()) {
732732
SourceFile *SF =
733733
MD->getSourceFileContainingLocation(customAttr->getLocation());
734734
ASTNode expansion = SF ? SF->getMacroExpansion() : nullptr;

0 commit comments

Comments
 (0)