Skip to content

Commit 1d36224

Browse files
committed
[ClosureExpr] Remove hasAppliedFunctionBuilder.
There are no longer any clients of the "has applied function builder" bit in ClosureExpr, so remove it.
1 parent a71203d commit 1d36224

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

include/swift/AST/Expr.h

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,10 +3770,7 @@ class ClosureExpr : public AbstractClosureExpr {
37703770
/// the CaptureListExpr which would normally maintain this sort of
37713771
/// information about captured variables), we need to have some way to access
37723772
/// this information directly on the ClosureExpr.
3773-
///
3774-
/// The bit indicates whether this closure has had a function builder
3775-
/// applied to it.
3776-
llvm::PointerIntPair<VarDecl *, 1, bool> CapturedSelfDeclAndAppliedBuilder;
3773+
VarDecl * CapturedSelfDecl;
37773774

37783775
/// The location of the "throws", if present.
37793776
SourceLoc ThrowsLoc;
@@ -3800,7 +3797,7 @@ class ClosureExpr : public AbstractClosureExpr {
38003797
: AbstractClosureExpr(ExprKind::Closure, Type(), /*Implicit=*/false,
38013798
discriminator, parent),
38023799
BracketRange(bracketRange),
3803-
CapturedSelfDeclAndAppliedBuilder(capturedSelfDecl, false),
3800+
CapturedSelfDecl(capturedSelfDecl),
38043801
ThrowsLoc(throwsLoc), ArrowLoc(arrowLoc), InLoc(inLoc),
38053802
ExplicitResultTypeAndEnclosingChecked(explicitResultType, false),
38063803
Body(nullptr) {
@@ -3906,22 +3903,14 @@ class ClosureExpr : public AbstractClosureExpr {
39063903

39073904
/// VarDecl captured by this closure under the literal name \c self , if any.
39083905
VarDecl *getCapturedSelfDecl() const {
3909-
return CapturedSelfDeclAndAppliedBuilder.getPointer();
3906+
return CapturedSelfDecl;
39103907
}
39113908

39123909
/// Whether this closure captures the \c self param in its body in such a
39133910
/// way that implicit \c self is enabled within its body (i.e. \c self is
39143911
/// captured non-weakly).
39153912
bool capturesSelfEnablingImplictSelf() const;
39163913

3917-
bool hasAppliedFunctionBuilder() const {
3918-
return CapturedSelfDeclAndAppliedBuilder.getInt();
3919-
}
3920-
3921-
void setAppliedFunctionBuilder(bool flag = true) {
3922-
CapturedSelfDeclAndAppliedBuilder.setInt(flag);
3923-
}
3924-
39253914
/// Whether this closure's body was type checked within the enclosing
39263915
/// context.
39273916
bool wasTypeCheckedInEnclosingContext() const {

lib/Sema/CSClosure.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ SolutionApplicationToFunctionResult ConstraintSystem::applySolution(
333333

334334
fn.setBody(newBody, /*isSingleExpression=*/false);
335335
if (closure) {
336-
closure->setAppliedFunctionBuilder();
337336
closure->setTypeCheckedInEnclosingContext();
338337
solution.setExprTypes(closure);
339338
}

0 commit comments

Comments
 (0)