13 #ifndef LLVM_CLANG_AST_DECLGROUP_H 14 #define LLVM_CLANG_AST_DECLGROUP_H 16 #include "llvm/Support/TrailingObjects.h" 27 unsigned NumDecls = 0;
38 unsigned size()
const {
return NumDecls; }
41 assert (i < NumDecls &&
"Out-of-bounds access.");
42 return getTrailingObjects<Decl *>()[i];
46 assert (i < NumDecls &&
"Out-of-bounds access.");
47 return getTrailingObjects<Decl *>()[i];
54 enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };
59 return (Kind) (
reinterpret_cast<uintptr_t>(D) & Mask);
66 : D((
Decl*) (reinterpret_cast<
uintptr_t>(dg) | DeclGroupKind)) {}
79 bool isNull()
const {
return D ==
nullptr; }
84 assert(isSingleDecl() &&
"Isn't a single decl");
92 assert(isDeclGroup() &&
"Isn't a declgroup");
93 return *((
DeclGroup*)(reinterpret_cast<uintptr_t>(D) & ~Mask));
101 return D ? &D :
nullptr;
102 return &getDeclGroup()[0];
107 return D ? &D+1 :
nullptr;
109 return &G[0] + G.
size();
114 return D ? &D :
nullptr;
115 return &getDeclGroup()[0];
120 return D ? &D+1 :
nullptr;
122 return &G[0] + G.
size();
128 X.D =
static_cast<Decl*
>(Ptr);
138 template <
typename T>
150 enum { NumLowBitsAvailable = 0 };
155 #endif // LLVM_CLANG_AST_DECLGROUP_H
Specialize PointerLikeTypeTraits to allow LazyGenerationalUpdatePtr to be placed into a PointerUnion...
void * getAsOpaquePtr() const
DeclGroup & getDeclGroup()
Decl *const & operator[](unsigned i) const
Decl - This represents one declaration (or definition), e.g.
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
Decl *& operator[](unsigned i)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const_iterator begin() const
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
const Decl * getSingleDecl() const
const_iterator end() const
static void * getAsVoidPointer(clang::DeclGroupRef P)
static DeclGroupRef getFromOpaquePtr(void *Ptr)
DeclGroupRef(DeclGroup *dg)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Dataflow Directional Tag Classes.
bool isSingleDecl() const
const DeclGroup & getDeclGroup() const
static clang::DeclGroupRef getFromVoidPointer(void *P)
Decl *const * const_iterator
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
static Decl::Kind getKind(const Decl *D)