mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CS] NFC: Inline recomputeSummaryFlags
This commit is contained in:
@@ -2731,14 +2731,6 @@ bool ConstraintSystem::diagnoseAmbiguity(Expr *expr,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Given a subpath of an old locator, compute its summary flags.
|
|
||||||
static unsigned recomputeSummaryFlags(ConstraintLocator *oldLocator,
|
|
||||||
ArrayRef<LocatorPathElt> path) {
|
|
||||||
if (oldLocator->getSummaryFlags() != 0)
|
|
||||||
return ConstraintLocator::getSummaryFlagsForPath(path);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ConstraintLocator *
|
ConstraintLocator *
|
||||||
constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
|
constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
|
||||||
SourceRange &range) {
|
SourceRange &range) {
|
||||||
@@ -2752,10 +2744,12 @@ constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
|
|||||||
return locator;
|
return locator;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recompute the summary flags if we had any to begin with. This is
|
// If the old locator didn't have any summary flags, neither will the
|
||||||
// necessary because we might remove e.g. tuple elements from the path.
|
// simplified version, as it must contain a subset of the path elements.
|
||||||
unsigned summaryFlags = recomputeSummaryFlags(locator, path);
|
if (locator->getSummaryFlags() == 0)
|
||||||
return cs.getConstraintLocator(anchor, path, summaryFlags);
|
return cs.getConstraintLocator(anchor, path, /*summaryFlags*/ 0);
|
||||||
|
|
||||||
|
return cs.getConstraintLocator(anchor, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
void constraints::simplifyLocator(Expr *&anchor,
|
void constraints::simplifyLocator(Expr *&anchor,
|
||||||
|
|||||||
Reference in New Issue
Block a user