Skip to content

Commit d51fcfa

Browse files
committed
Stashed changes
1 parent 78863dd commit d51fcfa

File tree

3 files changed

+2
-34
lines changed

3 files changed

+2
-34
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7456,24 +7456,6 @@ RValue SILGenFunction::emitRValue(Expr *E, SGFContext C) {
74567456
return RValueEmitter(*this).visit(E, C);
74577457
}
74587458

7459-
RValue SILGenFunction::emitPlusOneRValue(Expr *E, SGFContext C) {
7460-
Scope S(*this, SILLocation(E));
7461-
assert(!E->getType()->hasLValueType() &&
7462-
"l-values must be emitted with emitLValue");
7463-
return S.popPreservingValue(
7464-
RValueEmitter(*this).visit(E, C.withSubExprSideEffects()));
7465-
}
7466-
7467-
RValue SILGenFunction::emitPlusZeroRValue(Expr *E) {
7468-
// Check if E is a case that we know how to emit at plus zero. If so, handle
7469-
// it here.
7470-
//
7471-
// TODO: Fill this in.
7472-
7473-
// Otherwise, we go through the +1 path and borrow the result.
7474-
return emitPlusOneRValue(E).borrow(*this, SILLocation(E));
7475-
}
7476-
74777459
static void emitIgnoredPackExpansion(SILGenFunction &SGF,
74787460
PackExpansionExpr *E) {
74797461
auto expansionType =

lib/SILGen/SILGenFunction.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1792,21 +1792,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
17921792
StorageReferenceOperationKind kind);
17931793
Expr *findStorageReferenceExprForBorrowExpr(Expr *argExpr);
17941794

1795-
/// Emit the given expression as a +1 r-value.
1796-
///
1797-
/// *NOTE* This creates the +1 r-value and then pushes that +1 r-value through
1798-
/// a scope. So all temporaries resulting will be cleaned up.
1799-
///
1800-
/// *NOTE* +0 vs +1 is ignored by this function. The only reason to use the
1801-
/// SGFContext argument is to pass in an initialization.
1802-
RValue emitPlusOneRValue(Expr *E, SGFContext C = SGFContext());
1803-
1804-
/// Emit the given expression as a +0 r-value.
1805-
///
1806-
/// *NOTE* This does not scope the creation of the +0 r-value. The reason why
1807-
/// this is done is that +0 r-values can not be pushed through scopes.
1808-
RValue emitPlusZeroRValue(Expr *E);
1809-
18101795
/// Emit the given expression as an r-value with the given conversion
18111796
/// context. This may be more efficient --- and, in some cases,
18121797
/// semantically different --- than emitting the expression and then

lib/SILGen/SILGenStmt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,7 @@ void SILGenFunction::emitReturnExpr(SILLocation branchLoc,
729729
} else {
730730
// SILValue return.
731731
FullExpr scope(Cleanups, CleanupLocation(ret));
732+
FormalEvaluationScope writeback(*this);
732733

733734
// Does the return context require reabstraction?
734735
RValue RV;
@@ -740,7 +741,7 @@ void SILGenFunction::emitReturnExpr(SILLocation branchLoc,
740741
loweredRetTy, loweredResultTy);
741742
RV = RValue(*this, ret, emitConvertedRValue(ret, conversion));
742743
} else {
743-
RV = emitRValue(ret);
744+
RV = emitRValue(ret, SGFContext::AllowImmediatePlusZero);
744745
}
745746

746747
std::move(RV)

0 commit comments

Comments
 (0)