Skip to content

Commit 66938f4

Browse files
committed
[SIL] bridge MoveValue and BeginBorrow .isFromVarDecl [WIP]
1 parent 94d1b39 commit 66938f4

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

SwiftCompilerSources/Sources/SIL/Instruction.swift

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

957957
final public class MoveValueInst : SingleValueInstruction, UnaryInstruction {
958958
public var fromValue: Value { operand.value }
959+
960+
public var isFromVarDecl: Bool { bridged.MoveValue_isFromVarDecl() }
959961
}
960962

961963
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
@@ -735,6 +735,9 @@ BridgedSubscriptDecl_asAbstractStorageDecl(BridgedSubscriptDecl decl);
735735
// MARK: VarDecl
736736
//===----------------------------------------------------------------------===//
737737

738+
SWIFT_NAME("BridgedVarDecl.getSourceLocation(self:)")
739+
BRIDGED_INLINE BridgedSourceLoc BridgedVarDecl_getSourceLocation(BridgedVarDecl decl);
740+
738741
SWIFT_NAME("BridgedVarDecl.getUserFacingName(self:)")
739742
BRIDGED_INLINE
740743
BridgedStringRef BridgedVarDecl_getUserFacingName(BridgedVarDecl decl);

include/swift/SIL/SILBridgingImpl.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,18 @@ bool BridgedInstruction::BeginBorrow_isLexical() const {
911911
return getAs<swift::BeginBorrowInst>()->isLexical();
912912
}
913913

914+
bool BridgedInstruction::BeginBorrow_isFromVarDecl() const {
915+
return getAs<swift::BeginBorrowInst>()->isFromVarDecl();
916+
}
917+
918+
bool BridgedInstruction::MoveValue_isLexical() const {
919+
return getAs<swift::MoveValueInst>()->isLexical();
920+
}
921+
922+
bool BridgedInstruction::MoveValue_isFromVarDecl() const {
923+
return getAs<swift::MoveValueInst>()->isFromVarDecl();
924+
}
925+
914926
SwiftInt BridgedInstruction::ProjectBoxInst_fieldIndex() const {
915927
return getAs<swift::ProjectBoxInst>()->getFieldIndex();
916928
}

0 commit comments

Comments
 (0)