From 763bd9136e59e77b6fbc68841855632547dd9882 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 14 Sep 2017 23:38:44 +0000 Subject: [Module map] Introduce a private module re-export directive. Introduce a new "export_as" directive for top-level modules, which indicates that the current module is a "private" module whose symbols will eventually be exported through the named "public" module. This is in support of a common pattern in the Darwin ecosystem where a single public framework is constructed of several private frameworks, with (currently) header duplication and some support from the linker. Addresses rdar://problem/34438420. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313316 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticLexKinds.td | 7 +++++++ include/clang/Basic/Module.h | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'include/clang/Basic') diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 9f35ed5762..ec95dca6ac 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -674,6 +674,13 @@ def err_mmap_invalid_header_attribute_value : Error< "expected integer literal as value for header attribute '%0'">; def err_mmap_expected_header_attribute : Error< "expected a header attribute name ('size' or 'mtime')">; +def err_mmap_conflicting_export_as : Error< + "conflicting re-export of module '%0' as '%1' or '%2'">; +def warn_mmap_redundant_export_as : Warning< + "module '%0' already re-exported as '%1'">, + InGroup; +def err_mmap_submodule_export_as : Error< + "only top-level modules can be re-exported as public">; def warn_auto_module_import : Warning< "treating #%select{include|import|include_next|__include_macros}0 as an " diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index edc2f8e723..0b2a665f05 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -99,6 +99,10 @@ public: /// \brief The name of the umbrella entry, as written in the module map. std::string UmbrellaAsWritten; + + /// \brief The module through which entities defined in this module will + /// eventually be exposed, for use in "private" modules. + std::string ExportAsModule; private: /// \brief The submodules of this module, indexed by name. -- cgit v1.2.3