[CS] Make ArgumentLists a private member

Move associateArgumentList onto ConstraintSystem
and make ArgumentLists private in preparation for
having it roll back at the end of solver scopes.
This commit is contained in:
Hamish Knight
2021-09-06 12:54:49 +01:00
parent 8e0cddded3
commit 632bf41768
3 changed files with 22 additions and 15 deletions

View File

@@ -4662,6 +4662,15 @@ ArgumentList *ConstraintSystem::getArgumentList(ConstraintLocator *locator) {
return nullptr;
}
void ConstraintSystem::associateArgumentList(ConstraintLocator *locator,
ArgumentList *args) {
assert(locator && locator->getAnchor());
auto *argInfoLoc = getArgumentInfoLocator(locator);
auto inserted = ArgumentLists.insert({argInfoLoc, args}).second;
assert(inserted && "Multiple argument lists at locator?");
(void)inserted;
}
/// Given an apply expr, returns true if it is expected to have a direct callee
/// overload, resolvable using `getChoiceFor`. Otherwise, returns false.
static bool shouldHaveDirectCalleeOverload(const CallExpr *callExpr) {