diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-18 19:20:11 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-18 19:20:11 +0000 |
commit | 4eb9fc0449ddbd5239ddc3ae6b6e52880f47dcf7 (patch) | |
tree | 8ddda4b4c7866fc96d51ed0492156ce438b7e554 /lib/Serialization/ASTWriterDecl.cpp | |
parent | eea742b0f60ebab8e5d2c233fe3996dbbd9fb892 (diff) |
Read/write declaration attributes from/to PCH properly. Embed them in the declaration block instead of trying to create another block.
The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116737 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index bf7c259635..24ac8f4417 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -133,6 +133,8 @@ void ASTDeclWriter::VisitDecl(Decl *D) { Writer.AddSourceLocation(D->getLocation(), Record); Record.push_back(D->isInvalidDecl()); Record.push_back(D->hasAttrs()); + if (D->hasAttrs()) + Writer.WriteAttributes(D->getAttrs(), Record); Record.push_back(D->isImplicit()); Record.push_back(D->isUsed(false)); Record.push_back(D->getAccess()); @@ -1212,10 +1214,6 @@ void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) { D->getDeclKindName() + "'"); Stream.EmitRecord(W.Code, Record, W.AbbrevToUse); - // If the declaration had any attributes, write them now. - if (D->hasAttrs()) - WriteAttributeRecord(D->getAttrs()); - // Flush any expressions that were written as part of this declaration. FlushStmts(); |