diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-11 23:09:25 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-06-11 23:09:25 +0000 |
commit | 911671718944f9b74b00e01842b68a754cc079f2 (patch) | |
tree | c79a702c11ebed1a26498d6ce1a3f685ea19f678 /clang/lib/AST/DeclBase.cpp | |
parent | 649caee022bdd0b984d0976bb33c0aa31df39711 (diff) | |
download | bcm5719-llvm-911671718944f9b74b00e01842b68a754cc079f2.tar.gz bcm5719-llvm-911671718944f9b74b00e01842b68a754cc079f2.zip |
Fix PCH issue. Attributes of a declaration were truncated to just one when the decl was read from a PCH file.
llvm-svn: 105852
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 8f6fdbc956f..f1b78e40fc8 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -314,9 +314,20 @@ unsigned Decl::getIdentifierNamespaceForKind(Kind DeclKind) { return 0; } +void Decl::initAttrs(Attr *attrs) { + assert(!HasAttrs && "Decl already contains attrs."); + + Attr *&AttrBlank = getASTContext().getDeclAttrs(this); + assert(AttrBlank == 0 && "HasAttrs was wrong?"); + + AttrBlank = attrs; + HasAttrs = true; +} + void Decl::addAttr(Attr *NewAttr) { Attr *&ExistingAttr = getASTContext().getDeclAttrs(this); + assert(NewAttr->getNext() == 0 && "Chain of attributes will be truncated!"); NewAttr->setNext(ExistingAttr); ExistingAttr = NewAttr; |