aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/Module.h6
-rw-r--r--include/clang/Lex/ModuleMap.h10
-rw-r--r--include/clang/Serialization/ASTBitCodes.h5
-rw-r--r--include/clang/Serialization/ASTReader.h24
4 files changed, 35 insertions, 10 deletions
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index 43edcfacec..422449b6bb 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -78,6 +78,10 @@ public:
///\ brief The visibility of names within this particular module.
NameVisibilityKind NameVisibility;
+
+ /// \brief The set of modules imported by this module, and on which this
+ /// module depends.
+ llvm::SmallVector<Module *, 2> Imports;
/// \brief Describes an exported module.
///
@@ -89,7 +93,7 @@ public:
llvm::SmallVector<ExportDecl, 2> Exports;
/// \brief Describes an exported module that has not yet been resolved
- /// (perhaps because the module it refers to has not yet been loaded).
+ /// (perhaps because tASThe module it refers to has not yet been loaded).
struct UnresolvedExportDecl {
/// \brief The location of the 'export' keyword in the module map file.
SourceLocation ExportLoc;
diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h
index 40488b29fc..fdd5ddbf5f 100644
--- a/include/clang/Lex/ModuleMap.h
+++ b/include/clang/Lex/ModuleMap.h
@@ -167,6 +167,16 @@ public:
/// false otherwise.
bool resolveExports(Module *Mod, bool Complain);
+ /// \brief Infers the (sub)module based on the given source location and
+ /// source manager.
+ ///
+ /// \param Loc The location within the source that we are querying, along
+ /// with its source manager.
+ ///
+ /// \returns The module that owns this source location, or null if no
+ /// module owns this source location.
+ Module *inferModuleFromLocation(FullSourceLoc Loc);
+
/// \brief Parse the given module map file, and record any modules we
/// encounter.
///
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h
index 3d234d9085..17c9992a6c 100644
--- a/include/clang/Serialization/ASTBitCodes.h
+++ b/include/clang/Serialization/ASTBitCodes.h
@@ -517,9 +517,12 @@ namespace clang {
SUBMODULE_HEADER = 2,
/// \brief Metadata for submodules as a whole.
SUBMODULE_METADATA = 3,
+ /// \brief Specifies the submodules that are imported by this
+ /// submodule.
+ SUBMODULE_IMPORTS = 4,
/// \brief Specifies the submodules that are re-exported from this
/// submodule.
- SUBMODULE_EXPORTS = 4
+ SUBMODULE_EXPORTS = 5
};
/// \defgroup ASTAST AST file AST constants
diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h
index 552d1a5bff..5e9da51b97 100644
--- a/include/clang/Serialization/ASTReader.h
+++ b/include/clang/Serialization/ASTReader.h
@@ -393,21 +393,29 @@ private:
/// declarations in that submodule that could be made visible.
HiddenNamesMapType HiddenNamesMap;
- /// \brief A module export that hasn't yet been resolved.
- struct UnresolvedModuleExport {
+
+ /// \brief A module import or export that hasn't yet been resolved.
+ struct UnresolvedModuleImportExport {
/// \brief The file in which this module resides.
ModuleFile *File;
- /// \brief The module that is exporting, along with a bit that specifies
- /// whether this is a wildcard export.
- llvm::PointerIntPair<Module *, 1, bool> ModuleAndWildcard;
+ /// \brief The module that is importing or exporting.
+ Module *Mod;
/// \brief The local ID of the module that is being exported.
- unsigned ExportedID;
+ unsigned ID;
+
+ /// \brief Whether this is an import (vs. an export).
+ unsigned IsImport : 1;
+
+ /// \brief Whether this is a wildcard export.
+ unsigned IsWildcard : 1;
};
- /// \brief The set of module exports that still need to be resolved.
- llvm::SmallVector<UnresolvedModuleExport, 2> UnresolvedModuleExports;
+ /// \brief The set of module imports and exports that still need to be
+ /// resolved.
+ llvm::SmallVector<UnresolvedModuleImportExport, 2>
+ UnresolvedModuleImportExports;
/// \brief A vector containing selectors that have already been loaded.
///