Skip to content

Commit 553537d

Browse files
committed
Revert "[NFC] Add isKnownObjC param to RenamedDeclRequest"
This reverts commit 102f9a3.
1 parent 97bd500 commit 553537d

File tree

7 files changed

+10
-15
lines changed

7 files changed

+10
-15
lines changed

include/swift/AST/Decl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6827,7 +6827,7 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
68276827
bool hasDynamicSelfResult() const;
68286828

68296829
/// The async function marked as the alternative to this function, if any.
6830-
AbstractFunctionDecl *getAsyncAlternative(bool isKnownObjC = false) const;
6830+
AbstractFunctionDecl *getAsyncAlternative() const;
68316831

68326832
/// If \p asyncAlternative is set, then compare its parameters to this
68336833
/// (presumed synchronous) function's parameters to find the index of the

include/swift/AST/TypeCheckRequests.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3455,8 +3455,7 @@ class ConditionalRequirementsRequest
34553455

34563456
class RenamedDeclRequest
34573457
: public SimpleRequest<RenamedDeclRequest,
3458-
ValueDecl *(const ValueDecl *, const AvailableAttr *,
3459-
bool isKnownObjC),
3458+
ValueDecl *(const ValueDecl *, const AvailableAttr *),
34603459
RequestFlags::Cached> {
34613460
public:
34623461
using SimpleRequest::SimpleRequest;
@@ -3465,7 +3464,7 @@ class RenamedDeclRequest
34653464
friend SimpleRequest;
34663465

34673466
ValueDecl *evaluate(Evaluator &evaluator, const ValueDecl *attached,
3468-
const AvailableAttr *attr, bool isKnownObjC) const;
3467+
const AvailableAttr *attr) const;
34693468

34703469
public:
34713470
bool isCached() const { return true; }

include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ SWIFT_REQUEST(TypeChecker, GetImplicitSendableRequest,
391391
ProtocolConformance *(NominalTypeDecl *),
392392
Cached, NoLocationInfo)
393393
SWIFT_REQUEST(TypeChecker, RenamedDeclRequest,
394-
ValueDecl *(const ValueDecl *, const AvailableAttr *, bool),
394+
ValueDecl *(const ValueDecl *),
395395
Cached, NoLocationInfo)
396396
SWIFT_REQUEST(TypeChecker, ClosureEffectsRequest,
397397
FunctionType::ExtInfo(ClosureExpr *),

lib/AST/Decl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7666,8 +7666,7 @@ bool AbstractFunctionDecl::hasDynamicSelfResult() const {
76667666
return isa<ConstructorDecl>(this);
76677667
}
76687668

7669-
AbstractFunctionDecl *
7670-
AbstractFunctionDecl::getAsyncAlternative(bool isKnownObjC) const {
7669+
AbstractFunctionDecl *AbstractFunctionDecl::getAsyncAlternative() const {
76717670
// Async functions can't have async alternatives
76727671
if (hasAsync())
76737672
return nullptr;
@@ -7691,8 +7690,7 @@ AbstractFunctionDecl::getAsyncAlternative(bool isKnownObjC) const {
76917690
}
76927691

76937692
auto *renamedDecl = evaluateOrDefault(
7694-
getASTContext().evaluator, RenamedDeclRequest{this, avAttr, isKnownObjC},
7695-
nullptr);
7693+
getASTContext().evaluator, RenamedDeclRequest{this, avAttr}, nullptr);
76967694
auto *alternative = dyn_cast_or_null<AbstractFunctionDecl>(renamedDecl);
76977695
if (!alternative || !alternative->hasAsync())
76987696
return nullptr;

lib/PrintAsClang/DeclAndTypePrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,8 +1547,7 @@ class DeclAndTypePrinter::Implementation
15471547
assert(!AvAttr->Rename.empty());
15481548

15491549
auto *renamedDecl = evaluateOrDefault(
1550-
getASTContext().evaluator, RenamedDeclRequest{D, AvAttr, false},
1551-
nullptr);
1550+
getASTContext().evaluator, RenamedDeclRequest{D, AvAttr}, nullptr);
15521551
if (renamedDecl) {
15531552
assert(shouldInclude(renamedDecl) &&
15541553
"ObjC printer logic mismatch with renamed decl");

lib/Sema/TypeCheckAttr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6657,8 +6657,7 @@ static bool parametersMatch(const AbstractFunctionDecl *a,
66576657

66586658
ValueDecl *RenamedDeclRequest::evaluate(Evaluator &evaluator,
66596659
const ValueDecl *attached,
6660-
const AvailableAttr *attr,
6661-
bool isKnownObjC) const {
6660+
const AvailableAttr *attr) const {
66626661
if (!attached || !attr)
66636662
return nullptr;
66646663

@@ -6689,7 +6688,7 @@ ValueDecl *RenamedDeclRequest::evaluate(Evaluator &evaluator,
66896688
auto minAccess = AccessLevel::Private;
66906689
if (attached->getModuleContext()->isExternallyConsumed())
66916690
minAccess = AccessLevel::Public;
6692-
bool attachedIsObjcVisible = isKnownObjC ||
6691+
bool attachedIsObjcVisible =
66936692
objc_translation::isVisibleToObjC(attached, minAccess);
66946693

66956694
SmallVector<ValueDecl *, 4> lookupResults;

lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@ getObjCMethodConflictDecls(const SourceFile::ObjCMethodConflict &conflict) {
24532453
asyncAlternatives;
24542454
for (auto method : methods) {
24552455
if (isa<ProtocolDecl>(method->getDeclContext())) {
2456-
if (auto alt = method->getAsyncAlternative(/*isKnownObjC=*/true))
2456+
if (auto alt = method->getAsyncAlternative())
24572457
asyncAlternatives[method] = alt;
24582458
}
24592459
}

0 commit comments

Comments
 (0)