Skip to content

Commit b686e81

Browse files
committed
[OwnershipUtils] Add move as OwnedValueIntroducer.
1 parent d5fdfa7 commit b686e81

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

include/swift/SIL/OwnershipUtils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,9 @@ class OwnedValueIntroducerKind {
10661066
/// memory location.
10671067
LoadTake,
10681068

1069+
/// An owned value produced by moving from another owned value.
1070+
Move,
1071+
10691072
/// An owned value that is a result of a true phi argument.
10701073
///
10711074
/// A true phi argument here is defined as an SIL phi argument that only has
@@ -1140,6 +1143,8 @@ class OwnedValueIntroducerKind {
11401143
return Kind::LoadCopy;
11411144
return Kind::Invalid;
11421145
}
1146+
case ValueKind::MoveValueInst:
1147+
return Kind::Move;
11431148
case ValueKind::PartialApplyInst:
11441149
return Kind::PartialApplyInit;
11451150
case ValueKind::AllocBoxInst:
@@ -1212,6 +1217,7 @@ struct OwnedValueIntroducer {
12121217
case OwnedValueIntroducerKind::BeginApply:
12131218
case OwnedValueIntroducerKind::TryApply:
12141219
case OwnedValueIntroducerKind::LoadTake:
1220+
case OwnedValueIntroducerKind::Move:
12151221
case OwnedValueIntroducerKind::Phi:
12161222
case OwnedValueIntroducerKind::Struct:
12171223
case OwnedValueIntroducerKind::Tuple:
@@ -1242,6 +1248,7 @@ struct OwnedValueIntroducer {
12421248
case OwnedValueIntroducerKind::BeginApply:
12431249
case OwnedValueIntroducerKind::TryApply:
12441250
case OwnedValueIntroducerKind::LoadTake:
1251+
case OwnedValueIntroducerKind::Move:
12451252
case OwnedValueIntroducerKind::FunctionArgument:
12461253
case OwnedValueIntroducerKind::PartialApplyInit:
12471254
case OwnedValueIntroducerKind::AllocBoxInit:

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,9 @@ void OwnedValueIntroducerKind::print(llvm::raw_ostream &os) const {
12611261
case OwnedValueIntroducerKind::LoadTake:
12621262
os << "LoadTake";
12631263
return;
1264+
case OwnedValueIntroducerKind::Move:
1265+
os << "Move";
1266+
return;
12641267
case OwnedValueIntroducerKind::Phi:
12651268
os << "Phi";
12661269
return;

lib/SILOptimizer/SemanticARC/OwnershipLiveRange.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ static SILValue convertIntroducerToGuaranteed(OwnedValueIntroducer introducer) {
296296
case OwnedValueIntroducerKind::BeginApply:
297297
case OwnedValueIntroducerKind::TryApply:
298298
case OwnedValueIntroducerKind::LoadTake:
299+
case OwnedValueIntroducerKind::Move:
299300
case OwnedValueIntroducerKind::FunctionArgument:
300301
case OwnedValueIntroducerKind::PartialApplyInit:
301302
case OwnedValueIntroducerKind::AllocBoxInit:

0 commit comments

Comments
 (0)