Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[move-only] Rename mark_must_check -> mark_unresolved_non_copyable_value #68228

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ extension ValueDefUseWalker {
}
case is BeginBorrowInst, is CopyValueInst, is MoveValueInst,
is UpcastInst, is UncheckedRefCastInst, is EndCOWMutationInst,
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkMustCheckInst:
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkUnresolvedNonCopyableValueInst:
return walkDownUses(ofValue: (instruction as! SingleValueInstruction), path: path)
case let mdi as MarkDependenceInst:
if operand.index == 0 {
Expand Down Expand Up @@ -492,7 +492,7 @@ extension AddressDefUseWalker {
return walkDownUses(ofAddress: ia, path: subPath.push(.anyIndexedElement, index: 0))
}
return walkDownUses(ofAddress: ia, path: path)
case let mmc as MarkMustCheckInst:
case let mmc as MarkUnresolvedNonCopyableValueInst:
return walkDownUses(ofAddress: mmc, path: path)
case let ba as BeginAccessInst:
// Don't treat `end_access` as leaf-use. Just ignore it.
Expand Down Expand Up @@ -656,7 +656,7 @@ extension ValueUseDefWalker {
return walkUp(value: oer.existential, path: path.push(.existential, index: 0))
case is BeginBorrowInst, is CopyValueInst, is MoveValueInst,
is UpcastInst, is UncheckedRefCastInst, is EndCOWMutationInst,
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkMustCheckInst:
is RefToBridgeObjectInst, is BridgeObjectToRefInst, is MarkUnresolvedNonCopyableValueInst:
return walkUp(value: (def as! Instruction).operands[0].value, path: path)
case let arg as BlockArgument:
if arg.isPhiArgument {
Expand Down Expand Up @@ -743,7 +743,7 @@ extension AddressUseDefWalker {
path: path.push(.enumCase, index: (def as! EnumInstruction).caseIndex))
case is InitExistentialAddrInst, is OpenExistentialAddrInst:
return walkUp(address: (def as! Instruction).operands[0].value, path: path.push(.existential, index: 0))
case is BeginAccessInst, is MarkMustCheckInst:
case is BeginAccessInst, is MarkUnresolvedNonCopyableValueInst:
return walkUp(address: (def as! Instruction).operands[0].value, path: path)
case let ia as IndexAddrInst:
if let idx = ia.constantSmallIndex {
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/Instruction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ final public class IsUniqueInst : SingleValueInstruction, UnaryInstruction {}
final public class IsEscapingClosureInst : SingleValueInstruction, UnaryInstruction {}

final public
class MarkMustCheckInst : SingleValueInstruction, UnaryInstruction {}
class MarkUnresolvedNonCopyableValueInst : SingleValueInstruction, UnaryInstruction {}

final public class ObjectInst : SingleValueInstruction {
public var baseOperands: OperandArray {
Expand Down
2 changes: 1 addition & 1 deletion SwiftCompilerSources/Sources/SIL/Registration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public func registerSILClasses() {
register(UncheckedRefCastInst.self)
register(UncheckedAddrCastInst.self)
register(UncheckedTrivialBitCastInst.self)
register(MarkMustCheckInst.self)
register(MarkUnresolvedNonCopyableValueInst.self)
register(ObjectInst.self)
register(RawPointerToRefInst.self)
register(AddressToPointerInst.self)
Expand Down
12 changes: 6 additions & 6 deletions docs/SIL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2817,7 +2817,7 @@ which codegens to the following SIL::
bb0(%0 : @noImplicitCopy $Klass):
%1 = copyable_to_moveonlywrapper [guaranteed] %0 : $@moveOnly Klass
%2 = copy_value %1 : $@moveOnly Klass
%3 = mark_must_check [no_consume_or_assign] %2 : $@moveOnly Klass
%3 = mark_unresolved_non_copyable_value [no_consume_or_assign] %2 : $@moveOnly Klass
debug_value %3 : $@moveOnly Klass, let, name "x", argno 1
%4 = begin_borrow %3 : $@moveOnly Klass
%5 = function_ref @$s4test5KlassC11doSomethingyyF : $@convention(method) (@guaranteed Klass) -> ()
Expand Down Expand Up @@ -2887,7 +2887,7 @@ Today this codegens to the following Swift::
bb0(%0 : @noImplicitCopy $Int):
%1 = copyable_to_moveonlywrapper [owned] %0 : $Int
%2 = move_value [lexical] %1 : $@moveOnly Int
%3 = mark_must_check [consumable_and_assignable] %2 : $@moveOnly Int
%3 = mark_unresolved_non_copyable_value [consumable_and_assignable] %2 : $@moveOnly Int
%5 = begin_borrow %3 : $@moveOnly Int
%6 = begin_borrow %3 : $@moveOnly Int
%7 = function_ref @addIntegers : $@convention(method) (Int, Int Int.Type) -> Int
Expand Down Expand Up @@ -2946,7 +2946,7 @@ A hypothetical SILGen for this code is as follows::
%3 = begin_borrow [lexical] %0 : $Klass
%4 = copy_value %3 : $Klass
%5 = copyable_to_moveonlywrapper [owned] %4 : $Klass
%6 = mark_must_check [consumable_and_assignable] %5 : $@moveOnly Klass
%6 = mark_unresolved_non_copyable_value [consumable_and_assignable] %5 : $@moveOnly Klass
debug_value %6 : $@moveOnly Klass, let, name "value"
%8 = begin_borrow %6 : $@moveOnly Klass
%9 = copy_value %8 : $@moveOnly Klass
Expand Down Expand Up @@ -8484,19 +8484,19 @@ The remaining components identify the SIL differentiability witness:
Optimizer Dataflow Marker Instructions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mark_must_check
mark_unresolved_non_copyable_value
```````````````
::

sil-instruction ::= 'mark_must_check'
sil-instruction ::= 'mark_unresolved_non_copyable_value'
'[' sil-optimizer-analysis-marker ']'

sil-optimizer-analysis-marker ::= 'consumable_and_assignable'
::= 'no_consume_or_assign'

A canary value inserted by a SIL generating frontend to signal to the move
checker to check a specific value. Valid only in Raw SIL. The relevant checkers
should remove the `mark_must_check`_ instruction after successfully running the
should remove the `mark_unresolved_non_copyable_value`_ instruction after successfully running the
relevant diagnostic. The idea here is that instead of needing to introduce
multiple "flagging" instructions for the optimizer, we can just reuse this one
instruction by varying the kind.
Expand Down
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsParse.def
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ ERROR(sil_movevalue_invalid_optional_attribute,none,
ERROR(sil_markmustcheck_invalid_attribute,none,
"Attribute '[%0]' can not be applied to mark_value_as_moveonly", (StringRef))
ERROR(sil_markmustcheck_requires_attribute,none,
"mark_must_check requires an attribute like 'noImplicitCopy'", ())
"mark_unresolved_non_copyable_value requires an attribute like 'noImplicitCopy'", ())
ERROR(sil_moveonlytocopyable_invalid_attribute,none,
"Attribute '[%0]' can not be applied to moveonlywrapper_to_copyable", (StringRef))
ERROR(sil_moveonlytocopyable_requires_attribute,none,
Expand Down
3 changes: 2 additions & 1 deletion include/swift/SIL/AddressWalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ TransitiveAddressWalker<Impl>::walk(SILValue projectedAddress) && {
isa<InitExistentialAddrInst>(user) || isa<InitEnumDataAddrInst>(user) ||
isa<BeginAccessInst>(user) || isa<TailAddrInst>(user) ||
isa<IndexAddrInst>(user) || isa<StoreBorrowInst>(user) ||
isa<UncheckedAddrCastInst>(user) || isa<MarkMustCheckInst>(user) ||
isa<UncheckedAddrCastInst>(user) ||
isa<MarkUnresolvedNonCopyableValueInst>(user) ||
isa<MarkUninitializedInst>(user) || isa<DropDeinitInst>(user) ||
isa<ProjectBlockStorageInst>(user) || isa<UpcastInst>(user) ||
isa<TuplePackElementAddrInst>(user) ||
Expand Down
2 changes: 1 addition & 1 deletion include/swift/SIL/MemAccessUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ inline bool isAccessStorageIdentityCast(SingleValueInstruction *svi) {

// Simply pass-thru the incoming address.
case SILInstructionKind::MarkUninitializedInst:
case SILInstructionKind::MarkMustCheckInst:
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst:
case SILInstructionKind::DropDeinitInst:
case SILInstructionKind::MarkUnresolvedReferenceBindingInst:
case SILInstructionKind::MarkDependenceInst:
Expand Down
10 changes: 5 additions & 5 deletions include/swift/SIL/SILBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1439,11 +1439,11 @@ class SILBuilder {
getSILDebugLocation(loc), srcAddr, takeAddr));
}

MarkMustCheckInst *
createMarkMustCheckInst(SILLocation loc, SILValue src,
MarkMustCheckInst::CheckKind kind) {
return insert(new (getModule())
MarkMustCheckInst(getSILDebugLocation(loc), src, kind));
MarkUnresolvedNonCopyableValueInst *createMarkUnresolvedNonCopyableValueInst(
SILLocation loc, SILValue src,
MarkUnresolvedNonCopyableValueInst::CheckKind kind) {
return insert(new (getModule()) MarkUnresolvedNonCopyableValueInst(
getSILDebugLocation(loc), src, kind));
}

MarkUnresolvedReferenceBindingInst *createMarkUnresolvedReferenceBindingInst(
Expand Down
5 changes: 3 additions & 2 deletions include/swift/SIL/SILCloner.h
Original file line number Diff line number Diff line change
Expand Up @@ -1949,9 +1949,10 @@ void SILCloner<ImplClass>::visitDropDeinitInst(DropDeinitInst *Inst) {
}

template <typename ImplClass>
void SILCloner<ImplClass>::visitMarkMustCheckInst(MarkMustCheckInst *Inst) {
void SILCloner<ImplClass>::visitMarkUnresolvedNonCopyableValueInst(
MarkUnresolvedNonCopyableValueInst *Inst) {
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
auto *MVI = getBuilder().createMarkMustCheckInst(
auto *MVI = getBuilder().createMarkUnresolvedNonCopyableValueInst(
getOpLocation(Inst->getLoc()), getOpValue(Inst->getOperand()),
Inst->getCheckKind());
recordClonedInstruction(Inst, MVI);
Expand Down
16 changes: 9 additions & 7 deletions include/swift/SIL/SILInstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -8302,9 +8302,10 @@ class MarkUnresolvedMoveAddrInst
/// diagnostic based semantic checker. Example: no implicit copy. Only legal in
/// Raw SIL so that we can guarantee canonical SIL has had all SSA based
/// checking by the checkers that rely upon this instruction.
class MarkMustCheckInst
: public UnaryInstructionBase<SILInstructionKind::MarkMustCheckInst,
OwnershipForwardingSingleValueInstruction> {
class MarkUnresolvedNonCopyableValueInst
: public UnaryInstructionBase<
SILInstructionKind::MarkUnresolvedNonCopyableValueInst,
OwnershipForwardingSingleValueInstruction> {
friend class SILBuilder;

public:
Expand Down Expand Up @@ -8341,13 +8342,14 @@ class MarkMustCheckInst
private:
CheckKind kind;

MarkMustCheckInst(SILDebugLocation DebugLoc, SILValue operand,
CheckKind checkKind)
MarkUnresolvedNonCopyableValueInst(SILDebugLocation DebugLoc,
SILValue operand, CheckKind checkKind)
: UnaryInstructionBase(DebugLoc, operand, operand->getType(),
operand->getOwnershipKind()),
kind(checkKind) {
assert(operand->getType().isMoveOnly() &&
"mark_must_check can only take a move only typed value");
"mark_unresolved_non_copyable_value can only take a move only typed "
"value");
}

public:
Expand Down Expand Up @@ -10592,7 +10594,7 @@ OwnershipForwardingSingleValueInstruction::classof(SILInstructionKind kind) {
case SILInstructionKind::TupleInst:
case SILInstructionKind::LinearFunctionInst:
case SILInstructionKind::DifferentiableFunctionInst:
case SILInstructionKind::MarkMustCheckInst:
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst:
case SILInstructionKind::MarkUnresolvedReferenceBindingInst:
case SILInstructionKind::ConvertFunctionInst:
case SILInstructionKind::UpcastInst:
Expand Down
4 changes: 2 additions & 2 deletions include/swift/SIL/SILNodes.def
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ ABSTRACT_VALUE_AND_INST(SingleValueInstruction, ValueBase, SILInstruction)
MayHaveSideEffects, DoesNotRelease)
// A canary value inserted by a SIL generating frontend to signal to the move
// checker to check a specific value. Valid only in Raw SIL. The relevant
// checkers should remove the mark_must_check instruction after successfully
// checkers should remove the mark_unresolved_non_copyable_value instruction after successfully
// running the relevant diagnostic.
SINGLE_VALUE_INST(MarkMustCheckInst, mark_must_check,
SINGLE_VALUE_INST(MarkUnresolvedNonCopyableValueInst, mark_unresolved_non_copyable_value,
SingleValueInstruction, None, DoesNotRelease)
// A canary value inserted by a SIL generating frontend to signal to the
// reference binding transform to check/transform a specific value. Valid
Expand Down
3 changes: 2 additions & 1 deletion lib/IRGen/IRGenSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,8 @@ class IRGenSILFunction :
void visitDropDeinitInst(DropDeinitInst *i) {
llvm_unreachable("only valid in ownership SIL");
}
void visitMarkMustCheckInst(MarkMustCheckInst *i) {
void visitMarkUnresolvedNonCopyableValueInst(
MarkUnresolvedNonCopyableValueInst *i) {
llvm_unreachable("Invalid in Lowered SIL");
}
void visitMarkUnresolvedReferenceBindingInst(
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/IR/OperandOwnership.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ FORWARDING_OWNERSHIP(UnconditionalCheckedCast)
FORWARDING_OWNERSHIP(InitExistentialRef)
FORWARDING_OWNERSHIP(DifferentiableFunction)
FORWARDING_OWNERSHIP(LinearFunction)
FORWARDING_OWNERSHIP(MarkMustCheck)
FORWARDING_OWNERSHIP(MarkUnresolvedNonCopyableValue)
FORWARDING_OWNERSHIP(MarkUnresolvedReferenceBinding)
FORWARDING_OWNERSHIP(MoveOnlyWrapperToCopyableValue)
FORWARDING_OWNERSHIP(CopyableToMoveOnlyWrapperValue)
Expand Down
5 changes: 3 additions & 2 deletions lib/SIL/IR/SILPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2078,8 +2078,9 @@ class SILPrinter : public SILInstructionVisitor<SILPrinter> {
*this << getIDAndType(I->getOperand());
}

void visitMarkMustCheckInst(MarkMustCheckInst *I) {
using CheckKind = MarkMustCheckInst::CheckKind;
void visitMarkUnresolvedNonCopyableValueInst(
MarkUnresolvedNonCopyableValueInst *I) {
using CheckKind = MarkUnresolvedNonCopyableValueInst::CheckKind;
switch (I->getCheckKind()) {
case CheckKind::Invalid:
llvm_unreachable("Invalid?!");
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/IR/ValueOwnership.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ FORWARDING_OWNERSHIP_INST(MarkDependence)
FORWARDING_OWNERSHIP_INST(InitExistentialRef)
FORWARDING_OWNERSHIP_INST(DifferentiableFunction)
FORWARDING_OWNERSHIP_INST(LinearFunction)
FORWARDING_OWNERSHIP_INST(MarkMustCheck)
FORWARDING_OWNERSHIP_INST(MarkUnresolvedNonCopyableValue)
FORWARDING_OWNERSHIP_INST(MarkUnresolvedReferenceBinding)
FORWARDING_OWNERSHIP_INST(MoveOnlyWrapperToCopyableValue)
FORWARDING_OWNERSHIP_INST(CopyableToMoveOnlyWrapperValue)
Expand Down
6 changes: 3 additions & 3 deletions lib/SIL/Parser/ParseSIL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3838,15 +3838,15 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
break;
}

case SILInstructionKind::MarkMustCheckInst: {
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst: {
StringRef AttrName;
if (!parseSILOptional(AttrName, *this)) {
auto diag = diag::sil_markmustcheck_requires_attribute;
P.diagnose(InstLoc.getSourceLoc(), diag);
return true;
}

using CheckKind = MarkMustCheckInst::CheckKind;
using CheckKind = MarkUnresolvedNonCopyableValueInst::CheckKind;
CheckKind CKind =
llvm::StringSwitch<CheckKind>(AttrName)
.Case("consumable_and_assignable",
Expand All @@ -3869,7 +3869,7 @@ bool SILParser::parseSpecificSILInstruction(SILBuilder &B,
if (parseSILDebugLocation(InstLoc, B))
return true;

auto *MVI = B.createMarkMustCheckInst(InstLoc, Val, CKind);
auto *MVI = B.createMarkUnresolvedNonCopyableValueInst(InstLoc, Val, CKind);
ResultVal = MVI;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/Utils/InstWrappers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool ForwardingOperation::hasSameRepresentation() const {
case SILInstructionKind::OpenExistentialBoxValueInst:
case SILInstructionKind::OpenExistentialRefInst:
case SILInstructionKind::OpenExistentialValueInst:
case SILInstructionKind::MarkMustCheckInst:
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst:
case SILInstructionKind::MarkUninitializedInst:
case SILInstructionKind::SelectEnumInst:
case SILInstructionKind::StructExtractInst:
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/Utils/InstructionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ RuntimeEffect swift::getRuntimeEffect(SILInstruction *inst, SILType &impactType)
case SILInstructionKind::MarkDependenceInst:
case SILInstructionKind::MoveValueInst:
case SILInstructionKind::DropDeinitInst:
case SILInstructionKind::MarkMustCheckInst:
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst:
case SILInstructionKind::MarkUnresolvedReferenceBindingInst:
case SILInstructionKind::CopyableToMoveOnlyWrapperValueInst:
case SILInstructionKind::MoveOnlyWrapperToCopyableValueInst:
Expand Down
7 changes: 4 additions & 3 deletions lib/SIL/Utils/MemAccessUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,9 @@ class AccessPathVisitor : public FindAccessVisitorImpl<AccessPathVisitor> {
// project_box is not normally an access projection but we treat it
// as such when it operates on unchecked_take_enum_data_addr.
|| isa<ProjectBoxInst>(projectedAddr)
// Ignore mark_must_check, we just look through it when we see it.
|| isa<MarkMustCheckInst>(projectedAddr)
// Ignore mark_unresolved_non_copyable_value, we just look through
// it when we see it.
|| isa<MarkUnresolvedNonCopyableValueInst>(projectedAddr)
// Ignore moveonlywrapper_to_copyable_addr and
// copyable_to_moveonlywrapper_addr, we just look through it when
// we see it
Expand Down Expand Up @@ -1872,7 +1873,7 @@ AccessPathDefUseTraversal::visitSingleValueUser(SingleValueInstruction *svi,
}

case SILInstructionKind::DropDeinitInst:
case SILInstructionKind::MarkMustCheckInst: {
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst: {
// Mark must check goes on the project_box, so it isn't a ref.
assert(!dfs.isRef());
pushUsers(svi, dfs);
Expand Down
7 changes: 4 additions & 3 deletions lib/SIL/Verifier/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ struct ImmutableAddressUseVerifier {
case SILInstructionKind::IndexAddrInst:
case SILInstructionKind::TailAddrInst:
case SILInstructionKind::IndexRawPointerInst:
case SILInstructionKind::MarkMustCheckInst:
case SILInstructionKind::MarkUnresolvedNonCopyableValueInst:
case SILInstructionKind::CopyableToMoveOnlyWrapperValueInst:
case SILInstructionKind::PackElementGetInst:
// Add these to our worklist.
Expand Down Expand Up @@ -2606,7 +2606,7 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
"Must store to an address dest");
// Note: This is the current implementation and the design is not final.
auto isLegal = [](SILValue value) {
if (auto *mmci = dyn_cast<MarkMustCheckInst>(value))
if (auto *mmci = dyn_cast<MarkUnresolvedNonCopyableValueInst>(value))
value = mmci->getOperand();
return isa<AllocStackInst>(value);
};
Expand Down Expand Up @@ -6121,7 +6121,8 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
checkDropDeinitUses(ddi);
}

void checkMarkMustCheckInst(MarkMustCheckInst *i) {
void checkMarkUnresolvedNonCopyableValueInst(
MarkUnresolvedNonCopyableValueInst *i) {
require(i->getModule().getStage() == SILStage::Raw,
"Only valid in Raw SIL! Should have been eliminated by /some/ "
"diagnostic pass");
Expand Down
8 changes: 4 additions & 4 deletions lib/SILGen/SILGenBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1068,14 +1068,14 @@ ManagedValue SILGenBuilder::createGuaranteedCopyableToMoveOnlyWrapperValue(
return ManagedValue::forBorrowedObjectRValue(mdi);
}

ManagedValue
SILGenBuilder::createMarkMustCheckInst(SILLocation loc, ManagedValue value,
MarkMustCheckInst::CheckKind kind) {
ManagedValue SILGenBuilder::createMarkUnresolvedNonCopyableValueInst(
SILLocation loc, ManagedValue value,
MarkUnresolvedNonCopyableValueInst::CheckKind kind) {
assert((value.isPlusOne(SGF) || value.isLValue() ||
value.getType().isAddress()) &&
"Argument must be at +1 or be an address!");
CleanupCloner cloner(*this, value);
auto *mdi = SILBuilder::createMarkMustCheckInst(
auto *mdi = SILBuilder::createMarkUnresolvedNonCopyableValueInst(
loc, value.forward(getSILGenFunction()), kind);
return cloner.clone(mdi);
}
Expand Down
7 changes: 4 additions & 3 deletions lib/SILGen/SILGenBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,10 @@ class SILGenBuilder : public SILBuilder {
createGuaranteedCopyableToMoveOnlyWrapperValue(SILLocation loc,
ManagedValue value);

using SILBuilder::createMarkMustCheckInst;
ManagedValue createMarkMustCheckInst(SILLocation loc, ManagedValue value,
MarkMustCheckInst::CheckKind kind);
using SILBuilder::createMarkUnresolvedNonCopyableValueInst;
ManagedValue createMarkUnresolvedNonCopyableValueInst(
SILLocation loc, ManagedValue value,
MarkUnresolvedNonCopyableValueInst::CheckKind kind);

using SILBuilder::emitCopyValueOperation;
ManagedValue emitCopyValueOperation(SILLocation Loc, ManagedValue v);
Expand Down
Loading