aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-14 20:14:38 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-14 20:14:38 +0000
commit36d2fd44bfeec417bbd7465218353abb8bf7e95d (patch)
treeab6641526c79014f373e00e8310b2d79737dc602 /lib/Serialization/ASTReaderDecl.cpp
parenteb5e9986e577b1e2bff3cca5973a2494fb593fbb (diff)
Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.
Progress for rdar://7260160. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--lib/Serialization/ASTReaderDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index 97adbf73cc..e8fe264651 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -833,6 +833,15 @@ void ASTDeclReader::VisitCXXRecordDecl(CXXRecordDecl *D) {
break;
}
}
+
+ // Load the key function to avoid deserializing every method so we can
+ // compute it.
+ if (D->IsDefinition) {
+ CXXMethodDecl *Key
+ = cast_or_null<CXXMethodDecl>(Reader.GetDecl(Record[Idx++]));
+ if (Key)
+ C.KeyFunctions[D] = Key;
+ }
}
void ASTDeclReader::VisitCXXMethodDecl(CXXMethodDecl *D) {