@@ -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
@@ -552,15 +546,6 @@ OperandOwnershipKindClassifier::visitReturnInst(ReturnInst *ri) {
552
546
553
547
OperandOwnershipKindMap
554
548
OperandOwnershipKindClassifier::visitEndBorrowInst (EndBorrowInst *i) {
555
- // If we are checking a subobject, make sure that we are from a guaranteed
556
- // basic block argument.
557
- if (isCheckingSubObject ()) {
558
- auto *phiArg = cast<SILPhiArgument>(op.get ());
559
- (void )phiArg;
560
- return Map::compatibilityMap (ValueOwnershipKind::Guaranteed,
561
- UseLifetimeConstraint::MustBeLive);
562
- }
563
-
564
549
// / An end_borrow is modeled as invalidating the guaranteed value preventing
565
550
// / any further uses of the value.
566
551
return Map::compatibilityMap (ValueOwnershipKind::Guaranteed,
@@ -1054,10 +1039,7 @@ OperandOwnershipKindClassifier::visitBuiltinInst(BuiltinInst *bi) {
1054
1039
// Top Level Entrypoint
1055
1040
// ===----------------------------------------------------------------------===//
1056
1041
1057
- OperandOwnershipKindMap
1058
- Operand::getOwnershipKindMap (bool isForwardingSubValue) const {
1059
- OperandOwnershipKindClassifier classifier (
1060
- getUser ()->getModule (), *this ,
1061
- isForwardingSubValue);
1042
+ OperandOwnershipKindMap Operand::getOwnershipKindMap () const {
1043
+ OperandOwnershipKindClassifier classifier (getUser ()->getModule (), *this );
1062
1044
return classifier.visit (const_cast <SILInstruction *>(getUser ()));
1063
1045
}
0 commit comments