Sema: Record implicit callAsFunction() roots in the trail

This commit is contained in:
Slava Pestov
2024-10-04 17:25:28 -04:00
parent 72a60728fc
commit 12eb7cec26
5 changed files with 18 additions and 22 deletions

View File

@@ -2423,7 +2423,7 @@ public:
/// A cache of implicitly generated dot-member expressions used as roots
/// for some `.callAsFunction` calls. The key here is "base" locator for
/// the `.callAsFunction` member reference.
llvm::SmallMapVector<ConstraintLocator *, UnresolvedDotExpr *, 2>
llvm::SmallDenseMap<ConstraintLocator *, UnresolvedDotExpr *, 2>
ImplicitCallAsFunctionRoots;
/// The set of conformances synthesized during solving (i.e. for
@@ -2855,9 +2855,6 @@ public:
/// FIXME: Remove this.
unsigned numFixes;
/// The length of \c ImplicitCallAsFunctionRoots.
unsigned numImplicitCallAsFunctionRoots;
/// The length of \c SynthesizedConformances.
unsigned numSynthesizedConformances;
@@ -3634,10 +3631,8 @@ public:
void recordMatchCallArgumentResult(ConstraintLocator *locator,
MatchCallArgumentResult result);
/// Record implicitly generated `callAsFunction` with root at the
/// given expression, located at \c locator.
void recordCallAsFunction(UnresolvedDotExpr *root, ArgumentList *arguments,
ConstraintLocator *locator);
void recordImplicitCallAsFunctionRoot(
ConstraintLocator *locator, UnresolvedDotExpr *root);
/// Record root, value, and declContext of keypath expression for use across
/// constraint system, and add a change to the trail.