File tree Expand file tree Collapse file tree 1 file changed +12
-22
lines changed Expand file tree Collapse file tree 1 file changed +12
-22
lines changed Original file line number Diff line number Diff line change @@ -2280,34 +2280,24 @@ Type EquivalenceClass::getAnchor(
2280
2280
return substAnchor ();
2281
2281
}
2282
2282
2283
- // Form the anchor.
2284
- bool updatedAnchor = false ;
2283
+ // Record the cache miss and update the cache.
2284
+ ++NumArchetypeAnchorCacheMisses;
2285
+ archetypeAnchorCache.anchor =
2286
+ builder.getCanonicalTypeParameter (
2287
+ members.front ()->getDependentType (genericParams));
2288
+ archetypeAnchorCache.lastGeneration = builder.Impl ->Generation ;
2289
+
2290
+ #ifndef NDEBUG
2291
+ // All members must produce the same anchor.
2285
2292
for (auto member : members) {
2286
2293
auto anchorType =
2287
2294
builder.getCanonicalTypeParameter (
2288
2295
member->getDependentType (genericParams));
2289
-
2290
- #ifndef NDEBUG
2291
- // Check that we get consistent results from all of the anchors.
2292
- if (updatedAnchor) {
2293
- assert (anchorType->isEqual (archetypeAnchorCache.anchor ) &&
2294
- " Inconsistent anchor computation" );
2295
- continue ;
2296
- }
2297
- #endif
2298
-
2299
- // Record the cache miss and update the cache.
2300
- ++NumArchetypeAnchorCacheMisses;
2301
- archetypeAnchorCache.anchor = anchorType;
2302
- archetypeAnchorCache.lastGeneration = builder.Impl ->Generation ;
2303
- updatedAnchor = true ;
2304
-
2305
- #if NDEBUG
2306
- break ;
2307
- #endif
2296
+ assert (anchorType->isEqual (archetypeAnchorCache.anchor ) &&
2297
+ " Inconsistent anchor computation" );
2308
2298
}
2299
+ #endif
2309
2300
2310
- assert (updatedAnchor && " Couldn't update anchor?" );
2311
2301
return substAnchor ();
2312
2302
}
2313
2303
You can’t perform that action at this time.
0 commit comments