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; }
43 return getTrailingObjects(NumDecls)[i];
50 enum Kind { SingleDeclKind=0x0, DeclGroupKind=0x1, Mask=0x1 };
54 Kind getKind()
const {
55 return (Kind) (
reinterpret_cast<uintptr_t>(
D) & Mask);
75 bool isNull()
const {
return D ==
nullptr; }
77 bool isDeclGroup()
const {
return getKind() == DeclGroupKind; }
97 return D ? &
D :
nullptr;
103 return D ? &
D+1 :
nullptr;
105 return &G[0] + G.
size();
110 return D ? &
D :
nullptr;
116 return D ? &
D+1 :
nullptr;
118 return &G[0] + G.
size();
124 X.D =
static_cast<Decl*
>(Ptr);
134 template <
typename T>
139 return P.getAsOpaquePtr();
146 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.
std::variant< struct RequiresDecl, struct HeaderDecl, struct UmbrellaDirDecl, struct ModuleDecl, struct ExcludeDecl, struct ExportDecl, struct ExportAsDecl, struct ExternModuleDecl, struct UseDecl, struct LinkDecl, struct ConfigMacrosDecl, struct ConflictDecl > Decl
All declarations that can appear in a module declaration.
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)