Skip to content

Commit 376fea1

Browse files
committed
[ConstraintSystem] Adds a new overload for getConstraintLocator that automatically gets the summary flags
1 parent 978ec73 commit 376fea1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,12 @@ getAlternativeLiteralTypes(KnownProtocolKind kind) {
374374
return *AlternativeLiteralTypes[index];
375375
}
376376

377+
ConstraintLocator *ConstraintSystem::getConstraintLocator(
378+
Expr *anchor, ArrayRef<ConstraintLocator::PathElement> path) {
379+
auto summaryFlags = ConstraintLocator::getSummaryFlagsForPath(path);
380+
return getConstraintLocator(anchor, path, summaryFlags);
381+
}
382+
377383
ConstraintLocator *ConstraintSystem::getConstraintLocator(
378384
Expr *anchor,
379385
ArrayRef<ConstraintLocator::PathElement> path,

lib/Sema/ConstraintSystem.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,6 +1921,12 @@ class ConstraintSystem {
19211921
ArrayRef<ConstraintLocator::PathElement> path,
19221922
unsigned summaryFlags);
19231923

1924+
/// Retrive the constraint locator for the given anchor and
1925+
/// path, uniqued and automatically infer the summary flags
1926+
ConstraintLocator *
1927+
getConstraintLocator(Expr *anchor,
1928+
ArrayRef<ConstraintLocator::PathElement> path);
1929+
19241930
/// Retrieve the constraint locator for the given anchor and
19251931
/// an empty path, uniqued.
19261932
ConstraintLocator *getConstraintLocator(Expr *anchor) {

0 commit comments

Comments
 (0)