diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 22:10:01 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-03-26 22:10:01 +0000 |
commit | 9ad44dae5d4de39873695dd945d76bf3bbbe3412 (patch) | |
tree | 89737ca15322d0cc4c8a85c1b387ed91a4d7f89e /include | |
parent | e97393dd73c4e2460f62ccdaa1069f50536bdc8f (diff) |
[modules] Restrict the module use-declaration to only appear in top-level
modules, and allow sub-modules of a module with a use-declaration to make use
of the nominated modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 4 | ||||
-rw-r--r-- | include/clang/Basic/Module.h | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 3fa9bcf419..6eaf423a77 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -579,7 +579,9 @@ def err_mmap_module_id : Error< def err_mmap_expected_library_name : Error< "expected %select{library|framework}0 name as a string">; def err_mmap_config_macro_submodule : Error< - "configuration macros are only allowed on top-level modules">; + "configuration macros are only allowed in top-level modules">; +def err_mmap_use_decl_submodule : Error< + "use declarations are only allowed in top-level modules">; def err_mmap_expected_config_macro : Error< "expected configuration macro name after ','">; def err_mmap_expected_conflicts_comma : Error< diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h index e3953a4571..a976601c51 100644 --- a/include/clang/Basic/Module.h +++ b/include/clang/Basic/Module.h @@ -399,6 +399,10 @@ public: /// \brief The top-level headers associated with this module. ArrayRef<const FileEntry *> getTopHeaders(FileManager &FileMgr); + /// \brief Determine whether this module has declared its intention to + /// directly use another module. + bool directlyUses(const Module *Requested) const; + /// \brief Add the given feature requirement to the list of features /// required by this module. /// |