Commits

Roman Levenstein committed 5ac4fa67e6e
More principal approach for casting of ABI-compatible arguments and return types. Implement castValueToABICompatibleType, which is general enough to handle all currently possible casts between ABI-compatible types. It is closely modelled after rules checked by SILVerifier::requireABICompatibleFunctionTypes. This function can also operate in a mode where it only checks if a cast is possible. Both checking and implementation logic are in the same function to make sure they never become inconsistent, because it happened before a few types. Use this new function everywhere (e.g. in simplify-cfg and devirtualizer) instead of previous custom and often incorrect solutions. It now supports a few test-cases which were disable before, because the optimizer could not handle them. rdar://23054843 Swift SVN r32629