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())
222 void setParamsAndSelLocs(ASTContext &C,
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),
239 RelatedResultType(HasRelatedResultType),
241 MethodDeclType(T), ReturnTInfo(ReturnTInfo), ParamsAndSelLocs(nullptr),
242 NumParams(0), DeclEndLoc(endLoc), Body(), SelfDecl(nullptr),
250 ObjCMethodDecl *getNextRedeclarationImpl()
override;
253 static ObjCMethodDecl *
254 Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc,
255 Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo,
258 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
260 bool HasRelatedResultType =
false);
304 if (hasStandardSelLocs())
309 return getStoredSelLocs()[Index];
372 return llvm::makeArrayRef(const_cast<ParmVarDecl**>(getParams()),
387 typedef llvm::mapped_iterator<param_const_iterator, GetTypeFn>
406 bool &selfIsPseudoStrong,
bool &selfIsConsumed);
463 DeclImplementation = ic;
538 void anchor()
override;
544 unsigned Variance : 2;
560 Index(index), Variance(static_cast<unsigned>(variance)),
561 VarianceLoc(varianceLoc), ColonLoc(colonLoc) { }
583 Variance =
static_cast<unsigned>(variance);
618 struct PODSourceRange {
653 unsigned size()
const {
return NumParams; }
659 return getTrailingObjects<ObjCTypeParamDecl *>();
667 assert(
size() > 0 &&
"empty Objective-C type parameter list");
672 assert(
size() > 0 &&
"empty Objective-C type parameter list");
705 void anchor()
override;
744 unsigned PropertyImplementation : 2;
759 :
NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
760 LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
763 PropertyImplementation(propControl),
766 GetterMethodDecl(nullptr), SetterMethodDecl(nullptr),
767 PropertyIvarDecl(nullptr) {}
772 IdentifierInfo *Id, SourceLocation AtLocation,
773 SourceLocation LParenLocation,
792 DeclTypeSourceInfo = TSI;
803 PropertyAttributes |= PRVal;
806 PropertyAttributes = PRVal;
814 PropertyAttributesAsWritten = PRVal;
831 return (PropertyAttributes &
883 PropertyImplementation = pc;
893 PropertyIvarDecl = Ivar;
896 return PropertyIvarDecl;
920 void anchor()
override;
936 typedef llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>
979 typedef llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>
1024 bool AllowHidden =
false)
const;
1026 bool AllowHidden =
false)
const {
1027 return getMethod(Sel,
true, AllowHidden);
1030 return getMethod(Sel,
false, AllowHidden);
1071 return K >= firstObjCContainer &&
1072 K <= lastObjCContainer;
1110 void anchor()
override;
1114 mutable const Type *TypeForDecl;
1117 struct DefinitionData {
1144 mutable unsigned ExternallyCompleted : 1;
1148 mutable unsigned IvarListMissingImplementation : 1;
1152 unsigned HasDesignatedInitializers : 1;
1154 enum InheritedDesignatedInitializersState {
1161 IDI_NotInherited = 2
1164 mutable unsigned InheritedDesignatedInitializers : 2;
1171 DefinitionData() : Definition(), SuperClassTInfo(), CategoryList(), IvarList(),
1172 ExternallyCompleted(),
1173 IvarListMissingImplementation(
true),
1174 HasDesignatedInitializers(),
1175 InheritedDesignatedInitializers(IDI_Unknown) { }
1179 IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1180 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1183 void LoadExternalDefinition()
const;
1186 ObjCTypeParamList *TypeParamList;
1193 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1195 DefinitionData &data()
const {
1196 assert(Data.getPointer() &&
"Declaration has no definition!");
1197 return *Data.getPointer();
1201 void allocateDefinitionData();
1203 typedef Redeclarable<ObjCInterfaceDecl> redeclarable_base;
1204 ObjCInterfaceDecl *getNextRedeclarationImpl()
override {
1207 ObjCInterfaceDecl *getPreviousDeclImpl()
override {
1210 ObjCInterfaceDecl *getMostRecentDeclImpl()
override {
1216 SourceLocation atLoc,
1218 ObjCTypeParamList *typeParamList,
1219 ObjCInterfaceDecl *PrevDecl,
1220 SourceLocation ClassLoc = SourceLocation(),
1221 bool isInternal =
false);
1242 return TypeParamList;
1272 assert(
hasDefinition() &&
"Caller did not check for forward reference!");
1273 if (data().ExternallyCompleted)
1274 LoadExternalDefinition();
1276 return data().ReferencedProtocols;
1303 if (data().ExternallyCompleted)
1304 LoadExternalDefinition();
1306 return data().ReferencedProtocols.begin();
1313 if (data().ExternallyCompleted)
1314 LoadExternalDefinition();
1316 return data().ReferencedProtocols.end();
1330 if (data().ExternallyCompleted)
1331 LoadExternalDefinition();
1333 return data().ReferencedProtocols.loc_begin();
1341 if (data().ExternallyCompleted)
1342 LoadExternalDefinition();
1344 return data().ReferencedProtocols.loc_end();
1359 if (data().ExternallyCompleted)
1360 LoadExternalDefinition();
1362 return data().AllReferencedProtocols.empty()
1364 : data().AllReferencedProtocols.begin();
1371 if (data().ExternallyCompleted)
1372 LoadExternalDefinition();
1374 return data().AllReferencedProtocols.empty()
1376 : data().AllReferencedProtocols.end();
1380 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
1416 data().ReferencedProtocols.set(List, Num, Locs, C);
1462 if (!Data.getOpaqueValue())
1465 return Data.getPointer();
1472 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1479 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1500 if (data().ExternallyCompleted)
1501 LoadExternalDefinition();
1503 return data().SuperClassTInfo;
1511 data().SuperClassTInfo = superClass;
1519 template<
bool (*Filter)(ObjCCategoryDecl *)>
1523 void findAcceptableCategory();
1536 findAcceptableCategory();
1552 return X.Current == Y.Current;
1557 return X.Current != Y.Current;
1570 typedef filtered_category_iterator<isVisibleCategory>
1573 typedef llvm::iterator_range<visible_categories_iterator>
1607 typedef llvm::iterator_range<known_categories_iterator>
1640 typedef filtered_category_iterator<isVisibleExtension>
1643 typedef llvm::iterator_range<visible_extensions_iterator>
1675 typedef filtered_category_iterator<isKnownExtension>
1677 typedef llvm::iterator_range<known_extensions_iterator>
1708 if (data().ExternallyCompleted)
1709 LoadExternalDefinition();
1711 return data().CategoryList;
1717 data().CategoryList = category;
1731 while (I !=
nullptr) {
1761 bool shallowCategoryLookup =
false,
1762 bool followSuper =
true,
1778 bool Instance=
true)
const;
1789 bool IsClassProperty)
const {
1800 return data().EndLoc;
1819 bool lookupCategory,
1820 bool RHSIsQualifiedID =
false);
1848 bool inheritsDesignatedInitializers()
const;
1867 void anchor()
override;
1879 :
FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1881 NextIvar(nullptr), DeclAccess(ac), Synthesized(synthesized) {}
1884 static ObjCIvarDecl *
Create(ASTContext &C, ObjCContainerDecl *DC,
1885 SourceLocation StartLoc, SourceLocation IdLoc,
1886 IdentifierInfo *Id, QualType T,
1887 TypeSourceInfo *TInfo,
1889 bool synthesized=
false);
1927 unsigned DeclAccess : 3;
1928 unsigned Synthesized : 1;
1934 void anchor()
override;
1938 :
FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
1987 void anchor()
override;
1989 struct DefinitionData {
2002 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2004 DefinitionData &data()
const {
2005 assert(Data.getPointer() &&
"Objective-C protocol has no definition!");
2006 return *Data.getPointer();
2013 void allocateDefinitionData();
2037 return data().ReferencedProtocols;
2049 return data().ReferencedProtocols.begin();
2055 return data().ReferencedProtocols.end();
2067 return data().ReferencedProtocols.loc_begin();
2073 return data().ReferencedProtocols.loc_end();
2079 return data().ReferencedProtocols.size();
2087 data().ReferencedProtocols.set(List, Num, Locs, C);
2108 if (!Data.getOpaqueValue())
2111 return Data.getPointer();
2116 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2121 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2190 void anchor()
override;
2253 ReferencedProtocols.
set(List, Num, Locs, C);
2257 return ReferencedProtocols;
2267 return ReferencedProtocols.
begin();
2281 return ReferencedProtocols.
loc_end();
2289 return NextClassCategory;
2295 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
2327 void anchor()
override;
2338 ClassInterface(classInterface) {}
2364 typedef llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>
2379 return K >= firstObjCImpl && K <= lastObjCImpl;
2397 void anchor()
override;
2406 :
ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id,
2407 nameLoc, atStartLoc),
2408 CategoryNameLoc(CategoryNameLoc) {}
2449 void anchor()
override;
2461 unsigned NumIvarInitializers;
2465 bool HasNonZeroConstructors : 1;
2468 bool HasDestructors : 1;
2480 nameLoc, atStartLoc),
2481 SuperClass(superDecl), SuperLoc(superLoc), IvarLBraceLoc(IvarLBraceLoc),
2482 IvarRBraceLoc(IvarRBraceLoc),
2483 IvarInitializers(
nullptr), NumIvarInitializers(0),
2484 HasNonZeroConstructors(
false), HasDestructors(
false) {}
2513 const auto *ConstThis =
this;
2529 return NumIvarInitializers;
2533 NumIvarInitializers = numNumIvarInitializers;
2538 unsigned numInitializers);
2562 assert(
getIdentifier() &&
"Name is not a simple identifier");
2589 typedef llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>
ivar_range;
2617 void anchor()
override;
2623 :
NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2670 Expr *GetterCXXConstructor;
2674 Expr *SetterCXXAssignment;
2681 :
Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2682 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl),
2683 GetterCXXConstructor(nullptr), SetterCXXAssignment(nullptr) {
2684 assert (PK ==
Dynamic || PropertyIvarDecl);
2689 SourceLocation atLoc, SourceLocation L,
2690 ObjCPropertyDecl *property,
2692 ObjCIvarDecl *ivarDecl,
2693 SourceLocation ivarLoc);
2703 return PropertyDecl;
2712 return PropertyIvarDecl;
2718 PropertyIvarDecl = Ivar;
2719 this->IvarLoc = IvarLoc;
2734 return GetterCXXConstructor;
2737 GetterCXXConstructor = getterCXXConstructor;
2741 return SetterCXXAssignment;
2744 SetterCXXAssignment = setterCXXAssignment;
2753 template<
bool (*Filter)(ObjCCategoryDecl *)>
2761 template<
bool (*Filter)(ObjCCategoryDecl *)>
2762 inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2765 findAcceptableCategory();
2777 inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2778 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...
void setImplicit(bool I=true)
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
Stmt - This represents one statement.
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.
Decl - This represents one declaration (or definition), e.g.
instprop_iterator instprop_begin() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
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()
bool isHidden() const
Determine whether this declaration might be hidden from name lookup.
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
Source range that this declaration covers.
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)
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.
SourceLocation getSetterNameLoc() const
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.
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
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.
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
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
SourceLocation getGetterNameLoc() 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
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
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
Source range that this declaration covers.
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)
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
Retrieves the "canonical" declaration of the given declaration.
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...
Number of bits fitting all the property attributes.
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 }.
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
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)
QualType operator()(const ParmVarDecl *PD) const
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
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.
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
Source range that this declaration covers.
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
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
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
ObjCIvarDecl * getPropertyIvarDecl() const
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
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
Source range that this declaration covers.
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
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.
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
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
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
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.
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
Kind
Lists the kind of concrete classes of Decl.
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.
SourceLocation getLocation() const
void setLexicalDeclContext(DeclContext *DC)
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.
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
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
param_type_iterator param_type_begin() const
const ObjCInterfaceDecl * getSuperClass() const