Sema: Record resolved overloads in the trail

This commit is contained in:
Slava Pestov
2024-10-03 22:11:16 -04:00
parent 892e79cd70
commit 43a4ac9216
5 changed files with 31 additions and 13 deletions

View File

@@ -2207,7 +2207,7 @@ private:
llvm::FoldingSetVector<ConstraintLocator> ConstraintLocators;
/// The overload sets that have been resolved along the current path.
llvm::MapVector<ConstraintLocator *, SelectedOverload> ResolvedOverloads;
llvm::DenseMap<ConstraintLocator *, SelectedOverload> ResolvedOverloads;
/// The current fixed score for this constraint system and the (partial)
/// solution it represents.
@@ -2857,9 +2857,6 @@ public:
/// FIXME: Remove this.
unsigned numFixes;
/// The length of \c ResolvedOverloads.
unsigned numResolvedOverloads;
/// The length of \c ClosureTypes.
unsigned numInferredClosureTypes;
@@ -4932,6 +4929,11 @@ public:
buildDisjunctionForOptionalVsUnderlying(boundTy, type, dynamicLocator);
}
void recordResolvedOverload(ConstraintLocator *locator,
SelectedOverload choice);
void removeResolvedOverload(ConstraintLocator *locator);
/// Resolve the given overload set to the given choice.
void resolveOverload(ConstraintLocator *locator, Type boundType,
OverloadChoice choice, DeclContext *useDC);
@@ -5689,7 +5691,7 @@ public:
}
/// The overload sets that have already been resolved along the current path.
const llvm::MapVector<ConstraintLocator *, SelectedOverload> &
const llvm::DenseMap<ConstraintLocator *, SelectedOverload> &
getResolvedOverloads() const {
return ResolvedOverloads;
}