Skip to content

Commit c47c8ea

Browse files
committed
[NFC] Return instruction from createScopeEnd.
1 parent be88e7c commit c47c8ea

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/swift/SIL/ScopedAddressUtils.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ struct ScopedAddressValue {
122122
AddressUseKind updateTransitiveLiveness(SSAPrunedLiveness &liveness) const;
123123

124124
/// Create appropriate scope ending instruction at \p insertPt.
125-
void createScopeEnd(SILBasicBlock::iterator insertPt, SILLocation loc) const;
125+
SILInstruction *createScopeEnd(SILBasicBlock::iterator insertPt,
126+
SILLocation loc) const;
126127

127128
/// Create scope ending instructions at \p liveness boundary.
128129
void endScopeAtLivenessBoundary(SSAPrunedLiveness *liveness) const;

lib/SIL/Utils/ScopedAddressUtils.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,15 @@ AddressUseKind ScopedAddressValue::updateTransitiveLiveness(
151151
return addressKind;
152152
}
153153

154-
void ScopedAddressValue::createScopeEnd(SILBasicBlock::iterator insertPt,
155-
SILLocation loc) const {
154+
SILInstruction *
155+
ScopedAddressValue::createScopeEnd(SILBasicBlock::iterator insertPt,
156+
SILLocation loc) const {
156157
switch (kind) {
157158
case ScopedAddressValueKind::StoreBorrow: {
158-
SILBuilderWithScope(insertPt).createEndBorrow(loc, value);
159-
return;
159+
return SILBuilderWithScope(insertPt).createEndBorrow(loc, value);
160160
}
161161
case ScopedAddressValueKind::BeginAccess: {
162-
SILBuilderWithScope(insertPt).createEndAccess(loc, value, false);
163-
return;
162+
return SILBuilderWithScope(insertPt).createEndAccess(loc, value, false);
164163
}
165164
case ScopedAddressValueKind::Invalid:
166165
llvm_unreachable("Using invalid case?!");

0 commit comments

Comments
 (0)