Skip to content

Commit 26dab57

Browse files
committed
[CS] NFC: Inline recomputeSummaryFlags
1 parent 4af9744 commit 26dab57

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,14 +2731,6 @@ bool ConstraintSystem::diagnoseAmbiguity(Expr *expr,
27312731
return false;
27322732
}
27332733

2734-
/// Given a subpath of an old locator, compute its summary flags.
2735-
static unsigned recomputeSummaryFlags(ConstraintLocator *oldLocator,
2736-
ArrayRef<LocatorPathElt> path) {
2737-
if (oldLocator->getSummaryFlags() != 0)
2738-
return ConstraintLocator::getSummaryFlagsForPath(path);
2739-
return 0;
2740-
}
2741-
27422734
ConstraintLocator *
27432735
constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
27442736
SourceRange &range) {
@@ -2752,10 +2744,12 @@ constraints::simplifyLocator(ConstraintSystem &cs, ConstraintLocator *locator,
27522744
return locator;
27532745
}
27542746

2755-
// Recompute the summary flags if we had any to begin with. This is
2756-
// necessary because we might remove e.g. tuple elements from the path.
2757-
unsigned summaryFlags = recomputeSummaryFlags(locator, path);
2758-
return cs.getConstraintLocator(anchor, path, summaryFlags);
2747+
// If the old locator didn't have any summary flags, neither will the
2748+
// simplified version, as it must contain a subset of the path elements.
2749+
if (locator->getSummaryFlags() == 0)
2750+
return cs.getConstraintLocator(anchor, path, /*summaryFlags*/ 0);
2751+
2752+
return cs.getConstraintLocator(anchor, path);
27592753
}
27602754

27612755
void constraints::simplifyLocator(Expr *&anchor,

0 commit comments

Comments
 (0)