aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/Module.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-18 20:56:22 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-18 20:56:22 +0000
commit057df20b3107cef764052d271c89b8591b98b3ce (patch)
tree656d5b6add01e885f09487b746d302e7794f7a9b /lib/Serialization/Module.cpp
parentc2a8d6cee01fc4845f5409bf5c021a64616ac8c3 (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 'lib/Serialization/Module.cpp')
-rw-r--r--lib/Serialization/Module.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Serialization/Module.cpp b/lib/Serialization/Module.cpp
index cb8c9cca06..bed545a0b2 100644
--- a/lib/Serialization/Module.cpp
+++ b/lib/Serialization/Module.cpp
@@ -20,8 +20,8 @@ using namespace clang;
using namespace serialization;
using namespace reader;
-ModuleFile::ModuleFile(ModuleKind Kind)
- : Kind(Kind), DirectlyImported(false), SizeInBits(0),
+ModuleFile::ModuleFile(ModuleKind Kind, unsigned Generation)
+ : Kind(Kind), DirectlyImported(false), Generation(Generation), SizeInBits(0),
LocalNumSLocEntries(0), SLocEntryBaseID(0),
SLocEntryBaseOffset(0), SLocEntryOffsets(0),
SLocFileOffsets(0), LocalNumIdentifiers(0),