mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
It does not take ownership of its non-trivial arguments, is a trivial function type and therefore must not be destroyed. The compiler must make sure to extend the lifetime of non-trivial arguments beyond the last use of the closure. %objc = copy_value %0 : $AnObject %closure = partial_apply [stack] [callee_guaranteed] %16(%obj) : $@convention(thin) (@guaranteed AnObject) -> () %closure2 = mark_dependence %closure : $@noescape @callee_guaranteed () -> () on %obj : $AnObject %user = function_ref @useClosure : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> () apply %user(%closure2) : $@convention(thin) (@noescape @callee_guaranteed () -> ()) -> () dealloc_stack %closure : $() ->() destroy_value %obj : $AnObject // noescape closure does not take ownership SR-904 rdar://35590578
3.5 KiB
3.5 KiB