18 using namespace clang;
20 void FriendDecl::anchor() { }
22 FriendDecl *FriendDecl::getNextFriendSlowCase() {
23 return cast_or_null<FriendDecl>(
24 NextFriend.
get(getASTContext().getExternalSource()));
35 assert(isa<FunctionDecl>(D) ||
36 isa<CXXRecordDecl>(D) ||
37 isa<FunctionTemplateDecl>(D) ||
38 isa<ClassTemplateDecl>(D));
42 assert(D->getFriendObjectKind() ||
45 assert(FriendTypeTPLists.size() == 0);
50 FriendDecl::additionalSizeToAlloc<TemplateParameterList *>(
51 FriendTypeTPLists.size());
54 cast<CXXRecordDecl>(DC)->pushFriendDecl(FD);
59 unsigned FriendTypeNumTPLists) {
61 additionalSizeToAlloc<TemplateParameterList *>(FriendTypeNumTPLists);
62 return new (
C,
ID, Extra)
FriendDecl(EmptyShell(), FriendTypeNumTPLists);
65 FriendDecl *CXXRecordDecl::getFirstFriend()
const {
67 Decl *
First = data().FirstFriend.get(Source);
68 return First ? cast<FriendDecl>(
First) :
nullptr;
Defines the clang::ASTContext interface.
__SIZE_TYPE__ size_t
The unsigned integer type of the result of the sizeof operator.
static TemplateSpecializationKind getTemplateSpecializationKind(Decl *D)
Determine what kind of template specialization the given declaration is.
Defines the C++ template declaration subclasses.
static FriendDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned FriendTypeNumTPLists)
static FriendDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, FriendUnion Friend_, SourceLocation FriendL, ArrayRef< TemplateParameterList * > FriendTypeTPLists=None)
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::PointerUnion< NamedDecl *, TypeSourceInfo * > FriendUnion
ASTContext & getParentASTContext() const
Abstract interface for external sources of AST nodes.
Encodes a location in the source.
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
NamedDecl - This represents a decl with a name.