diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:35 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-04 21:44:35 +0000 |
commit | c91e9f439ae85d5f79a6b65672f1d7d1b55ccda0 (patch) | |
tree | b4f0c79bca8661b61ce7be28a74f0d05db68accd /lib/Frontend/PCHReaderDecl.cpp | |
parent | 5586b019c18024b2967d027a17d5a05584a8b181 (diff) |
Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index c9bf4470eb..be4f72ec3b 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -507,6 +507,11 @@ void PCHDeclReader::VisitFieldDecl(FieldDecl *FD) { FD->setMutable(Record[Idx++]); if (Record[Idx++]) FD->setBitWidth(Reader.ReadExpr()); + if (!FD->getDeclName()) { + FieldDecl *Tmpl = cast_or_null<FieldDecl>(Reader.GetDecl(Record[Idx++])); + if (Tmpl) + Reader.getContext()->setInstantiatedFromUnnamedFieldDecl(FD, Tmpl); + } } void PCHDeclReader::VisitVarDecl(VarDecl *VD) { @@ -603,12 +608,19 @@ void PCHDeclReader::VisitUsingDecl(UsingDecl *D) { D->addShadowDecl(cast<UsingShadowDecl>(Reader.GetDecl(Record[Idx++]))); } D->setTypeName(Record[Idx++]); + NamedDecl *Pattern = cast_or_null<NamedDecl>(Reader.GetDecl(Record[Idx++])); + if (Pattern) + Reader.getContext()->setInstantiatedFromUsingDecl(D, Pattern); } void PCHDeclReader::VisitUsingShadowDecl(UsingShadowDecl *D) { VisitNamedDecl(D); D->setTargetDecl(cast<NamedDecl>(Reader.GetDecl(Record[Idx++]))); D->setUsingDecl(cast<UsingDecl>(Reader.GetDecl(Record[Idx++]))); + UsingShadowDecl *Pattern + = cast_or_null<UsingShadowDecl>(Reader.GetDecl(Record[Idx++])); + if (Pattern) + Reader.getContext()->setInstantiatedFromUsingShadowDecl(D, Pattern); } void PCHDeclReader::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) { @@ -715,6 +727,13 @@ void PCHDeclReader::VisitCXXRecordDecl(CXXRecordDecl *D) { void PCHDeclReader::VisitCXXMethodDecl(CXXMethodDecl *D) { VisitFunctionDecl(D); + unsigned NumOverridenMethods = Record[Idx++]; + while (NumOverridenMethods--) { + CXXMethodDecl *MD = cast<CXXMethodDecl>(Reader.GetDecl(Record[Idx++])); + // Avoid invariant checking of CXXMethodDecl::addOverriddenMethod, + // MD may be initializing. + Reader.getContext()->addOverriddenMethod(D, MD); + } } void PCHDeclReader::VisitCXXConstructorDecl(CXXConstructorDecl *D) { |