Skip to content

Commit 30e9d6b

Browse files
authored
Merge pull request #68391 from tshortli/unused-functions
NFC: Address warnings about unused functions
2 parents e7d3250 + b4f3a9f commit 30e9d6b

File tree

2 files changed

+0
-48
lines changed

2 files changed

+0
-48
lines changed

lib/Sema/TypeCheckCodeCompletion.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -57,51 +57,6 @@
5757
using namespace swift;
5858
using namespace constraints;
5959

60-
/// Find the declaration directly referenced by this expression.
61-
static std::pair<ValueDecl *, FunctionRefKind>
62-
findReferencedDecl(Expr *expr, DeclNameLoc &loc) {
63-
do {
64-
expr = expr->getSemanticsProvidingExpr();
65-
66-
if (auto ice = dyn_cast<ImplicitConversionExpr>(expr)) {
67-
expr = ice->getSubExpr();
68-
continue;
69-
}
70-
71-
if (auto dre = dyn_cast<DeclRefExpr>(expr)) {
72-
loc = dre->getNameLoc();
73-
return { dre->getDecl(), dre->getFunctionRefKind() };
74-
}
75-
76-
return { nullptr, FunctionRefKind::Unapplied };
77-
} while (true);
78-
}
79-
80-
// Check if \p E is a call expression to curried thunk of "KeyPath as function".
81-
// i.e. '{ `$kp$` in { $0[keyPath: $kp$] } }(keypath)'
82-
static bool isKeyPathCurriedThunkCallExpr(Expr *E) {
83-
auto CE = dyn_cast<CallExpr>(E);
84-
if (!CE)
85-
return false;
86-
auto thunk = dyn_cast<AutoClosureExpr>(CE->getFn());
87-
if (!thunk)
88-
return false;
89-
if (thunk->getParameters()->size() != 1 ||
90-
thunk->getParameters()->get(0)->getParameterName().str() != "$kp$")
91-
return false;
92-
93-
auto *unaryArg = CE->getArgs()->getUnlabeledUnaryExpr();
94-
if (!unaryArg)
95-
return false;
96-
return isa<KeyPathExpr>(unaryArg);
97-
}
98-
99-
// Extract the keypath expression from the curried thunk expression.
100-
static Expr *extractKeyPathFromCurryThunkCall(Expr *E) {
101-
assert(isKeyPathCurriedThunkCallExpr(E));
102-
return cast<CallExpr>(E)->getArgs()->getUnlabeledUnaryExpr();
103-
}
104-
10560
static Type
10661
getTypeOfExpressionWithoutApplying(Expr *&expr, DeclContext *dc,
10762
ConcreteDeclRef &referencedDecl,

stdlib/public/Concurrency/Actor.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,9 +1035,6 @@ static DefaultActor *asAbstract(DefaultActorImpl *actor) {
10351035
static NonDefaultDistributedActorImpl *asImpl(NonDefaultDistributedActor *actor) {
10361036
return reinterpret_cast<NonDefaultDistributedActorImpl*>(actor);
10371037
}
1038-
static NonDefaultDistributedActor *asAbstract(NonDefaultDistributedActorImpl *actor) {
1039-
return reinterpret_cast<NonDefaultDistributedActor*>(actor);
1040-
}
10411038

10421039
/*****************************************************************************/
10431040
/******************** NEW DEFAULT ACTOR IMPLEMENTATION ***********************/

0 commit comments

Comments
 (0)