This is an archive of the discontinued LLVM Phabricator instance.

[include-fixer] Improve include paths' minimization.
AbandonedPublic

Authored by hokein on May 10 2016, 9:00 AM.

Details

Reviewers
bkramer
Summary

The file path of a symbol in yaml database is an absolute
file path. However, HeaderSearch::suggestPathToFileForDiagnostics assumes that
the FileEntry::Name is a relative file path based on header search path,
otherwise, it returns an absolute file path.

This patch makes include-fixer follow this assumption, so that
include-fixer can get the most appropriate header path.

Diff Detail

Event Timeline

hokein updated this revision to Diff 56728.May 10 2016, 9:00 AM
hokein retitled this revision from to [include-fixer] Improve include paths' minimization..
hokein updated this object.
hokein updated this revision to Diff 56788.May 10 2016, 1:11 PM

Minor update.

hokein updated this object.May 11 2016, 12:57 AM
hokein added a reviewer: bkramer.
hokein set the repository for this revision to rL LLVM.
hokein added a subscriber: cfe-commits.
bkramer edited edge metadata.May 11 2016, 1:45 AM

Making one path relative to another part is a hard problem. We'd need to make this work on windows and possibly also have it working in presence of symlinks. I'd much prefer to make paths in the YAML file relative to the "directory" in the compilation database, which is always the working directory of any clang tool. Would that break something?

hokein abandoned this revision.May 11 2016, 4:40 AM

Abandon this, in favor of http://reviews.llvm.org/D20158.