14 #ifndef LLVM_CLANG_AST_DECLOBJC_H
15 #define LLVM_CLANG_AST_DECLOBJC_H
19 #include "llvm/ADT/STLExtras.h"
20 #include "llvm/Support/Compiler.h"
29 class ObjCProtocolDecl;
30 class ObjCCategoryDecl;
31 class ObjCPropertyDecl;
32 class ObjCPropertyImplDecl;
33 class CXXCtorInitializer;
49 void set(
void *
const* InList,
unsigned Elts,
ASTContext &Ctx);
69 assert(Idx <
NumElts &&
"Invalid access");
123 unsigned IsInstance : 1;
124 unsigned IsVariadic : 1;
127 unsigned IsPropertyAccessor : 1;
130 unsigned IsDefined : 1;
133 unsigned IsRedeclaration : 1;
136 mutable unsigned HasRedeclaration : 1;
140 unsigned DeclImplementation : 2;
144 unsigned objcDeclQualifier : 7;
147 unsigned RelatedResultType : 1;
151 unsigned SelLocsKind : 2;
160 unsigned IsOverriding : 1;
163 unsigned HasSkippedBody : 1;
173 void *ParamsAndSelLocs;
192 bool hasStandardSelLocs()
const {
198 SourceLocation *getStoredSelLocs() {
199 return reinterpret_cast<SourceLocation*
>(getParams() + NumParams);
201 const SourceLocation *getStoredSelLocs()
const {
202 return reinterpret_cast<const SourceLocation*
>(getParams() + NumParams);
207 ParmVarDecl **getParams() {
208 return reinterpret_cast<ParmVarDecl **
>(ParamsAndSelLocs);
210 const ParmVarDecl *
const *getParams()
const {
211 return reinterpret_cast<const ParmVarDecl *
const *
>(ParamsAndSelLocs);
216 unsigned getNumStoredSelLocs()
const {
217 if (hasStandardSelLocs())
223 ArrayRef<ParmVarDecl*> Params,
224 ArrayRef<SourceLocation> SelLocs);
226 ObjCMethodDecl(SourceLocation beginLoc, SourceLocation endLoc,
227 Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,
230 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
232 bool HasRelatedResultType =
false)
233 :
NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),
235 IsInstance(isInstance), IsVariadic(
isVariadic),
237 IsRedeclaration(0), HasRedeclaration(0), DeclImplementation(impControl),
238 objcDeclQualifier(OBJC_TQ_None),
239 RelatedResultType(HasRelatedResultType),
241 MethodDeclType(T), ReturnTInfo(ReturnTInfo), ParamsAndSelLocs(nullptr),
242 NumParams(0), DeclEndLoc(endLoc), Body(), SelfDecl(nullptr),
244 setImplicit(isImplicitlyDeclared);
250 ObjCMethodDecl *getNextRedeclarationImpl()
override;
253 static ObjCMethodDecl *
255 Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,
258 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
260 bool HasRelatedResultType =
false);
270 return ObjCDeclQualifier(objcDeclQualifier);
304 if (hasStandardSelLocs())
309 return getStoredSelLocs()[Index];
372 return llvm::makeArrayRef(const_cast<ParmVarDecl**>(getParams()),
384 typedef std::const_mem_fun_t<QualType, ParmVarDecl>
deref_fun;
385 typedef llvm::mapped_iterator<param_const_iterator, deref_fun>
404 bool &selfIsPseudoStrong,
bool &selfIsConsumed);
461 DeclImplementation = ic;
533 void anchor()
override;
539 unsigned Variance : 2;
555 Index(index), Variance(static_cast<unsigned>(variance)),
556 VarianceLoc(varianceLoc), ColonLoc(colonLoc) { }
578 Variance =
static_cast<unsigned>(variance);
613 struct PODSourceRange {
648 unsigned size()
const {
return NumParams; }
654 return getTrailingObjects<ObjCTypeParamDecl *>();
662 assert(
size() > 0 &&
"empty Objective-C type parameter list");
667 assert(
size() > 0 &&
"empty Objective-C type parameter list");
700 void anchor()
override;
739 unsigned PropertyImplementation : 2;
752 :
NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
753 LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
756 PropertyImplementation(propControl),
759 GetterMethodDecl(nullptr), SetterMethodDecl(nullptr),
760 PropertyIvarDecl(nullptr) {}
765 IdentifierInfo *Id, SourceLocation AtLocation,
766 SourceLocation LParenLocation,
785 DeclTypeSourceInfo = TSI;
796 PropertyAttributes |= PRVal;
799 PropertyAttributes = PRVal;
807 PropertyAttributesAsWritten = PRVal;
824 return (PropertyAttributes &
868 PropertyImplementation = pc;
875 PropertyIvarDecl = Ivar;
878 return PropertyIvarDecl;
902 void anchor()
override;
918 typedef llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>
961 typedef llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>
1006 bool AllowHidden =
false)
const;
1008 bool AllowHidden =
false)
const {
1009 return getMethod(Sel,
true, AllowHidden);
1012 return getMethod(Sel,
false, AllowHidden);
1025 typedef llvm::DenseMap<const ObjCProtocolDecl *, ObjCPropertyDecl*>
1054 return K >= firstObjCContainer &&
1055 K <= lastObjCContainer;
1093 void anchor()
override;
1097 mutable const Type *TypeForDecl;
1100 struct DefinitionData {
1127 mutable unsigned ExternallyCompleted : 1;
1131 mutable unsigned IvarListMissingImplementation : 1;
1135 unsigned HasDesignatedInitializers : 1;
1137 enum InheritedDesignatedInitializersState {
1144 IDI_NotInherited = 2
1147 mutable unsigned InheritedDesignatedInitializers : 2;
1154 DefinitionData() : Definition(), SuperClassTInfo(), CategoryList(), IvarList(),
1155 ExternallyCompleted(),
1156 IvarListMissingImplementation(
true),
1157 HasDesignatedInitializers(),
1158 InheritedDesignatedInitializers(IDI_Unknown) { }
1162 IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1163 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1166 void LoadExternalDefinition()
const;
1169 ObjCTypeParamList *TypeParamList;
1176 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1178 DefinitionData &data()
const {
1179 assert(Data.getPointer() &&
"Declaration has no definition!");
1180 return *Data.getPointer();
1184 void allocateDefinitionData();
1186 typedef Redeclarable<ObjCInterfaceDecl> redeclarable_base;
1187 ObjCInterfaceDecl *getNextRedeclarationImpl()
override {
1190 ObjCInterfaceDecl *getPreviousDeclImpl()
override {
1193 ObjCInterfaceDecl *getMostRecentDeclImpl()
override {
1199 SourceLocation atLoc,
1201 ObjCTypeParamList *typeParamList,
1202 ObjCInterfaceDecl *PrevDecl,
1203 SourceLocation ClassLoc = SourceLocation(),
1204 bool isInternal =
false);
1225 return TypeParamList;
1255 assert(
hasDefinition() &&
"Caller did not check for forward reference!");
1256 if (data().ExternallyCompleted)
1257 LoadExternalDefinition();
1259 return data().ReferencedProtocols;
1286 if (data().ExternallyCompleted)
1287 LoadExternalDefinition();
1289 return data().ReferencedProtocols.begin();
1296 if (data().ExternallyCompleted)
1297 LoadExternalDefinition();
1299 return data().ReferencedProtocols.end();
1313 if (data().ExternallyCompleted)
1314 LoadExternalDefinition();
1316 return data().ReferencedProtocols.loc_begin();
1324 if (data().ExternallyCompleted)
1325 LoadExternalDefinition();
1327 return data().ReferencedProtocols.loc_end();
1342 if (data().ExternallyCompleted)
1343 LoadExternalDefinition();
1345 return data().AllReferencedProtocols.empty()
1347 : data().AllReferencedProtocols.begin();
1354 if (data().ExternallyCompleted)
1355 LoadExternalDefinition();
1357 return data().AllReferencedProtocols.empty()
1359 : data().AllReferencedProtocols.end();
1363 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
1399 data().ReferencedProtocols.set(List, Num, Locs, C);
1445 if (!Data.getOpaqueValue())
1448 return Data.getPointer();
1455 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1462 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1483 if (data().ExternallyCompleted)
1484 LoadExternalDefinition();
1486 return data().SuperClassTInfo;
1494 data().SuperClassTInfo = superClass;
1502 template<
bool (*Filter)(ObjCCategoryDecl *)>
1506 void findAcceptableCategory();
1519 findAcceptableCategory();
1535 return X.Current == Y.Current;
1540 return X.Current != Y.Current;
1553 typedef filtered_category_iterator<isVisibleCategory>
1556 typedef llvm::iterator_range<visible_categories_iterator>
1590 typedef llvm::iterator_range<known_categories_iterator>
1623 typedef filtered_category_iterator<isVisibleExtension>
1626 typedef llvm::iterator_range<visible_extensions_iterator>
1658 typedef filtered_category_iterator<isKnownExtension>
1660 typedef llvm::iterator_range<known_extensions_iterator>
1691 if (data().ExternallyCompleted)
1692 LoadExternalDefinition();
1694 return data().CategoryList;
1700 data().CategoryList = category;
1714 while (I !=
nullptr) {
1744 bool shallowCategoryLookup =
false,
1745 bool followSuper =
true,
1761 bool Instance=
true)
const;
1772 bool IsClassProperty)
const {
1781 return getLocation();
1783 return data().EndLoc;
1795 return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
1802 bool lookupCategory,
1803 bool RHSIsQualifiedID =
false);
1831 bool inheritsDesignatedInitializers()
const;
1850 void anchor()
override;
1862 :
FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1864 NextIvar(nullptr), DeclAccess(ac), Synthesized(synthesized) {}
1868 SourceLocation StartLoc, SourceLocation IdLoc,
1869 IdentifierInfo *Id, QualType T,
1870 TypeSourceInfo *TInfo,
1872 bool synthesized=
false);
1910 unsigned DeclAccess : 3;
1911 unsigned Synthesized : 1;
1917 void anchor()
override;
1921 :
FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
1970 void anchor()
override;
1972 struct DefinitionData {
1985 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1987 DefinitionData &data()
const {
1988 assert(Data.getPointer() &&
"Objective-C protocol has no definition!");
1989 return *Data.getPointer();
1996 void allocateDefinitionData();
2020 return data().ReferencedProtocols;
2032 return data().ReferencedProtocols.begin();
2038 return data().ReferencedProtocols.end();
2050 return data().ReferencedProtocols.loc_begin();
2056 return data().ReferencedProtocols.loc_end();
2062 return data().ReferencedProtocols.size();
2070 data().ReferencedProtocols.set(List, Num, Locs, C);
2091 if (!Data.getOpaqueValue())
2094 return Data.getPointer();
2099 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2104 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2172 void anchor()
override;
2235 ReferencedProtocols.
set(List, Num, Locs, C);
2239 return ReferencedProtocols;
2249 return ReferencedProtocols.
begin();
2263 return ReferencedProtocols.
loc_end();
2271 return NextClassCategory;
2277 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
2309 void anchor()
override;
2321 nameLoc, atStartLoc),
2322 ClassInterface(classInterface) {}
2331 method->setLexicalDeclContext(
this);
2336 method->setLexicalDeclContext(
this);
2348 typedef llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>
2363 return K >= firstObjCImpl && K <= lastObjCImpl;
2381 void anchor()
override;
2393 :
ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, nameLoc, atStartLoc),
2394 Id(Id), CategoryNameLoc(CategoryNameLoc) {}
2462 void anchor()
override;
2474 unsigned NumIvarInitializers;
2478 bool HasNonZeroConstructors : 1;
2481 bool HasDestructors : 1;
2490 :
ObjCImplDecl(ObjCImplementation, DC, classInterface, nameLoc, atStartLoc),
2491 SuperClass(superDecl), SuperLoc(superLoc), IvarLBraceLoc(IvarLBraceLoc),
2492 IvarRBraceLoc(IvarRBraceLoc),
2493 IvarInitializers(
nullptr), NumIvarInitializers(0),
2494 HasNonZeroConstructors(
false), HasDestructors(
false) {}
2523 const auto *ConstThis =
this;
2539 return NumIvarInitializers;
2543 NumIvarInitializers = numNumIvarInitializers;
2548 unsigned numInitializers);
2572 assert(
getIdentifier() &&
"Name is not a simple identifier");
2599 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
2627 void anchor()
override;
2633 :
NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2680 Expr *GetterCXXConstructor;
2684 Expr *SetterCXXAssignment;
2691 :
Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2692 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl),
2693 GetterCXXConstructor(nullptr), SetterCXXAssignment(nullptr) {
2694 assert (PK ==
Dynamic || PropertyIvarDecl);
2699 SourceLocation atLoc, SourceLocation L,
2700 ObjCPropertyDecl *property,
2702 ObjCIvarDecl *ivarDecl,
2703 SourceLocation ivarLoc);
2713 return PropertyDecl;
2722 return PropertyIvarDecl;
2728 PropertyIvarDecl = Ivar;
2729 this->IvarLoc = IvarLoc;
2740 return IvarLoc.
isValid() && IvarLoc != getLocation();
2744 return GetterCXXConstructor;
2747 GetterCXXConstructor = getterCXXConstructor;
2751 return SetterCXXAssignment;
2754 SetterCXXAssignment = setterCXXAssignment;
2763 template<
bool (*Filter)(ObjCCategoryDecl *)>
2771 template<
bool (*Filter)(ObjCCategoryDecl *)>
2772 inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2775 findAcceptableCategory();
2787 inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2788 return Cat->IsClassExtension();
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
bool isInstanceProperty() const
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
param_const_iterator param_begin() const
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=llvm::None)
Sets the method's parameters and selector source locations.
void setCategoryNameLoc(SourceLocation Loc)
bool hasDefinition() const
Determine whether this class has been defined.
bool isAtomic() const
isAtomic - Return true if the property is atomic.
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
classmeth_iterator classmeth_end() const
void setEndOfDefinitionLoc(SourceLocation LE)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
protocol_range protocols() const
Smart pointer class that efficiently represents Objective-C method names.
redeclarable_base::redecl_range redecl_range
A (possibly-)qualified type.
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ImplementationControl getImplementationControl() const
static bool classof(const Decl *D)
propimpl_iterator propimpl_begin() const
visible_categories_iterator visible_categories_end() const
Retrieve an iterator to the end of the visible-categories list.
ObjCInterfaceDecl * getClassInterface()
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
ObjCInterfaceDecl * getClassInterface()
void setOverriding(bool isOverriding)
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
redeclarable_base::redecl_iterator redecl_iterator
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
void setLParenLoc(SourceLocation L)
static bool classof(const Decl *D)
protocol_iterator protocol_end() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names this declaration, if there is one.
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
protocol_loc_iterator protocol_loc_end() const
PropertyControl getPropertyImplementation() const
bool isClassProperty() const
const SourceLocation * loc_iterator
ivar_iterator ivar_end() const
llvm::DenseMap< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
llvm::iterator_range< protocol_iterator > protocol_range
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
instprop_iterator instprop_begin() const
SourceRange getSourceRange() const override LLVM_READONLY
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
std::const_mem_fun_t< QualType, ParmVarDecl > deref_fun
void setTypeForDecl(const Type *TD) const
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
ObjCProtocolList::loc_iterator protocol_loc_iterator
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
static bool classofKind(Kind K)
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
const ObjCIvarDecl * all_declared_ivar_begin() const
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
ObjCInterfaceDecl * getClassInterface()
void setNumIvarInitializers(unsigned numNumIvarInitializers)
void ** List
List is an array of pointers to objects that are not owned by this object.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
The base class of the type hierarchy.
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
known_extensions_iterator known_extensions_end() const
Retrieve an iterator to the end of the known-extensions list.
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
ObjCCategoryDecl * getNextClassCategory() const
llvm::iterator_range< classmeth_iterator > classmeth_range
std::ptrdiff_t difference_type
instmeth_iterator instmeth_begin() const
SourceRange getSourceRange() const override LLVM_READONLY
protocol_loc_iterator protocol_loc_begin() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
void setPropertyImplementation(PropertyControl pc)
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
static bool classofKind(Kind K)
A container of type source information.
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
bool isBlockPointerType() const
void setPropertyAccessor(bool isAccessor)
protocol_range protocols() const
ObjCProtocolList::iterator protocol_iterator
Iterates over a filtered subrange of declarations stored in a DeclContext.
static bool classof(const Decl *D)
float __ovld __cnfn distance(float p0, float p1)
Returns the distance between p0 and p1.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implict parameters. ...
static bool classofKind(Decl::Kind K)
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
protocol_loc_iterator protocol_loc_begin() const
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
static bool classofKind(Kind K)
const Type * getTypeForDecl() const
void setImplementation(ObjCCategoryImplDecl *ImplD)
visible_categories_range visible_categories() const
llvm::iterator_range< param_const_iterator > param_const_range
Expr * getSetterCXXAssignment() const
unsigned getIndex() const
Retrieve the index into its type parameter list.
SourceLocation getIvarRBraceLoc() const
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type...
SourceLocation getLocStart() const LLVM_READONLY
static bool classof(const Decl *D)
llvm::DenseMap< const ObjCProtocolDecl *, ObjCPropertyDecl * > ProtocolPropertyMap
TypeSourceInfo * getSuperClassTInfo() const
static bool classofKind(Kind K)
ObjCMethodDecl - Represents an instance or class method declaration.
SourceRange getReturnTypeSourceRange() const
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class...
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
decl_iterator decls_end() const
void setSelfDecl(ImplicitParamDecl *SD)
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
unsigned param_size() const
unsigned size() const
Determine the number of type parameters in this list.
ParmVarDecl - Represents a parameter to a function.
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the category interface associated with this implementat...
TypeSourceInfo * getTypeSourceInfo() const
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
known_categories_iterator known_categories_begin() const
Retrieve an iterator to the beginning of the known-categories list.
Kind getPropertyImplementation() const
unsigned ivar_size() const
ObjCProtocolList::iterator protocol_iterator
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class. ...
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
Provides common interface for the Decls that can be redeclared.
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
param_const_iterator sel_param_end() const
const ObjCInterfaceDecl * getClassInterface() const
One of these records is kept for each identifier that is lexed.
SourceLocation getSelectorStartLoc() const
param_type_iterator param_type_end() const
const ObjCInterfaceDecl * getContainingInterface() const
Return the class interface that this ivar is logically contained in; this is either the interface whe...
Represents a class type in Objective C.
llvm::iterator_range< classprop_iterator > classprop_range
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
ObjCMethodFamily
A family of Objective-C methods.
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
The parameter is contravariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant ...
protocol_loc_range protocol_locs() const
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
protocol_iterator protocol_begin() const
static SourceLocation getFromRawEncoding(unsigned Encoding)
Turn a raw encoding of a SourceLocation object into a real SourceLocation.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
std::string getNameAsString() const
Get the name of the class associated with this interface.
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc)
ImplicitParamDecl * getCmdDecl() const
all_protocol_range all_referenced_protocols() const
redecl_iterator redecls_begin() const
void setSuperClass(TypeSourceInfo *superClass)
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
method_range methods() const
static bool classofKind(Kind K)
void setReturnType(QualType T)
void startDefinition()
Starts the definition of this Objective-C protocol.
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
static bool classof(const Decl *D)
static bool classof(const Decl *D)
void setDeclImplementation(ImplementationControl ic)
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
SourceLocation getCategoryNameLoc() const
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
filtered_decl_iterator< ObjCPropertyDecl,&ObjCPropertyDecl::isInstanceProperty > instprop_iterator
bool IsClassExtension() const
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
SourceLocation getSelectorLoc(unsigned Index) const
ObjCInterfaceDecl * getNextRedeclaration() const
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
ObjCTypeParamDecl * AlignmentHack
unsigned getNumSelectorLocs() const
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCContainerDecl - Represents a container for method declarations.
void setAccessControl(AccessControl ac)
protocol_loc_range protocol_locs() const
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
void setAtLoc(SourceLocation L)
SourceLocation getIvarLBraceLoc() const
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
static ObjCCategoryDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, ObjCTypeParamList *typeParamList, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
protocol_iterator protocol_end() const
SourceRange getSourceRange() const override LLVM_READONLY
ObjCContainerDecl(Kind DK, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
void setSuperClass(ObjCInterfaceDecl *superCls)
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
llvm::iterator_range< init_const_iterator > init_const_range
Expr * getGetterCXXConstructor() const
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
const ObjCIvarDecl * getNextIvar() const
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setLazyBody(uint64_t Offset)
Selector getSetterName() const
llvm::iterator_range< param_iterator > param_range
void setClassInterface(ObjCInterfaceDecl *D)
void setIdentifier(IdentifierInfo *II)
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface...
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
filtered_category_iterator()
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
CompoundStmt * getCompoundBody()
Represents an Objective-C protocol declaration.
filtered_category_iterator operator++(int)
ObjCInterfaceDecl * getSuperClass()
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
void addInstanceMethod(ObjCMethodDecl *method)
Represents an ObjC class declaration.
SourceLocation getLocEnd() const LLVM_READONLY
propimpl_range property_impls() const
decl_iterator decls_begin() const
detail::InMemoryDirectory::const_iterator I
PropertyAttributeKind getPropertyAttributes() const
ObjCInterfaceDecl * getClassInterface()
known_categories_range known_categories() const
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
CXXCtorInitializer ** init_iterator
init_iterator - Iterates through the ivar initializer list.
const ObjCProtocolDecl * getCanonicalDecl() const
ObjCMethodDecl * getCanonicalDecl() override
specific_decl_iterator< ObjCMethodDecl > method_iterator
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceLocation getIvarLBraceLoc() const
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
SourceLocation getAtStartLoc() const
void setGetterCXXConstructor(Expr *getterCXXConstructor)
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
SourceLocation getAtLoc() const
filtered_category_iterator< isKnownCategory > known_categories_iterator
Iterator that walks over all of the known categories and extensions, including those that are hidden...
SourceRange getAtEndRange() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
void setVariadic(bool isVar)
llvm::iterator_range< redecl_iterator > redecl_range
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
SourceLocation getLocStart() const LLVM_READONLY
const ParmVarDecl *const * param_const_iterator
visible_categories_iterator visible_categories_begin() const
Retrieve an iterator to the beginning of the visible-categories list.
llvm::iterator_range< instprop_iterator > instprop_range
method_iterator meth_end() const
CompoundStmt - This represents a group of statements like { stmt stmt }.
bool isRetaining() const
isRetaining - Return true if the property retains its value.
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
void setHasDestructors(bool val)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute...
ObjCProtocolList::loc_iterator protocol_loc_iterator
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
protocol_loc_iterator protocol_loc_begin() const
ObjCDeclQualifier getObjCDeclQualifier() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
void setIvarRBraceLoc(SourceLocation Loc)
SourceLocation getSuperClassLoc() const
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
bool isUnarySelector() const
static bool classofKind(Kind K)
void setNextIvar(ObjCIvarDecl *ivar)
void setSynthesize(bool synth)
FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
filtered_decl_iterator< ObjCPropertyDecl,&ObjCPropertyDecl::isClassProperty > classprop_iterator
visible_extensions_iterator visible_extensions_begin() const
Retrieve an iterator to the beginning of the visible-extensions list.
void setType(QualType T, TypeSourceInfo *TSI)
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction...
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
filtered_category_iterator< isVisibleExtension > visible_extensions_iterator
Iterator that walks over all of the visible extensions, skipping any that are known but hidden...
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
Expr - This represents one expression.
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, TypeSourceInfo *TInfo)
StringRef getName() const
Return the actual identifier string.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
static ObjCMethodDecl * Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
static bool classof(const Decl *D)
unsigned getNumArgs() const
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
static bool classof(const Decl *D)
ObjCIvarDecl * getPropertyIvarDecl() const
protocol_iterator protocol_begin() const
param_iterator param_end()
llvm::iterator_range< visible_categories_iterator > visible_categories_range
void setAtEndRange(SourceRange atEnd)
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
prop_iterator prop_end() const
llvm::iterator_range< known_categories_iterator > known_categories_range
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
void addClassMethod(ObjCMethodDecl *method)
ParmVarDecl *const * param_iterator
void setGetterName(Selector Sel)
ImplicitParamDecl * getSelfDecl() const
protocol_iterator protocol_begin() const
void setDefined(bool isDefined)
classmeth_iterator classmeth_begin() const
ObjCTypeParamDecl * back() const
void setImplementation(ObjCImplementationDecl *ImplD)
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type...
bool isInstanceMethod() const
static bool classofKind(Kind K)
SourceLocation getRAngleLoc() const
static bool classof(const Decl *D)
virtual void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const
This routine collects list of properties to be implemented in the class.
instmeth_iterator instmeth_end() const
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
DeclarationName getDeclName() const
getDeclName - Get the actual, stored name of the declaration, which may be a special name...
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
protocol_loc_range protocol_locs() const
static bool classof(const Decl *D)
void setIvarRBraceLoc(SourceLocation Loc)
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
unsigned ivar_size() const
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
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...
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
void setHasSkippedBody(bool Skipped=true)
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
init_const_range inits() const
TypeSourceInfo * getReturnTypeSourceInfo() const
AccessControl getCanonicalAccessControl() const
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
ObjCInterfaceDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
filtered_category_iterator(ObjCCategoryDecl *Current)
ivar_iterator ivar_begin() const
ivar_iterator ivar_begin() const
ObjCCategoryDecl * getCategoryDecl() const
param_const_iterator param_end() const
filtered_decl_iterator< ObjCMethodDecl,&ObjCMethodDecl::isClassMethod > classmeth_iterator
bool isClassMethod() const
std::input_iterator_tag iterator_category
PODSourceRange Brackets
Location of the left and right angle brackets.
ArrayRef< ParmVarDecl * > parameters() const
ivar_iterator ivar_end() const
const ObjCMethodDecl * getCanonicalDecl() const
T * operator[](unsigned Idx) const
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed)
filtered_decl_iterator< ObjCMethodDecl,&ObjCMethodDecl::isInstanceMethod > instmeth_iterator
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface. ...
pointer operator->() const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
Encodes a location in the source.
llvm::iterator_range< protocol_iterator > protocol_range
unsigned protocol_size() const
bool visible_extensions_empty() const
Determine whether the visible-extensions list is empty.
classprop_iterator classprop_begin() const
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
llvm::iterator_range< init_iterator > init_range
void setIvarLBraceLoc(SourceLocation Loc)
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
const ObjCInterfaceDecl * getClassInterface() const
void setAtStartLoc(SourceLocation Loc)
ivar_iterator ivar_end() const
static bool classof(const Decl *D)
bool isValid() const
Return true if this is a valid SourceLocation object.
void setObjCDeclQualifier(ObjCDeclQualifier QV)
redeclarable_base::redecl_iterator redecl_iterator
ObjCList - This is a simple template class used to hold various lists of decls etc, which is heavily used by the ObjC front-end.
void setPropertyAttributesAsWritten(PropertyAttributeKind PRVal)
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
ivar_iterator ivar_begin() const
bool getSynthesize() const
redecl_iterator redecls_end() const
reference operator*() const
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
all_protocol_iterator all_referenced_protocol_end() const
const_iterator begin() const
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
ObjCCategoryDecl - Represents a category declaration.
const ObjCInterfaceDecl * getClassInterface() const
llvm::iterator_range< instmeth_iterator > instmeth_range
bool isPropertyAccessor() const
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
Represents one property declaration in an Objective-C interface.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i.e., not hidden in a non-imported submodule.
ObjCTypeParamDecl ** iterator
Iterate through the type parameters in the list.
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertyMap &PM) const
Number of bits fitting all the property attributes.
loc_iterator loc_begin() const
QualType getReturnType() const
const T * castAs() const
Member-template castAs<specific type>.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
llvm::iterator_range< all_protocol_iterator > all_protocol_range
prop_iterator prop_begin() const
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
const ObjCInterfaceDecl * getDefinition() const
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
ObjCTypeParamDecl *const * const_iterator
SourceLocation getLAngleLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
SourceLocation getCategoryNameLoc() const
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
SourceLocation getLParenLoc() const
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
void setSetterCXXAssignment(Expr *setterCXXAssignment)
ObjCIvarDecl * getNextIvar()
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
known_extensions_iterator known_extensions_begin() const
Retrieve an iterator to the beginning of the known-extensions list.
Base class for declarations which introduce a typedef-name.
void setPropertyDecl(ObjCPropertyDecl *Prop)
const ObjCProtocolList & getReferencedProtocols() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
instmeth_range instance_methods() const
static bool classofKind(Kind K)
Selector getObjCSelector() const
getObjCSelector - Get the Objective-C selector stored in this declaration name.
param_iterator param_begin()
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
static bool classofKind(Kind K)
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.
static bool classof(const Decl *D)
ObjCCategoryImplDecl * getImplementation() const
SourceRange getSourceRange() const override LLVM_READONLY
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
protocol_loc_iterator protocol_loc_end() const
prop_range properties() const
std::string getNameAsString() const
Get the name of the class associated with this interface.
ObjCIvarDecl * getPropertyIvarDecl() const
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
SourceRange getSourceRange() const override LLVM_READONLY
protocol_loc_iterator protocol_loc_end() const
bool isValid() const
Whether this pointer is non-NULL.
Reads an AST files chain containing the contents of a translation unit.
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
void setIvarList(ObjCIvarDecl *ivar)
SourceLocation getPropertyIvarDeclLoc() const
filtered_category_iterator & operator++()
Represents the declaration of an Objective-C type parameter.
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
Selector getGetterName() const
bool hasDefinition() const
Determine whether this protocol has a definition.
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
init_const_iterator init_end() const
end() - Retrieve an iterator past the last initializer.
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
loc_iterator loc_end() const
Selector getSelector() const
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
static bool classofKind(Kind K)
ObjCTypeParamDecl * front() const
SourceLocation getEndOfDefinitionLoc() const
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
instprop_iterator instprop_end() const
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
visible_extensions_iterator visible_extensions_end() const
Retrieve an iterator to the end of the visible-extensions list.
known_extensions_range known_extensions() const
static ObjCIvarDecl * Create(ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
ObjCMethodDecl * getGetterMethodDecl() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
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).
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
void setHasNonZeroConstructors(bool val)
void overwritePropertyAttributes(unsigned PRVal)
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
Represents a C++ base or member initializer.
unsigned ivar_size() const
ObjCMethodDecl * getSetterMethodDecl() const
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 ']': "[foo release]".
instprop_range instance_properties() const
SourceRange getSourceRange() const override LLVM_READONLY
ObjCProtocolList::iterator protocol_iterator
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
bool hasBody() const override
Determine whether this method has a body.
llvm::iterator_range< protocol_iterator > protocol_range
void setSetterName(Selector Sel)
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
A list of Objective-C protocols, along with the source locations at which they were referenced...
const ObjCProtocolList & getReferencedProtocols() const
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
unsigned protocol_size() const
protocol_range protocols() const
ObjCImplementationDecl * getImplementation() const
void addDecl(Decl *D)
Add the declaration D into this context.
protocol_iterator protocol_end() const
ObjCCategoryDecl * value_type
const ObjCInterfaceDecl * getClassInterface() const
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
ObjCPropertyDecl * getPropertyDecl() const
AccessControl getAccessControl() const
classmeth_range class_methods() const
static bool classofKind(Kind K)
llvm::iterator_range< known_extensions_iterator > known_extensions_range
Represents a field declaration created by an @defs(...).
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node...
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
classprop_range class_properties() const
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
void setInstanceMethod(bool isInst)
void SetRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
method_iterator meth_begin() const
all_protocol_iterator all_referenced_protocol_begin() const
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCIvarDecl - Represents an ObjC instance variable.
llvm::mapped_iterator< param_const_iterator, deref_fun > param_type_iterator
ObjCPropertyQueryKind getQueryKind() const
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
void setIvarLBraceLoc(SourceLocation Loc)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
void setPropertyAttributes(PropertyAttributeKind PRVal)
static bool classofKind(Kind K)
ObjCInterfaceDecl * getSuperClass() const
PropertyAttributeKind getPropertyAttributesAsWritten() const
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
SourceLocation getIvarRBraceLoc() const
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or immediately...
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void addPropertyImplementation(ObjCPropertyImplDecl *property)
void setAtLoc(SourceLocation Loc)
const ObjCInterfaceDecl * getCanonicalDecl() const
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
static bool classof(const Decl *D)
A trivial tuple used to represent a source range.
propimpl_iterator propimpl_end() const
NamedDecl - This represents a decl with a name.
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
static bool classof(const Decl *D)
bool known_categories_empty() const
Determine whether the known-categories list is empty.
SourceRange getSourceRange() const
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
classprop_iterator classprop_end() const
static bool classofKind(Kind K)
redeclarable_base::redecl_range redecl_range
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
void setCmdDecl(ImplicitParamDecl *CD)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
The parameter is invariant: must match exactly.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
visible_extensions_range visible_extensions() const
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
const_iterator end() const
DeclContext(Decl::Kind K)
ObjCCompatibleAliasDecl - Represents alias of a class.
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
const ObjCProtocolList & getReferencedProtocols() const
bool isHidden() const
Determine whether this declaration is hidden from name lookup.
param_type_iterator param_type_begin() const
const ObjCInterfaceDecl * getSuperClass() const