diff options
| author | Ben Langmuir <blangmuir@apple.com> | 2014-04-23 21:10:46 +0000 |
|---|---|---|
| committer | Ben Langmuir <blangmuir@apple.com> | 2014-04-23 21:10:46 +0000 |
| commit | 1cd8e7dad6c61280604722593ad3d36a017f7851 (patch) | |
| tree | bb8137285611a51a746ae2bb75cdc39360deb2da /lib/Basic/Module.cpp | |
| parent | f035b1e0f6b37a2abe56ab36d2ac8683d845bf6a (diff) | |
| download | clang-1cd8e7dad6c61280604722593ad3d36a017f7851.tar.gz clang-1cd8e7dad6c61280604722593ad3d36a017f7851.tar.bz2 clang-1cd8e7dad6c61280604722593ad3d36a017f7851.tar.xz | |
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
Diffstat (limited to 'lib/Basic/Module.cpp')
| -rw-r--r-- | lib/Basic/Module.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Basic/Module.cpp b/lib/Basic/Module.cpp index 067528abac..e75485dbd6 100644 --- a/lib/Basic/Module.cpp +++ b/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); |
