Skip to content

Commit 9586a23

Browse files
authored
Merge pull request #6792 from gottesmm/small_silgen_fixup
[semantic-sil] Use SILGenFunction::emitManagedBufferWithCleanup instead of entering in a random cleanup.
2 parents 2e9ba52 + e5376e4 commit 9586a23

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/SILGen/SILGenFunction.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#ifndef SILGENFUNCTION_H
14-
#define SILGENFUNCTION_H
13+
#ifndef SWIFT_SILGEN_SILGENFUNCTION_H
14+
#define SWIFT_SILGEN_SILGENFUNCTION_H
1515

1616
#include "SILGen.h"
1717
#include "JumpDest.h"

lib/SILGen/SILGenLValue.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,9 +1670,8 @@ LValue SILGenLValue::visitDiscardAssignmentExpr(DiscardAssignmentExpr *e,
16701670
SILValue address = gen.emitTemporaryAllocation(e, typeData.TypeOfRValue);
16711671
address = gen.B.createMarkUninitialized(e, address,
16721672
MarkUninitializedInst::Var);
1673-
gen.enterDestroyCleanup(address);
16741673
LValue lv;
1675-
lv.add<ValueComponent>(ManagedValue::forUnmanaged(address), typeData);
1674+
lv.add<ValueComponent>(gen.emitManagedBufferWithCleanup(address), typeData);
16761675
return lv;
16771676
}
16781677

0 commit comments

Comments
 (0)