Skip to content

Commit 5b6552a

Browse files
committed
silgen: eliminated unused RValue emission functions
The functions `emitPlusOneRValue` and `emitPlusOneZeroRValue` of SILGenFunction, are unused and not fully implemented.
1 parent 4852aa0 commit 5b6552a

File tree

2 files changed

+0
-33
lines changed

2 files changed

+0
-33
lines changed

lib/SILGen/SILGenExpr.cpp

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

7508-
RValue SILGenFunction::emitPlusOneRValue(Expr *E, SGFContext C) {
7509-
Scope S(*this, SILLocation(E));
7510-
assert(!E->getType()->hasLValueType() &&
7511-
"l-values must be emitted with emitLValue");
7512-
return S.popPreservingValue(
7513-
RValueEmitter(*this).visit(E, C.withSubExprSideEffects()));
7514-
}
7515-
7516-
RValue SILGenFunction::emitPlusZeroRValue(Expr *E) {
7517-
// Check if E is a case that we know how to emit at plus zero. If so, handle
7518-
// it here.
7519-
//
7520-
// TODO: Fill this in.
7521-
7522-
// Otherwise, we go through the +1 path and borrow the result.
7523-
return emitPlusOneRValue(E).borrow(*this, SILLocation(E));
7524-
}
7525-
75267508
static void emitIgnoredPackExpansion(SILGenFunction &SGF,
75277509
PackExpansionExpr *E) {
75287510
auto expansionType =

lib/SILGen/SILGenFunction.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,21 +1827,6 @@ class LLVM_LIBRARY_VISIBILITY SILGenFunction
18271827
StorageReferenceOperationKind kind);
18281828
Expr *findStorageReferenceExprForBorrowExpr(Expr *argExpr);
18291829

1830-
/// Emit the given expression as a +1 r-value.
1831-
///
1832-
/// *NOTE* This creates the +1 r-value and then pushes that +1 r-value through
1833-
/// a scope. So all temporaries resulting will be cleaned up.
1834-
///
1835-
/// *NOTE* +0 vs +1 is ignored by this function. The only reason to use the
1836-
/// SGFContext argument is to pass in an initialization.
1837-
RValue emitPlusOneRValue(Expr *E, SGFContext C = SGFContext());
1838-
1839-
/// Emit the given expression as a +0 r-value.
1840-
///
1841-
/// *NOTE* This does not scope the creation of the +0 r-value. The reason why
1842-
/// this is done is that +0 r-values can not be pushed through scopes.
1843-
RValue emitPlusZeroRValue(Expr *E);
1844-
18451830
/// Emit the given expression as an r-value with the given conversion
18461831
/// context. This may be more efficient --- and, in some cases,
18471832
/// semantically different --- than emitting the expression and then

0 commit comments

Comments
 (0)