class ObjCProtocolDecl
Declaration
class ObjCProtocolDecl : public ObjCContainerDecl, public Redeclarable { /* full declaration omitted */ };
Description
Represents an Objective-C protocol declaration. Objective-C protocols declare a pure abstract type (i.e., no instance variables are permitted). Protocols originally drew inspiration from C++ pure virtual functions (a C++ feature with nice semantics and lousy syntax:-). Here is an example: This says that NSDraggingInfo requires two methods and requires everything that the two "referenced protocols" 'refproto1' and 'refproto2' require as well. ObjC protocols inspired Java interfaces. Unlike Java, ObjC classes and protocols are in distinct namespaces. For example, Cocoa defines both an NSObject protocol and class (which isn't allowed in Java). As a result, protocols are referenced using angle brackets as follows: id < NSDraggingInfo> anyObjectThatImplementsNSDraggingInfo;
Declared at: clang/include/clang/AST/DeclObjC.h:2052
Inherits from: ObjCContainerDecl, Redeclarable
Member Variables
- private llvm::PointerIntPair<DefinitionData*, 1, bool> Data
- The bit indicates when we don't need to check for out-of-date declarations. It will be set unless modules are enabled.
Inherited from DeclContext:
- protected
- protected FirstDecl = nullptr
- protected LastDecl = nullptr
Inherited from Decl:
- protected NextInContextAndBits
- protected Access
- protected FromASTFile
- protected IdentifierNamespace
- protected CacheValidAndLinkage
Method Overview
- public static clang::ObjCProtocolDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::IdentifierInfo * Id, clang::SourceLocation nameLoc, clang::SourceLocation atStartLoc, clang::ObjCProtocolDecl * PrevDecl)
- public static clang::ObjCProtocolDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
- private ObjCProtocolDecl(clang::ASTContext & C, clang::DeclContext * DC, clang::IdentifierInfo * Id, clang::SourceLocation nameLoc, clang::SourceLocation atStartLoc, clang::ObjCProtocolDecl * PrevDecl)
- private void allocateDefinitionData()
- private void anchor()
- public static bool classof(const clang::Decl * D)
- public static bool classofKind(clang::Decl::Kind K)
- public void collectInheritedProtocolProperties(const clang::ObjCPropertyDecl * Property, clang::ObjCContainerDecl::ProtocolPropertySet & PS, clang::ObjCContainerDecl::PropertyDeclOrder & PO) const
- public void collectPropertiesToImplement(clang::ObjCContainerDecl::PropertyMap & PM, clang::ObjCContainerDecl::PropertyDeclOrder & PO) const
- private clang::ObjCProtocolDecl::DefinitionData & data() const
- public const clang::ObjCProtocolDecl * getCanonicalDecl() const
- public clang::ObjCProtocolDecl * getCanonicalDecl()
- public const clang::ObjCProtocolDecl * getDefinition() const
- public clang::ObjCProtocolDecl * getDefinition()
- public void getImpliedProtocols(llvm::DenseSet<const ObjCProtocolDecl *> & IPs) const
- private clang::ObjCProtocolDecl * getMostRecentDeclImpl()
- private clang::ObjCProtocolDecl * getNextRedeclarationImpl()
- public llvm::StringRef getObjCRuntimeNameAsString() const
- private clang::ObjCProtocolDecl * getPreviousDeclImpl()
- public const clang::ObjCProtocolList & getReferencedProtocols() const
- public clang::SourceRange getSourceRange() const
- public bool hasDefinition() const
- public bool isNonRuntimeProtocol() const
- public bool isThisDeclarationADefinition() const
- public clang::ObjCMethodDecl * lookupClassMethod(clang::Selector Sel) const
- public clang::ObjCMethodDecl * lookupInstanceMethod(clang::Selector Sel) const
- public clang::ObjCMethodDecl * lookupMethod(clang::Selector Sel, bool isInstance) const
- public clang::ObjCProtocolDecl * lookupProtocolNamed(clang::IdentifierInfo * PName)
- public clang::ObjCProtocolDecl::protocol_iterator protocol_begin() const
- public clang::ObjCProtocolDecl::protocol_iterator protocol_end() const
- public clang::ObjCProtocolDecl::protocol_loc_iterator protocol_loc_begin() const
- public clang::ObjCProtocolDecl::protocol_loc_iterator protocol_loc_end() const
- public clang::ObjCProtocolDecl::protocol_loc_range protocol_locs() const
- public unsigned int protocol_size() const
- public clang::ObjCProtocolDecl::protocol_range protocols() const
- public void setProtocolList(clang::ObjCProtocolDecl *const * List, unsigned int Num, const clang::SourceLocation * Locs, clang::ASTContext & C)
- public void startDefinition()
Inherited from ObjCContainerDecl:
- public FindPropertyDeclaration
- public HasUserDeclaredSetterMethod
- public castFromDeclContext
- public castToDeclContext
- public class_methods
- public class_properties
- public classmeth_begin
- public classmeth_end
- public classof
- public classofKind
- public classprop_begin
- public classprop_end
- public collectPropertiesToImplement
- public getAtEndRange
- public getAtStartLoc
- public getClassMethod
- public getInstanceMethod
- public getIvarDecl
- public getMethod
- public getProperty
- public getSourceRange
- public instance_methods
- public instance_properties
- public instmeth_begin
- public instmeth_end
- public instprop_begin
- public instprop_end
- public meth_begin
- public meth_end
- public methods
- public prop_begin
- public prop_end
- public properties
- public setAtEndRange
- public setAtStartLoc
Inherited from DeclContext:
- protected BuildDeclChain
- public Encloses
- public Equals
- public InEnclosingNamespaceSetOf
- public addDecl
- public addDeclInternal
- public addHiddenDecl
- public buildLookup
- public classof
- public classof
- public collectAllContexts
- public containsDecl
- public containsDeclAndLoad
- public ddiags
- public decls
- public decls_begin
- public decls_empty
- public decls_end
- public dumpDeclContext
- public dumpLookups
- public dumpLookups
- public getDeclKind
- public getDeclKindName
- public getEnclosingNamespaceContext
- public getEnclosingNamespaceContext
- public getExternCContext
- public getInnermostBlockDecl
- public getLexicalParent
- public getLexicalParent
- public getLookupParent
- public getLookupParent
- public getLookupPtr
- public getNonClosureAncestor
- public getNonClosureAncestor
- public getNonTransparentContext
- public getNonTransparentContext
- public getOuterLexicalRecordContext
- public getOuterLexicalRecordContext
- public getParent
- public getParent
- public getParentASTContext
- public getPrimaryContext
- public getPrimaryContext
- public getRedeclContext
- public getRedeclContext
- public hasExternalLexicalStorage
- public hasExternalVisibleStorage
- public isClosure
- public isDeclInLexicalTraversal
- public isDependentContext
- public isExternCContext
- public isExternCXXContext
- public isFileContext
- public isFunctionOrMethod
- public isInlineNamespace
- public isLookupContext
- public isNamespace
- public isObjCContainer
- public isRecord
- public isStdNamespace
- public isTranslationUnit
- public isTransparentContext
- public localUncachedLookup
- public lookup
- public lookups
- public lookups_begin
- public lookups_end
- public makeDeclVisibleInContext
- public noload_decls
- public noload_decls_begin
- public noload_decls_end
- public noload_lookup
- public noload_lookups
- public noload_lookups_begin
- public noload_lookups_end
- public removeDecl
- public setHasExternalLexicalStorage
- public setHasExternalVisibleStorage
- public setMustBuildLookupTable
- public setUseQualifiedLookup
- public shouldUseQualifiedLookup
- public using_directives
Inherited from NamedDecl:
- public classof
- public classofKind
- public declarationReplaces
- public getDeclName
- public getExplicitVisibility
- public getFormalLinkage
- public getIdentifier
- public getLinkageAndVisibility
- public getLinkageInternal
- public getMostRecentDecl
- public getMostRecentDecl
- public getName
- public getNameAsString
- public getNameForDiagnostic
- public getObjCFStringFormattingFamily
- public getQualifiedNameAsString
- public getUnderlyingDecl
- public getUnderlyingDecl
- public getVisibility
- public hasExternalFormalLinkage
- public hasLinkage
- public hasLinkageBeenComputed
- public isCXXClassMember
- public isCXXInstanceMember
- public isExternallyDeclarable
- public isExternallyVisible
- public isLinkageValid
- public isReserved
- public printName
- public printNestedNameSpecifier
- public printNestedNameSpecifier
- public printQualifiedName
- public printQualifiedName
- public setDeclName
Inherited from Decl:
- public EnableStatistics
- public PrintStats
- public add
- public addAttr
- public attr_begin
- public attr_end
- public attrs
- public canBeWeakImported
- public castFromDeclContext
- public castToDeclContext
- public classofKind
- public dropAttr
- public dropAttrs
- public dump
- public dump
- public dumpColor
- public getASTContext
- protected getASTMutationListener
- public getAccess
- public getAccessUnsafe
- public getAsFunction
- public getAsFunction
- public getAttr
- public getAttrs
- public getAttrs
- public getAvailability
- public getBeginLoc
- public getBody
- public getBodyRBrace
- protected getCachedLinkage
- public getCanonicalDecl
- public getCanonicalDecl
- public getDeclContext
- public getDeclContext
- public getDeclKindName
- public getDefiningAttr
- public getDescribedTemplate
- public getDescribedTemplateParams
- public getEndLoc
- public getExternalSourceSymbolAttr
- public getFriendObjectKind
- public getFunctionType
- public getGlobalID
- public getID
- public getIdentifierNamespace
- public getIdentifierNamespaceForKind
- public getImportedOwningModule
- public getKind
- public getLangOpts
- public getLexicalDeclContext
- public getLexicalDeclContext
- public getLocalOwningModule
- public getLocation
- public getMaxAlignment
- public getModuleOwnershipKind
- public getMostRecentDecl
- public getMostRecentDecl
- protected getMostRecentDeclImpl
- public getNextDeclInContext
- public getNextDeclInContext
- protected getNextRedeclarationImpl
- public getNonClosureContext
- public getNonClosureContext
- public getOwningModule
- public getOwningModuleForLinkage
- public getOwningModuleID
- public getParentFunctionOrMethod
- public getParentFunctionOrMethod
- public getPreviousDecl
- public getPreviousDecl
- protected getPreviousDeclImpl
- public getSourceRange
- public getTemplateDepth
- public getTranslationUnitDecl
- public getTranslationUnitDecl
- public getVersionIntroduced
- public hasAttr
- public hasAttrs
- public hasBody
- protected hasCachedLinkage
- public hasDefiningAttr
- protected hasLocalOwningModuleStorage
- public hasOwningModule
- public hasTagIdentifierNamespace
- public isCanonicalDecl
- public isDefinedOutsideFunctionOrMethod
- public isDeprecated
- public isDiscardedInGlobalModuleFragment
- public isFirstDecl
- public isFromASTFile
- public isFunctionOrFunctionTemplate
- public isImplicit
- public isInAnonymousNamespace
- public isInExportDeclContext
- public isInIdentifierNamespace
- public isInLocalScopeForInstantiation
- public isInStdNamespace
- public isInvalidDecl
- public isInvisibleOutsideTheOwningModule
- public isLocalExternDecl
- public isModulePrivate
- public isOutOfLine
- public isParameterPack
- public isReachable
- public isReferenced
- public isTagIdentifierNamespace
- public isTemplateDecl
- public isTemplateParameter
- public isTemplateParameterPack
- public isTemplated
- public isThisDeclarationReferenced
- public isTopLevelDeclInObjCContainer
- public isUnavailable
- public isUnconditionallyVisible
- public isUsed
- public isWeakImported
- public markUsed
- public print
- public print
- public printGroup
- public redecls
- public redecls_begin
- public redecls_end
- public setAccess
- public setAttrs
- protected setCachedLinkage
- public setDeclContext
- public setFromASTFile
- public setImplicit
- public setInvalidDecl
- public setIsUsed
- public setLexicalDeclContext
- public setLocalExternDecl
- public setLocalOwningModule
- public setLocation
- public setModuleOwnershipKind
- protected setModulePrivate
- public setNonMemberOperator
- public setObjectOfFriendDecl
- public setOwningModuleID
- public setReferenced
- public setTopLevelDeclInObjCContainer
- public setVisibleDespiteOwningModule
- public specific_attr_begin
- public specific_attr_end
- public specific_attrs
- protected updateOutOfDate
Methods
¶static clang::ObjCProtocolDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::IdentifierInfo* Id,
clang::SourceLocation nameLoc,
clang::SourceLocation atStartLoc,
clang::ObjCProtocolDecl* PrevDecl)
static clang::ObjCProtocolDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::IdentifierInfo* Id,
clang::SourceLocation nameLoc,
clang::SourceLocation atStartLoc,
clang::ObjCProtocolDecl* PrevDecl)
Declared at: clang/include/clang/AST/DeclObjC.h:2101
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::IdentifierInfo* Id
- clang::SourceLocation nameLoc
- clang::SourceLocation atStartLoc
- clang::ObjCProtocolDecl* PrevDecl
¶static clang::ObjCProtocolDecl*
CreateDeserialized(clang::ASTContext& C,
unsigned int ID)
static clang::ObjCProtocolDecl*
CreateDeserialized(clang::ASTContext& C,
unsigned int ID)
Declared at: clang/include/clang/AST/DeclObjC.h:2107
Parameters
- clang::ASTContext& C
- unsigned int ID
¶ObjCProtocolDecl(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::IdentifierInfo* Id,
clang::SourceLocation nameLoc,
clang::SourceLocation atStartLoc,
clang::ObjCProtocolDecl* PrevDecl)
ObjCProtocolDecl(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::IdentifierInfo* Id,
clang::SourceLocation nameLoc,
clang::SourceLocation atStartLoc,
clang::ObjCProtocolDecl* PrevDecl)
Declared at: clang/include/clang/AST/DeclObjC.h:2069
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::IdentifierInfo* Id
- clang::SourceLocation nameLoc
- clang::SourceLocation atStartLoc
- clang::ObjCProtocolDecl* PrevDecl
¶void allocateDefinitionData()
void allocateDefinitionData()
Declared at: clang/include/clang/AST/DeclObjC.h:2080
¶void anchor()
void anchor()
Declared at: clang/include/clang/AST/DeclObjC.h:2073
¶static bool classof(const clang::Decl* D)
static bool classof(const clang::Decl* D)
Declared at: clang/include/clang/AST/DeclObjC.h:2256
Parameters
- const clang::Decl* D
¶static bool classofKind(clang::Decl::Kind K)
static bool classofKind(clang::Decl::Kind K)
Declared at: clang/include/clang/AST/DeclObjC.h:2257
Parameters
- clang::Decl::Kind K
¶void collectInheritedProtocolProperties(
const clang::ObjCPropertyDecl* Property,
clang::ObjCContainerDecl::ProtocolPropertySet&
PS,
clang::ObjCContainerDecl::PropertyDeclOrder&
PO) const
void collectInheritedProtocolProperties(
const clang::ObjCPropertyDecl* Property,
clang::ObjCContainerDecl::ProtocolPropertySet&
PS,
clang::ObjCContainerDecl::PropertyDeclOrder&
PO) const
Declared at: clang/include/clang/AST/DeclObjC.h:2252
Parameters
- const clang::ObjCPropertyDecl* Property
- clang::ObjCContainerDecl::ProtocolPropertySet& PS
- clang::ObjCContainerDecl::PropertyDeclOrder& PO
¶void collectPropertiesToImplement(
clang::ObjCContainerDecl::PropertyMap& PM,
clang::ObjCContainerDecl::PropertyDeclOrder&
PO) const
void collectPropertiesToImplement(
clang::ObjCContainerDecl::PropertyMap& PM,
clang::ObjCContainerDecl::PropertyDeclOrder&
PO) const
Description
This routine collects list of properties to be implemented in the class. This includes, class's and its conforming protocols' properties. Note, the superclass's properties are not included in the list.
Declared at: clang/include/clang/AST/DeclObjC.h:2249
Parameters
¶clang::ObjCProtocolDecl::DefinitionData& data()
const
clang::ObjCProtocolDecl::DefinitionData& data()
const
Declared at: clang/include/clang/AST/DeclObjC.h:2075
¶const clang::ObjCProtocolDecl* getCanonicalDecl()
const
const clang::ObjCProtocolDecl* getCanonicalDecl()
const
Declared at: clang/include/clang/AST/DeclObjC.h:2247
¶clang::ObjCProtocolDecl* getCanonicalDecl()
clang::ObjCProtocolDecl* getCanonicalDecl()
Description
Retrieves the canonical declaration of this Objective-C protocol.
Declared at: clang/include/clang/AST/DeclObjC.h:2246
¶const clang::ObjCProtocolDecl* getDefinition()
const
const clang::ObjCProtocolDecl* getDefinition()
const
Description
Retrieve the definition of this protocol, if any.
Declared at: clang/include/clang/AST/DeclObjC.h:2211
¶clang::ObjCProtocolDecl* getDefinition()
clang::ObjCProtocolDecl* getDefinition()
Description
Retrieve the definition of this protocol, if any.
Declared at: clang/include/clang/AST/DeclObjC.h:2206
¶void getImpliedProtocols(
llvm::DenseSet<const ObjCProtocolDecl*>& IPs)
const
void getImpliedProtocols(
llvm::DenseSet<const ObjCProtocolDecl*>& IPs)
const
Description
Get the set of all protocols implied by this protocols inheritance hierarchy.
Declared at: clang/include/clang/AST/DeclObjC.h:2177
Parameters
- llvm::DenseSet<const ObjCProtocolDecl*>& IPs
¶clang::ObjCProtocolDecl* getMostRecentDeclImpl()
clang::ObjCProtocolDecl* getMostRecentDeclImpl()
Description
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.
Declared at: clang/include/clang/AST/DeclObjC.h:2092
¶clang::ObjCProtocolDecl*
getNextRedeclarationImpl()
clang::ObjCProtocolDecl*
getNextRedeclarationImpl()
Description
Returns the next redeclaration or itself if this is the only decl. Decl subclasses that can be redeclared should override this method so that Decl::redecl_iterator can iterate over them.
Declared at: clang/include/clang/AST/DeclObjC.h:2084
¶llvm::StringRef getObjCRuntimeNameAsString() const
llvm::StringRef getObjCRuntimeNameAsString() const
Description
Produce a name to be used for protocol's metadata. It comes either via objc_runtime_name attribute or protocol name.
Declared at: clang/include/clang/AST/DeclObjC.h:2226
¶clang::ObjCProtocolDecl* getPreviousDeclImpl()
clang::ObjCProtocolDecl* getPreviousDeclImpl()
Description
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Declared at: clang/include/clang/AST/DeclObjC.h:2088
¶const clang::ObjCProtocolList&
getReferencedProtocols() const
const clang::ObjCProtocolList&
getReferencedProtocols() const
Declared at: clang/include/clang/AST/DeclObjC.h:2109
¶clang::SourceRange getSourceRange() const
clang::SourceRange getSourceRange() const
Description
Source range that this declaration covers.
Declared at: clang/include/clang/AST/DeclObjC.h:2228
¶bool hasDefinition() const
bool hasDefinition() const
Description
Determine whether this protocol has a definition.
Declared at: clang/include/clang/AST/DeclObjC.h:2194
¶bool isNonRuntimeProtocol() const
bool isNonRuntimeProtocol() const
Description
This is true iff the protocol is tagged with the `objc_non_runtime_protocol` attribute.
Declared at: clang/include/clang/AST/DeclObjC.h:2173
¶bool isThisDeclarationADefinition() const
bool isThisDeclarationADefinition() const
Description
Determine whether this particular declaration is also the definition.
Declared at: clang/include/clang/AST/DeclObjC.h:2217
¶clang::ObjCMethodDecl* lookupClassMethod(
clang::Selector Sel) const
clang::ObjCMethodDecl* lookupClassMethod(
clang::Selector Sel) const
Declared at: clang/include/clang/AST/DeclObjC.h:2189
Parameters
- clang::Selector Sel
¶clang::ObjCMethodDecl* lookupInstanceMethod(
clang::Selector Sel) const
clang::ObjCMethodDecl* lookupInstanceMethod(
clang::Selector Sel) const
Declared at: clang/include/clang/AST/DeclObjC.h:2185
Parameters
- clang::Selector Sel
¶clang::ObjCMethodDecl* lookupMethod(
clang::Selector Sel,
bool isInstance) const
clang::ObjCMethodDecl* lookupMethod(
clang::Selector Sel,
bool isInstance) const
Declared at: clang/include/clang/AST/DeclObjC.h:2183
Parameters
- clang::Selector Sel
- bool isInstance
¶clang::ObjCProtocolDecl* lookupProtocolNamed(
clang::IdentifierInfo* PName)
clang::ObjCProtocolDecl* lookupProtocolNamed(
clang::IdentifierInfo* PName)
Declared at: clang/include/clang/AST/DeclObjC.h:2179
Parameters
- clang::IdentifierInfo* PName
¶clang::ObjCProtocolDecl::protocol_iterator
protocol_begin() const
clang::ObjCProtocolDecl::protocol_iterator
protocol_begin() const
Declared at: clang/include/clang/AST/DeclObjC.h:2121
¶clang::ObjCProtocolDecl::protocol_iterator
protocol_end() const
clang::ObjCProtocolDecl::protocol_iterator
protocol_end() const
Declared at: clang/include/clang/AST/DeclObjC.h:2128
¶clang::ObjCProtocolDecl::protocol_loc_iterator
protocol_loc_begin() const
clang::ObjCProtocolDecl::protocol_loc_iterator
protocol_loc_begin() const
Declared at: clang/include/clang/AST/DeclObjC.h:2142
¶clang::ObjCProtocolDecl::protocol_loc_iterator
protocol_loc_end() const
clang::ObjCProtocolDecl::protocol_loc_iterator
protocol_loc_end() const
Declared at: clang/include/clang/AST/DeclObjC.h:2149
¶clang::ObjCProtocolDecl::protocol_loc_range
protocol_locs() const
clang::ObjCProtocolDecl::protocol_loc_range
protocol_locs() const
Declared at: clang/include/clang/AST/DeclObjC.h:2138
¶unsigned int protocol_size() const
unsigned int protocol_size() const
Declared at: clang/include/clang/AST/DeclObjC.h:2156
¶clang::ObjCProtocolDecl::protocol_range
protocols() const
clang::ObjCProtocolDecl::protocol_range
protocols() const
Declared at: clang/include/clang/AST/DeclObjC.h:2117
¶void setProtocolList(
clang::ObjCProtocolDecl* const* List,
unsigned int Num,
const clang::SourceLocation* Locs,
clang::ASTContext& C)
void setProtocolList(
clang::ObjCProtocolDecl* const* List,
unsigned int Num,
const clang::SourceLocation* Locs,
clang::ASTContext& C)
Description
setProtocolList - Set the list of protocols that this interface implements.
Declared at: clang/include/clang/AST/DeclObjC.h:2165
Parameters
- clang::ObjCProtocolDecl* const* List
- unsigned int Num
- const clang::SourceLocation* Locs
- clang::ASTContext& C
¶void startDefinition()
void startDefinition()
Description
Starts the definition of this Objective-C protocol.
Declared at: clang/include/clang/AST/DeclObjC.h:2222