mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Intrinsic support for pinning.
Using the intrinsics is obnoxious because I needed them to return Builtin.NativeObject?, but there's no reasonable way to safely generate optional types from Builtins.cpp. Ugh. Dave and I also decided that there's no need for swift_tryPin to allow a null object. Swift SVN r23824
This commit is contained in:
@@ -1071,8 +1071,14 @@ MarkFunctionEscapeInst::MarkFunctionEscapeInst(SILLocation Loc,
|
||||
Operands(this, Elems) {
|
||||
}
|
||||
|
||||
static SILType getPinResultType(SILType operandType) {
|
||||
return SILType::getPrimitiveObjectType(
|
||||
OptionalType::get(operandType.getSwiftRValueType())->getCanonicalType());
|
||||
}
|
||||
|
||||
|
||||
StrongPinInst::StrongPinInst(SILLocation loc, SILValue operand)
|
||||
: UnaryInstructionBase(loc, operand, getPinResultType(operand.getType())) {
|
||||
}
|
||||
|
||||
StoreWeakInst::StoreWeakInst(SILLocation loc, SILValue value, SILValue dest,
|
||||
IsInitialization_t isInit)
|
||||
|
||||
Reference in New Issue
Block a user