Commits

Roman Levenstein committed f53cad846e9
[sil-combine] Fix a bug in the peephole performing apply{partial_apply(x,y,z)}(a) -> apply(a,x,y,z) The peephole was retaining, but not releasing @guaranteed arguments of closures, which under certain circumstances introduced memory leaks. This patch fixes this, by inserting those missing releases for non-consumed arguments. In addition, new temporaries are created for each indirect consumed argument (e.g. for @in argument of the closure), initialized with the original argument of the partial apply and used instead of it afterwards. This is done to extend the lifetime of the original arguments and ensure that they are alive at each apply instruction which invokes the closure created by the partial_apply. Comments were slightly improved as well. rdar://23100352 Swift SVN r32898