[PATCH] D54503: [HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory
Alex Lorenz via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 13 17:10:36 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346822: [HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory (authored by arphaman, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D54503?vs=173958&id=173968#toc
Repository:
rL LLVM
https://reviews.llvm.org/D54503
Files:
cfe/trunk/lib/Lex/HeaderSearch.cpp
cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
cfe/trunk/test/Modules/subdirectory-module-maps-working-dir.m
Index: cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
===================================================================
--- cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
+++ cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/module.map
@@ -0,0 +1,5 @@
+module ModuleInSubdir {
+header "h1.h"
+ export *
+}
+
Index: cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
===================================================================
--- cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
+++ cfe/trunk/test/Modules/Inputs/subdirectory-module-maps-working-dir/subdir_module/h1.h
@@ -0,0 +1 @@
+int bar();
Index: cfe/trunk/test/Modules/subdirectory-module-maps-working-dir.m
===================================================================
--- cfe/trunk/test/Modules/subdirectory-module-maps-working-dir.m
+++ cfe/trunk/test/Modules/subdirectory-module-maps-working-dir.m
@@ -0,0 +1,13 @@
+// RUN: rm -rf %t
+// RUN: %clang -fsyntax-only -fmodules -fmodules-cache-path=%t \
+// RUN: -working-directory %S/Inputs \
+// RUN: -I subdirectory-module-maps-working-dir \
+// RUN: %s -Werror=implicit-function-declaration -Xclang -verify
+
+ at import ModuleInSubdir;
+
+void foo() {
+ int x = bar();
+}
+
+// expected-no-diagnostics
Index: cfe/trunk/lib/Lex/HeaderSearch.cpp
===================================================================
--- cfe/trunk/lib/Lex/HeaderSearch.cpp
+++ cfe/trunk/lib/Lex/HeaderSearch.cpp
@@ -1638,8 +1638,10 @@
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)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54503.173968.patch
Type: text/x-patch
Size: 2111 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181114/7dd86b95/attachment-0001.bin>
More information about the cfe-commits
mailing list