aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Lex/ModuleMap.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-31 04:05:44 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-31 04:05:44 +0000
commit51f564f80d9f71e175635b452ffeeeff899e9bf1 (patch)
treeada57bc51cc68158361f5d1a49d8de00b6a1e564 /include/clang/Lex/ModuleMap.h
parent868f65c6bf904591f62a0d69866825d2d3dfd16f (diff)
Implement support for module requirements, which indicate the language
features needed for a particular module to be available. This allows mixed-language modules, where certain headers only work under some language variants (e.g., in C++, std.tuple might only be available in C++11 mode). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147387 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/ModuleMap.h')
-rw-r--r--include/clang/Lex/ModuleMap.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index 2d95255290..b017a05e97 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -38,8 +38,13 @@ class ModuleMapParser;
class ModuleMap {
SourceManager *SourceMgr;
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags;
- LangOptions LangOpts;
-
+ const LangOptions &LangOpts;
+
+ /// \brief Language options used to parse the module map itself.
+ ///
+ /// These are always simple C language options.
+ LangOptions MMapLangOpts;
+
/// \brief The top-level modules that are known.
llvm::StringMap<Module *> Modules;
@@ -82,7 +87,10 @@ public:
///
/// \param DC A diagnostic consumer that will be cloned for use in generating
/// diagnostics.
- ModuleMap(FileManager &FileMgr, const DiagnosticConsumer &DC);
+ ///
+ /// \param LangOpts Language options for this translation unit.
+ ModuleMap(FileManager &FileMgr, const DiagnosticConsumer &DC,
+ const LangOptions &LangOpts);
/// \brief Destroy the module map.
///
@@ -96,6 +104,10 @@ public:
/// that no module owns this header file.
Module *findModuleForHeader(const FileEntry *File);
+ /// \brief Determine whether the given header is part of a module
+ /// marked 'unavailable'.
+ bool isHeaderInUnavailableModule(const FileEntry *Header);
+
/// \brief Retrieve a module with the given name.
///
/// \param The name of the module to look up.
@@ -188,7 +200,7 @@ public:
/// \brief Adds this header to the given module.
void addHeader(Module *Mod, const FileEntry *Header);
-
+
/// \brief Parse the given module map file, and record any modules we
/// encounter.
///