Skip to content

Commit 6bf5dae

Browse files
authored
Merge pull request #27402 from xedin/missing-args-asan-atmpt-2
[ConstraintSystem] Materialize locator only once per missing argument
2 parents 40016b5 + 24a5003 commit 6bf5dae

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -837,20 +837,20 @@ class ArgumentFailureTracker : public MatchCallArgumentListener {
837837
const auto &param = Parameters[paramIdx];
838838

839839
unsigned newArgIdx = Arguments.size();
840-
auto argLoc =
840+
auto *argLoc = CS.getConstraintLocator(
841841
Locator
842842
.withPathElement(LocatorPathElt::ApplyArgToParam(
843843
newArgIdx, paramIdx, param.getParameterFlags()))
844-
.withPathElement(LocatorPathElt::SynthesizedArgument(newArgIdx));
844+
.withPathElement(LocatorPathElt::SynthesizedArgument(newArgIdx)));
845845

846-
auto *argType = CS.createTypeVariable(
847-
CS.getConstraintLocator(argLoc),
848-
TVO_CanBindToInOut | TVO_CanBindToLValue | TVO_CanBindToNoEscape);
846+
auto *argType =
847+
CS.createTypeVariable(argLoc, TVO_CanBindToInOut | TVO_CanBindToLValue |
848+
TVO_CanBindToNoEscape);
849849

850850
CS.recordHole(argType);
851-
CS.addUnsolvedConstraint(Constraint::create(
852-
CS, ConstraintKind::Defaultable, argType, CS.getASTContext().TheAnyType,
853-
CS.getConstraintLocator(argLoc)));
851+
CS.addUnsolvedConstraint(
852+
Constraint::create(CS, ConstraintKind::Defaultable, argType,
853+
CS.getASTContext().TheAnyType, argLoc));
854854

855855
Arguments.push_back(param.withType(argType));
856856
++NumSynthesizedArgs;

0 commit comments

Comments
 (0)