diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-18 20:56:22 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-18 20:56:22 +0000 |
commit | 057df20b3107cef764052d271c89b8591b98b3ce (patch) | |
tree | 656d5b6add01e885f09487b746d302e7794f7a9b /include/clang/Serialization/Module.h | |
parent | c2a8d6cee01fc4845f5409bf5c021a64616ac8c3 (diff) |
Optimize unqualified/global name lookup in modules by introducing a
generational scheme for identifiers that avoids searching the hash
tables of a given module more than once for a given
identifier. Previously, loading any new module invalidated all of the
previous lookup results for all identifiers, causing us to perform the
lookups repeatedly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Serialization/Module.h')
-rw-r--r-- | include/clang/Serialization/Module.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index ad2c98e695..831a873ac1 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -57,7 +57,7 @@ struct DeclContextInfo { /// other modules. class ModuleFile { public: - ModuleFile(ModuleKind Kind); + ModuleFile(ModuleKind Kind, unsigned Generation); ~ModuleFile(); // === General information === @@ -72,6 +72,9 @@ public: /// user. bool DirectlyImported; + /// \brief The generation of which this module file is a part. + unsigned Generation; + /// \brief The memory buffer that stores the data associated with /// this AST file. llvm::OwningPtr<llvm::MemoryBuffer> Buffer; |