[clang][HeaderSearch] Shorten paths for includes in mainfile's directory
authorKadir Cetinkaya <kadircet@google.com>
Wed, 3 Jul 2019 07:47:19 +0000 (07:47 +0000)
committerKadir Cetinkaya <kadircet@google.com>
Wed, 3 Jul 2019 07:47:19 +0000 (07:47 +0000)
commit1f6d9845d8f2e0e664b0b03488588010adf39b3f
treed6cac219b4e8686f740c72c3f0fd33fe059ba278
parent09a0d3d1a256900def51534184ed8c30169cd382
[clang][HeaderSearch] Shorten paths for includes in mainfile's directory

Summary:
Currently HeaderSearch only looks at SearchDir's passed into it, but in
addition to those paths headers can be relative to including file's directory.

This patch makes sure that is taken into account.

Reviewers: gribozavr

Subscribers: jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D63295

llvm-svn: 365005
clang-tools-extra/clang-include-fixer/IncludeFixer.cpp
clang-tools-extra/clangd/CodeComplete.cpp
clang-tools-extra/clangd/Headers.cpp
clang-tools-extra/clangd/Headers.h
clang-tools-extra/clangd/IncludeFixer.cpp
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang-tools-extra/clangd/unittests/HeadersTests.cpp
clang/include/clang/Lex/HeaderSearch.h
clang/lib/Lex/HeaderSearch.cpp
clang/lib/Sema/SemaLookup.cpp
clang/unittests/Lex/HeaderSearchTest.cpp