aboutsummaryrefslogtreecommitdiff
path: root/include/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-08 19:11:24 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-08 19:11:24 +0000
commit77d029f6a24dbf70d97e61757945df53fb250ea0 (patch)
treea5b04a494d0f58aa79d0523e53213a842ffe5dd2 /include/clang
parentd5c3fa29c6a06ed9c74e03b4a96f786cbc156b7c (diff)
Implement umbrella directories for modules, which are similar to
umbrella headers in the sense that all of the headers within that directory (and eventually its subdirectories) are considered to be part of the module with that umbrella directory. However, unlike umbrella headers, which are expected to include all of the headers within their subdirectories, Clang will automatically include all of the headers it finds in the named subdirectory. The intent here is to allow a module map to trivially turn a subdirectory into a module, where the module's structure can mimic the directory structure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r--include/clang/Basic/DiagnosticLexKinds.td11
-rw-r--r--include/clang/Lex/ModuleMap.h6
-rw-r--r--include/clang/Serialization/ASTBitCodes.h16
3 files changed, 20 insertions, 13 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td
index 2cf115d728..cbaa407d3f 100644
--- a/include/clang/Basic/DiagnosticLexKinds.td
+++ b/include/clang/Basic/DiagnosticLexKinds.td
@@ -382,8 +382,9 @@ def err_mmap_expected_lbrace : Error<"expected '{' to start module '%0'">;
def err_mmap_expected_rbrace : Error<"expected '}'">;
def note_mmap_lbrace_match : Note<"to match this '{'">;
def err_mmap_expected_member : Error<
- "expected umbrella header, header, submodule, or module export">;
+ "expected umbrella, header, submodule, or module export">;
def err_mmap_expected_header : Error<"expected a header name after '%0'">;
+def err_mmap_expected_dir : Error<"expected a directory name after '%0'">;
def err_mmap_module_redefinition : Error<
"redefinition of module '%0'">;
def note_mmap_prev_definition : Note<"previously defined here">;
@@ -391,10 +392,10 @@ def err_mmap_header_conflict : Error<
"header '%0' is already part of module '%1'">;
def err_mmap_header_not_found : Error<
"%select{|umbrella }0header '%1' not found">;
-def err_mmap_umbrella_header_conflict : Error<
- "module '%0' already has an umbrella header ('%1')">;
+def err_mmap_umbrella_dir_not_found : Error<
+ "umbrella directory '%0' not found">;
def err_mmap_umbrella_clash : Error<
- "umbrella header for module '%0' already covers this directory">;
+ "umbrella for module '%0' already covers this directory">;
def err_mmap_export_module_id : Error<
"expected an exported module name or '*'">;
def err_mmap_missing_module_unqualified : Error<
@@ -404,7 +405,7 @@ def err_mmap_missing_module_qualified : Error<
def err_mmap_top_level_inferred_submodule : Error<
"only submodules may be inferred with wildcard syntax">;
def err_mmap_inferred_no_umbrella : Error<
- "inferred submodules require a module with an umbrella header">;
+ "inferred submodules require a module with an umbrella">;
def err_mmap_inferred_redef : Error<
"redefinition of inferred submodule">;
def err_mmap_expected_lbrace_wildcard : Error<
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index 262e50db23..2d95255290 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -181,7 +181,11 @@ public:
/// \brief Sets the umbrella header of the given module to the given
/// header.
void setUmbrellaHeader(Module *Mod, const FileEntry *UmbrellaHeader);
-
+
+ /// \brief Sets the umbrella directory of the given module to the given
+ /// directory.
+ void setUmbrellaDir(Module *Mod, const DirectoryEntry *UmbrellaDir);
+
/// \brief Adds this header to the given module.
void addHeader(Module *Mod, const FileEntry *Header);
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h
index 17c9992a6c..41ef74ee0a 100644
--- a/include/clang/Serialization/ASTBitCodes.h
+++ b/include/clang/Serialization/ASTBitCodes.h
@@ -507,22 +507,24 @@ namespace clang {
/// \brief Record types used within a submodule description block.
enum SubmoduleRecordTypes {
+ /// \brief Metadata for submodules as a whole.
+ SUBMODULE_METADATA = 0,
/// \brief Defines the major attributes of a submodule, including its
/// name and parent.
- SUBMODULE_DEFINITION = 0,
+ SUBMODULE_DEFINITION = 1,
/// \brief Specifies the umbrella header used to create this module,
/// if any.
- SUBMODULE_UMBRELLA = 1,
+ SUBMODULE_UMBRELLA_HEADER = 2,
/// \brief Specifies a header that falls into this (sub)module.
- SUBMODULE_HEADER = 2,
- /// \brief Metadata for submodules as a whole.
- SUBMODULE_METADATA = 3,
+ SUBMODULE_HEADER = 3,
+ /// \brief Specifies an umbrella directory.
+ SUBMODULE_UMBRELLA_DIR = 4,
/// \brief Specifies the submodules that are imported by this
/// submodule.
- SUBMODULE_IMPORTS = 4,
+ SUBMODULE_IMPORTS = 5,
/// \brief Specifies the submodules that are re-exported from this
/// submodule.
- SUBMODULE_EXPORTS = 5
+ SUBMODULE_EXPORTS = 6
};
/// \defgroup ASTAST AST file AST constants