aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-07 21:25:07 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-07 21:25:07 +0000
commit4813442c124d13a5c9cbf71beb7762275e45aacd (patch)
tree79bf7a64d1d8e6099799aef22aed73985db50c54 /lib/Lex/HeaderSearch.cpp
parentb1febb646bf7a2f319ad894c9833968c52d21711 (diff)
Make sure we pick up module_private.map when loading a module.map file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r--lib/Lex/HeaderSearch.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp
index 7035b9c45d..9a7230c24e 100644
--- a/lib/Lex/HeaderSearch.cpp
+++ b/lib/Lex/HeaderSearch.cpp
@@ -799,7 +799,16 @@ bool HeaderSearch::loadModuleMapFile(const FileEntry *File) {
return !KnownDir->second;
bool Result = ModMap.parseModuleMapFile(File);
- DirectoryHasModuleMap[Dir] = !Result;
+ if (!Result && llvm::sys::path::filename(File->getName()) == "module.map") {
+ // If the file we loaded was a module.map, look for the corresponding
+ // module_private.map.
+ llvm::SmallString<128> PrivateFilename(Dir->getName());
+ llvm::sys::path::append(PrivateFilename, "module_private.map");
+ if (const FileEntry *PrivateFile = FileMgr.getFile(PrivateFilename))
+ Result = ModMap.parseModuleMapFile(PrivateFile);
+ }
+
+ DirectoryHasModuleMap[Dir] = !Result;
return Result;
}