14 #ifndef LLVM_CLANG_AST_DECLGROUP_H 15 #define LLVM_CLANG_AST_DECLGROUP_H 17 #include "llvm/Support/TrailingObjects.h" 28 unsigned NumDecls = 0;
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];
55 enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };
60 return (Kind) (
reinterpret_cast<uintptr_t>(D) & Mask);
67 : D((
Decl*) (reinterpret_cast<
uintptr_t>(dg) | DeclGroupKind)) {}
80 bool isNull()
const {
return D ==
nullptr; }
85 assert(isSingleDecl() &&
"Isn't a single decl");
93 assert(isDeclGroup() &&
"Isn't a declgroup");
94 return *((
DeclGroup*)(reinterpret_cast<uintptr_t>(D) & ~Mask));
102 return D ? &D :
nullptr;
103 return &getDeclGroup()[0];
108 return D ? &D+1 :
nullptr;
110 return &G[0] + G.
size();
115 return D ? &D :
nullptr;
116 return &getDeclGroup()[0];
121 return D ? &D+1 :
nullptr;
123 return &G[0] + G.
size();
129 X.D =
static_cast<Decl*
>(Ptr);
139 template <
typename T>
151 enum { NumLowBitsAvailable = 0 };
156 #endif // LLVM_CLANG_AST_DECLGROUP_H
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
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
const Decl * getSingleDecl() 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_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)