diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-28 06:26:18 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-28 06:26:18 +0000 |
commit | 23b88b73e1982404b75a5175dccab22eb6a3a29a (patch) | |
tree | 7d14cfe8c07df251f43fbe5a6d676a7377114afd /clang/lib/AST/DeclGroup.cpp | |
parent | dca83c467665b24359a7638f245f1680482a3d3f (diff) | |
download | bcm5719-llvm-23b88b73e1982404b75a5175dccab22eb6a3a29a.tar.gz bcm5719-llvm-23b88b73e1982404b75a5175dccab22eb6a3a29a.zip |
Cleanups for DeclGroup.
llvm-svn: 67922
Diffstat (limited to 'clang/lib/AST/DeclGroup.cpp')
-rw-r--r-- | clang/lib/AST/DeclGroup.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/AST/DeclGroup.cpp b/clang/lib/AST/DeclGroup.cpp index 35cb6d3bc61..36a7c2b400e 100644 --- a/clang/lib/AST/DeclGroup.cpp +++ b/clang/lib/AST/DeclGroup.cpp @@ -17,7 +17,6 @@ #include "llvm/Support/Allocator.h" #include "llvm/Bitcode/Serialize.h" #include "llvm/Bitcode/Deserialize.h" - using namespace clang; DeclGroup* DeclGroup::Create(ASTContext& C, unsigned numdecls, Decl** decls) { @@ -48,8 +47,8 @@ DeclGroup* DeclGroup::Read(llvm::Deserializer& D, ASTContext& C) { } DeclGroup::DeclGroup(unsigned numdecls, Decl** decls) : NumDecls(numdecls) { - assert (numdecls > 0); - assert (decls); + assert(numdecls > 0); + assert(decls); memcpy(this+1, decls, numdecls * sizeof(*decls)); } @@ -59,14 +58,12 @@ void DeclGroup::Destroy(ASTContext& C) { } void DeclGroupRef::Emit(llvm::Serializer& S) const { - if (getKind() == DeclKind) { + if (isSingleDecl()) { S.EmitBool(false); S.EmitPtr(D); - } - else { + } else { S.EmitBool(true); - S.EmitPtr(reinterpret_cast<DeclGroup*>(reinterpret_cast<uintptr_t>(D) - & ~Mask)); + S.EmitPtr(&getDeclGroup()); } } |