Skip to content

Commit a4bb310

Browse files
committed
Sema: Remove addExpectedOpaqueAccessorsToStorage()
1 parent 6c5ecb5 commit a4bb310

File tree

6 files changed

+5
-27
lines changed

6 files changed

+5
-27
lines changed

lib/Sema/CSApply.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4039,7 +4039,6 @@ namespace {
40394039
method = func;
40404040
} else if (auto var = dyn_cast<VarDecl>(foundDecl)) {
40414041
// Properties.
4042-
addExpectedOpaqueAccessorsToStorage(var);
40434042

40444043
// If this isn't a property on a type, complain.
40454044
if (!var->getDeclContext()->isTypeContext()) {

lib/Sema/CodeSynthesis.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,13 +1293,6 @@ SynthesizeAccessorRequest::evaluate(Evaluator &evaluator,
12931293
}
12941294
}
12951295

1296-
void swift::addExpectedOpaqueAccessorsToStorage(AbstractStorageDecl *storage) {
1297-
storage->visitExpectedOpaqueAccessors([&](AccessorKind kind) {
1298-
// Force synthesis if necessary.
1299-
(void) storage->getSynthesizedAccessor(kind);
1300-
});
1301-
}
1302-
13031296
/// Synthesize the body of a setter which just delegates to a mutable
13041297
/// addressor.
13051298
static std::pair<BraceStmt *, bool>
@@ -1717,7 +1710,6 @@ static VarDecl *synthesizePropertyWrapperStorageWrapperProperty(
17171710
property->setImplInfo(StorageImplInfo::getMutableComputed());
17181711
else
17191712
property->setImplInfo(StorageImplInfo::getImmutableComputed());
1720-
addExpectedOpaqueAccessorsToStorage(property);
17211713

17221714
var->getAttrs().add(
17231715
new (ctx) ProjectedValuePropertyAttr(name, SourceLoc(), SourceRange(),

lib/Sema/CodeSynthesis.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ class ObjCReason;
4545
// Implemented in TypeCheckerOverride.cpp
4646
bool checkOverrides(ValueDecl *decl);
4747

48-
// These are implemented in CodeSynthesis.cpp.
49-
void addExpectedOpaqueAccessorsToStorage(AbstractStorageDecl *storage);
50-
5148
/// Describes the kind of implicit constructor that will be
5249
/// generated.
5350
enum class ImplicitConstructorKind {

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,12 +2528,8 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
25282528
// Compute these requests in case they emit diagnostics.
25292529
(void) VD->isGetterMutating();
25302530
(void) VD->isSetterMutating();
2531-
2532-
// Retrieve the backing property of a wrapped property.
25332531
(void) VD->getPropertyWrapperBackingProperty();
2534-
2535-
// Set up accessors, also lowering lazy and @NSManaged properties.
2536-
addExpectedOpaqueAccessorsToStorage(VD);
2532+
(void) VD->getImplInfo();
25372533

25382534
// Add the '@_hasStorage' attribute if this property is stored.
25392535
if (VD->hasStorage() && !VD->getAttrs().hasAttribute<HasStorageAttr>())
@@ -2542,9 +2538,8 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
25422538
// Reject cases where this is a variable that has storage but it isn't
25432539
// allowed.
25442540
if (VD->hasStorage()) {
2545-
// Stored properties in protocols are diagnosed in
2546-
// addExpectedOpaqueAccessorsToStorage(), to ensure they run when a
2547-
// protocol requirement is validated but not type checked.
2541+
// Note: Stored properties in protocols are diagnosed in
2542+
// finishProtocolStorageImplInfo().
25482543

25492544
// Enums and extensions cannot have stored instance properties.
25502545
// Static stored properties are allowed, with restrictions
@@ -2615,8 +2610,6 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
26152610

26162611
TC.checkDeclAttributes(VD);
26172612

2618-
addExpectedOpaqueAccessorsToStorage(VD);
2619-
26202613
if (VD->getDeclContext()->getSelfClassDecl()) {
26212614
checkDynamicSelfType(VD, VD->getValueInterfaceType());
26222615

@@ -2861,8 +2854,7 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
28612854
// Compute these requests in case they emit diagnostics.
28622855
(void) SD->isGetterMutating();
28632856
(void) SD->isSetterMutating();
2864-
2865-
addExpectedOpaqueAccessorsToStorage(SD);
2857+
(void) SD->getImplInfo();
28662858

28672859
if (SD->getAttrs().hasAttribute<DynamicReplacementAttr>()) {
28682860
TC.checkDynamicReplacementAttribute(SD);

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,8 +1879,6 @@ OverriddenDeclsRequest::evaluate(Evaluator &evaluator, ValueDecl *decl) const {
18791879
SmallVector<OverrideMatch, 2> matches;
18801880
for (auto overridden : overridingASD->getOverriddenDecls()) {
18811881
auto baseASD = cast<AbstractStorageDecl>(overridden);
1882-
addExpectedOpaqueAccessorsToStorage(baseASD);
1883-
18841882
auto kind = accessor->getAccessorKind();
18851883

18861884
// If the base doesn't consider this an opaque accessor,

test/attr/attr_objc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ class infer_instanceVar1 {
845845
}
846846

847847
var observingAccessorsVar1: Int {
848-
// CHECK: @objc @_hasStorage var observingAccessorsVar1: Int {
848+
// CHECK: @_hasStorage @objc var observingAccessorsVar1: Int {
849849
willSet {}
850850
// CHECK-NEXT: {{^}} @objc get
851851
didSet {}

0 commit comments

Comments
 (0)