22 #include "llvm/Support/Casting.h" 26 using namespace clang;
28 void FriendDecl::anchor() {}
30 FriendDecl *FriendDecl::getNextFriendSlowCase() {
31 return cast_or_null<FriendDecl>(
43 assert(isa<FunctionDecl>(D) ||
44 isa<CXXRecordDecl>(D) ||
45 isa<FunctionTemplateDecl>(D) ||
46 isa<ClassTemplateDecl>(D));
53 assert(FriendTypeTPLists.empty());
58 FriendDecl::additionalSizeToAlloc<TemplateParameterList *>(
59 FriendTypeTPLists.size());
62 cast<CXXRecordDecl>(DC)->pushFriendDecl(FD);
67 unsigned FriendTypeNumTPLists) {
69 additionalSizeToAlloc<TemplateParameterList *>(FriendTypeNumTPLists);
73 FriendDecl *CXXRecordDecl::getFirstFriend()
const {
75 Decl *First = data().FirstFriend.get(Source);
76 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.
Decl - This represents one declaration (or definition), e.g.
Defines the C++ template declaration subclasses.
static FriendDecl * CreateDeserialized(ASTContext &C, unsigned ID, unsigned FriendTypeNumTPLists)
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
llvm::PointerUnion< NamedDecl *, TypeSourceInfo * > FriendUnion
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
A placeholder type used to construct an empty shell of a decl-derived type that will be filled in lat...
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so...
Abstract interface for external sources of AST nodes.
static FriendDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, FriendUnion Friend_, SourceLocation FriendL, ArrayRef< TemplateParameterList *> FriendTypeTPLists=None)
Encodes a location in the source.
ASTContext & getASTContext() const LLVM_READONLY
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
NamedDecl - This represents a decl with a name.