Skip to content

Commit 93c0fa6

Browse files
committed
[silgen] Make ensurePlusOne emit copies even when guaranteed normal arguments is not enabled.
I want to use this to fix issues around us forwarding +0 values into memory. These fixes are good even from the perspective of normal compilation. rdar://34222540
1 parent f2c3870 commit 93c0fa6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/SILGen/ManagedValue.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,7 @@ void ManagedValue::dump(raw_ostream &os, unsigned indent) const {
203203

204204
ManagedValue ManagedValue::ensurePlusOne(SILGenFunction &SGF,
205205
SILLocation loc) const {
206-
// guaranteed-normal-args-todo: We only copy here when guaranteed normal args
207-
// are explicitly enabled. Otherwise, this always just returns self.
208-
if (SGF.getOptions().EnableGuaranteedNormalArguments && !hasCleanup()) {
206+
if (!hasCleanup()) {
209207
return copy(SGF, loc);
210208
}
211209
return *this;

0 commit comments

Comments
 (0)