mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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
This commit is contained in:
@@ -44,7 +44,9 @@ enum class DynamicCastFeasibility {
|
||||
/// types should be unlowered formal types.
|
||||
DynamicCastFeasibility classifyDynamicCast(Module *context,
|
||||
CanType sourceType,
|
||||
CanType targetType);
|
||||
CanType targetType,
|
||||
bool isSourceTypeExact = false,
|
||||
bool isWholdModuleOpts = false);
|
||||
|
||||
SILValue emitSuccessfulScalarUnconditionalCast(SILBuilder &B, Module *M,
|
||||
SILLocation loc, SILValue value,
|
||||
|
||||
Reference in New Issue
Block a user