14 #ifndef LLVM_CLANG_AST_DECLGROUP_H
15 #define LLVM_CLANG_AST_DECLGROUP_H
17 #include "llvm/Support/DataTypes.h"
18 #include "llvm/Support/TrailingObjects.h"
26 class DeclGroupIterator;
39 unsigned size()
const {
return NumDecls; }
42 assert (i < NumDecls &&
"Out-of-bounds access.");
43 return getTrailingObjects<Decl *>()[i];
47 assert (i < NumDecls &&
"Out-of-bounds access.");
48 return getTrailingObjects<Decl *>()[i];
57 enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };
60 Kind getKind()
const {
61 return (Kind) (
reinterpret_cast<uintptr_t>(D) & Mask);
69 : D((
Decl*) (reinterpret_cast<
uintptr_t>(dg) | DeclGroupKind)) {}
82 bool isNull()
const {
return D ==
nullptr; }
84 bool isDeclGroup()
const {
return getKind() == DeclGroupKind; }
96 return *((
DeclGroup*)(reinterpret_cast<uintptr_t>(D) & ~Mask));
104 return D ? &D :
nullptr;
110 return D ? &D+1 :
nullptr;
112 return &G[0] + G.
size();
117 return D ? &D :
nullptr;
123 return D ? &D+1 :
nullptr;
125 return &G[0] + G.
size();
131 X.D =
static_cast<Decl*
>(Ptr);
140 template <
typename T>
151 enum { NumLowBitsAvailable = 0 };
DeclGroup & getDeclGroup()
const_iterator begin() const
Decl *& operator[](unsigned i)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const DeclGroup & getDeclGroup() const
Decl *const & operator[](unsigned i) const
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static DeclGroupRef getFromOpaquePtr(void *Ptr)
DeclGroupRef(DeclGroup *dg)
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
void * getAsOpaquePtr() const
static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
const_iterator end() const
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
Decl *const * const_iterator
static void * getAsVoidPointer(clang::DeclGroupRef P)
static clang::DeclGroupRef getFromVoidPointer(void *P)
const Decl * getSingleDecl() const
bool isSingleDecl() const