Commits

Roman Levenstein committed 3721ee9c875
[sil-combine] Fix a bug in the peephole apply{partial_apply(x,y)}(z) -> apply(z,x,y) The existing implementation of this peephole was miscompiling when some arguments of a partial_apply were alloc_stack, because some of they could be dead before the apply which uses the partial_apply. To fix this problem I had to re-factor the implementation. Earlier we were looking for an apply first and then for a partial_apply it uses. With this patch, we do it the other way around: we fist look for a partial_apply and then peephole all apply instructions referring to it in one go. To solve the problem with "prematurely" dead alloc_stack arguments, we introduce new temporaries with a longer lifetime and copy the original arguments into them. The test-cases are extended with more complex examples, including usage of existentials. This fixes the compile-time crasher in test/Interpreter/currying_generics.swift rdar://20868728 Swift SVN r28570