Commits

Chris Lattner committed 44a1eb7715f
Rework SILGen of optional methods to work with non-@objc situations: - Split getSelfTypeForDynamicLookup into two pieces, and generalize it to work on non-loadable protocols. - Change dynamic_method_branch to take its argument as a protocol of any protocol type, instead of as something of UnownObject type. - Teach emitForcedDynamicMemberRef to only do its peephole optimization for @objc cases, since it is special behavior of objc_msgSend. - enhance emitDynamicPartialApply & emitDynamicMemberRefExpr to emit the proper project_existential instruction (not a _ref) when dealing with a non-classbound protocol. Change the verifier to allow DynamicMethodBranchInst to work on non-@objc protocol members. This eliminates a bunch of pointless unchecked_ref_cast's in the generated SIL for existing code, but this got squashed at IRGen time anyway, so no real change for anything that sema permits. Swift SVN r21519