diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-06 17:34:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-06 17:34:58 +0000 |
commit | dd005f69f0b25f7a65ba4f08db175d66b029c4ef (patch) | |
tree | 7be8c78f74a71795d268cc13382b1fd6958adee8 /clang/lib/Lex/ModuleMap.cpp | |
parent | ac35a4d0f7a5f9445b68b143b67ac72f38ddeee6 (diff) | |
download | bcm5719-llvm-dd005f69f0b25f7a65ba4f08db175d66b029c4ef.tar.gz bcm5719-llvm-dd005f69f0b25f7a65ba4f08db175d66b029c4ef.zip |
Allow inferred submodules for any (sub)module that has an umbrella header
llvm-svn: 145945
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 5f3379bf965..581a5d5631d 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -900,16 +900,16 @@ void ModuleMapParser::parseInferredSubmoduleDecl(bool Explicit) { } // Inferred modules must have umbrella headers. - if (!Failed && !ActiveModule->getTopLevelModule()->UmbrellaHeader) { + if (!Failed && !ActiveModule->UmbrellaHeader) { Diags.Report(StarLoc, diag::err_mmap_inferred_no_umbrella); Failed = true; } // Check for redefinition of an inferred module. - if (!Failed && ActiveModule->getTopLevelModule()->InferSubmodules) { + if (!Failed && ActiveModule->InferSubmodules) { Diags.Report(StarLoc, diag::err_mmap_inferred_redef); - if (ActiveModule->getTopLevelModule()->InferredSubmoduleLoc.isValid()) - Diags.Report(ActiveModule->getTopLevelModule()->InferredSubmoduleLoc, + if (ActiveModule->InferredSubmoduleLoc.isValid()) + Diags.Report(ActiveModule->InferredSubmoduleLoc, diag::note_mmap_prev_definition); Failed = true; } @@ -927,10 +927,9 @@ void ModuleMapParser::parseInferredSubmoduleDecl(bool Explicit) { } // Note that we have an inferred submodule. - Module *TopModule = ActiveModule->getTopLevelModule(); - TopModule->InferSubmodules = true; - TopModule->InferredSubmoduleLoc = StarLoc; - TopModule->InferExplicitSubmodules = Explicit; + ActiveModule->InferSubmodules = true; + ActiveModule->InferredSubmoduleLoc = StarLoc; + ActiveModule->InferExplicitSubmodules = Explicit; // Parse the opening brace. if (!Tok.is(MMToken::LBrace)) { @@ -952,7 +951,7 @@ void ModuleMapParser::parseInferredSubmoduleDecl(bool Explicit) { case MMToken::ExportKeyword: { consumeToken(); if (Tok.is(MMToken::Star)) - TopModule->InferExportWildcard = true; + ActiveModule->InferExportWildcard = true; else Diags.Report(Tok.getLocation(), diag::err_mmap_expected_export_wildcard); |