Skip to content

Commit 5da7ac6

Browse files
committed
[NFC] Use DeclAttributes::isDeprecated in a few more places.
1 parent 005b45c commit 5da7ac6

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
@@ -207,7 +207,7 @@ computeExportContextBits(ASTContext &Ctx, Decl *D,
207207
if (D->isImplicit() && !isDeferBody)
208208
*implicit = true;
209209

210-
if (D->getAttrs().getDeprecated(Ctx))
210+
if (D->getAttrs().isDeprecated(Ctx))
211211
*deprecated = true;
212212

213213
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
@@ -448,7 +448,7 @@ static bool initDocEntityInfo(const Decl *D,
448448
}
449449

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

0 commit comments

Comments
 (0)