Skip to content

Commit dadb4b7

Browse files
committed
[SIL] bridge MoveValue and BeginBorrow .isFromVarDecl [WIP]
1 parent 18a3c2c commit dadb4b7

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,8 @@ final public class CopyValueInst : SingleValueInstruction, UnaryInstruction {
901901

902902
final public class MoveValueInst : SingleValueInstruction, UnaryInstruction {
903903
public var fromValue: Value { operand.value }
904+
905+
public var isFromVarDecl: Bool { bridged.MoveValue_isFromVarDecl() }
904906
}
905907

906908
final public class DropDeinitInst : SingleValueInstruction, UnaryInstruction {

include/swift/AST/ASTBridging.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,9 @@ void BridgedNominalTypeDecl_setParsedMembers(BridgedNominalTypeDecl decl,
636636
// MARK: VarDecl
637637
//===----------------------------------------------------------------------===//
638638

639+
SWIFT_NAME("BridgedVarDecl.getSourceLocation(self:)")
640+
BRIDGED_INLINE BridgedSourceLoc BridgedVarDecl_getSourceLocation(BridgedVarDecl decl);
641+
639642
SWIFT_NAME("BridgedVarDecl.getUserFacingName(self:)")
640643
BRIDGED_INLINE
641644
BridgedStringRef BridgedVarDecl_getUserFacingName(BridgedVarDecl decl);

include/swift/SIL/SILBridgingImpl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,16 @@ bool BridgedInstruction::BeginBorrow_isLexical() const {
888888
return getAs<swift::BeginBorrowInst>()->isLexical();
889889
}
890890

891+
bool BridgedInstruction::BeginBorrow_isFromVarDecl() const {
892+
return getAs<swift::BeginBorrowInst>()->isFromVarDecl();
893+
}
894+
895+
bool BridgedInstruction::MoveValue_isLexical() const {
896+
return getAs<swift::MoveValueInst>()->isLexical();
897+
}
898+
899+
bool BridgedInstruction::MoveValue_isFromVarDecl() const {
900+
return getAs<swift::MoveValueInst>()->isFromVarDecl();
891901
}
892902

893903
SwiftInt BridgedInstruction::ProjectBoxInst_fieldIndex() const {

0 commit comments

Comments
 (0)