13#ifndef LLVM_CLANG_AST_DECLOBJC_H
14#define LLVM_CLANG_AST_DECLOBJC_H
27#include "llvm/ADT/ArrayRef.h"
28#include "llvm/ADT/DenseSet.h"
29#include "llvm/ADT/MapVector.h"
30#include "llvm/ADT/PointerIntPair.h"
31#include "llvm/ADT/STLExtras.h"
32#include "llvm/ADT/StringRef.h"
33#include "llvm/ADT/iterator_range.h"
34#include "llvm/Support/Compiler.h"
35#include "llvm/Support/TrailingObjects.h"
47class CXXCtorInitializer;
49class ObjCCategoryDecl;
50class ObjCCategoryImplDecl;
51class ObjCImplementationDecl;
52class ObjCInterfaceDecl;
54class ObjCPropertyDecl;
55class ObjCPropertyImplDecl;
56class ObjCProtocolDecl;
74 void set(
void *
const* InList,
unsigned Elts,
ASTContext &Ctx);
94 assert(Idx <
NumElts &&
"Invalid access");
152 void *ParamsAndSelLocs =
nullptr;
153 unsigned NumParams = 0;
172 bool isInstance =
true,
bool isVariadic =
false,
174 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
176 bool HasRelatedResultType =
false);
186 bool hasStandardSelLocs()
const {
193 return reinterpret_cast<SourceLocation *
>(getParams() + NumParams);
196 return reinterpret_cast<const SourceLocation *
>(getParams() + NumParams);
202 return reinterpret_cast<ParmVarDecl **
>(ParamsAndSelLocs);
205 return reinterpret_cast<const ParmVarDecl *
const *
>(ParamsAndSelLocs);
210 unsigned getNumStoredSelLocs()
const {
211 if (hasStandardSelLocs())
235 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
237 bool HasRelatedResultType =
false);
296 if (hasStandardSelLocs())
301 return getStoredSelLocs()[Index];
378 assert(Idx < NumParams &&
"Index out of bounds!");
379 return getParams()[Idx];
397 llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
416 bool &selfIsPseudoStrong,
bool &selfIsConsumed)
const;
584 unsigned Variance : 2;
600 Index(index), Variance(
static_cast<unsigned>(variance)),
601 VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
603 void anchor()
override;
629 Variance =
static_cast<unsigned>(variance);
659 :
private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
686 unsigned size()
const {
return NumParams; }
692 return getTrailingObjects<ObjCTypeParamDecl *>();
700 assert(
size() > 0 &&
"empty Objective-C type parameter list");
705 assert(
size() > 0 &&
"empty Objective-C type parameter list");
731 void anchor()
override;
753 unsigned PropertyImplementation : 2;
779 :
NamedDecl(ObjCProperty, DC, L,
Id), AtLoc(AtLocation),
780 LParenLoc(LParenLocation), DeclType(
T), DeclTypeSourceInfo(TSI),
781 PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
782 PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
783 PropertyImplementation(propControl) {}
786 static ObjCPropertyDecl *
Create(ASTContext &
C, DeclContext *DC,
787 SourceLocation L,
const IdentifierInfo *
Id,
788 SourceLocation AtLocation,
789 SourceLocation LParenLocation, QualType
T,
807 DeclTypeSourceInfo = TSI;
819 PropertyAttributes |= PRVal;
823 PropertyAttributes = PRVal;
831 PropertyAttributesAsWritten = PRVal;
908 PropertyImplementation = pc;
920 PropertyIvarDecl = Ivar;
924 return PropertyIvarDecl;
955 void anchor()
override;
964 llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
1013 llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1063 bool AllowHidden =
false)
const;
1066 bool AllowHidden =
false)
const {
1067 return getMethod(Sel,
true, AllowHidden);
1071 return getMethod(Sel,
false, AllowHidden);
1078 bool IsInstance)
const;
1114 return K >= firstObjCContainer &&
1115 K <= lastObjCContainer;
1159 mutable const Type *TypeForDecl =
nullptr;
1161 struct DefinitionData {
1188 LLVM_PREFERRED_TYPE(
bool)
1189 mutable unsigned ExternallyCompleted : 1;
1193 LLVM_PREFERRED_TYPE(
bool)
1194 mutable unsigned IvarListMissingImplementation : 1;
1198 LLVM_PREFERRED_TYPE(
bool)
1199 unsigned HasDesignatedInitializers : 1;
1201 enum InheritedDesignatedInitializersState {
1210 IDI_NotInherited = 2
1214 LLVM_PREFERRED_TYPE(InheritedDesignatedInitializersState)
1215 mutable unsigned InheritedDesignatedInitializers : 2;
1218 LLVM_PREFERRED_TYPE(
bool)
1219 unsigned HasODRHash : 1;
1230 : ExternallyCompleted(
false), IvarListMissingImplementation(
true),
1231 HasDesignatedInitializers(
false),
1232 InheritedDesignatedInitializers(IDI_Unknown), HasODRHash(
false) {}
1236 ObjCTypeParamList *TypeParamList =
nullptr;
1243 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1245 ObjCInterfaceDecl(
const ASTContext &
C, DeclContext *DC, SourceLocation AtLoc,
1246 const IdentifierInfo *
Id, ObjCTypeParamList *typeParamList,
1247 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1250 void anchor()
override;
1252 void LoadExternalDefinition()
const;
1254 DefinitionData &data()
const {
1255 assert(
Data.getPointer() &&
"Declaration has no definition!");
1256 return *
Data.getPointer();
1260 void allocateDefinitionData();
1262 using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
1264 ObjCInterfaceDecl *getNextRedeclarationImpl()
override {
1268 ObjCInterfaceDecl *getPreviousDeclImpl()
override {
1272 ObjCInterfaceDecl *getMostRecentDeclImpl()
override {
1277 static ObjCInterfaceDecl *
1279 const IdentifierInfo *
Id, ObjCTypeParamList *typeParamList,
1280 ObjCInterfaceDecl *PrevDecl,
1281 SourceLocation ClassLoc = SourceLocation(),
bool isInternal =
false);
1303 return TypeParamList;
1333 assert(
hasDefinition() &&
"Caller did not check for forward reference!");
1334 if (data().ExternallyCompleted)
1335 LoadExternalDefinition();
1337 return data().ReferencedProtocols;
1367 if (data().ExternallyCompleted)
1368 LoadExternalDefinition();
1370 return data().ReferencedProtocols.begin();
1378 if (data().ExternallyCompleted)
1379 LoadExternalDefinition();
1381 return data().ReferencedProtocols.end();
1396 if (data().ExternallyCompleted)
1397 LoadExternalDefinition();
1399 return data().ReferencedProtocols.loc_begin();
1407 if (data().ExternallyCompleted)
1408 LoadExternalDefinition();
1410 return data().ReferencedProtocols.loc_end();
1426 if (data().ExternallyCompleted)
1427 LoadExternalDefinition();
1429 return data().AllReferencedProtocols.empty()
1431 : data().AllReferencedProtocols.begin();
1439 if (data().ExternallyCompleted)
1440 LoadExternalDefinition();
1442 return data().AllReferencedProtocols.empty()
1444 : data().AllReferencedProtocols.end();
1448 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
1486 data().ReferencedProtocols.set(List, Num, Locs,
C);
1532 if (!
Data.getOpaqueValue())
1535 return Data.getPointer();
1577 if (data().ExternallyCompleted)
1578 LoadExternalDefinition();
1580 return data().SuperClassTInfo;
1588 data().SuperClassTInfo = superClass;
1596 template<
bool (*Filter)(ObjCCategoryDecl *)>
1600 void findAcceptableCategory();
1611 : Current(Current) {
1612 findAcceptableCategory();
1628 return X.Current == Y.Current;
1633 return X.Current != Y.Current;
1650 llvm::iterator_range<visible_categories_iterator>;
1684 llvm::iterator_range<known_categories_iterator>;
1720 llvm::iterator_range<visible_extensions_iterator>;
1759 llvm::iterator_range<known_extensions_iterator>;
1789 if (data().ExternallyCompleted)
1790 LoadExternalDefinition();
1792 return data().CategoryList;
1798 data().CategoryList = category;
1811 while (I !=
nullptr) {
1841 bool shallowCategoryLookup =
false,
1842 bool followSuper =
true,
1859 bool Instance=
true)
const;
1870 bool IsClassProperty)
const {
1881 return data().EndLoc;
1900 bool lookupCategory,
1901 bool RHSIsQualifiedID =
false);
1929 bool hasODRHash()
const;
1930 void setHasODRHash(
bool HasHash);
1933 bool inheritsDesignatedInitializers()
const;
1952 void anchor()
override;
1964 :
FieldDecl(ObjCIvar, DC, StartLoc, IdLoc,
Id,
T, TInfo, BW,
1966 DeclAccess(ac), Synthesized(synthesized) {}
1969 static ObjCIvarDecl *
Create(ASTContext &
C, ObjCContainerDecl *DC,
1970 SourceLocation StartLoc, SourceLocation IdLoc,
1971 const IdentifierInfo *
Id, QualType
T,
1973 Expr *BW =
nullptr,
bool synthesized =
false);
2023 unsigned DeclAccess : 3;
2024 LLVM_PREFERRED_TYPE(
bool)
2025 unsigned Synthesized : 1;
2033 :
FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc,
Id,
T,
2037 void anchor()
override;
2084 struct DefinitionData {
2092 LLVM_PREFERRED_TYPE(
bool)
2093 unsigned HasODRHash : 1;
2104 llvm::PointerIntPair<DefinitionData *, 1, bool>
Data;
2110 void anchor()
override;
2112 DefinitionData &data()
const {
2113 assert(
Data.getPointer() &&
"Objective-C protocol has no definition!");
2114 return *
Data.getPointer();
2117 void allocateDefinitionData();
2134 bool hasODRHash()
const;
2135 void setHasODRHash(
bool HasHash);
2154 return data().ReferencedProtocols;
2168 return data().ReferencedProtocols.begin();
2175 return data().ReferencedProtocols.end();
2189 return data().ReferencedProtocols.loc_begin();
2196 return data().ReferencedProtocols.loc_end();
2203 return data().ReferencedProtocols.size();
2211 data().ReferencedProtocols.set(List, Num, Locs,
C);
2242 if (!
Data.getOpaqueValue())
2245 return Data.getPointer();
2356 void anchor()
override;
2392 ReferencedProtocols.
set(List, Num, Locs,
C);
2396 return ReferencedProtocols;
2407 return ReferencedProtocols.
begin();
2425 return ReferencedProtocols.
loc_end();
2433 return NextClassCategory;
2439 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2475 void anchor()
override;
2482 ClassInterface(classInterface) {}
2510 llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2527 return K >= firstObjCImpl && K <= lastObjCImpl;
2552 :
ObjCImplDecl(ObjCCategoryImpl, DC, classInterface,
Id, nameLoc,
2554 CategoryNameLoc(CategoryNameLoc) {}
2556 void anchor()
override;
2577raw_ostream &
operator<<(raw_ostream &OS,
const ObjCCategoryImplDecl &CID);
2608 unsigned NumIvarInitializers = 0;
2612 LLVM_PREFERRED_TYPE(
bool)
2613 bool HasNonZeroConstructors : 1;
2616 LLVM_PREFERRED_TYPE(
bool)
2617 bool HasDestructors : 1;
2629 nameLoc, atStartLoc),
2630 SuperClass(superDecl), SuperLoc(superLoc),
2631 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2632 HasNonZeroConstructors(
false), HasDestructors(
false) {}
2634 void anchor()
override;
2669 const auto *ConstThis =
this;
2688 return NumIvarInitializers;
2692 NumIvarInitializers = numNumIvarInitializers;
2697 unsigned numInitializers);
2721 assert(
getIdentifier() &&
"Name is not a simple identifier");
2746 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2770raw_ostream &
operator<<(raw_ostream &OS,
const ObjCImplementationDecl &
ID);
2780 :
NamedDecl(ObjCCompatibleAlias, DC, L,
Id), AliasedClass(aliasedClass) {}
2782 void anchor()
override;
2835 Expr *GetterCXXConstructor =
nullptr;
2839 Expr *SetterCXXAssignment =
nullptr;
2846 :
Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2847 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2848 assert(PK ==
Dynamic || PropertyIvarDecl);
2870 return PropertyDecl;
2879 return PropertyIvarDecl;
2885 PropertyIvarDecl = Ivar;
2886 this->IvarLoc = IvarLoc;
2907 return GetterCXXConstructor;
2911 GetterCXXConstructor = getterCXXConstructor;
2915 return SetterCXXAssignment;
2919 SetterCXXAssignment = setterCXXAssignment;
2926template<
bool (*Filter)(ObjCCategoryDecl *)>
2928ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2929findAcceptableCategory() {
2930 while (Current && !Filter(Current))
2931 Current = Current->getNextClassCategoryRaw();
2934template<
bool (*Filter)(ObjCCategoryDecl *)>
2935inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2937 Current = Current->getNextClassCategoryRaw();
2938 findAcceptableCategory();
2951inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2952 return !Cat->isInvalidDecl() && Cat->IsClassExtension();
enum clang::sema::@1655::IndirectLocalPathEntry::EntryKind Kind
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
Represents a C++ base or member initializer.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Iterates over a filtered subrange of declarations stored in a DeclContext.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ObjCMethodDeclBitfields ObjCMethodDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
void addDecl(Decl *D)
Add the declaration D into this context.
decl_iterator decls_end() const
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Kind
Lists the kind of concrete classes of Decl.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
bool isInvalidDecl() const
SourceLocation getLocation() const
void setLexicalDeclContext(DeclContext *DC)
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
This represents one expression.
Represents a member of a struct/union/class.
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a field declaration created by an @defs(...).
static bool classofKind(Kind K)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
ObjCCategoryDecl - Represents a category declaration.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ObjCCategoryDecl * getNextClassCategory() const
unsigned ivar_size() const
ivar_iterator ivar_begin() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
ivar_iterator ivar_end() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
protocol_loc_range protocol_locs() const
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setIvarLBraceLoc(SourceLocation Loc)
unsigned protocol_size() const
ObjCCategoryImplDecl * getImplementation() const
void setCategoryNameLoc(SourceLocation Loc)
ObjCInterfaceDecl * getClassInterface()
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
static bool classofKind(Kind K)
void setIvarRBraceLoc(SourceLocation Loc)
protocol_iterator protocol_end() const
const ObjCInterfaceDecl * getClassInterface() const
llvm::iterator_range< protocol_iterator > protocol_range
SourceLocation getIvarLBraceLoc() const
bool IsClassExtension() const
SourceLocation getIvarRBraceLoc() const
protocol_loc_iterator protocol_loc_begin() const
protocol_iterator protocol_begin() const
protocol_range protocols() const
const ObjCProtocolList & getReferencedProtocols() const
void setImplementation(ObjCCategoryImplDecl *ImplD)
ObjCProtocolList::iterator protocol_iterator
static bool classof(const Decl *D)
SourceLocation getCategoryNameLoc() const
protocol_loc_iterator protocol_loc_end() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
static bool classofKind(Kind K)
SourceLocation getCategoryNameLoc() const
ObjCCategoryDecl * getCategoryDecl() const
static bool classof(const Decl *D)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
static bool classofKind(Kind K)
ObjCInterfaceDecl * getClassInterface()
static bool classof(const Decl *D)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setClassInterface(ObjCInterfaceDecl *D)
ObjCContainerDecl - Represents a container for method declarations.
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
classmeth_iterator classmeth_end() const
prop_iterator prop_end() const
method_iterator meth_begin() const
method_range methods() const
instprop_iterator instprop_end() const
void setAtStartLoc(SourceLocation Loc)
SourceRange getAtEndRange() const
classmeth_iterator classmeth_begin() const
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
prop_iterator prop_begin() const
llvm::iterator_range< instprop_iterator > instprop_range
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
instmeth_range instance_methods() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
classprop_iterator classprop_end() const
instmeth_iterator instmeth_end() const
llvm::iterator_range< classprop_iterator > classprop_range
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
specific_decl_iterator< ObjCMethodDecl > method_iterator
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
classprop_iterator classprop_begin() const
SourceLocation getAtStartLoc() const
method_iterator meth_end() const
static bool classof(const Decl *D)
instprop_range instance_properties() const
llvm::iterator_range< classmeth_iterator > classmeth_range
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
void setAtEndRange(SourceRange atEnd)
virtual void collectPropertiesToImplement(PropertyMap &PM) const
This routine collects list of properties to be implemented in the class.
instmeth_iterator instmeth_begin() const
classprop_range class_properties() const
instprop_iterator instprop_begin() const
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
prop_range properties() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
classmeth_range class_methods() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
llvm::iterator_range< instmeth_iterator > instmeth_range
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
void addPropertyImplementation(ObjCPropertyImplDecl *property)
void addClassMethod(ObjCMethodDecl *method)
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
ObjCInterfaceDecl * getClassInterface()
propimpl_iterator propimpl_begin() const
static bool classof(const Decl *D)
propimpl_range property_impls() const
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
propimpl_iterator propimpl_end() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
static bool classofKind(Kind K)
void addInstanceMethod(ObjCMethodDecl *method)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void setNumIvarInitializers(unsigned numNumIvarInitializers)
static bool classofKind(Kind K)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
llvm::iterator_range< init_iterator > init_range
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
std::string getNameAsString() const
Get the name of the class associated with this interface.
SourceLocation getSuperClassLoc() const
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ivar_iterator ivar_begin() const
void setIvarLBraceLoc(SourceLocation Loc)
ObjCInterfaceDecl * getSuperClass()
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
void setSuperClass(ObjCInterfaceDecl *superCls)
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
llvm::iterator_range< init_const_iterator > init_const_range
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
init_const_range inits() const
ivar_iterator ivar_end() const
unsigned ivar_size() const
void setIvarRBraceLoc(SourceLocation Loc)
init_const_iterator init_end() const
end() - Retrieve an iterator past the last initializer.
static bool classof(const Decl *D)
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getIvarLBraceLoc() const
void setHasDestructors(bool val)
void setHasNonZeroConstructors(bool val)
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
filtered_category_iterator(ObjCCategoryDecl *Current)
filtered_category_iterator()=default
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
pointer operator->() const
std::ptrdiff_t difference_type
reference operator*() const
filtered_category_iterator operator++(int)
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
filtered_category_iterator & operator++()
std::input_iterator_tag iterator_category
ObjCCategoryDecl * value_type
Represents an ObjC class declaration.
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
all_protocol_iterator all_referenced_protocol_end() const
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 passe...
ivar_iterator ivar_end() const
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
static bool classofKind(Kind K)
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
const ObjCInterfaceDecl * getCanonicalDecl() const
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
unsigned ivar_size() const
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
visible_categories_iterator visible_categories_begin() const
Retrieve an iterator to the beginning of the visible-categories list.
bool hasDefinition() const
Determine whether this class has been defined.
all_protocol_range all_referenced_protocols() const
visible_extensions_range visible_extensions() const
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
protocol_loc_iterator protocol_loc_end() const
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
ObjCCategoryDecl * FindCategoryDeclaration(const IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
llvm::iterator_range< all_protocol_iterator > all_protocol_range
protocol_loc_iterator protocol_loc_begin() const
ivar_iterator ivar_begin() const
protocol_range protocols() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void setImplementation(ObjCImplementationDecl *ImplD)
protocol_loc_range protocol_locs() const
known_categories_range known_categories() const
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
void setSuperClass(TypeSourceInfo *superClass)
protocol_iterator protocol_end() const
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
all_protocol_iterator all_referenced_protocol_begin() const
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
filtered_category_iterator< isVisibleExtension > visible_extensions_iterator
Iterator that walks over all of the visible extensions, skipping any that are known but hidden.
llvm::iterator_range< visible_categories_iterator > visible_categories_range
const ObjCIvarDecl * all_declared_ivar_begin() const
const ObjCInterfaceDecl * getDefinition() const
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
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 pas...
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
const ObjCProtocolList & getReferencedProtocols() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i....
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
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,...
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
llvm::iterator_range< known_categories_iterator > known_categories_range
ObjCProtocolList::iterator protocol_iterator
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
const Type * getTypeForDecl() const
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class,...
void setTypeForDecl(const Type *TD) const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
ObjCImplementationDecl * getImplementation() const
static bool classof(const Decl *D)
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, GlobalDeclID ID)
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
SourceLocation getEndOfDefinitionLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
llvm::iterator_range< protocol_iterator > protocol_range
llvm::iterator_range< known_extensions_iterator > known_extensions_range
filtered_category_iterator< isKnownCategory > known_categories_iterator
Iterator that walks over all of the known categories and extensions, including those that are hidden.
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
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.
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
known_extensions_iterator known_extensions_end() const
Retrieve an iterator to the end of the known-extensions list.
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
void setEndOfDefinitionLoc(SourceLocation LE)
known_categories_iterator known_categories_begin() const
Retrieve an iterator to the beginning of the known-categories list.
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
bool known_categories_empty() const
Determine whether the known-categories list is empty.
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
known_extensions_iterator known_extensions_begin() const
Retrieve an iterator to the beginning of the known-extensions list.
visible_categories_range visible_categories() const
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
ObjCInterfaceDecl * getSuperClass() const
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
TypeSourceInfo * getSuperClassTInfo() const
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface.
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
redeclarable_base::redecl_iterator redecl_iterator
void setIvarList(ObjCIvarDecl *ivar)
void mergeDuplicateDefinitionWithCommon(const ObjCInterfaceDecl *Definition)
visible_categories_iterator visible_categories_end() const
Retrieve an iterator to the end of the visible-categories list.
visible_extensions_iterator visible_extensions_begin() const
Retrieve an iterator to the beginning of the visible-extensions list.
known_extensions_range known_extensions() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
void setAccessControl(AccessControl ac)
static bool classof(const Decl *D)
void setNextIvar(ObjCIvarDecl *ivar)
bool getSynthesize() const
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
void setSynthesize(bool synth)
ObjCIvarDecl * getNextIvar()
const ObjCIvarDecl * getNextIvar() const
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const ObjCInterfaceDecl * getContainingInterface() const
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
AccessControl getCanonicalAccessControl() const
const ObjCIvarDecl * getCanonicalDecl() const
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
static bool classofKind(Kind K)
void ** List
List is an array of pointers to objects that are not owned by this object.
ObjCListBase & operator=(const ObjCListBase &)=delete
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCListBase(const ObjCListBase &)=delete
ObjCList - This is a simple template class used to hold various lists of decls etc,...
T * operator[](unsigned Idx) const
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCMethodDecl - Represents an instance or class method declaration.
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface.
ImplicitParamDecl * getSelfDecl() const
bool hasBody() const override
Determine whether this method has a body.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
void setObjCDeclQualifier(ObjCDeclQualifier QV)
void setDefined(bool isDefined)
static bool classofKind(Kind K)
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
param_iterator param_end()
unsigned param_size() const
void setSelfDecl(ImplicitParamDecl *SD)
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
const ParmVarDecl * getParamDecl(unsigned Idx) const
static bool classof(const Decl *D)
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
bool isPropertyAccessor() const
CompoundStmt * getCompoundBody()
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
void setHasRedeclaration(bool HRD) const
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
param_const_iterator param_end() const
SourceLocation getSelectorStartLoc() const
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
param_const_iterator param_begin() const
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
void setIsRedeclaration(bool RD)
void setCmdDecl(ImplicitParamDecl *CD)
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
bool hasRedeclaration() const
True if redeclared in the same interface.
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
param_type_iterator param_type_begin() const
llvm::iterator_range< param_const_iterator > param_const_range
param_iterator param_begin()
bool isSynthesizedAccessorStub() const
SourceLocation getSelectorLoc(unsigned Index) const
SourceRange getReturnTypeSourceRange() const
void setOverriding(bool IsOver)
const ParmVarDecl *const * param_const_iterator
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
param_type_iterator param_type_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=std::nullopt)
Sets the method's parameters and selector source locations.
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
bool isDirectMethod() const
True if the method is tagged as objc_direct.
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
void setPropertyAccessor(bool isAccessor)
Selector getSelector() const
void setDeclImplementation(ObjCImplementationControl ic)
ImplicitParamDecl * getCmdDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isInstanceMethod() const
llvm::iterator_range< param_iterator > param_range
void setReturnType(QualType T)
void setLazyBody(uint64_t Offset)
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
ParmVarDecl * getParamDecl(unsigned Idx)
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
void setHasSkippedBody(bool Skipped=true)
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
QualType getReturnType() const
ParmVarDecl *const * param_iterator
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
unsigned getNumSelectorLocs() const
bool isClassMethod() const
ObjCInterfaceDecl * getClassInterface()
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
void setInstanceMethod(bool isInst)
void setVariadic(bool isVar)
param_const_iterator sel_param_end() const
const ObjCInterfaceDecl * getClassInterface() const
const ObjCMethodDecl * getCanonicalDecl() const
const ObjCCategoryDecl * getCategory() const
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
void setAtLoc(SourceLocation L)
bool isAtomic() const
isAtomic - Return true if the property is atomic.
ObjCPropertyQueryKind getQueryKind() const
bool isClassProperty() const
void setPropertyImplementation(PropertyControl pc)
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
SourceLocation getGetterNameLoc() const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
ObjCMethodDecl * getGetterMethodDecl() const
bool isRetaining() const
isRetaining - Return true if the property retains its value.
bool isInstanceProperty() const
ObjCMethodDecl * getSetterMethodDecl() const
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
ObjCIvarDecl * getPropertyIvarDecl() const
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isDirectProperty() const
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
static bool classofKind(Kind K)
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
void overwritePropertyAttributes(unsigned PRVal)
Selector getGetterName() const
static bool classof(const Decl *D)
void setLParenLoc(SourceLocation L)
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
SourceLocation getLParenLoc() const
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
ObjCPropertyAttribute::Kind getPropertyAttributes() const
void setType(QualType T, TypeSourceInfo *TSI)
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
PropertyControl getPropertyImplementation() const
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Kind getPropertyImplementation() const
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
void setSetterMethodDecl(ObjCMethodDecl *MD)
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
void setSetterCXXAssignment(Expr *setterCXXAssignment)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCMethodDecl * getSetterMethodDecl() const
static bool classof(const Decl *D)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classofKind(Decl::Kind K)
void setGetterMethodDecl(ObjCMethodDecl *MD)
void setAtLoc(SourceLocation Loc)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyDecl(ObjCPropertyDecl *Prop)
void setGetterCXXConstructor(Expr *getterCXXConstructor)
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition)
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
bool hasDefinition() const
Determine whether this protocol has a definition.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
const ObjCProtocolList & getReferencedProtocols() const
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
redeclarable_base::redecl_iterator redecl_iterator
protocol_loc_iterator protocol_loc_end() const
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
protocol_loc_range protocol_locs() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
llvm::iterator_range< protocol_iterator > protocol_range
void getImpliedProtocols(llvm::DenseSet< const ObjCProtocolDecl * > &IPs) const
Get the set of all protocols implied by this protocols inheritance hierarchy.
void startDefinition()
Starts the definition of this Objective-C protocol.
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
ObjCProtocolList::iterator protocol_iterator
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
static bool classof(const Decl *D)
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
protocol_range protocols() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const ObjCProtocolDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
unsigned protocol_size() const
protocol_iterator protocol_end() const
protocol_loc_iterator protocol_loc_begin() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
A list of Objective-C protocols, along with the source locations at which they were referenced.
loc_iterator loc_begin() const
const SourceLocation * loc_iterator
loc_iterator loc_end() const
ObjCProtocolList()=default
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Represents the declaration of an Objective-C type parameter.
static bool classof(const Decl *D)
unsigned getIndex() const
Retrieve the index into its type parameter list.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
static bool classofKind(Kind K)
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, GlobalDeclID ID)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
SourceRange getSourceRange() const
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
unsigned size() const
Determine the number of type parameters in this list.
const_iterator begin() const
ObjCTypeParamDecl * front() const
const_iterator end() const
SourceLocation getRAngleLoc() const
ObjCTypeParamDecl *const * const_iterator
ObjCTypeParamDecl * back() const
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
SourceLocation getLAngleLoc() const
Represents a parameter to a function.
A (possibly-)qualified type.
Provides common interface for the Decls that can be redeclared.
ObjCInterfaceDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
ObjCInterfaceDecl * getNextRedeclaration() const
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Smart pointer class that efficiently represents Objective-C method names.
bool isUnarySelector() const
unsigned getNumArgs() const
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
A container of type source information.
The base class of the type hierarchy.
bool isBlockPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
Base class for declarations which introduce a typedef-name.
The JSON file list parser is used to communicate input to InstallAPI.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
@ SelLoc_NonStandard
Non-standard.
@ ICIS_NoInit
No in-class initializer.
ObjCMethodFamily
A family of Objective-C methods.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Property
The type of a property.
ObjCImplementationControl
SourceLocation getStandardSelectorLoc(unsigned Index, Selector Sel, bool WithArgSpace, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Get the "standard" location of a selector identifier, e.g: For nullary selectors, immediately before ...
const FunctionProtoType * T
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
@ None
The alignment was not explicit in code.
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
bool isValid() const
Whether this pointer is non-NULL.
QualType operator()(const ParmVarDecl *PD) const