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/ASTCommon.h | |
parent | 032f25329565adfc542f001953565091eccba130 (diff) | |
download | clang-5a04f9fc2b000da98fd903c8156034304bdadb2f.tar.gz |
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/ASTCommon.h')
-rw-r--r-- | lib/Serialization/ASTCommon.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Serialization/ASTCommon.h b/lib/Serialization/ASTCommon.h index 643deb24d1..f9db1f0f94 100644 --- a/lib/Serialization/ASTCommon.h +++ b/lib/Serialization/ASTCommon.h @@ -58,6 +58,18 @@ TypeID MakeTypeID(ASTContext &Context, QualType T, IdxForTypeTy IdxForType) { unsigned ComputeHash(Selector Sel); +/// \brief Retrieve the "definitive" declaration that provides all of the +/// visible entries for the given declaration context, if there is one. +/// +/// The "definitive" declaration is the only place where we need to look to +/// find information about the declarations within the given declaration +/// context. For example, C++ and Objective-C classes, C structs/unions, and +/// Objective-C protocols, categories, and extensions are all defined in a +/// single place in the source code, so they have definitive declarations +/// associated with them. C++ namespaces, on the other hand, can have +/// multiple definitions. +const Decl *getDefinitiveDeclContext(const DeclContext *DC); + } // namespace serialization } // namespace clang |