Commit Graph

56 Commits

Author SHA1 Message Date
Roman Levenstein
f63cae6f13 Add initial support into DynamicCasts for handling bridging between error types.
Teach it that casts between error types do not always fail and may succeed, in general.

Swift SVN r27098
2015-04-07 22:53:52 +00:00
Roman Levenstein
55ea9ec0e3 [sil-combine] Minor clean-up of casts optimizations. NFC.
Add more checks and logic into emitSuccessfulIndirectUnconditionalCast and emitSuccessfulScalarUnconditionalCast, so that its clients in sil-combine can be simplified by avoiding looking into special cases.

Swift SVN r26885
2015-04-02 19:57:35 +00:00
Arnold Schwaighofer
d6ec9f2640 Make isObjectiveCBridgeable an available function so it can be used elsewhere.
Swift SVN r26265
2015-03-18 17:43:09 +00:00
Roman Levenstein
c97f748fb9 Move the logic for folding type casts using statically known protocol conformances into DynamicCasts.cpp.
The logic for different special cases of type casting is spread over multiple places currently. This patch simply re-factors some of that  code (folding of of type casts using statically known protocol conformances) and moves it into one central place, which makes it easier to maintain. Plus, it allows other clients of DynamicCasts benefit from it as well, e.g. the inliner can use this now. NFC.

Swift SVN r25486
2015-02-23 21:30:48 +00:00
John McCall
20b1f2de3e Switch isa and as? processing over to use the new
indirect cast instructions when necessary.

Swift SVN r19079
2014-06-22 09:53:36 +00:00
John McCall
48d6a833a5 SILGen unconditional dynamic casts using the new
unconditional_dynamic_cast_addr instruction.

Also, fix some major semantic problems with the
existing specialization of unconditional dynamic
casts by handling optional types and being much
more conservative about deciding that a cast is
infeasible.

This commit regresses specialization slightly by
failing to turn indirect dynamic casts into scalar
ones when possible; we can fix that easily enough
in a follow-up.

Swift SVN r19044
2014-06-20 07:47:03 +00:00