diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-07 19:09:05 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-01-07 19:09:05 +0000 |
commit | 9bc6fb6317f9bc6aaaacd266b9ea36996ad338bb (patch) | |
tree | 0584c0206d04bbae3d25e8ce9401f0464b105a21 /include | |
parent | b6e5fe3cae9bf456f084c555c3ecc256f4181cc5 (diff) |
Pack UsingDecl more.
88 -> 80 bytes on x86_64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147736 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/DeclCXX.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/include/clang/AST/DeclCXX.h b/include/clang/AST/DeclCXX.h index 588b1993d9..17c82ca3ef 100644 --- a/include/clang/AST/DeclCXX.h +++ b/include/clang/AST/DeclCXX.h @@ -19,6 +19,7 @@ #include "clang/AST/Decl.h" #include "clang/AST/TypeLoc.h" #include "clang/AST/UnresolvedSet.h" +#include "llvm/ADT/PointerIntPair.h" #include "llvm/ADT/SmallPtrSet.h" namespace clang { @@ -2472,18 +2473,16 @@ class UsingDecl : public NamedDecl { DeclarationNameLoc DNLoc; /// \brief The first shadow declaration of the shadow decl chain associated - /// with this using declaration. - UsingShadowDecl *FirstUsingShadow; - - // \brief Has 'typename' keyword. - bool IsTypeName; + /// with this using declaration. The bool member of the pair store whether + /// this decl has the 'typename' keyword. + llvm::PointerIntPair<UsingShadowDecl *, 1, bool> FirstUsingShadow; UsingDecl(DeclContext *DC, SourceLocation UL, NestedNameSpecifierLoc QualifierLoc, const DeclarationNameInfo &NameInfo, bool IsTypeNameArg) : NamedDecl(Using, DC, NameInfo.getLoc(), NameInfo.getName()), UsingLocation(UL), QualifierLoc(QualifierLoc), - DNLoc(NameInfo.getInfo()), FirstUsingShadow(0),IsTypeName(IsTypeNameArg) { + DNLoc(NameInfo.getInfo()), FirstUsingShadow(0, IsTypeNameArg) { } public: @@ -2507,10 +2506,10 @@ public: } /// \brief Return true if the using declaration has 'typename'. - bool isTypeName() const { return IsTypeName; } + bool isTypeName() const { return FirstUsingShadow.getInt(); } /// \brief Sets whether the using declaration has 'typename'. - void setTypeName(bool TN) { IsTypeName = TN; } + void setTypeName(bool TN) { FirstUsingShadow.setInt(TN); } /// \brief Iterates through the using shadow declarations assosiated with /// this using declaration. @@ -2551,7 +2550,7 @@ public: }; shadow_iterator shadow_begin() const { - return shadow_iterator(FirstUsingShadow); + return shadow_iterator(FirstUsingShadow.getPointer()); } shadow_iterator shadow_end() const { return shadow_iterator(); } |