Skip to content

Commit 95c83e9

Browse files
committed
Swift SIL: add BeginBorrowInst.isLexical
1 parent 0509a05 commit 95c83e9

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ final public class BeginBorrowInst : SingleValueInstruction, UnaryInstruction {
879879
public var endBorrows: EndBorrowSequence {
880880
uses.lazy.compactMap({ $0.instruction as? EndBorrowInst })
881881
}
882+
883+
public var isLexical: Bool { bridged.BeginBorrow_isLexical() }
882884
}
883885

884886
final public class ProjectBoxInst : SingleValueInstruction, UnaryInstruction {

include/swift/SIL/SILBridging.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ struct BridgedInstruction {
593593
BRIDGED_INLINE SwiftInt StructExtractInst_fieldIndex() const;
594594
BRIDGED_INLINE OptionalBridgedValue StructInst_getUniqueNonTrivialFieldValue() const;
595595
BRIDGED_INLINE SwiftInt StructElementAddrInst_fieldIndex() const;
596+
BRIDGED_INLINE bool BeginBorrow_isLexical() const;
596597
BRIDGED_INLINE SwiftInt ProjectBoxInst_fieldIndex() const;
597598
BRIDGED_INLINE bool EndCOWMutationInst_doKeepUnique() const;
598599
BRIDGED_INLINE SwiftInt EnumInst_caseIndex() const;

include/swift/SIL/SILBridgingImpl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,6 +780,10 @@ SwiftInt BridgedInstruction::StructElementAddrInst_fieldIndex() const {
780780
return getAs<swift::StructElementAddrInst>()->getFieldIndex();
781781
}
782782

783+
bool BridgedInstruction::BeginBorrow_isLexical() const {
784+
return getAs<swift::BeginBorrowInst>()->isLexical();
785+
}
786+
783787
SwiftInt BridgedInstruction::ProjectBoxInst_fieldIndex() const {
784788
return getAs<swift::ProjectBoxInst>()->getFieldIndex();
785789
}

0 commit comments

Comments
 (0)