mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSGen] NFC: Remove obsolete ConstraintSystem::{get, set}FavoredType
This commit is contained in:
@@ -2211,10 +2211,6 @@ private:
|
||||
|
||||
llvm::SetVector<TypeVariableType *> TypeVariables;
|
||||
|
||||
/// Maps expressions to types for choosing a favored overload
|
||||
/// type in a disjunction constraint.
|
||||
llvm::DenseMap<Expr *, TypeBase *> FavoredTypes;
|
||||
|
||||
/// Maps discovered closures to their types inferred
|
||||
/// from declared parameters/result and body.
|
||||
///
|
||||
@@ -2955,15 +2951,6 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TypeBase* getFavoredType(Expr *E) {
|
||||
assert(E != nullptr);
|
||||
return this->FavoredTypes[E];
|
||||
}
|
||||
void setFavoredType(Expr *E, TypeBase *T) {
|
||||
assert(E != nullptr);
|
||||
this->FavoredTypes[E] = T;
|
||||
}
|
||||
|
||||
/// Set the type in our type map for the given node, and record the change
|
||||
/// in the trail.
|
||||
///
|
||||
|
||||
@@ -403,7 +403,6 @@ namespace {
|
||||
Type fixedOutputType =
|
||||
CS.getFixedTypeRecursive(outputTy, /*wantRValue=*/false);
|
||||
if (!fixedOutputType->isTypeVariableOrMember()) {
|
||||
CS.setFavoredType(anchor, fixedOutputType.getPointer());
|
||||
outputTy = fixedOutputType;
|
||||
}
|
||||
|
||||
@@ -807,11 +806,6 @@ namespace {
|
||||
return eltType;
|
||||
}
|
||||
}
|
||||
|
||||
if (!knownType->hasPlaceholder()) {
|
||||
// Set the favored type for this expression to the known type.
|
||||
CS.setFavoredType(E, knownType.getPointer());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1290,9 +1284,6 @@ namespace {
|
||||
CS.getASTContext());
|
||||
}
|
||||
|
||||
if (auto favoredTy = CS.getFavoredType(expr->getSubExpr())) {
|
||||
CS.setFavoredType(expr, favoredTy);
|
||||
}
|
||||
return CS.getType(expr->getSubExpr());
|
||||
}
|
||||
|
||||
@@ -2567,7 +2558,6 @@ namespace {
|
||||
Type fixedType =
|
||||
CS.getFixedTypeRecursive(resultType, /*wantRvalue=*/true);
|
||||
if (!fixedType->isTypeVariableOrMember()) {
|
||||
CS.setFavoredType(expr, fixedType.getPointer());
|
||||
resultType = fixedType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user