summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-04-23 21:10:46 +0000
committerBen Langmuir <blangmuir@apple.com>2014-04-23 21:10:46 +0000
commitffbafa2af021504d2bdb575b5445e53faf63bb7a (patch)
treeabaec23d08afe7e33630787a00f56c5ec10e0c15 /clang/lib/Lex/ModuleMap.cpp
parent4dbd4891c7bdfcecb4933a50ca72285acc238850 (diff)
downloadbcm5719-llvm-ffbafa2af021504d2bdb575b5445e53faf63bb7a.tar.gz
bcm5719-llvm-ffbafa2af021504d2bdb575b5445e53faf63bb7a.zip
Do not print inferred submodules explicitly in __inferred_module.map
Otherwise including a header in your source file that is not included by framework's umbrella header will silently add an empty submodule with that name. is automatically translated to @import Foo.NotInModule; which then would have succeeded because the inferred module map contained an empty submodule called NotInModule. llvm-svn: 207024
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 068e16d0431..39c11210112 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -365,6 +365,7 @@ ModuleMap::findModuleForHeader(const FileEntry *File,
llvm::sys::path::stem(SkippedDirs[I-1]->getName()), NameBuf);
Result = findOrCreateModule(Name, Result, UmbrellaModule->ModuleMap,
/*IsFramework=*/false, Explicit).first;
+ Result->IsInferred = true;
// Associate the module and the directory.
UmbrellaDirs[SkippedDirs[I-1]] = Result;
@@ -381,6 +382,7 @@ ModuleMap::findModuleForHeader(const FileEntry *File,
llvm::sys::path::stem(File->getName()), NameBuf);
Result = findOrCreateModule(Name, Result, UmbrellaModule->ModuleMap,
/*IsFramework=*/false, Explicit).first;
+ Result->IsInferred = true;
Result->addTopHeader(File);
// If inferred submodules export everything they import, add a
OpenPOWER on IntegriCloud