CastOptimizer: pass the SIL function to the cast-classify APIs, instead of the module decl

NFC
This commit is contained in:
Erik Eckstein
2025-04-04 19:14:41 +02:00
parent 9df1039379
commit e18bedaa87
4 changed files with 22 additions and 24 deletions

View File

@@ -64,7 +64,7 @@ atBest(DynamicCastFeasibility feasibility, DynamicCastFeasibility bestCase) {
/// Classify the feasibility of a dynamic cast. The source and target
/// types should be unlowered formal types.
DynamicCastFeasibility classifyDynamicCast(
ModuleDecl *context,
SILFunction *function,
CanType sourceType, CanType targetType,
bool isSourceTypeExact = false,
bool isWholeModuleOpts = false);
@@ -390,7 +390,7 @@ public:
DynamicCastFeasibility classifyFeasibility(bool allowWholeModule) const {
return swift::classifyDynamicCast(
getModule().getSwiftModule(),
getFunction(),
getSourceFormalType(), getTargetFormalType(),
isSourceTypeExact(), allowWholeModule && getModule().isWholeModule());
}