summaryrefslogtreecommitdiffstats
path: root/lib/Lex
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2018-11-14 01:08:03 +0000
committerAlex Lorenz <arphaman@gmail.com>2018-11-14 01:08:03 +0000
commit87d8b2e8044fee827b6799d5ad7266f3a5112a38 (patch)
treec59716ccc6494ab4acac25224b070ff3090b7754 /lib/Lex
parentd43a004bc92af49358d0b21f8fe01f57c607e147 (diff)
[HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory
Include search paths can be relative paths. The loadSubdirectoryModuleMaps function should account for that and respect the -working-directory parameter given to Clang. rdar://46045849 Differential Revision: https://reviews.llvm.org/D54503 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r--lib/Lex/HeaderSearch.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 27eca0a81c..5b827b13c0 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -1638,8 +1638,10 @@ void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
return;
std::error_code EC;
+ SmallString<128> Dir = SearchDir.getDir()->getName();
+ FileMgr.makeAbsolutePath(Dir);
SmallString<128> DirNative;
- llvm::sys::path::native(SearchDir.getDir()->getName(), DirNative);
+ llvm::sys::path::native(Dir, DirNative);
llvm::vfs::FileSystem &FS = *FileMgr.getVirtualFileSystem();
for (llvm::vfs::directory_iterator Dir = FS.dir_begin(DirNative, EC), DirEnd;
Dir != DirEnd && !EC; Dir.increment(EC)) {