Skip to content

Commit bc4a83f

Browse files
committed
Stashed changes
1 parent d624927 commit bc4a83f

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
@@ -7462,24 +7462,6 @@ RValue SILGenFunction::emitRValue(Expr *E, SGFContext C) {
74627462
return RValueEmitter(*this).visit(E, C);
74637463
}
74647464

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

lib/SILGen/SILGenFunction.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,21 +1814,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
18141814
StorageReferenceOperationKind kind);
18151815
Expr *findStorageReferenceExprForBorrowExpr(Expr *argExpr);
18161816

1817-
/// Emit the given expression as a +1 r-value.
1818-
///
1819-
/// *NOTE* This creates the +1 r-value and then pushes that +1 r-value through
1820-
/// a scope. So all temporaries resulting will be cleaned up.
1821-
///
1822-
/// *NOTE* +0 vs +1 is ignored by this function. The only reason to use the
1823-
/// SGFContext argument is to pass in an initialization.
1824-
RValue emitPlusOneRValue(Expr *E, SGFContext C = SGFContext());
1825-
1826-
/// Emit the given expression as a +0 r-value.
1827-
///
1828-
/// *NOTE* This does not scope the creation of the +0 r-value. The reason why
1829-
/// this is done is that +0 r-values can not be pushed through scopes.
1830-
RValue emitPlusZeroRValue(Expr *E);
1831-
18321817
/// Emit the given expression as an r-value with the given conversion
18331818
/// context. This may be more efficient --- and, in some cases,
18341819
/// 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)