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/Basic/Module.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'clang/lib/Basic/Module.cpp') diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 067528a..e75485d 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -29,9 +29,10 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), ModuleMap(File), Umbrella(), ASTFile(0), IsMissingRequirement(false), IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework), IsExplicit(IsExplicit), - IsSystem(false), IsExternC(false), InferSubmodules(false), - InferExplicitSubmodules(false), InferExportWildcard(false), - ConfigMacrosExhaustive(false), NameVisibility(Hidden) { + IsSystem(false), IsExternC(false), IsInferred(false), + InferSubmodules(false), InferExplicitSubmodules(false), + InferExportWildcard(false), ConfigMacrosExhaustive(false), + NameVisibility(Hidden) { if (Parent) { if (!Parent->isAvailable()) IsAvailable = false; @@ -360,7 +361,8 @@ void Module::print(raw_ostream &OS, unsigned Indent) const { for (submodule_const_iterator MI = submodule_begin(), MIEnd = submodule_end(); MI != MIEnd; ++MI) - (*MI)->print(OS, Indent + 2); + if (!(*MI)->IsInferred) + (*MI)->print(OS, Indent + 2); for (unsigned I = 0, N = Exports.size(); I != N; ++I) { OS.indent(Indent + 2); -- cgit v1.1