diff options
Diffstat (limited to 'clang/include/clang')
-rw-r--r-- | clang/include/clang/Serialization/ASTBitCodes.h | 4 | ||||
-rw-r--r-- | clang/include/clang/Serialization/ModuleManager.h | 21 |
2 files changed, 24 insertions, 1 deletions
diff --git a/clang/include/clang/Serialization/ASTBitCodes.h b/clang/include/clang/Serialization/ASTBitCodes.h index 1e26927fbff..3668d4c6320 100644 --- a/clang/include/clang/Serialization/ASTBitCodes.h +++ b/clang/include/clang/Serialization/ASTBitCodes.h @@ -295,6 +295,10 @@ namespace clang { /// \brief Record code for the module build directory. MODULE_DIRECTORY = 16, + + /// \brief Record code for the list of other AST files made available by + /// this AST file but not actually used by it. + KNOWN_MODULE_FILES = 17, }; /// \brief Record types that occur within the input-files block diff --git a/clang/include/clang/Serialization/ModuleManager.h b/clang/include/clang/Serialization/ModuleManager.h index 3d10fad0a1b..d20c7e2fbbb 100644 --- a/clang/include/clang/Serialization/ModuleManager.h +++ b/clang/include/clang/Serialization/ModuleManager.h @@ -35,7 +35,13 @@ class ModuleManager { /// \brief All loaded modules, indexed by name. llvm::DenseMap<const FileEntry *, ModuleFile *> Modules; - + + typedef llvm::SetVector<const FileEntry *> AdditionalKnownModuleFileSet; + + /// \brief Additional module files that are known but not loaded. Tracked + /// here so that we can re-export them if necessary. + AdditionalKnownModuleFileSet AdditionalKnownModuleFiles; + /// \brief FileManager that handles translating between filenames and /// FileEntry *. FileManager &FileMgr; @@ -219,6 +225,19 @@ public: /// has been "accepted", and will not (can not) be unloaded. void moduleFileAccepted(ModuleFile *MF); + /// \brief Notification from the frontend that the given module file is + /// part of this compilation (even if not imported) and, if this compilation + /// is exported, should be made available to importers of it. + bool addKnownModuleFile(StringRef FileName); + + /// \brief Get a list of additional module files that are not currently + /// loaded but are considered to be part of the current compilation. + llvm::iterator_range<AdditionalKnownModuleFileSet::const_iterator> + getAdditionalKnownModuleFiles() { + return llvm::make_range(AdditionalKnownModuleFiles.begin(), + AdditionalKnownModuleFiles.end()); + } + /// \brief Visit each of the modules. /// /// This routine visits each of the modules, starting with the |