@@ -2328,7 +2328,7 @@ class ConstraintSystem {
23282328
23292329 // / The set of remembered disjunction choices used to reach
23302330 // / the current constraint system.
2331- llvm::MapVector <ConstraintLocator *, unsigned > DisjunctionChoices;
2331+ llvm::SmallDenseMap <ConstraintLocator *, unsigned , 4 > DisjunctionChoices;
23322332
23332333 // / A map from applied disjunction constraints to the corresponding
23342334 // / argument function type.
@@ -2879,9 +2879,6 @@ class ConstraintSystem {
28792879 // / FIXME: Remove this.
28802880 unsigned numFixes;
28812881
2882- // / The length of \c DisjunctionChoices.
2883- unsigned numDisjunctionChoices;
2884-
28852882 // / The length of \c AppliedDisjunctions.
28862883 unsigned numAppliedDisjunctions;
28872884
@@ -5319,15 +5316,16 @@ class ConstraintSystem {
53195316 // / Collect the current inactive disjunction constraints.
53205317 void collectDisjunctions (SmallVectorImpl<Constraint *> &disjunctions);
53215318
5322- // / Record a particular disjunction choice of
5323- void recordDisjunctionChoice (ConstraintLocator *disjunctionLocator,
5324- unsigned index) {
5325- // We shouldn't ever register disjunction choices multiple times .
5326- assert (!DisjunctionChoices. count (disjunctionLocator) ||
5327- DisjunctionChoices[disjunctionLocator] == index );
5328- DisjunctionChoices. insert ({disjunctionLocator, index} );
5319+ // / Record a particular disjunction choice and add a change to the trail.
5320+ void recordDisjunctionChoice (ConstraintLocator *locator, unsigned index);
5321+
5322+ // / Undo the above change .
5323+ void removeDisjunctionChoice (ConstraintLocator *locator) {
5324+ bool erased = DisjunctionChoices. erase (locator );
5325+ ASSERT (erased );
53295326 }
53305327
5328+
53315329 // / Filter the set of disjunction terms, keeping only those where the
53325330 // / predicate returns \c true.
53335331 // /
0 commit comments