[ConstraintSystem] Convert ImplicitValueConversions to a map vector to avoid duplicates

This commit is contained in:
Pavel Yaskevich
2021-10-19 17:13:04 -07:00
parent 568c27f551
commit e95e43d019
3 changed files with 3 additions and 3 deletions

View File

@@ -2399,7 +2399,7 @@ private:
/// The set of implicit value conversions performed by the solver on
/// a current path to reach a solution.
SmallVector<std::pair<ConstraintLocator *, ConversionRestrictionKind>, 2>
llvm::SmallMapVector<ConstraintLocator *, ConversionRestrictionKind, 2>
ImplicitValueConversions;
/// The worklist of "active" constraints that should be revisited

View File

@@ -11322,7 +11322,7 @@ ConstraintSystem::simplifyRestrictedConstraintImpl(
FunctionType::get({FunctionType::Param(type1)}, type2),
memberTy, applicationLoc);
ImplicitValueConversions.push_back(
ImplicitValueConversions.insert(
{getConstraintLocator(locator), restriction});
return SolutionKind::Solved;
}

View File

@@ -305,7 +305,7 @@ void ConstraintSystem::applySolution(const Solution &solution) {
}
for (auto &valueConversion : solution.ImplicitValueConversions) {
ImplicitValueConversions.push_back(valueConversion);
ImplicitValueConversions.insert(valueConversion);
}
// Register the argument lists.