@@ -78,6 +78,18 @@ ManagedValue ArgumentSource::getAsSingleValue(SILGenFunction &gen,
78
78
}
79
79
}
80
80
81
+
82
+ ManagedValue ArgumentSource::getAsSingleValue (SILGenFunction &gen,
83
+ AbstractionPattern origFormalType,
84
+ SGFContext C) && {
85
+ auto loc = getLocation ();
86
+ auto substFormalType = getSubstType ();
87
+ ManagedValue outputValue = std::move (*this ).getAsSingleValue (gen);
88
+ return gen.emitSubstToOrigValue (loc,
89
+ outputValue, origFormalType,
90
+ substFormalType, C);
91
+ }
92
+
81
93
void ArgumentSource::forwardInto (SILGenFunction &gen, Initialization *dest) && {
82
94
assert (!isLValue ());
83
95
if (isRValue ()) {
@@ -152,12 +164,10 @@ void ArgumentSource::forwardInto(SILGenFunction &SGF,
152
164
153
165
// Otherwise, emit as a single independent value.
154
166
SILLocation loc = getLocation ();
155
- ManagedValue inputValue = std::move (*this ).getAsSingleValue (SGF);
156
-
157
- // Reabstract.
158
167
ManagedValue outputValue =
159
- SGF.emitSubstToOrigValue (loc, inputValue, origFormalType,
160
- substFormalType, SGFContext (dest));
168
+ std::move (*this ).getAsSingleValue (SGF, origFormalType,
169
+ SGFContext (dest));
170
+
161
171
if (outputValue.isInContext ()) return ;
162
172
163
173
// Use RValue's forward-into-initialization code. We have to lie to
0 commit comments