This is an archive of the discontinued LLVM Phabricator instance.

Do not cache hardcoded formats in FormatManager
ClosedPublic

Authored by aprantl on Dec 9 2019, 4:46 PM.

Details

Summary

The cache in FormatCache uses only a type name as key. The hardcoded formats, synthetic children, etc inspect an entire ValueObject to determine their eligibility, which isn't modelled in the cache. This leads to bugs such as the one in this patch (where two similarly named types in different files have different hardcoded summary providers). The problem is exaggerated in the Swift language plugin due to the language's dynamic nature.

rdar://problem/57756763

Diff Detail

Event Timeline

This looks fine to me. So long as there wasn't much strict type-based matching done in the Hardcoded Summary providers, then this shouldn't cause the format matching to get slower.

jingham accepted this revision.Dec 10 2019, 2:52 PM

And check the Accept checkbox...

This revision is now accepted and ready to land.Dec 10 2019, 2:52 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2019, 3:58 PM