Skip to content

Commit 3e26cf8

Browse files
committed
SwiftCompilerSources: bridge createEndApply and createAbortApply.
1 parent 4612728 commit 3e26cf8

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

SwiftCompilerSources/Sources/SIL/Builder.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,18 @@ public struct Builder {
482482
return notifyNew(endAccess.getAs(EndAccessInst.self))
483483
}
484484

485+
@discardableResult
486+
public func createEndApply(beginApply: BeginApplyInst) -> EndApplyInst {
487+
let endApply = bridged.createEndApply(beginApply.token.bridged)
488+
return notifyNew(endApply.getAs(EndApplyInst.self))
489+
}
490+
491+
@discardableResult
492+
public func createAbortApply(beginApply: BeginApplyInst) -> AbortApplyInst {
493+
let endApply = bridged.createAbortApply(beginApply.token.bridged)
494+
return notifyNew(endApply.getAs(AbortApplyInst.self))
495+
}
496+
485497
public func createConvertFunction(originalFunction: Value, resultType: Type, withoutActuallyEscaping: Bool) -> ConvertFunctionInst {
486498
let convertFunction = bridged.createConvertFunction(originalFunction.bridged, resultType.bridged, withoutActuallyEscaping)
487499
return notifyNew(convertFunction.getAs(ConvertFunctionInst.self))

include/swift/SIL/SILBridging.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,10 @@ struct BridgedBuilder{
11951195

11961196
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createEndAccess(BridgedValue value) const;
11971197

1198+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createEndApply(BridgedValue value) const;
1199+
1200+
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createAbortApply(BridgedValue value) const;
1201+
11981202
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createConvertFunction(BridgedValue originalFunction, BridgedType resultType, bool withoutActuallyEscaping) const;
11991203
SWIFT_IMPORT_UNSAFE BRIDGED_INLINE BridgedInstruction createConvertEscapeToNoEscape(BridgedValue originalFunction, BridgedType resultType, bool isLifetimeGuaranteed) const;
12001204

include/swift/SIL/SILBridgingImpl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,6 +2296,16 @@ BridgedInstruction BridgedBuilder::createEndAccess(BridgedValue value) const {
22962296
return {unbridged().createEndAccess(regularLoc(), value.getSILValue(), false)};
22972297
}
22982298

2299+
BridgedInstruction BridgedBuilder::createEndApply(BridgedValue value) const {
2300+
swift::ASTContext &ctxt = unbridged().getASTContext();
2301+
return {unbridged().createEndApply(regularLoc(), value.getSILValue(),
2302+
swift::SILType::getEmptyTupleType(ctxt))};
2303+
}
2304+
2305+
BridgedInstruction BridgedBuilder::createAbortApply(BridgedValue value) const {
2306+
return {unbridged().createAbortApply(regularLoc(), value.getSILValue())};
2307+
}
2308+
22992309
BridgedInstruction BridgedBuilder::createConvertFunction(BridgedValue originalFunction, BridgedType resultType, bool withoutActuallyEscaping) const {
23002310
return {unbridged().createConvertFunction(regularLoc(), originalFunction.getSILValue(), resultType.unbridged(), withoutActuallyEscaping)};
23012311
}

0 commit comments

Comments
 (0)