This is an archive of the discontinued LLVM Phabricator instance.

[include-fixer] Rank symbols based on the number of occurrences we found while merging.
ClosedPublic

Authored by bkramer on May 31 2016, 7:12 AM.

Details

Summary

This sorts based on the popularity of the header, not the symbol. If
there are mutliple matching symbols in one header we take the maximum
popularity for that header and deduplicate. If we know nothing we sort
lexicographically based on the header path.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer updated this revision to Diff 59062.May 31 2016, 7:12 AM
bkramer retitled this revision from to [include-fixer] Rank symbols based on the number of occurrences we found while merging..
bkramer updated this object.
bkramer added reviewers: ioeric, djasper.
bkramer added a subscriber: cfe-commits.
djasper accepted this revision.May 31 2016, 7:35 AM
djasper edited edge metadata.
djasper added inline comments.
include-fixer/SymbolIndexManager.cpp
25 ↗(On Diff #59062)

Maybe use a DenseHashMap?

include-fixer/tool/ClangIncludeFixer.cpp
101 ↗(On Diff #59062)

Can you please write a regular for loop with index instead?

105 ↗(On Diff #59062)

Add a comment that you are assigning fake occurrences to keep the existing test logic (with the first include being the most preferable).

This revision is now accepted and ready to land.May 31 2016, 7:35 AM
This revision was automatically updated to reflect the committed changes.