Skip to content

Commit 0bfa875

Browse files
committed
[NFC] Use DeclAttributes::isDeprecated in a few more places.
(cherry picked from commit 5da7ac6)
1 parent cc83510 commit 0bfa875

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

lib/APIDigester/ModuleAnalyzerNodes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ SDKNodeInitInfo::SDKNodeInitInfo(SDKContext &Ctx, Decl *D):
14741474
ObjCName(Ctx.getObjcName(D)),
14751475
InitKind(Ctx.getInitKind(D)),
14761476
IsImplicit(D->isImplicit()),
1477-
IsDeprecated(D->getAttrs().getDeprecated(D->getASTContext())),
1477+
IsDeprecated(D->getAttrs().isDeprecated(D->getASTContext())),
14781478
IsABIPlaceholder(isABIPlaceholderRecursive(D)),
14791479
IsFromExtension(isDeclaredInExtension(D)),
14801480
DeclAttrs(collectDeclAttributes(D)) {

lib/IDE/CodeCompletionResultBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void CodeCompletionResultBuilder::setAssociatedDecl(const Decl *D) {
212212
CurrentModule = MD;
213213
}
214214

215-
if (D->getAttrs().getDeprecated(D->getASTContext()))
215+
if (D->getAttrs().isDeprecated(D->getASTContext()))
216216
setContextFreeNotRecommended(ContextFreeNotRecommendedReason::Deprecated);
217217
else if (D->getAttrs().getSoftDeprecated(D->getASTContext()))
218218
setContextFreeNotRecommended(

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4230,7 +4230,7 @@ findImportedCaseWithMatchingSuffix(Type instanceTy, DeclNameRef name) {
42304230

42314231
// Is one more available than the other?
42324232
WORSE(->getAttrs().isUnavailable(ctx));
4233-
WORSE(->getAttrs().getDeprecated(ctx));
4233+
WORSE(->getAttrs().isDeprecated(ctx));
42344234

42354235
// Does one have a shorter name (so the non-matching prefix is shorter)?
42364236
WORSE(->getName().getBaseName().userFacingName().size());

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ computeExportContextBits(ASTContext &Ctx, Decl *D, bool *spi, bool *implicit,
198198
if (D->isImplicit() && !isDeferBody)
199199
*implicit = true;
200200

201-
if (D->getAttrs().getDeprecated(Ctx))
201+
if (D->getAttrs().isDeprecated(Ctx))
202202
*deprecated = true;
203203

204204
if (auto *A = D->getAttrs().getUnavailable(Ctx)) {

tools/SourceKit/lib/SwiftLang/SwiftDocSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ static bool initDocEntityInfo(const Decl *D,
451451
}
452452

453453
Info.IsUnavailable = AvailableAttr::isUnavailable(D);
454-
Info.IsDeprecated = D->getAttrs().getDeprecated(D->getASTContext()) != nullptr;
454+
Info.IsDeprecated = D->getAttrs().isDeprecated(D->getASTContext());
455455
Info.IsOptional = D->getAttrs().hasAttribute<OptionalAttr>();
456456
if (auto *AFD = dyn_cast<AbstractFunctionDecl>(D)) {
457457
Info.IsAsync = AFD->hasAsync();

0 commit comments

Comments
 (0)