diff options
author | Douglas Gregor <dgregor@apple.com> | 2013-01-21 15:25:38 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2013-01-21 15:25:38 +0000 |
commit | 5a04f9fc2b000da98fd903c8156034304bdadb2f (patch) | |
tree | 0bd659d6514e28faeac725451124f0ed9a03f627 /lib/Serialization/ASTWriter.cpp | |
parent | 032f25329565adfc542f001953565091eccba130 (diff) |
Introduce a fast path for the ASTReader's name lookup within a
DeclContext. When the DeclContext is of a kind that can only be
defined once and never updated, we limit the search to the module file
that conatins the lookup table. Provides a 15% speedup in one
modules-heavy source file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173050 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 37577ce071..2f9e1543c2 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -4780,6 +4780,7 @@ void ASTWriter::AddedVisibleDecl(const DeclContext *DC, const Decl *D) { if (!(!D->isFromASTFile() && cast<Decl>(DC)->isFromASTFile())) return; // Not a source decl added to a DeclContext from PCH. + assert(!getDefinitiveDeclContext(DC) && "DeclContext not definitive!"); AddUpdatedDeclContext(DC); UpdatingVisibleDecls.push_back(D); } |