File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -921,3 +921,23 @@ ManagedValue SILGenBuilder::createGuaranteedMoveOnlyWrapperToCopyableValue(
921921 assert (mdi->getOperand ()->getType ().isObject () && " Expected an object?!" );
922922 return ManagedValue::forUnmanaged (mdi);
923923}
924+
925+ ManagedValue
926+ SILGenBuilder::createCopyableToMoveOnlyWrapperValue (SILLocation loc,
927+ ManagedValue value) {
928+ assert (value.isPlusOne (SGF) && " Argument must be at +1!" );
929+ CleanupCloner cloner (*this , value);
930+ auto *mdi = SILBuilder::createCopyableToMoveOnlyWrapperValue (
931+ loc, value.forward (getSILGenFunction ()));
932+ return cloner.clone (mdi);
933+ }
934+
935+ ManagedValue
936+ SILGenBuilder::createMarkMustCheckInst (SILLocation loc, ManagedValue value,
937+ MarkMustCheckInst::CheckKind kind) {
938+ assert (value.isPlusOne (SGF) && " Argument must be at +1!" );
939+ CleanupCloner cloner (*this , value);
940+ auto *mdi = SILBuilder::createMarkMustCheckInst (
941+ loc, value.forward (getSILGenFunction ()), kind);
942+ return cloner.clone (mdi);
943+ }
Original file line number Diff line number Diff line change 2828#include " RValue.h"
2929#include " swift/Basic/ProfileCounter.h"
3030#include " swift/SIL/SILBuilder.h"
31+ #include " swift/SIL/SILInstruction.h"
3132#include " swift/SIL/SILLocation.h"
3233
3334namespace swift {
@@ -414,6 +415,17 @@ class SILGenBuilder : public SILBuilder {
414415 ManagedValue
415416 createGuaranteedMoveOnlyWrapperToCopyableValue (SILLocation loc,
416417 ManagedValue value);
418+
419+ using SILBuilder::createCopyableToMoveOnlyWrapperValue;
420+ // / Create a copyable_to_moveonlywrapper. This expects a +1 value and returns
421+ // / a +1 value. Semantically though the two things are different entities so
422+ // / we are not forwarding ownership in the sense of the word.
423+ ManagedValue createCopyableToMoveOnlyWrapperValue (SILLocation loc,
424+ ManagedValue value);
425+
426+ using SILBuilder::createMarkMustCheckInst;
427+ ManagedValue createMarkMustCheckInst (SILLocation loc, ManagedValue value,
428+ MarkMustCheckInst::CheckKind kind);
417429};
418430
419431} // namespace Lowering
You can’t perform that action at this time.
0 commit comments