clang 20.0.0git
|
Represents an ObjC class declaration. More...
#include "clang/AST/DeclObjC.h"
Classes | |
class | filtered_category_iterator |
Iterator that walks over the list of categories, filtering out those that do not meet specific criteria. More... | |
Public Member Functions | |
ObjCTypeParamList * | getTypeParamList () const |
Retrieve the type parameters of this class. | |
void | setTypeParamList (ObjCTypeParamList *TPL) |
Set the type parameters of this class. | |
ObjCTypeParamList * | getTypeParamListAsWritten () const |
Retrieve the type parameters written on this particular declaration of the class. | |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
void | setExternallyCompleted () |
Indicate that this Objective-C class is complete, but that the external AST source will be responsible for filling in its contents when a complete class is required. | |
void | setHasDesignatedInitializers () |
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_initializer' attribute. | |
bool | hasDesignatedInitializers () const |
Returns true if this interface decl contains at least one initializer marked with the 'objc_designated_initializer' attribute. | |
bool | declaresOrInheritsDesignatedInitializers () const |
Returns true if this interface decl declares a designated initializer or it inherites one from its super class. | |
const ObjCProtocolList & | getReferencedProtocols () const |
ObjCImplementationDecl * | getImplementation () const |
void | setImplementation (ObjCImplementationDecl *ImplD) |
ObjCCategoryDecl * | FindCategoryDeclaration (const IdentifierInfo *CategoryId) const |
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and returns it. | |
ObjCMethodDecl * | getCategoryInstanceMethod (Selector Sel) const |
ObjCMethodDecl * | getCategoryClassMethod (Selector Sel) const |
ObjCMethodDecl * | getCategoryMethod (Selector Sel, bool isInstance) const |
protocol_range | protocols () const |
protocol_iterator | protocol_begin () const |
protocol_iterator | protocol_end () const |
protocol_loc_range | protocol_locs () const |
protocol_loc_iterator | protocol_loc_begin () const |
protocol_loc_iterator | protocol_loc_end () const |
all_protocol_range | all_referenced_protocols () const |
all_protocol_iterator | all_referenced_protocol_begin () const |
all_protocol_iterator | all_referenced_protocol_end () const |
ivar_range | ivars () const |
ivar_iterator | ivar_begin () const |
ivar_iterator | ivar_end () const |
unsigned | ivar_size () const |
bool | ivar_empty () const |
ObjCIvarDecl * | all_declared_ivar_begin () |
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementation. | |
const ObjCIvarDecl * | all_declared_ivar_begin () const |
void | setIvarList (ObjCIvarDecl *ivar) |
void | setProtocolList (ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C) |
setProtocolList - Set the list of protocols that this interface implements. | |
void | mergeClassExtensionProtocolList (ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C) |
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for this class. | |
StringRef | getObjCRuntimeNameAsString () const |
Produce a name to be used for class's metadata. | |
void | getDesignatedInitializers (llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const |
Returns the designated initializers for the interface. | |
bool | isDesignatedInitializer (Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const |
Returns true if the given selector is a designated initializer for the interface. | |
bool | isThisDeclarationADefinition () const |
Determine whether this particular declaration of this class is actually also a definition. | |
bool | hasDefinition () const |
Determine whether this class has been defined. | |
ObjCInterfaceDecl * | getDefinition () |
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) but not yet defined (with @interface). | |
const ObjCInterfaceDecl * | getDefinition () const |
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) but not yet defined (with @interface). | |
void | startDefinition () |
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a definition (@interface). | |
void | startDuplicateDefinitionForComparison () |
Starts the definition without sharing it with other redeclarations. | |
void | mergeDuplicateDefinitionWithCommon (const ObjCInterfaceDecl *Definition) |
const ObjCObjectType * | getSuperClassType () const |
Retrieve the superclass type. | |
TypeSourceInfo * | getSuperClassTInfo () const |
ObjCInterfaceDecl * | getSuperClass () const |
void | setSuperClass (TypeSourceInfo *superClass) |
visible_categories_range | visible_categories () const |
visible_categories_iterator | visible_categories_begin () const |
Retrieve an iterator to the beginning of the visible-categories list. | |
visible_categories_iterator | visible_categories_end () const |
Retrieve an iterator to the end of the visible-categories list. | |
bool | visible_categories_empty () const |
Determine whether the visible-categories list is empty. | |
known_categories_range | known_categories () const |
known_categories_iterator | known_categories_begin () const |
Retrieve an iterator to the beginning of the known-categories list. | |
known_categories_iterator | known_categories_end () const |
Retrieve an iterator to the end of the known-categories list. | |
bool | known_categories_empty () const |
Determine whether the known-categories list is empty. | |
visible_extensions_range | visible_extensions () const |
visible_extensions_iterator | visible_extensions_begin () const |
Retrieve an iterator to the beginning of the visible-extensions list. | |
visible_extensions_iterator | visible_extensions_end () const |
Retrieve an iterator to the end of the visible-extensions list. | |
bool | visible_extensions_empty () const |
Determine whether the visible-extensions list is empty. | |
known_extensions_range | known_extensions () const |
known_extensions_iterator | known_extensions_begin () const |
Retrieve an iterator to the beginning of the known-extensions list. | |
known_extensions_iterator | known_extensions_end () const |
Retrieve an iterator to the end of the known-extensions list. | |
bool | known_extensions_empty () const |
Determine whether the known-extensions list is empty. | |
ObjCCategoryDecl * | getCategoryListRaw () const |
Retrieve the raw pointer to the start of the category/extension list. | |
void | setCategoryListRaw (ObjCCategoryDecl *category) |
Set the raw pointer to the start of the category/extension list. | |
ObjCPropertyDecl * | FindPropertyVisibleInPrimaryClass (const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const |
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the primary class; including those in protocols (direct or indirect) used by the primary class. | |
void | collectPropertiesToImplement (PropertyMap &PM) const override |
This routine collects list of properties to be implemented in the class. | |
bool | isSuperClassOf (const ObjCInterfaceDecl *I) const |
isSuperClassOf - Return true if this class is the specified class or is a super class of the specified interface class. | |
bool | isArcWeakrefUnavailable () const |
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __weak references. | |
const ObjCInterfaceDecl * | isObjCRequiresPropertyDefs () const |
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthesized. | |
ObjCIvarDecl * | lookupInstanceVariable (IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared) |
ObjCIvarDecl * | lookupInstanceVariable (IdentifierInfo *IVarName) |
ObjCProtocolDecl * | lookupNestedProtocol (IdentifierInfo *Name) |
ObjCMethodDecl * | lookupMethod (Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const |
lookupMethod - This method returns an instance/class method by looking in the class, its categories, and its super classes (using a linear search). | |
ObjCMethodDecl * | lookupInstanceMethod (Selector Sel) const |
Lookup an instance method for a given selector. | |
ObjCMethodDecl * | lookupClassMethod (Selector Sel) const |
Lookup a class method for a given selector. | |
ObjCInterfaceDecl * | lookupInheritedClass (const IdentifierInfo *ICName) |
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passed as argument. | |
ObjCMethodDecl * | lookupPrivateMethod (const Selector &Sel, bool Instance=true) const |
Lookup a method in the classes implementation hierarchy. | |
ObjCMethodDecl * | lookupPrivateClassMethod (const Selector &Sel) |
ObjCMethodDecl * | lookupPropertyAccessor (const Selector Sel, const ObjCCategoryDecl *Cat, bool IsClassProperty) const |
Lookup a setter or getter in the class hierarchy, including in all categories except for category passed as argument. | |
SourceLocation | getEndOfDefinitionLoc () const |
void | setEndOfDefinitionLoc (SourceLocation LE) |
SourceLocation | getSuperClassLoc () const |
Retrieve the starting location of the superclass. | |
bool | isImplicitInterfaceDecl () const |
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node. | |
bool | ClassImplementsProtocol (ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false) |
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class, its super class or categories (if lookupCategory is true). | |
ObjCInterfaceDecl * | getCanonicalDecl () override |
Retrieves the canonical declaration of this Objective-C class. | |
const ObjCInterfaceDecl * | getCanonicalDecl () const |
const Type * | getTypeForDecl () const |
void | setTypeForDecl (const Type *TD) const |
unsigned | getODRHash () |
Get precomputed ODRHash or add a new one. | |
![]() | |
ObjCContainerDecl (Kind DK, DeclContext *DC, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc) | |
prop_range | properties () const |
prop_iterator | prop_begin () const |
prop_iterator | prop_end () const |
instprop_range | instance_properties () const |
instprop_iterator | instprop_begin () const |
instprop_iterator | instprop_end () const |
classprop_range | class_properties () const |
classprop_iterator | classprop_begin () const |
classprop_iterator | classprop_end () const |
method_range | methods () const |
method_iterator | meth_begin () const |
method_iterator | meth_end () const |
instmeth_range | instance_methods () const |
instmeth_iterator | instmeth_begin () const |
instmeth_iterator | instmeth_end () const |
classmeth_range | class_methods () const |
classmeth_iterator | classmeth_begin () const |
classmeth_iterator | classmeth_end () const |
ObjCMethodDecl * | getMethod (Selector Sel, bool isInstance, bool AllowHidden=false) const |
ObjCMethodDecl * | getInstanceMethod (Selector Sel, bool AllowHidden=false) const |
ObjCMethodDecl * | getClassMethod (Selector Sel, bool AllowHidden=false) const |
bool | HasUserDeclaredSetterMethod (const ObjCPropertyDecl *P) const |
This routine returns 'true' if a user declared setter method was found in the class, its protocols, its super classes or categories. | |
ObjCIvarDecl * | getIvarDecl (IdentifierInfo *Id) const |
getIvarDecl - This method looks up an ivar in this ContextDecl. | |
ObjCPropertyDecl * | getProperty (const IdentifierInfo *Id, bool IsInstance) const |
ObjCPropertyDecl * | FindPropertyDeclaration (const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const |
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and returns it. | |
virtual void | collectPropertiesToImplement (PropertyMap &PM) const |
This routine collects list of properties to be implemented in the class. | |
SourceLocation | getAtStartLoc () const |
void | setAtStartLoc (SourceLocation Loc) |
SourceRange | getAtEndRange () const |
void | setAtEndRange (SourceRange atEnd) |
SourceRange | getSourceRange () const override LLVM_READONLY |
Source range that this declaration covers. | |
![]() | |
IdentifierInfo * | getIdentifier () const |
Get the identifier that names this declaration, if there is one. | |
StringRef | getName () const |
Get the name of identifier for this declaration as a StringRef. | |
std::string | getNameAsString () const |
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ constructor, Objective-C selector, etc). | |
virtual void | printName (raw_ostream &OS, const PrintingPolicy &Policy) const |
Pretty-print the unqualified name of this declaration. | |
void | printName (raw_ostream &OS) const |
Calls printName() with the ASTContext printing policy from the decl. | |
DeclarationName | getDeclName () const |
Get the actual, stored name of the declaration, which may be a special name. | |
void | setDeclName (DeclarationName N) |
Set the name of this declaration. | |
void | printQualifiedName (raw_ostream &OS) const |
Returns a human-readable qualified name for this declaration, like A::B::i, for i being member of namespace A::B. | |
void | printQualifiedName (raw_ostream &OS, const PrintingPolicy &Policy) const |
void | printNestedNameSpecifier (raw_ostream &OS) const |
Print only the nested name specifier part of a fully-qualified name, including the '::' at the end. | |
void | printNestedNameSpecifier (raw_ostream &OS, const PrintingPolicy &Policy) const |
std::string | getQualifiedNameAsString () const |
virtual void | getNameForDiagnostic (raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const |
Appends a human-readable name for this declaration into the given stream. | |
bool | declarationReplaces (const NamedDecl *OldD, bool IsKnownNewer=true) const |
Determine whether this declaration, if known to be well-formed within its context, will replace the declaration OldD if introduced into scope. | |
bool | hasLinkage () const |
Determine whether this declaration has linkage. | |
bool | isCXXClassMember () const |
Determine whether this declaration is a C++ class member. | |
bool | isCXXInstanceMember () const |
Determine whether the given declaration is an instance member of a C++ class. | |
ReservedIdentifierStatus | isReserved (const LangOptions &LangOpts) const |
Determine if the declaration obeys the reserved identifier rules of the given language. | |
Linkage | getLinkageInternal () const |
Determine what kind of linkage this entity has. | |
Linkage | getFormalLinkage () const |
Get the linkage from a semantic point of view. | |
bool | hasExternalFormalLinkage () const |
True if this decl has external linkage. | |
bool | isExternallyVisible () const |
bool | isExternallyDeclarable () const |
Determine whether this declaration can be redeclared in a different translation unit. | |
Visibility | getVisibility () const |
Determines the visibility of this entity. | |
LinkageInfo | getLinkageAndVisibility () const |
Determines the linkage and visibility of this entity. | |
std::optional< Visibility > | getExplicitVisibility (ExplicitVisibilityKind kind) const |
If visibility was explicitly specified for this declaration, return that visibility. | |
bool | isLinkageValid () const |
True if the computed linkage is valid. | |
bool | hasLinkageBeenComputed () const |
True if something has required us to compute the linkage of this declaration. | |
bool | isPlaceholderVar (const LangOptions &LangOpts) const |
NamedDecl * | getUnderlyingDecl () |
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl. | |
const NamedDecl * | getUnderlyingDecl () const |
NamedDecl * | getMostRecentDecl () |
const NamedDecl * | getMostRecentDecl () const |
ObjCStringFormatFamily | getObjCFStringFormattingFamily () const |
bool | isModulePrivate () const |
Whether this declaration was marked as being private to the module in which it was defined. | |
void | setModulePrivate () |
Specify that this declaration was marked as being private to the module in which it was defined. | |
![]() | |
Decl ()=delete | |
Decl (const Decl &)=delete | |
Decl (Decl &&)=delete | |
Decl & | operator= (const Decl &)=delete |
Decl & | operator= (Decl &&)=delete |
virtual SourceRange | getSourceRange () const LLVM_READONLY |
Source range that this declaration covers. | |
SourceLocation | getBeginLoc () const LLVM_READONLY |
SourceLocation | getEndLoc () const LLVM_READONLY |
SourceLocation | getLocation () const |
void | setLocation (SourceLocation L) |
Kind | getKind () const |
const char * | getDeclKindName () const |
Decl * | getNextDeclInContext () |
const Decl * | getNextDeclInContext () const |
DeclContext * | getDeclContext () |
const DeclContext * | getDeclContext () const |
DeclContext * | getNonTransparentDeclContext () |
Return the non transparent context. | |
const DeclContext * | getNonTransparentDeclContext () const |
Decl * | getNonClosureContext () |
Find the innermost non-closure ancestor of this declaration, walking up through blocks, lambdas, etc. | |
const Decl * | getNonClosureContext () const |
TranslationUnitDecl * | getTranslationUnitDecl () |
const TranslationUnitDecl * | getTranslationUnitDecl () const |
bool | isInAnonymousNamespace () const |
bool | isInStdNamespace () const |
bool | isFileContextDecl () const |
ASTContext & | getASTContext () const LLVM_READONLY |
const LangOptions & | getLangOpts () const LLVM_READONLY |
Helper to get the language options from the ASTContext. | |
void | setAccess (AccessSpecifier AS) |
AccessSpecifier | getAccess () const |
AccessSpecifier | getAccessUnsafe () const |
Retrieve the access specifier for this declaration, even though it may not yet have been properly set. | |
bool | hasAttrs () const |
void | setAttrs (const AttrVec &Attrs) |
AttrVec & | getAttrs () |
const AttrVec & | getAttrs () const |
void | dropAttrs () |
void | addAttr (Attr *A) |
attr_range | attrs () const |
attr_iterator | attr_begin () const |
attr_iterator | attr_end () const |
template<typename... Ts> | |
void | dropAttrs () |
template<typename T > | |
void | dropAttr () |
template<typename T > | |
llvm::iterator_range< specific_attr_iterator< T > > | specific_attrs () const |
template<typename T > | |
specific_attr_iterator< T > | specific_attr_begin () const |
template<typename T > | |
specific_attr_iterator< T > | specific_attr_end () const |
template<typename |