From 1cd8e7dad6c61280604722593ad3d36a017f7851 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207024 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/ModuleMap.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Lex/ModuleMap.cpp') diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 068e16d043..39c1121011 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/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