13#ifndef LLVM_CLANG_AST_DECLGROUP_H
14#define LLVM_CLANG_AST_DECLGROUP_H
16#include "llvm/Support/TrailingObjects.h"
25class DeclGroup final :
private llvm::TrailingObjects<DeclGroup, Decl *> {
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 };
58 Kind getKind()
const {
59 return (Kind) (
reinterpret_cast<uintptr_t>(
D) & Mask);
79 bool isNull()
const {
return D ==
nullptr; }
81 bool isDeclGroup()
const {
return getKind() == DeclGroupKind; }
101 return D ? &
D :
nullptr;
107 return D ? &
D+1 :
nullptr;
109 return &G[0] + G.
size();
114 return D ? &
D :
nullptr;
120 return D ? &
D+1 :
nullptr;
122 return &G[0] + G.
size();
128 X.D =
static_cast<Decl*
>(Ptr);
138 template <
typename T>
143 return P.getAsOpaquePtr();
150 static constexpr int NumLowBitsAvailable = 0;
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
static DeclGroupRef getFromOpaquePtr(void *Ptr)
DeclGroupRef(DeclGroup *dg)
const Decl * getSingleDecl() const
Decl *const * const_iterator
const DeclGroup & getDeclGroup() const
static DeclGroupRef Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
const_iterator end() const
const_iterator begin() const
DeclGroup & getDeclGroup()
void * getAsOpaquePtr() const
bool isSingleDecl() const
static DeclGroup * Create(ASTContext &C, Decl **Decls, unsigned NumDecls)
Decl *const & operator[](unsigned i) const
Decl *& operator[](unsigned i)
Decl - This represents one declaration (or definition), e.g.
@ Decl
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
Diagnostic wrappers for TextAPI types for error reporting.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static clang::DeclGroupRef getFromVoidPointer(void *P)
static void * getAsVoidPointer(clang::DeclGroupRef P)