Commits

Manman Ren committed 480b41c8241
[SIL Vtable emission] use the least derived method in sil_vtable. Given base class A and dervied class B, both with member functions f(), to look for A.f in B's vtable, we should return SILFunction for B.f. Before this commit, B's vtable will have entry for B.f, A's vtable will have entry for A.f. When looking for A.f in B's vtable, it returns null. And devirtualizer will look for A.f in A's vtable and resolve it to SILFunction for A.f. When replacing a class_method %1 : $A, #A.f!1 with a function ref to B.f, we will have type checking issues for the apply instructions. So devirtualizer will replace the argument of the apply instructions when necessary. rdar://16681983 Swift SVN r16854