Skip to content

Commit 6f99187

Browse files
committed
[CodeCompletion] Delete two unused functions
1 parent f512878 commit 6f99187

File tree

1 file changed

+0
-45
lines changed

1 file changed

+0
-45
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,

0 commit comments

Comments
 (0)