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 | 9f7828905552b0dcfe809412f1bb55432eedae06 (patch) | |
tree | c374b3985a1a1af4e58e219cd34cb7ec1af43ae7 /clang/lib/Serialization/ASTWriter.cpp | |
parent | 031b69d8dfb974798bafe8a1b123bfe0e7a7991a (diff) | |
download | bcm5719-llvm-9f7828905552b0dcfe809412f1bb55432eedae06.tar.gz bcm5719-llvm-9f7828905552b0dcfe809412f1bb55432eedae06.zip |
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.
llvm-svn: 173050
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 37577ce0718..2f9e1543c2c 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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); } |