13#ifndef LLVM_CLANG_AST_DECLOBJC_H
14#define LLVM_CLANG_AST_DECLOBJC_H
27#include "llvm/ADT/ArrayRef.h"
28#include "llvm/ADT/DenseSet.h"
29#include "llvm/ADT/MapVector.h"
30#include "llvm/ADT/PointerIntPair.h"
31#include "llvm/ADT/STLExtras.h"
32#include "llvm/ADT/StringRef.h"
33#include "llvm/ADT/iterator_range.h"
34#include "llvm/Support/Compiler.h"
35#include "llvm/Support/TrailingObjects.h"
47class CXXCtorInitializer;
49class ObjCCategoryDecl;
50class ObjCCategoryImplDecl;
51class ObjCImplementationDecl;
52class ObjCInterfaceDecl;
54class ObjCPropertyDecl;
55class ObjCPropertyImplDecl;
56class ObjCProtocolDecl;
74 void set(
void *
const* InList,
unsigned Elts,
ASTContext &Ctx);
94 assert(Idx <
NumElts &&
"Invalid access");
154 void *ParamsAndSelLocs =
nullptr;
155 unsigned NumParams = 0;
176 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
178 bool HasRelatedResultType =
false);
188 bool hasStandardSelLocs()
const {
194 SourceLocation *getStoredSelLocs() {
195 return reinterpret_cast<SourceLocation *
>(getParams() + NumParams);
197 const SourceLocation *getStoredSelLocs()
const {
198 return reinterpret_cast<const SourceLocation *
>(getParams() + NumParams);
203 ParmVarDecl **getParams() {
204 return reinterpret_cast<ParmVarDecl **
>(ParamsAndSelLocs);
206 const ParmVarDecl *
const *getParams()
const {
207 return reinterpret_cast<const ParmVarDecl *
const *
>(ParamsAndSelLocs);
212 unsigned getNumStoredSelLocs()
const {
213 if (hasStandardSelLocs())
218 void setParamsAndSelLocs(ASTContext &
C,
219 ArrayRef<ParmVarDecl*> Params,
220 ArrayRef<SourceLocation> SelLocs);
225 ObjCMethodDecl *getNextRedeclarationImpl()
override;
237 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
239 bool HasRelatedResultType =
false);
298 if (hasStandardSelLocs())
303 return getStoredSelLocs()[Index];
380 assert(Idx < NumParams &&
"Index out of bounds!");
381 return getParams()[Idx];
399 llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
418 bool &selfIsPseudoStrong,
bool &selfIsConsumed)
const;
584 unsigned Variance : 2;
600 Index(index), Variance(
static_cast<unsigned>(variance)),
601 VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
603 void anchor()
override;
628 Variance =
static_cast<unsigned>(variance);
658 :
private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
685 unsigned size()
const {
return NumParams; }
691 return getTrailingObjects<ObjCTypeParamDecl *>();
699 assert(
size() > 0 &&
"empty Objective-C type parameter list");
704 assert(
size() > 0 &&
"empty Objective-C type parameter list");
730 void anchor()
override;
749 unsigned PropertyImplementation : 2;
775 :
NamedDecl(ObjCProperty, DC, L,
Id), AtLoc(AtLocation),
776 LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
777 PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
778 PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
779 PropertyImplementation(propControl) {}
782 static ObjCPropertyDecl *
783 Create(ASTContext &
C, DeclContext *DC, SourceLocation L, IdentifierInfo *
Id,
784 SourceLocation AtLocation, SourceLocation LParenLocation, QualType T,
801 DeclTypeSourceInfo = TSI;
813 PropertyAttributes |= PRVal;
817 PropertyAttributes = PRVal;
825 PropertyAttributesAsWritten = PRVal;
902 PropertyImplementation = pc;
914 PropertyIvarDecl = Ivar;
918 return PropertyIvarDecl;
949 void anchor()
override;
958 llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
1007 llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1057 bool AllowHidden =
false)
const;
1060 bool AllowHidden =
false)
const {
1061 return getMethod(Sel,
true, AllowHidden);
1065 return getMethod(Sel,
false, AllowHidden);
1072 bool IsInstance)
const;
1108 return K >= firstObjCContainer &&
1109 K <= lastObjCContainer;
1153 mutable const Type *TypeForDecl =
nullptr;
1155 struct DefinitionData {
1182 mutable unsigned ExternallyCompleted : 1;
1186 mutable unsigned IvarListMissingImplementation : 1;
1190 unsigned HasDesignatedInitializers : 1;
1192 enum InheritedDesignatedInitializersState {
1201 IDI_NotInherited = 2
1205 mutable unsigned InheritedDesignatedInitializers : 2;
1208 unsigned HasODRHash : 1;
1219 : ExternallyCompleted(
false), IvarListMissingImplementation(
true),
1220 HasDesignatedInitializers(
false),
1221 InheritedDesignatedInitializers(IDI_Unknown), HasODRHash(
false) {}
1225 ObjCTypeParamList *TypeParamList =
nullptr;
1232 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1234 ObjCInterfaceDecl(
const ASTContext &
C, DeclContext *DC, SourceLocation AtLoc,
1235 IdentifierInfo *
Id, ObjCTypeParamList *typeParamList,
1236 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1239 void anchor()
override;
1241 void LoadExternalDefinition()
const;
1243 DefinitionData &data()
const {
1244 assert(
Data.getPointer() &&
"Declaration has no definition!");
1245 return *
Data.getPointer();
1249 void allocateDefinitionData();
1251 using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
1253 ObjCInterfaceDecl *getNextRedeclarationImpl()
override {
1257 ObjCInterfaceDecl *getPreviousDeclImpl()
override {
1261 ObjCInterfaceDecl *getMostRecentDeclImpl()
override {
1267 SourceLocation atLoc,
1269 ObjCTypeParamList *typeParamList,
1270 ObjCInterfaceDecl *PrevDecl,
1271 SourceLocation ClassLoc = SourceLocation(),
1272 bool isInternal =
false);
1293 return TypeParamList;
1323 assert(
hasDefinition() &&
"Caller did not check for forward reference!");
1324 if (data().ExternallyCompleted)
1325 LoadExternalDefinition();
1327 return data().ReferencedProtocols;
1356 if (data().ExternallyCompleted)
1357 LoadExternalDefinition();
1359 return data().ReferencedProtocols.begin();
1367 if (data().ExternallyCompleted)
1368 LoadExternalDefinition();
1370 return data().ReferencedProtocols.end();
1385 if (data().ExternallyCompleted)
1386 LoadExternalDefinition();
1388 return data().ReferencedProtocols.loc_begin();
1396 if (data().ExternallyCompleted)
1397 LoadExternalDefinition();
1399 return data().ReferencedProtocols.loc_end();
1415 if (data().ExternallyCompleted)
1416 LoadExternalDefinition();
1418 return data().AllReferencedProtocols.empty()
1420 : data().AllReferencedProtocols.begin();
1428 if (data().ExternallyCompleted)
1429 LoadExternalDefinition();
1431 return data().AllReferencedProtocols.empty()
1433 : data().AllReferencedProtocols.end();
1437 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
1475 data().ReferencedProtocols.set(List, Num, Locs,
C);
1521 if (!
Data.getOpaqueValue())
1524 return Data.getPointer();
1566 if (data().ExternallyCompleted)
1567 LoadExternalDefinition();
1569 return data().SuperClassTInfo;
1577 data().SuperClassTInfo = superClass;
1585 template<
bool (*Filter)(ObjCCategoryDecl *)>
1589 void findAcceptableCategory();
1600 : Current(Current) {
1601 findAcceptableCategory();
1617 return X.Current == Y.Current;
1622 return X.Current != Y.Current;
1639 llvm::iterator_range<visible_categories_iterator>;
1673 llvm::iterator_range<known_categories_iterator>;
1709 llvm::iterator_range<visible_extensions_iterator>;
1747 llvm::iterator_range<known_extensions_iterator>;
1777 if (data().ExternallyCompleted)
1778 LoadExternalDefinition();
1780 return data().CategoryList;
1786 data().CategoryList = category;
1799 while (I !=
nullptr) {
1829 bool shallowCategoryLookup =
false,
1830 bool followSuper =
true,
1847 bool Instance=
true)
const;
1858 bool IsClassProperty)
const {
1869 return data().EndLoc;
1888 bool lookupCategory,
1889 bool RHSIsQualifiedID =
false);
1917 bool hasODRHash()
const;
1918 void setHasODRHash(
bool HasHash);
1921 bool inheritsDesignatedInitializers()
const;
1940 void anchor()
override;
1952 :
FieldDecl(ObjCIvar, DC, StartLoc, IdLoc,
Id, T, TInfo, BW,
1954 DeclAccess(ac), Synthesized(synthesized) {}
1957 static ObjCIvarDecl *
Create(ASTContext &
C, ObjCContainerDecl *DC,
1958 SourceLocation StartLoc, SourceLocation IdLoc,
1959 IdentifierInfo *
Id, QualType T,
1960 TypeSourceInfo *TInfo,
1962 bool synthesized=
false);
2011 unsigned DeclAccess : 3;
2012 unsigned Synthesized : 1;
2020 :
FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc,
Id, T,
2024 void anchor()
override;
2070 struct DefinitionData {
2078 unsigned HasODRHash : 1;
2089 llvm::PointerIntPair<DefinitionData *, 1, bool>
Data;
2095 void anchor()
override;
2097 DefinitionData &data()
const {
2098 assert(
Data.getPointer() &&
"Objective-C protocol has no definition!");
2099 return *
Data.getPointer();
2102 void allocateDefinitionData();
2119 bool hasODRHash()
const;
2120 void setHasODRHash(
bool HasHash);
2138 return data().ReferencedProtocols;
2152 return data().ReferencedProtocols.begin();
2159 return data().ReferencedProtocols.end();
2173 return data().ReferencedProtocols.loc_begin();
2180 return data().ReferencedProtocols.loc_end();
2187 return data().ReferencedProtocols.size();
2195 data().ReferencedProtocols.set(List, Num, Locs,
C);
2226 if (!
Data.getOpaqueValue())
2229 return Data.getPointer();
2340 void anchor()
override;
2378 ReferencedProtocols.
set(List, Num, Locs,
C);
2382 return ReferencedProtocols;
2393 return ReferencedProtocols.
begin();
2411 return ReferencedProtocols.
loc_end();
2419 return NextClassCategory;
2425 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2461 void anchor()
override;
2469 ClassInterface(classInterface) {}
2497 llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2514 return K >= firstObjCImpl && K <= lastObjCImpl;
2540 nameLoc, atStartLoc),
2541 CategoryNameLoc(CategoryNameLoc) {}
2543 void anchor()
override;
2565raw_ostream &
operator<<(raw_ostream &OS,
const ObjCCategoryImplDecl &CID);
2596 unsigned NumIvarInitializers = 0;
2600 bool HasNonZeroConstructors : 1;
2603 bool HasDestructors : 1;
2615 nameLoc, atStartLoc),
2616 SuperClass(superDecl), SuperLoc(superLoc),
2617 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2618 HasNonZeroConstructors(
false), HasDestructors(
false) {}
2620 void anchor()
override;
2654 const auto *ConstThis =
this;
2673 return NumIvarInitializers;
2677 NumIvarInitializers = numNumIvarInitializers;
2682 unsigned numInitializers);
2706 assert(
getIdentifier() &&
"Name is not a simple identifier");
2731 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2755raw_ostream &
operator<<(raw_ostream &OS,
const ObjCImplementationDecl &
ID);
2765 :
NamedDecl(ObjCCompatibleAlias, DC, L,
Id), AliasedClass(aliasedClass) {}
2767 void anchor()
override;
2820 Expr *GetterCXXConstructor =
nullptr;
2824 Expr *SetterCXXAssignment =
nullptr;
2831 :
Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2832 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2833 assert(PK ==
Dynamic || PropertyIvarDecl);
2854 return PropertyDecl;
2863 return PropertyIvarDecl;
2869 PropertyIvarDecl = Ivar;
2870 this->IvarLoc = IvarLoc;
2891 return GetterCXXConstructor;
2895 GetterCXXConstructor = getterCXXConstructor;
2899 return SetterCXXAssignment;
2903 SetterCXXAssignment = setterCXXAssignment;
2910template<
bool (*Filter)(ObjCCategoryDecl *)>
2912ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2913findAcceptableCategory() {
2914 while (Current && !Filter(Current))
2915 Current = Current->getNextClassCategoryRaw();
2918template<
bool (*Filter)(ObjCCategoryDecl *)>
2919inline ObjCInterfaceDecl::filtered_category_iterator<Filter> &
2921 Current = Current->getNextClassCategoryRaw();
2922 findAcceptableCategory();
2935inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2936 return !Cat->isInvalidDecl() && Cat->IsClassExtension();
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
Represents a C++ base or member initializer.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Iterates over a filtered subrange of declarations stored in a DeclContext.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ObjCMethodDeclBitfields ObjCMethodDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
void addDecl(Decl *D)
Add the declaration D into this context.
decl_iterator decls_end() const
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Kind
Lists the kind of concrete classes of Decl.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
bool isInvalidDecl() const
SourceLocation getLocation() const
void setLexicalDeclContext(DeclContext *DC)
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
This represents one expression.
Represents a member of a struct/union/class.
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a field declaration created by an @defs(...).
static bool classofKind(Kind K)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
static bool classof(const Decl *D)
ObjCCategoryDecl - Represents a category declaration.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ObjCCategoryDecl * getNextClassCategory() const
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
unsigned ivar_size() const
ivar_iterator ivar_begin() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
ivar_iterator ivar_end() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
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())
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
protocol_loc_range protocol_locs() const
void setIvarLBraceLoc(SourceLocation Loc)
unsigned protocol_size() const
ObjCCategoryImplDecl * getImplementation() const
void setCategoryNameLoc(SourceLocation Loc)
ObjCInterfaceDecl * getClassInterface()
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
static bool classofKind(Kind K)
void setIvarRBraceLoc(SourceLocation Loc)
protocol_iterator protocol_end() const
const ObjCInterfaceDecl * getClassInterface() const
llvm::iterator_range< protocol_iterator > protocol_range
SourceLocation getIvarLBraceLoc() const
bool IsClassExtension() const
SourceLocation getIvarRBraceLoc() const
protocol_loc_iterator protocol_loc_begin() const
protocol_iterator protocol_begin() const
protocol_range protocols() const
const ObjCProtocolList & getReferencedProtocols() const
void setImplementation(ObjCCategoryImplDecl *ImplD)
ObjCProtocolList::iterator protocol_iterator
static bool classof(const Decl *D)
SourceLocation getCategoryNameLoc() const
protocol_loc_iterator protocol_loc_end() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
static bool classofKind(Kind K)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
SourceLocation getCategoryNameLoc() const
ObjCCategoryDecl * getCategoryDecl() const
static bool classof(const Decl *D)
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
static bool classofKind(Kind K)
ObjCInterfaceDecl * getClassInterface()
static bool classof(const Decl *D)
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setClassInterface(ObjCInterfaceDecl *D)
ObjCContainerDecl - Represents a container for method declarations.
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
classmeth_iterator classmeth_end() const
prop_iterator prop_end() const
method_iterator meth_begin() const
method_range methods() const
instprop_iterator instprop_end() const
void setAtStartLoc(SourceLocation Loc)
SourceRange getAtEndRange() const
classmeth_iterator classmeth_begin() const
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
prop_iterator prop_begin() const
llvm::iterator_range< instprop_iterator > instprop_range
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
instmeth_range instance_methods() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
classprop_iterator classprop_end() const
instmeth_iterator instmeth_end() const
llvm::iterator_range< classprop_iterator > classprop_range
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
specific_decl_iterator< ObjCMethodDecl > method_iterator
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
classprop_iterator classprop_begin() const
SourceLocation getAtStartLoc() const
method_iterator meth_end() const
static bool classof(const Decl *D)
instprop_range instance_properties() const
llvm::iterator_range< classmeth_iterator > classmeth_range
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
void setAtEndRange(SourceRange atEnd)
virtual void collectPropertiesToImplement(PropertyMap &PM) const
This routine collects list of properties to be implemented in the class.
instmeth_iterator instmeth_begin() const
classprop_range class_properties() const
instprop_iterator instprop_begin() const
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
prop_range properties() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
classmeth_range class_methods() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
llvm::iterator_range< instmeth_iterator > instmeth_range
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
void addPropertyImplementation(ObjCPropertyImplDecl *property)
void addClassMethod(ObjCMethodDecl *method)
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
ObjCInterfaceDecl * getClassInterface()
propimpl_iterator propimpl_begin() const
static bool classof(const Decl *D)
propimpl_range property_impls() const
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
propimpl_iterator propimpl_end() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
static bool classofKind(Kind K)
void addInstanceMethod(ObjCMethodDecl *method)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void setNumIvarInitializers(unsigned numNumIvarInitializers)
static bool classofKind(Kind K)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
llvm::iterator_range< init_iterator > init_range
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
std::string getNameAsString() const
Get the name of the class associated with this interface.
SourceLocation getSuperClassLoc() const
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ivar_iterator ivar_begin() const
void setIvarLBraceLoc(SourceLocation Loc)
ObjCInterfaceDecl * getSuperClass()
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
void setSuperClass(ObjCInterfaceDecl *superCls)
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
llvm::iterator_range< init_const_iterator > init_const_range
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
init_const_range inits() const
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ivar_iterator ivar_end() const
unsigned ivar_size() const
void setIvarRBraceLoc(SourceLocation Loc)
init_const_iterator init_end() const
end() - Retrieve an iterator past the last initializer.
static bool classof(const Decl *D)
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getIvarLBraceLoc() const
void setHasDestructors(bool val)
void setHasNonZeroConstructors(bool val)
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
filtered_category_iterator(ObjCCategoryDecl *Current)
filtered_category_iterator()=default
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
pointer operator->() const
std::ptrdiff_t difference_type
reference operator*() const
filtered_category_iterator operator++(int)
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
filtered_category_iterator & operator++()
std::input_iterator_tag iterator_category
ObjCCategoryDecl * value_type
Represents an ObjC class declaration.
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
all_protocol_iterator all_referenced_protocol_end() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
ivar_iterator ivar_end() const
static bool classofKind(Kind K)
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
const ObjCInterfaceDecl * getCanonicalDecl() const
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
unsigned ivar_size() const
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
visible_categories_iterator visible_categories_begin() const
Retrieve an iterator to the beginning of the visible-categories list.
bool hasDefinition() const
Determine whether this class has been defined.
all_protocol_range all_referenced_protocols() const
visible_extensions_range visible_extensions() const
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
protocol_loc_iterator protocol_loc_end() const
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
llvm::iterator_range< all_protocol_iterator > all_protocol_range
protocol_loc_iterator protocol_loc_begin() const
ivar_iterator ivar_begin() const
protocol_range protocols() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void setImplementation(ObjCImplementationDecl *ImplD)
protocol_loc_range protocol_locs() const
known_categories_range known_categories() const
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
void setSuperClass(TypeSourceInfo *superClass)
protocol_iterator protocol_end() const
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
all_protocol_iterator all_referenced_protocol_begin() const
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
filtered_category_iterator< isVisibleExtension > visible_extensions_iterator
Iterator that walks over all of the visible extensions, skipping any that are known but hidden.
llvm::iterator_range< visible_categories_iterator > visible_categories_range
const ObjCIvarDecl * all_declared_ivar_begin() const
const ObjCInterfaceDecl * getDefinition() const
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
ObjCMethodDecl * lookupPropertyAccessor(const Selector Sel, const ObjCCategoryDecl *Cat, bool IsClassProperty) const
Lookup a setter or getter in the class hierarchy, including in all categories except for category pas...
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
const ObjCProtocolList & getReferencedProtocols() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i....
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class,...
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
llvm::iterator_range< known_categories_iterator > known_categories_range
ObjCProtocolList::iterator protocol_iterator
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
const Type * getTypeForDecl() const
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class,...
void setTypeForDecl(const Type *TD) const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
ObjCImplementationDecl * getImplementation() const
static bool classof(const Decl *D)
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
SourceLocation getEndOfDefinitionLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
llvm::iterator_range< protocol_iterator > protocol_range
llvm::iterator_range< known_extensions_iterator > known_extensions_range
filtered_category_iterator< isKnownCategory > known_categories_iterator
Iterator that walks over all of the known categories and extensions, including those that are hidden.
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
visible_extensions_iterator visible_extensions_end() const
Retrieve an iterator to the end of the visible-extensions list.
bool visible_extensions_empty() const
Determine whether the visible-extensions list is empty.
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
known_extensions_iterator known_extensions_end() const
Retrieve an iterator to the end of the known-extensions list.
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
void setEndOfDefinitionLoc(SourceLocation LE)
known_categories_iterator known_categories_begin() const
Retrieve an iterator to the beginning of the known-categories list.
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
bool known_categories_empty() const
Determine whether the known-categories list is empty.
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
known_extensions_iterator known_extensions_begin() const
Retrieve an iterator to the beginning of the known-extensions list.
visible_categories_range visible_categories() const
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
ObjCInterfaceDecl * getSuperClass() const
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
TypeSourceInfo * getSuperClassTInfo() const
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface.
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
redeclarable_base::redecl_iterator redecl_iterator
void setIvarList(ObjCIvarDecl *ivar)
void mergeDuplicateDefinitionWithCommon(const ObjCInterfaceDecl *Definition)
visible_categories_iterator visible_categories_end() const
Retrieve an iterator to the end of the visible-categories list.
visible_extensions_iterator visible_extensions_begin() const
Retrieve an iterator to the beginning of the visible-extensions list.
known_extensions_range known_extensions() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
void setAccessControl(AccessControl ac)
static bool classof(const Decl *D)
void setNextIvar(ObjCIvarDecl *ivar)
bool getSynthesize() const
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
void setSynthesize(bool synth)
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)
ObjCIvarDecl * getNextIvar()
const ObjCIvarDecl * getNextIvar() const
const ObjCInterfaceDecl * getContainingInterface() const
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
AccessControl getCanonicalAccessControl() const
const ObjCIvarDecl * getCanonicalDecl() const
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
static bool classofKind(Kind K)
void ** List
List is an array of pointers to objects that are not owned by this object.
ObjCListBase & operator=(const ObjCListBase &)=delete
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCListBase(const ObjCListBase &)=delete
ObjCList - This is a simple template class used to hold various lists of decls etc,...
T * operator[](unsigned Idx) const
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCMethodDecl - Represents an instance or class method declaration.
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface.
ImplicitParamDecl * getSelfDecl() const
bool hasBody() const override
Determine whether this method has a body.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
void setObjCDeclQualifier(ObjCDeclQualifier QV)
void setDefined(bool isDefined)
static bool classofKind(Kind K)
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
param_iterator param_end()
unsigned param_size() const
void setSelfDecl(ImplicitParamDecl *SD)
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
const ParmVarDecl * getParamDecl(unsigned Idx) const
static bool classof(const Decl *D)
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 isSynthesizedAccessorStub=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
bool isPropertyAccessor() const
CompoundStmt * getCompoundBody()
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
void setHasRedeclaration(bool HRD) const
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
param_const_iterator param_end() const
SourceLocation getSelectorStartLoc() const
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
param_const_iterator param_begin() const
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
void setIsRedeclaration(bool RD)
void setCmdDecl(ImplicitParamDecl *CD)
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
bool hasRedeclaration() const
True if redeclared in the same interface.
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
param_type_iterator param_type_begin() const
llvm::iterator_range< param_const_iterator > param_const_range
param_iterator param_begin()
bool isSynthesizedAccessorStub() const
SourceLocation getSelectorLoc(unsigned Index) const
SourceRange getReturnTypeSourceRange() const
void setDeclImplementation(ImplementationControl ic)
void setOverriding(bool IsOver)
const ParmVarDecl *const * param_const_iterator
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
ImplementationControl getImplementationControl() const
param_type_iterator param_type_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs=std::nullopt)
Sets the method's parameters and selector source locations.
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
bool isDirectMethod() const
True if the method is tagged as objc_direct.
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
void setPropertyAccessor(bool isAccessor)
Selector getSelector() const
ImplicitParamDecl * getCmdDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isInstanceMethod() const
llvm::iterator_range< param_iterator > param_range
void setReturnType(QualType T)
void setLazyBody(uint64_t Offset)
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
ParmVarDecl * getParamDecl(unsigned Idx)
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
void setHasSkippedBody(bool Skipped=true)
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
QualType getReturnType() const
ParmVarDecl *const * param_iterator
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
unsigned getNumSelectorLocs() const
bool isClassMethod() const
ObjCInterfaceDecl * getClassInterface()
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
void setInstanceMethod(bool isInst)
void setVariadic(bool isVar)
param_const_iterator sel_param_end() const
const ObjCInterfaceDecl * getClassInterface() const
const ObjCMethodDecl * getCanonicalDecl() const
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
const ObjCCategoryDecl * getCategory() const
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
void setAtLoc(SourceLocation L)
bool isAtomic() const
isAtomic - Return true if the property is atomic.
ObjCPropertyQueryKind getQueryKind() const
bool isClassProperty() const
void setPropertyImplementation(PropertyControl pc)
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
SourceLocation getGetterNameLoc() const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
ObjCMethodDecl * getGetterMethodDecl() const
bool isRetaining() const
isRetaining - Return true if the property retains its value.
bool isInstanceProperty() const
ObjCMethodDecl * getSetterMethodDecl() const
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
ObjCIvarDecl * getPropertyIvarDecl() const
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
bool isDirectProperty() const
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
static bool classofKind(Kind K)
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
void overwritePropertyAttributes(unsigned PRVal)
Selector getGetterName() const
static bool classof(const Decl *D)
void setLParenLoc(SourceLocation L)
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
SourceLocation getLParenLoc() const
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
ObjCPropertyAttribute::Kind getPropertyAttributes() const
void setType(QualType T, TypeSourceInfo *TSI)
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
PropertyControl getPropertyImplementation() const
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Kind getPropertyImplementation() const
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
void setSetterMethodDecl(ObjCMethodDecl *MD)
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
void setSetterCXXAssignment(Expr *setterCXXAssignment)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCMethodDecl * getSetterMethodDecl() const
static bool classof(const Decl *D)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classofKind(Decl::Kind K)
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
void setGetterMethodDecl(ObjCMethodDecl *MD)
void setAtLoc(SourceLocation Loc)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyDecl(ObjCPropertyDecl *Prop)
void setGetterCXXConstructor(Expr *getterCXXConstructor)
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition)
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
bool hasDefinition() const
Determine whether this protocol has a definition.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
const ObjCProtocolList & getReferencedProtocols() const
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
redeclarable_base::redecl_iterator redecl_iterator
protocol_loc_iterator protocol_loc_end() const
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
protocol_loc_range protocol_locs() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
llvm::iterator_range< protocol_iterator > protocol_range
void getImpliedProtocols(llvm::DenseSet< const ObjCProtocolDecl * > &IPs) const
Get the set of all protocols implied by this protocols inheritance hierarchy.
void startDefinition()
Starts the definition of this Objective-C protocol.
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
ObjCProtocolList::iterator protocol_iterator
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
static bool classof(const Decl *D)
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
protocol_range protocols() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const ObjCProtocolDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
unsigned protocol_size() const
protocol_iterator protocol_end() const
protocol_loc_iterator protocol_loc_begin() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
A list of Objective-C protocols, along with the source locations at which they were referenced.
loc_iterator loc_begin() const
const SourceLocation * loc_iterator
loc_iterator loc_end() const
ObjCProtocolList()=default
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Represents the declaration of an Objective-C type parameter.
static bool classof(const Decl *D)
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
unsigned getIndex() const
Retrieve the index into its type parameter list.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
static bool classofKind(Kind K)
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
SourceRange getSourceRange() const
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
unsigned size() const
Determine the number of type parameters in this list.
const_iterator begin() const
ObjCTypeParamDecl * front() const
const_iterator end() const
SourceLocation getRAngleLoc() const
ObjCTypeParamDecl *const * const_iterator
ObjCTypeParamDecl * back() const
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
SourceLocation getLAngleLoc() const
Represents a parameter to a function.
A (possibly-)qualified type.
Provides common interface for the Decls that can be redeclared.
ObjCInterfaceDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
ObjCInterfaceDecl * getNextRedeclaration() const
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Smart pointer class that efficiently represents Objective-C method names.
bool isUnarySelector() const
unsigned getNumArgs() const
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
A container of type source information.
The base class of the type hierarchy.
bool isBlockPointerType() const
const T * castAs() const
Member-template castAs<specific type>.
Base class for declarations which introduce a typedef-name.
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
@ SelLoc_NonStandard
Non-standard.
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
@ ICIS_NoInit
No in-class initializer.
ObjCMethodFamily
A family of Objective-C methods.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ C
Languages that the frontend can parse and compile.
@ Property
The type of a property.
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 ...
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
bool isValid() const
Whether this pointer is non-NULL.
QualType operator()(const ParmVarDecl *PD) const