aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-02-24 04:58:15 +0000
committerBen Langmuir <blangmuir@apple.com>2015-02-24 04:58:15 +0000
commit1f6a32b3e7aa095263a5a0bbb1cc0576dce441a6 (patch)
tree147eaf2b4883a589053c55467ca88f26a00c065a /clang/lib/Lex/HeaderSearch.cpp
parentd0a19981c4f6d275707571fc1530ac8846853940 (diff)
downloadllvm-1f6a32b3e7aa095263a5a0bbb1cc0576dce441a6.zip
llvm-1f6a32b3e7aa095263a5a0bbb1cc0576dce441a6.tar.gz
llvm-1f6a32b3e7aa095263a5a0bbb1cc0576dce441a6.tar.bz2
Don't load Framework module.map files when searching subdirectories
This would cause frameworks to have spurious "redefinition" errors if they had both a (legacy) "module.map" and a (new) "module.modulemap" file and we happened to do a sub-directory search in that directory using a non-framework include path (e.g. -Ifoo/ -Ffoo/). For migration purposes it's very handy that the compiler will prefer the new spelling of the filename and not look at the old one if it doesn't need to. llvm-svn: 230308
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index d6b255f..b94cdbd 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);