diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-18 21:12:54 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-04-18 21:12:54 +0000 |
commit | a5bbbfef156c818f845a183096bed15747ecb8c3 (patch) | |
tree | ad0bb51be1a7af3b564d650e195fadf2caf35a01 /clang/lib/Lex/ModuleMap.cpp | |
parent | 4664916017ef0619f32371dd7ad225ca0f648d62 (diff) | |
download | bcm5719-llvm-a5bbbfef156c818f845a183096bed15747ecb8c3.tar.gz bcm5719-llvm-a5bbbfef156c818f845a183096bed15747ecb8c3.zip |
[c++2a] Add semantic support for private module fragments.
llvm-svn: 358713
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index b597c6dafcb..5e0be1a57da 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -806,7 +806,7 @@ std::pair<Module *, bool> ModuleMap::findOrCreateModule(StringRef Name, return std::make_pair(Result, true); } -Module *ModuleMap::createGlobalModuleForInterfaceUnit(SourceLocation Loc) { +Module *ModuleMap::createGlobalModuleFragmentForModuleUnit(SourceLocation Loc) { PendingSubmodules.emplace_back( new Module("<global>", Loc, nullptr, /*IsFramework*/ false, /*IsExplicit*/ true, NumCreatedModules++)); @@ -814,6 +814,16 @@ Module *ModuleMap::createGlobalModuleForInterfaceUnit(SourceLocation Loc) { return PendingSubmodules.back().get(); } +Module * +ModuleMap::createPrivateModuleFragmentForInterfaceUnit(Module *Parent, + SourceLocation Loc) { + auto *Result = + new Module("<private>", Loc, Parent, /*IsFramework*/ false, + /*IsExplicit*/ true, NumCreatedModules++); + Result->Kind = Module::PrivateModuleFragment; + return Result; +} + Module *ModuleMap::createModuleForInterfaceUnit(SourceLocation Loc, StringRef Name, Module *GlobalModule) { |