[semantic-sil] Create unmanaged_autorelease_value.

This is an autorelease for use with Builtin.autorelease that does not need to be
balanced as part of the ownership model.

rdar://29791263
This commit is contained in:
Michael Gottesman
2017-01-30 11:47:38 -08:00
parent dc8b994fc2
commit 554feff463
17 changed files with 66 additions and 10 deletions

View File

@@ -3043,6 +3043,18 @@ class UnmanagedReleaseValueInst
: UnaryInstructionBase(DebugLoc, operand) {}
};
/// Transfers ownership of a loadable value to the current autorelease
/// pool. Unmanaged, so it is ignored from an ownership balancing perspective.
class UnmanagedAutoreleaseValueInst
: public UnaryInstructionBase<ValueKind::UnmanagedAutoreleaseValueInst,
RefCountingInst,
/*HasValue*/ false> {
friend SILBuilder;
UnmanagedAutoreleaseValueInst(SILDebugLocation DebugLoc, SILValue operand)
: UnaryInstructionBase(DebugLoc, operand) {}
};
/// Transfers ownership of a loadable value to the current autorelease pool.
class AutoreleaseValueInst
: public UnaryInstructionBase<ValueKind::AutoreleaseValueInst,