@@ -35,7 +35,6 @@ class OperandOwnershipKindClassifier
35
35
LLVM_ATTRIBUTE_UNUSED SILModule &mod;
36
36
37
37
const Operand &op;
38
- bool checkingSubObject;
39
38
40
39
public:
41
40
// / Create a new OperandOwnershipKindClassifier.
@@ -45,13 +44,8 @@ class OperandOwnershipKindClassifier
45
44
// / should be the subobject and Value should be the parent object. An example
46
45
// / of where one would want to do this is in the case of value projections
47
46
// / like struct_extract.
48
- OperandOwnershipKindClassifier (
49
- SILModule &mod, const Operand &op,
50
- bool checkingSubObject)
51
- : mod(mod), op(op),
52
- checkingSubObject (checkingSubObject) {}
53
-
54
- bool isCheckingSubObject () const { return checkingSubObject; }
47
+ OperandOwnershipKindClassifier (SILModule &mod, const Operand &op)
48
+ : mod(mod), op(op) {}
55
49
56
50
SILValue getValue () const { return op.get (); }
57
51
@@ -553,15 +547,6 @@ OperandOwnershipKindClassifier::visitReturnInst(ReturnInst *ri) {
553
547
554
548
OperandOwnershipKindMap
555
549
OperandOwnershipKindClassifier::visitEndBorrowInst (EndBorrowInst *i) {
556
- // If we are checking a subobject, make sure that we are from a guaranteed
557
- // basic block argument.
558
- if (isCheckingSubObject ()) {
559
- auto *phiArg = cast<SILPhiArgument>(op.get ());
560
- (void )phiArg;
561
- return Map::compatibilityMap (ValueOwnershipKind::Guaranteed,
562
- UseLifetimeConstraint::MustBeLive);
563
- }
564
-
565
550
// / An end_borrow is modeled as invalidating the guaranteed value preventing
566
551
// / any further uses of the value.
567
552
return Map::compatibilityMap (ValueOwnershipKind::Guaranteed,
@@ -1065,10 +1050,7 @@ OperandOwnershipKindClassifier::visitBuiltinInst(BuiltinInst *bi) {
1065
1050
// Top Level Entrypoint
1066
1051
// ===----------------------------------------------------------------------===//
1067
1052
1068
- OperandOwnershipKindMap
1069
- Operand::getOwnershipKindMap (bool isForwardingSubValue) const {
1070
- OperandOwnershipKindClassifier classifier (
1071
- getUser ()->getModule (), *this ,
1072
- isForwardingSubValue);
1053
+ OperandOwnershipKindMap Operand::getOwnershipKindMap () const {
1054
+ OperandOwnershipKindClassifier classifier (getUser ()->getModule (), *this );
1073
1055
return classifier.visit (const_cast <SILInstruction *>(getUser ()));
1074
1056
}
0 commit comments