summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp6
-rw-r--r--clang/test/Modules/Inputs/ModuleMapLocations/Both_F.framework/Headers/a.h1
-rw-r--r--clang/test/Modules/modulemap-locations.m2
-rw-r--r--clang/test/Modules/self-import-header.m3
4 files changed, 8 insertions, 4 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index d6b255fb014..b94cdbd1cbf 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -1353,8 +1353,10 @@ void HeaderSearch::loadSubdirectoryModuleMaps(DirectoryLookup &SearchDir) {
llvm::sys::path::native(SearchDir.getDir()->getName(), DirNative);
for (llvm::sys::fs::directory_iterator Dir(DirNative.str(), EC), DirEnd;
Dir != DirEnd && !EC; Dir.increment(EC)) {
- loadModuleMapFile(Dir->path(), SearchDir.isSystemHeaderDirectory(),
- SearchDir.isFramework());
+ bool IsFramework = llvm::sys::path::extension(Dir->path()) == ".framework";
+ if (IsFramework == SearchDir.isFramework())
+ loadModuleMapFile(Dir->path(), SearchDir.isSystemHeaderDirectory(),
+ SearchDir.isFramework());
}
SearchDir.setSearchedAllModuleMaps(true);
diff --git a/clang/test/Modules/Inputs/ModuleMapLocations/Both_F.framework/Headers/a.h b/clang/test/Modules/Inputs/ModuleMapLocations/Both_F.framework/Headers/a.h
index 9dabfc089a1..aa47ef47c48 100644
--- a/clang/test/Modules/Inputs/ModuleMapLocations/Both_F.framework/Headers/a.h
+++ b/clang/test/Modules/Inputs/ModuleMapLocations/Both_F.framework/Headers/a.h
@@ -1 +1,2 @@
+@import Module; // Don't cause redefinition error.
void will_be_found2(void);
diff --git a/clang/test/Modules/modulemap-locations.m b/clang/test/Modules/modulemap-locations.m
index 9acdcd63436..949c4786263 100644
--- a/clang/test/Modules/modulemap-locations.m
+++ b/clang/test/Modules/modulemap-locations.m
@@ -1,5 +1,5 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs/ModuleMapLocations/Module_ModuleMap -I %S/Inputs/ModuleMapLocations/Both -F %S/Inputs/ModuleMapLocations -x objective-c -fsyntax-only %s -verify
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %S/Inputs/ModuleMapLocations/Module_ModuleMap -I %S/Inputs/ModuleMapLocations/Both -F %S/Inputs/ModuleMapLocations -I %S/Inputs/ModuleMapLocations -F %S/Inputs -x objective-c -fsyntax-only %s -verify
// regular
@import module_modulemap;
diff --git a/clang/test/Modules/self-import-header.m b/clang/test/Modules/self-import-header.m
index 4dccd94050d..9b4bd5dee52 100644
--- a/clang/test/Modules/self-import-header.m
+++ b/clang/test/Modules/self-import-header.m
@@ -3,6 +3,7 @@
// RUN: rm -rf %t
// RUN: %clang -fsyntax-only -isysroot %S/Inputs/System/usr/include -fmodules -fmodules-cache-path=%t \
// RUN: -target x86_64-darwin \
-// RUN: -F %S -I %S/Inputs/self-import-header %s -D__need_wint_t -Werror=implicit-function-declaration
+// RUN: -F %S -F %S/Inputs/self-import-header -I %S/Inputs/self-import-header \
+// RUN: %s -D__need_wint_t -Werror=implicit-function-declaration
@import af;
OpenPOWER on IntegriCloud