[PATCH] D28548: Improve include fixer's ranking by taking the paths into account.
Manuel Klimek via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 11 01:59:09 PST 2017
klimek created this revision.
klimek added a reviewer: bkramer.
klimek added a subscriber: cfe-commits.
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 "./".
https://reviews.llvm.org/D28548
Files:
include-fixer/IncludeFixer.cpp
include-fixer/SymbolIndexManager.cpp
include-fixer/SymbolIndexManager.h
include-fixer/tool/ClangIncludeFixer.cpp
test/include-fixer/Inputs/fake_yaml_db.yaml
test/include-fixer/ranking.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28548.83930.patch
Type: text/x-patch
Size: 8024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170111/95e6e8f4/attachment.bin>
More information about the cfe-commits
mailing list