14#ifndef LLVM_CLANG_AST_DECLFRIEND_H
15#define LLVM_CLANG_AST_DECLFRIEND_H
21#include "llvm/ADT/PointerUnion.h"
22#include "llvm/Support/Casting.h"
23#include "llvm/Support/Compiler.h"
47 LLVM_DECLARE_VIRTUAL_ANCHOR_FUNCTION();
50 using FriendUnion = llvm::PointerUnion<NamedDecl *, TypeSourceInfo *>;
77 return cast_or_null<FriendDecl>(
NextFriend.get(
nullptr));
118 return K >= firstFriend && K <= lastFriend;
142 assert(Ptr &&
"attempt to increment past end of friend list");
143 Ptr = Ptr->getNextFriend();
148 friend_iterator tmp = *
this;
154 return Ptr ==
Other.Ptr;
158 return Ptr !=
Other.Ptr;
162 assert(N >= 0 &&
"cannot rewind a CXXRecordDecl::friend_iterator");
169 friend_iterator tmp = *
this;
188 assert(!FD->
NextFriend &&
"friend already has next friend?");
190 data().FirstFriend = FD;
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::TypeLoc interface and its subclasses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
An iterator over the friend declarations of a class.
std::forward_iterator_tag iterator_category
friend_iterator operator+(difference_type N) const
friend_iterator()=default
friend class CXXRecordDecl
bool operator!=(const friend_iterator &Other) const
friend_iterator operator++(int)
bool operator==(const friend_iterator &Other) const
friend_iterator & operator+=(difference_type N)
reference operator*() const
friend_iterator & operator++()
friend_range friends() const
friend_iterator friend_begin() const
llvm::iterator_range< friend_iterator > friend_range
void pushFriendDecl(FriendDecl *FD)
friend_iterator friend_end() const
Decl - This represents one declaration (or definition), e.g.
Kind
Lists the kind of concrete classes of Decl.
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
FriendDecl(Kind K, DeclContext *DC, SourceLocation L, FriendUnion Friend, SourceLocation FL, SourceLocation EllipsisLoc={})
llvm::PointerUnion< NamedDecl *, TypeSourceInfo * > FriendUnion
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static bool classofKind(Kind K)
static bool classof(const Decl *D)
SourceLocation getFriendLoc() const
friend class ASTDeclReader
friend class ASTNodeImporter
friend class CXXRecordDecl
SourceLocation getEllipsisLoc() const
Retrieves the location of the '...', if present.
FriendDecl * getNextFriendSlowCase()
virtual NamedDecl * getFriendDecl() const
If this friend declaration doesn't name a type, return the inner declaration.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
friend class ASTDeclWriter
bool isPackExpansion() const
FriendDecl * getNextFriend()
FriendDecl(Kind K, EmptyShell Empty)
static FriendDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
This represents a decl that may have a name.
Encodes a location in the source.
A trivial tuple used to represent a source range.
A container of type source information.
Top level wrappers for InstallAPI frontend operations.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
LazyOffsetPtr< Decl, GlobalDeclID, &ExternalASTSource::GetExternalDecl > LazyDeclPtr
A lazy pointer to a declaration.
@ Other
Other implicit parameter.
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...