From ffbafa2af021504d2bdb575b5445e53faf63bb7a Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Wed, 23 Apr 2014 21:10:46 +0000 Subject: 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 --- clang/lib/Lex/ModuleMap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Lex/ModuleMap.cpp') 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 -- cgit v1.2.3