File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -921,3 +921,23 @@ ManagedValue SILGenBuilder::createGuaranteedMoveOnlyWrapperToCopyableValue(
921
921
assert (mdi->getOperand ()->getType ().isObject () && " Expected an object?!" );
922
922
return ManagedValue::forUnmanaged (mdi);
923
923
}
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 28
28
#include " RValue.h"
29
29
#include " swift/Basic/ProfileCounter.h"
30
30
#include " swift/SIL/SILBuilder.h"
31
+ #include " swift/SIL/SILInstruction.h"
31
32
#include " swift/SIL/SILLocation.h"
32
33
33
34
namespace swift {
@@ -414,6 +415,17 @@ class SILGenBuilder : public SILBuilder {
414
415
ManagedValue
415
416
createGuaranteedMoveOnlyWrapperToCopyableValue (SILLocation loc,
416
417
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);
417
429
};
418
430
419
431
} // namespace Lowering
You can’t perform that action at this time.
0 commit comments