This is an archive of the discontinued LLVM Phabricator instance.

Improve include fixer's ranking by taking the paths into account.
ClosedPublic

Authored by klimek on Jan 11 2017, 1:59 AM.

Details

Summary

Instead of just using popularity, we also take into account how similar the
path of the current file is to the path of the header.
Our first approach is to get popularity into a reasonably small scale by taking
log2 (which is roughly intuitive to how humans would bucket popularity), and
multiply that with the number of matching prefix path fragments of the included
header with the current file.
Note that currently we do not take special care for unclean paths containing
"../" or "./".

Diff Detail

Repository
rL LLVM

Event Timeline

klimek updated this revision to Diff 83930.Jan 11 2017, 1:59 AM
klimek retitled this revision from to Improve include fixer's ranking by taking the paths into account..
klimek updated this object.
klimek added a reviewer: bkramer.
klimek added a subscriber: cfe-commits.
bkramer accepted this revision.Jan 11 2017, 2:27 AM
bkramer edited edge metadata.
This revision is now accepted and ready to land.Jan 11 2017, 2:27 AM
This revision was automatically updated to reflect the committed changes.