File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4782,6 +4782,8 @@ class BorrowedFromInst final : public InstructionBaseWithTrailingOperands<
4782
4782
OperandValueArrayRef getEnclosingValues () const {
4783
4783
return OperandValueArrayRef (getEnclosingValueOperands ());
4784
4784
}
4785
+
4786
+ bool isReborrow () const ;
4785
4787
};
4786
4788
4787
4789
inline auto BeginBorrowInst::getEndBorrows () const -> EndBorrowRange {
Original file line number Diff line number Diff line change @@ -301,6 +301,14 @@ Operand *BeginBorrowInst::getSingleNonEndingUse() const {
301
301
return singleUse;
302
302
}
303
303
304
+ bool BorrowedFromInst::isReborrow () const {
305
+ // The forwarded operand is either a phi or undef.
306
+ if (auto *phi = dyn_cast<SILPhiArgument>(getBorrowedValue ())) {
307
+ return phi->isReborrow ();
308
+ }
309
+ return false ;
310
+ }
311
+
304
312
namespace {
305
313
class InstructionDestroyer
306
314
: public SILInstructionVisitor<InstructionDestroyer> {
You can’t perform that action at this time.
0 commit comments