AST: Introduce Decl::getDeprecatedAttr().

It replaces `DeclAttr::getDeprecated()` as the designated way to query for the
attribute that makes a decl deprecated.
This commit is contained in:
Allan Shortlidge
2024-11-26 15:55:24 -05:00
parent 3e50a90c45
commit c5398e17d3
12 changed files with 93 additions and 113 deletions

View File

@@ -218,9 +218,9 @@ void CodeCompletionResultBuilder::setAssociatedDecl(const Decl *D) {
CurrentModule = MD;
}
if (D->getAttrs().isDeprecated(D->getASTContext()))
if (D->isDeprecated())
setContextFreeNotRecommended(ContextFreeNotRecommendedReason::Deprecated);
else if (D->getAttrs().getSoftDeprecated(D->getASTContext()))
else if (D->getSoftDeprecatedAttr())
setContextFreeNotRecommended(
ContextFreeNotRecommendedReason::SoftDeprecated);