aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commit4fc9f3e819d64b244f322c213e2dab10bd85636f (patch)
treebbf574d05acff4fcbe42ca396f0e384bb3504346 /clang/lib/Serialization/Module.cpp
parentc3cc110bb43a3d84782a7f72210cd68e15870d04 (diff)
downloadllvm-4fc9f3e819d64b244f322c213e2dab10bd85636f.zip
llvm-4fc9f3e819d64b244f322c213e2dab10bd85636f.tar.gz
llvm-4fc9f3e819d64b244f322c213e2dab10bd85636f.tar.bz2
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. llvm-svn: 148412
Diffstat (limited to 'clang/lib/Serialization/Module.cpp')
-rw-r--r--clang/lib/Serialization/Module.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Serialization/Module.cpp b/clang/lib/Serialization/Module.cpp
index cb8c9cc..bed545a 100644
--- a/clang/lib/Serialization/Module.cpp
+++ b/clang/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),