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 | fe95deaf66e4fbd82d44b5f6afa8162fa69cb85c (patch) | |
tree | 17d31b37ce180f750570ca69baeaa6b644b1500e /lib/AST/DeclGroup.cpp | |
parent | 8d7ba402ba062994e242c97719685d6d66a056dd (diff) | |
download | clang-fe95deaf66e4fbd82d44b5f6afa8162fa69cb85c.tar.gz |
Cleanups for DeclGroup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67922 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclGroup.cpp')
-rw-r--r-- | lib/AST/DeclGroup.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/AST/DeclGroup.cpp b/lib/AST/DeclGroup.cpp index 35cb6d3bc6..36a7c2b400 100644 --- a/lib/AST/DeclGroup.cpp +++ b/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()); } } |