/// \brief The current C++ ABI.
llvm::OwningPtr<CXXABI> ABI;
CXXABI *createCXXABI(const TargetInfo &T);
-
+
+ friend class ASTDeclReader;
+
public:
const TargetInfo &Target;
IdentifierTable &Idents;
const CXXMethodDecl *&Entry = KeyFunctions[RD];
if (!Entry)
Entry = RecordLayoutBuilder::ComputeKeyFunction(RD);
- else
- assert(Entry == RecordLayoutBuilder::ComputeKeyFunction(RD) &&
- "Key function changed!");
return Entry;
}
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) {
Record.push_back(CXXRecNotTemplate);
}
+ // Store the key function to avoid deserializing every method so we can
+ // compute it.
+ if (D->IsDefinition)
+ Writer.AddDeclRef(Context.getKeyFunction(D), Record);
+
Code = serialization::DECL_CXX_RECORD;
}
struct S1 {
void S1_method(); // This should not be deserialized.
+ virtual void S1_keyfunc();
};