aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-07-28 00:53:40 +0000
committerDouglas Gregor <dgregor@apple.com>2011-07-28 00:53:40 +0000
commita126f17ca83b985300c1f65cee647bea108db657 (patch)
treeca7e2d6e46767edd2166be7e1027190e7beacadb /lib/Serialization/ASTReader.cpp
parent7e90985df09855dc309ed888a5b16a0ae684f8e3 (diff)
Switch Sema::DynamicClasses over to LazyVector
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136317 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r--lib/Serialization/ASTReader.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index e8ae251e5a..8b2d1a270e 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -4341,9 +4341,6 @@ void ASTReader::InitializeSema(Sema &S) {
// If there were any dynamic classes declarations, deserialize them
// and add them to Sema's vector of such declarations.
- for (unsigned I = 0, N = DynamicClasses.size(); I != N; ++I)
- SemaObj->DynamicClasses.push_back(
- cast<CXXRecordDecl>(GetDecl(DynamicClasses[I])));
// Load the offsets of the declarations that Sema references.
// They will be lazily deserialized when needed.
@@ -4586,6 +4583,16 @@ void ASTReader::ReadExtVectorDecls(SmallVectorImpl<TypedefNameDecl *> &Decls) {
ExtVectorDecls.clear();
}
+void ASTReader::ReadDynamicClasses(SmallVectorImpl<CXXRecordDecl *> &Decls) {
+ for (unsigned I = 0, N = DynamicClasses.size(); I != N; ++I) {
+ CXXRecordDecl *D
+ = dyn_cast_or_null<CXXRecordDecl>(GetDecl(DynamicClasses[I]));
+ if (D)
+ Decls.push_back(D);
+ }
+ DynamicClasses.clear();
+}
+
void ASTReader::LoadSelector(Selector Sel) {
// It would be complicated to avoid reading the methods anyway. So don't.
ReadMethodPool(Sel);