Skip to content

Commit 8995602

Browse files
committed
[NFC] Promote static to member function.
1 parent 76dc6e1 commit 8995602

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

include/swift/AST/Decl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8441,6 +8441,10 @@ class AccessorDecl final : public FuncDecl {
84418441
/// accessed by it.
84428442
ArrayRef<VarDecl *> getAccessedProperties() const;
84438443

8444+
/// Whether this accessor should have a body. Note that this will be true
8445+
/// even when it does not have one _yet_.
8446+
bool doesAccessorHaveBody() const;
8447+
84448448
static bool classof(const Decl *D) {
84458449
return D->getKind() == DeclKind::Accessor;
84468450
}

lib/Sema/TypeCheckStorage.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,8 @@ buildIndexForwardingParamList(AbstractStorageDecl *storage,
928928
return ParameterList::create(context, elements);
929929
}
930930

931-
static bool doesAccessorHaveBody(AccessorDecl *accessor) {
931+
bool AccessorDecl::doesAccessorHaveBody() const {
932+
auto *accessor = this;
932933
// Protocol requirements don't have bodies.
933934
//
934935
// FIXME: Revisit this if we ever get 'real' default implementations.
@@ -2349,7 +2350,7 @@ static void finishImplicitAccessor(AccessorDecl *accessor,
23492350
if (ctx.Stats)
23502351
++ctx.Stats->getFrontendCounters().NumAccessorsSynthesized;
23512352

2352-
if (doesAccessorHaveBody(accessor))
2353+
if (accessor->doesAccessorHaveBody())
23532354
accessor->setBodySynthesizer(&synthesizeAccessorBody);
23542355
}
23552356

@@ -2828,7 +2829,7 @@ IsAccessorTransparentRequest::evaluate(Evaluator &evaluator,
28282829
if (!accessor->isImplicit())
28292830
return false;
28302831

2831-
if (!doesAccessorHaveBody(accessor))
2832+
if (!accessor->doesAccessorHaveBody())
28322833
return false;
28332834

28342835
auto *DC = accessor->getDeclContext();

0 commit comments

Comments
 (0)