diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-05 16:33:54 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-05 16:33:54 +0000 |
commit | 55988680ece66b8e505ee136b35e74fcb1173aee (patch) | |
tree | 98b942dc721f88d21eeda306df4a7af70a04db12 /include/clang/Serialization | |
parent | 5460ff35ab748860f05aeea4685cd195153dca66 (diff) |
When writing a module file, keep track of the set of (sub)modules that
it imports, establishing dependencies at the (sub)module
granularity. This is not a user-visible change (yet).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145808 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization')
-rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 5 | ||||
-rw-r--r-- | include/clang/Serialization/ASTReader.h | 24 |
2 files changed, 20 insertions, 9 deletions
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. /// |