From a5bbbfef156c818f845a183096bed15747ecb8c3 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 18 Apr 2019 21:12:54 +0000 Subject: [c++2a] Add semantic support for private module fragments. llvm-svn: 358713 --- clang/lib/Lex/ModuleMap.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'clang/lib/Lex/ModuleMap.cpp') diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index b597c6d..5e0be1a 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -806,7 +806,7 @@ std::pair 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("", 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("", Loc, Parent, /*IsFramework*/ false, + /*IsExplicit*/ true, NumCreatedModules++); + Result->Kind = Module::PrivateModuleFragment; + return Result; +} + Module *ModuleMap::createModuleForInterfaceUnit(SourceLocation Loc, StringRef Name, Module *GlobalModule) { -- cgit v1.1