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"
74 void set(
void *
const* InList,
unsigned Elts,
ASTContext &Ctx);
94 assert(Idx <
NumElts &&
"Invalid access");
152 void *ParamsAndSelLocs =
nullptr;
153 unsigned NumParams = 0;
172 bool isInstance =
true,
bool isVariadic =
false,
174 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
176 bool HasRelatedResultType =
false);
186 bool hasStandardSelLocs()
const {
193 return reinterpret_cast<SourceLocation *
>(getParams() + NumParams);
196 return reinterpret_cast<const SourceLocation *
>(getParams() + NumParams);
202 return reinterpret_cast<ParmVarDecl **
>(ParamsAndSelLocs);
205 return reinterpret_cast<const ParmVarDecl *
const *
>(ParamsAndSelLocs);
210 unsigned getNumStoredSelLocs()
const {
211 if (hasStandardSelLocs())
229 static ObjCMethodDecl *
235 bool isImplicitlyDeclared =
false,
bool isDefined =
false,
237 bool HasRelatedResultType =
false);
299 if (hasStandardSelLocs())
304 return getStoredSelLocs()[Index];
327 return const_cast<ObjCMethodDecl*
>(
this)->
getCategory();
377 return {
const_cast<ParmVarDecl **
>(getParams()), NumParams};
381 assert(Idx < NumParams &&
"Index out of bounds!");
382 return getParams()[Idx];
385 return const_cast<ObjCMethodDecl *
>(
this)->
getParamDecl(Idx);
400 llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
419 bool &selfIsPseudoStrong,
bool &selfIsConsumed)
const;
526 bool hasBody()
const override {
return Body.isValid(); }
547 return static_cast<DeclContext *
>(
const_cast<ObjCMethodDecl*
>(D));
551 return static_cast<ObjCMethodDecl *
>(
const_cast<DeclContext*
>(DC));
587 unsigned Variance : 2;
603 Index(
index), Variance(
static_cast<unsigned>(variance)),
604 VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
606 void anchor()
override;
632 Variance =
static_cast<unsigned>(variance);
664class ObjCTypeParamList final
665 :
private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
692 unsigned size()
const {
return NumParams; }
704 assert(
size() > 0 &&
"empty Objective-C type parameter list");
709 assert(
size() > 0 &&
"empty Objective-C type parameter list");
735 void anchor()
override;
757 unsigned PropertyImplementation : 2;
783 :
NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
784 LParenLoc(LParenLocation), DeclType(
T), DeclTypeSourceInfo(TSI),
787 PropertyImplementation(propControl) {}
791 SourceLocation L,
const IdentifierInfo *Id,
792 SourceLocation AtLocation,
793 SourceLocation LParenLocation, QualType T,
814 DeclTypeSourceInfo = TSI;
826 PropertyAttributes |= PRVal;
830 PropertyAttributes = PRVal;
838 PropertyAttributesAsWritten = PRVal;
915 PropertyImplementation = pc;
927 PropertyIvarDecl = Ivar;
931 return PropertyIvarDecl;
962 void anchor()
override;
971 llvm::iterator_range<specific_decl_iterator<ObjCPropertyDecl>>;
1020 llvm::iterator_range<specific_decl_iterator<ObjCMethodDecl>>;
1070 bool AllowHidden =
false)
const;
1073 bool AllowHidden =
false)
const {
1074 return getMethod(Sel,
true, AllowHidden);
1078 return getMethod(Sel,
false, AllowHidden);
1085 bool IsInstance)
const;
1121 return K >= firstObjCContainer &&
1122 K <= lastObjCContainer;
1166 mutable const Type *TypeForDecl =
nullptr;
1168 struct DefinitionData {
1195 LLVM_PREFERRED_TYPE(
bool)
1196 mutable unsigned ExternallyCompleted : 1;
1200 LLVM_PREFERRED_TYPE(
bool)
1201 mutable unsigned IvarListMissingImplementation : 1;
1205 LLVM_PREFERRED_TYPE(
bool)
1206 unsigned HasDesignatedInitializers : 1;
1208 enum InheritedDesignatedInitializersState {
1217 IDI_NotInherited = 2
1221 LLVM_PREFERRED_TYPE(InheritedDesignatedInitializersState)
1222 mutable unsigned InheritedDesignatedInitializers : 2;
1225 LLVM_PREFERRED_TYPE(
bool)
1226 unsigned HasODRHash : 1;
1237 : ExternallyCompleted(
false), IvarListMissingImplementation(
true),
1238 HasDesignatedInitializers(
false),
1239 InheritedDesignatedInitializers(IDI_Unknown), HasODRHash(
false) {}
1243 ObjCTypeParamList *TypeParamList =
nullptr;
1250 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1253 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1254 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1257 void anchor()
override;
1259 void LoadExternalDefinition()
const;
1261 DefinitionData &data()
const {
1262 assert(Data.getPointer() &&
"Declaration has no definition!");
1263 return *Data.getPointer();
1267 void allocateDefinitionData();
1284 static ObjCInterfaceDecl *
1286 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1287 ObjCInterfaceDecl *PrevDecl,
1288 SourceLocation ClassLoc = SourceLocation(),
bool isInternal =
false);
1310 return TypeParamList;
1340 assert(
hasDefinition() &&
"Caller did not check for forward reference!");
1341 if (data().ExternallyCompleted)
1342 LoadExternalDefinition();
1344 return data().ReferencedProtocols;
1374 if (data().ExternallyCompleted)
1375 LoadExternalDefinition();
1377 return data().ReferencedProtocols.begin();
1385 if (data().ExternallyCompleted)
1386 LoadExternalDefinition();
1388 return data().ReferencedProtocols.end();
1403 if (data().ExternallyCompleted)
1404 LoadExternalDefinition();
1406 return data().ReferencedProtocols.loc_begin();
1414 if (data().ExternallyCompleted)
1415 LoadExternalDefinition();
1417 return data().ReferencedProtocols.loc_end();
1433 if (data().ExternallyCompleted)
1434 LoadExternalDefinition();
1436 return data().AllReferencedProtocols.empty()
1438 : data().AllReferencedProtocols.begin();
1446 if (data().ExternallyCompleted)
1447 LoadExternalDefinition();
1449 return data().AllReferencedProtocols.empty()
1451 : data().AllReferencedProtocols.end();
1455 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
1493 data().ReferencedProtocols.set(List,
Num, Locs,
C);
1539 if (!Data.getOpaqueValue())
1542 return Data.getPointer();
1549 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1556 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
1584 if (data().ExternallyCompleted)
1585 LoadExternalDefinition();
1587 return data().SuperClassTInfo;
1595 data().SuperClassTInfo = superClass;
1603 template<
bool (*Filter)(ObjCCategoryDecl *)>
1607 void findAcceptableCategory();
1618 : Current(Current) {
1619 findAcceptableCategory();
1635 return X.Current == Y.Current;
1640 return X.Current != Y.Current;
1657 llvm::iterator_range<visible_categories_iterator>;
1691 llvm::iterator_range<known_categories_iterator>;
1727 llvm::iterator_range<visible_extensions_iterator>;
1766 llvm::iterator_range<known_extensions_iterator>;
1796 if (data().ExternallyCompleted)
1797 LoadExternalDefinition();
1799 return data().CategoryList;
1805 data().CategoryList = category;
1818 while (I !=
nullptr) {
1839 ObjCInterfaceDecl *ClassDeclared;
1848 bool shallowCategoryLookup =
false,
1849 bool followSuper =
true,
1866 bool Instance=
true)
const;
1877 bool IsClassProperty)
const {
1888 return data().EndLoc;
1907 bool lookupCategory,
1908 bool RHSIsQualifiedID =
false);
1936 bool hasODRHash()
const;
1937 void setHasODRHash(
bool HasHash);
1940 bool inheritsDesignatedInitializers()
const;
1959 void anchor()
override;
1971 :
FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id,
T, TInfo, BW,
1973 DeclAccess(ac), Synthesized(synthesized) {}
1977 SourceLocation StartLoc, SourceLocation IdLoc,
1978 const IdentifierInfo *Id, QualType T,
1980 Expr *BW =
nullptr,
bool synthesized =
false);
2030 unsigned DeclAccess : 3;
2031 LLVM_PREFERRED_TYPE(
bool)
2032 unsigned Synthesized : 1;
2040 :
FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id,
T,
2044 void anchor()
override;
2091 struct DefinitionData {
2099 LLVM_PREFERRED_TYPE(
bool)
2100 unsigned HasODRHash : 1;
2111 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2115 ObjCProtocolDecl *PrevDecl);
2117 void anchor()
override;
2119 DefinitionData &data()
const {
2120 assert(Data.getPointer() &&
"Objective-C protocol has no definition!");
2121 return *Data.getPointer();
2124 void allocateDefinitionData();
2141 bool hasODRHash()
const;
2142 void setHasODRHash(
bool HasHash);
2155 ObjCProtocolDecl *PrevDecl);
2161 return data().ReferencedProtocols;
2175 return data().ReferencedProtocols.begin();
2182 return data().ReferencedProtocols.end();
2196 return data().ReferencedProtocols.loc_begin();
2203 return data().ReferencedProtocols.loc_end();
2210 return data().ReferencedProtocols.size();
2218 data().ReferencedProtocols.set(List,
Num, Locs,
C);
2249 if (!Data.getOpaqueValue())
2252 return Data.getPointer();
2257 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2262 return hasDefinition()? Data.getPointer()->Definition :
nullptr;
2347 ObjCCategoryDecl *NextClassCategory =
nullptr;
2363 void anchor()
override;
2369 static ObjCCategoryDecl *
2399 ReferencedProtocols.set(List,
Num, Locs,
C);
2403 return ReferencedProtocols;
2414 return ReferencedProtocols.begin();
2428 return ReferencedProtocols.loc_begin();
2432 return ReferencedProtocols.loc_end();
2440 return NextClassCategory;
2446 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2482 void anchor()
override;
2489 ClassInterface(classInterface) {}
2517 llvm::iterator_range<specific_decl_iterator<ObjCPropertyImplDecl>>;
2534 return K >= firstObjCImpl && K <= lastObjCImpl;
2559 :
ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id, nameLoc,
2561 CategoryNameLoc(CategoryNameLoc) {}
2563 void anchor()
override;
2569 static ObjCCategoryImplDecl *
2584raw_ostream &
operator<<(raw_ostream &OS,
const ObjCCategoryImplDecl &CID);
2615 unsigned NumIvarInitializers = 0;
2619 LLVM_PREFERRED_TYPE(
bool)
2620 bool HasNonZeroConstructors : 1;
2623 LLVM_PREFERRED_TYPE(
bool)
2624 bool HasDestructors : 1;
2636 nameLoc, atStartLoc),
2637 SuperClass(superDecl), SuperLoc(superLoc),
2638 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2639 HasNonZeroConstructors(
false), HasDestructors(
false) {}
2641 void anchor()
override;
2676 const auto *ConstThis =
this;
2695 return NumIvarInitializers;
2699 NumIvarInitializers = numNumIvarInitializers;
2704 unsigned numInitializers);
2728 assert(
getIdentifier() &&
"Name is not a simple identifier");
2753 using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
2777raw_ostream &
operator<<(raw_ostream &OS,
const ObjCImplementationDecl &ID);
2787 :
NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2789 void anchor()
override;
2811class ObjCPropertyImplDecl :
public Decl {
2842 Expr *GetterCXXConstructor =
nullptr;
2846 Expr *SetterCXXAssignment =
nullptr;
2853 :
Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2854 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2855 assert(PK ==
Dynamic || PropertyIvarDecl);
2877 return PropertyDecl;
2886 return PropertyIvarDecl;
2892 PropertyIvarDecl = Ivar;
2893 this->IvarLoc = IvarLoc;
2904 return IvarLoc.isValid() && IvarLoc !=
getLocation();
2914 return GetterCXXConstructor;
2918 GetterCXXConstructor = getterCXXConstructor;
2922 return SetterCXXAssignment;
2926 SetterCXXAssignment = setterCXXAssignment;
2933template<
bool (*Filter)(ObjCCategoryDecl *)>
2935ObjCInterfaceDecl::filtered_category_iterator<Filter>::
2936findAcceptableCategory() {
2937 while (Current && !Filter(Current))
2938 Current = Current->getNextClassCategoryRaw();
2941template<
bool (*Filter)(ObjCCategoryDecl *)>
2945 findAcceptableCategory();
2958inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2959 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 ...
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
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
DeclContext(Decl::Kind K)
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.
friend class Redeclarable
virtual Decl * getPreviousDeclImpl()
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
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
virtual Decl * getNextRedeclarationImpl()
Returns the next redeclaration or itself if this is the only decl.
SourceLocation getLocation() const
virtual Decl * getMostRecentDeclImpl()
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...
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(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)
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.
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
static bool classofKind(Kind K)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
ObjCCategoryDecl - Represents a category declaration.
ObjCCategoryDecl * getNextClassCategory() const
unsigned ivar_size() const
ivar_iterator ivar_begin() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
ivar_iterator ivar_end() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
protocol_loc_range protocol_locs() const
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setIvarLBraceLoc(SourceLocation Loc)
unsigned protocol_size() const
ObjCCategoryImplDecl * getImplementation() const
void setCategoryNameLoc(SourceLocation Loc)
ObjCInterfaceDecl * getClassInterface()
friend class ASTDeclReader
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
ObjCProtocolList::loc_iterator protocol_loc_iterator
SourceLocation getIvarLBraceLoc() const
bool IsClassExtension() const
SourceLocation getIvarRBraceLoc() const
friend class ASTDeclWriter
protocol_loc_iterator protocol_loc_begin() const
protocol_iterator protocol_begin() const
protocol_range protocols() const
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
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)
friend class ASTDeclReader
SourceLocation getCategoryNameLoc() const
friend class ASTDeclWriter
ObjCCategoryDecl * getCategoryDecl() const
static bool classof(const Decl *D)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const ObjCInterfaceDecl * getClassInterface() const
static bool classofKind(Kind K)
ObjCInterfaceDecl * getClassInterface()
static bool classof(const Decl *D)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setClassInterface(ObjCInterfaceDecl *D)
ObjCContainerDecl - Represents a container for method declarations.
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
classmeth_iterator classmeth_end() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
prop_iterator prop_end() const
method_iterator meth_begin() const
method_range methods() const
instprop_iterator instprop_end() const
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
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
instmeth_range instance_methods() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
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
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
static bool classof(const Decl *D)
instprop_range instance_properties() const
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
llvm::iterator_range< classmeth_iterator > classmeth_range
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
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< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_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
ObjCContainerDecl(Kind DK, DeclContext *DC, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
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, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
ObjCInterfaceDecl * getClassInterface()
propimpl_iterator propimpl_begin() const
static bool classof(const Decl *D)
propimpl_range property_impls() const
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
propimpl_iterator propimpl_end() const
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
const ObjCInterfaceDecl * getClassInterface() const
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
static bool classofKind(Kind K)
void addInstanceMethod(ObjCMethodDecl *method)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void setNumIvarInitializers(unsigned numNumIvarInitializers)
static bool classofKind(Kind K)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
llvm::iterator_range< init_iterator > init_range
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
std::string getNameAsString() const
Get the name of the class associated with this interface.
SourceLocation getSuperClassLoc() const
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
friend class ASTDeclReader
ivar_iterator ivar_begin() const
void setIvarLBraceLoc(SourceLocation Loc)
CXXCtorInitializer ** init_iterator
init_iterator - Iterates through the ivar initializer list.
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
friend class ASTDeclWriter
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)
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
void setHasNonZeroConstructors(bool val)
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
filtered_category_iterator(ObjCCategoryDecl *Current)
filtered_category_iterator()=default
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
pointer operator->() const
std::ptrdiff_t difference_type
reference operator*() const
filtered_category_iterator operator++(int)
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
filtered_category_iterator & operator++()
std::input_iterator_tag iterator_category
ObjCCategoryDecl * value_type
Represents an ObjC class declaration.
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
all_protocol_iterator all_referenced_protocol_end() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
ivar_iterator ivar_end() const
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
static bool classofKind(Kind K)
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
const ObjCInterfaceDecl * getCanonicalDecl() const
unsigned ivar_size() const
llvm::iterator_range< visible_categories_iterator > visible_categories_range
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.
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
friend class ODRDiagsEmitter
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.
llvm::iterator_range< known_extensions_iterator > known_extensions_range
all_protocol_range all_referenced_protocols() const
visible_extensions_range visible_extensions() const
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
protocol_loc_iterator protocol_loc_end() const
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
ObjCCategoryDecl * FindCategoryDeclaration(const IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
llvm::iterator_range< all_protocol_iterator > all_protocol_range
protocol_loc_iterator protocol_loc_begin() const
ivar_iterator ivar_begin() const
protocol_range protocols() const
friend class ASTDeclMerger
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
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.
friend class ASTDeclReader
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)
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...
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
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.
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,...
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
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< 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.
friend class ASTDeclWriter
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
ObjCImplementationDecl * getImplementation() const
static bool classof(const Decl *D)
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, GlobalDeclID ID)
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
SourceLocation getEndOfDefinitionLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
llvm::iterator_range< protocol_iterator > protocol_range
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.
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i....
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...
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
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.
llvm::iterator_range< known_categories_iterator > known_categories_range
known_extensions_range known_extensions() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
void setAccessControl(AccessControl ac)
static bool classof(const Decl *D)
void setNextIvar(ObjCIvarDecl *ivar)
bool getSynthesize() const
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
void setSynthesize(bool synth)
ObjCIvarDecl * getNextIvar()
const ObjCIvarDecl * getNextIvar() const
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const ObjCInterfaceDecl * getContainingInterface() const
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
AccessControl getCanonicalAccessControl() const
const ObjCIvarDecl * getCanonicalDecl() const
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
static bool classofKind(Kind K)
void ** List
List is an array of pointers to objects that are not owned by this object.
ObjCListBase & operator=(const ObjCListBase &)=delete
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCListBase(const ObjCListBase &)=delete
ObjCList - This is a simple template class used to hold various lists of decls etc,...
T * operator[](unsigned Idx) const
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCMethodDecl - Represents an instance or class method declaration.
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface.
ImplicitParamDecl * getSelfDecl() const
bool hasBody() const override
Determine whether this method has a body.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
void setObjCDeclQualifier(ObjCDeclQualifier QV)
void setDefined(bool isDefined)
static bool classofKind(Kind K)
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
param_iterator param_end()
unsigned param_size() const
void setSelfDecl(ImplicitParamDecl *SD)
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
const ParmVarDecl * getParamDecl(unsigned Idx) const
static bool classof(const Decl *D)
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
bool isPropertyAccessor() const
CompoundStmt * getCompoundBody()
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
void setHasRedeclaration(bool HRD) const
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
param_const_iterator param_end() const
SourceLocation getSelectorStartLoc() const
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
param_const_iterator param_begin() const
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
void setIsRedeclaration(bool RD)
void setCmdDecl(ImplicitParamDecl *CD)
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
bool hasRedeclaration() const
True if redeclared in the same interface.
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs={})
Sets the method's parameters and selector source locations.
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
friend class ASTDeclReader
param_type_iterator param_type_begin() const
llvm::iterator_range< param_const_iterator > param_const_range
param_iterator param_begin()
bool isSynthesizedAccessorStub() const
SourceLocation getSelectorLoc(unsigned Index) const
SourceRange getReturnTypeSourceRange() const
void setOverriding(bool IsOver)
const ParmVarDecl *const * param_const_iterator
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
param_type_iterator param_type_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
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.
void setPropertyAccessor(bool isAccessor)
Selector getSelector() const
void setDeclImplementation(ObjCImplementationControl ic)
friend class ASTDeclWriter
ImplicitParamDecl * getCmdDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isInstanceMethod() const
llvm::iterator_range< param_iterator > param_range
void setReturnType(QualType T)
void setLazyBody(uint64_t Offset)
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
ParmVarDecl * getParamDecl(unsigned Idx)
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override
Appends a human-readable name for this declaration into the given stream.
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
void setHasSkippedBody(bool Skipped=true)
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
QualType getReturnType() const
ParmVarDecl *const * param_iterator
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
unsigned getNumSelectorLocs() const
bool isClassMethod() const
ObjCInterfaceDecl * getClassInterface()
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
void setInstanceMethod(bool isInst)
void setVariadic(bool isVar)
param_const_iterator sel_param_end() const
const ObjCInterfaceDecl * getClassInterface() const
const ObjCMethodDecl * getCanonicalDecl() const
const ObjCCategoryDecl * getCategory() const
Represents one property declaration in an Objective-C interface.
void getNameForDiagnostic(raw_ostream &OS, const PrintingPolicy &Policy, bool Qualified) const override
Appends a human-readable name for this declaration into the given stream.
void setAtLoc(SourceLocation L)
bool isAtomic() const
isAtomic - Return true if the property is atomic.
ObjCPropertyQueryKind getQueryKind() const
bool isClassProperty() const
void setPropertyImplementation(PropertyControl pc)
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
SourceLocation getGetterNameLoc() const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
ObjCMethodDecl * getGetterMethodDecl() const
bool isRetaining() const
isRetaining - Return true if the property retains its value.
bool isInstanceProperty() const
ObjCMethodDecl * getSetterMethodDecl() const
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
ObjCIvarDecl * getPropertyIvarDecl() const
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isDirectProperty() const
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
static bool classofKind(Kind K)
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
void overwritePropertyAttributes(unsigned PRVal)
Selector getGetterName() const
static bool classof(const Decl *D)
void setLParenLoc(SourceLocation L)
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
SourceLocation getLParenLoc() const
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
ObjCPropertyAttribute::Kind getPropertyAttributes() const
void setType(QualType T, TypeSourceInfo *TSI)
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
PropertyControl getPropertyImplementation() const
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Kind getPropertyImplementation() const
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
void setSetterMethodDecl(ObjCMethodDecl *MD)
friend class ASTDeclReader
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
void setSetterCXXAssignment(Expr *setterCXXAssignment)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCMethodDecl * getSetterMethodDecl() const
static bool classof(const Decl *D)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classofKind(Decl::Kind K)
void setGetterMethodDecl(ObjCMethodDecl *MD)
void setAtLoc(SourceLocation Loc)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyDecl(ObjCPropertyDecl *Prop)
void setGetterCXXConstructor(Expr *getterCXXConstructor)
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition)
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
bool hasDefinition() const
Determine whether this protocol has a definition.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
const ObjCProtocolList & getReferencedProtocols() const
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
ObjCProtocolDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
friend class ODRDiagsEmitter
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
friend class ASTDeclMerger
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
protocol_loc_range protocol_locs() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
llvm::iterator_range< protocol_iterator > protocol_range
void getImpliedProtocols(llvm::DenseSet< const ObjCProtocolDecl * > &IPs) const
Get the set of all protocols implied by this protocols inheritance hierarchy.
void startDefinition()
Starts the definition of this Objective-C protocol.
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
ObjCProtocolList::iterator protocol_iterator
friend class ASTDeclReader
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.
ObjCProtocolDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
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
friend class ASTDeclWriter
static bool classofKind(Kind K)
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
unsigned protocol_size() const
protocol_iterator protocol_end() const
protocol_loc_iterator protocol_loc_begin() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
A list of Objective-C protocols, along with the source locations at which they were referenced.
loc_iterator loc_begin() const
const SourceLocation * loc_iterator
loc_iterator loc_end() const
ObjCProtocolList()=default
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Represents the declaration of an Objective-C type parameter.
static bool classof(const Decl *D)
unsigned getIndex() const
Retrieve the index into its type parameter list.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
friend class ASTDeclReader
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
static bool classofKind(Kind K)
friend class ASTDeclWriter
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, GlobalDeclID ID)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
SourceRange getSourceRange() const
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
unsigned size() const
Determine the number of type parameters in this list.
const_iterator begin() const
ObjCTypeParamDecl * front() const
const_iterator end() const
SourceLocation getRAngleLoc() const
ObjCTypeParamDecl *const * const_iterator
ObjCTypeParamDecl * back() const
ObjCTypeParamDecl ** iterator
Iterate through the type parameters in the list.
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.
ObjCInterfaceDecl * getFirstDecl()
ObjCInterfaceDecl * getNextRedeclaration() const
Redeclarable(const ASTContext &Ctx)
ObjCInterfaceDecl * getPreviousDecl()
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
ObjCInterfaceDecl * getMostRecentDecl()
redecl_iterator redecls_begin() const
redecl_range redecls() const
Smart pointer class that efficiently represents Objective-C method names.
bool isUnarySelector() const
unsigned getNumArgs() const
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
void setTypeForDecl(const Type *TD)
const Type * getTypeForDecl() const
A container of type source information.
The base class of the type hierarchy.
bool isBlockPointerType() const
TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, TypeSourceInfo *TInfo)
ObjCPropertyAttribute::Kind - list of property attributes.
Top level wrappers for InstallAPI frontend operations.
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.
LazyOffsetPtr< Stmt, uint64_t, &ExternalASTSource::GetExternalDeclStmt > LazyDeclStmtPtr
A lazy pointer to a statement.
@ ICIS_NoInit
No in-class initializer.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
LazyOffsetPtr< CXXCtorInitializer *, uint64_t, &ExternalASTSource::GetExternalCXXCtorInitializers > LazyCXXCtorInitializersPtr
A lazy pointer to a set of CXXCtorInitializers.
ObjCMethodFamily
A family of Objective-C methods.
@ Property
The type of a property.
const FunctionProtoType * T
ObjCImplementationControl
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
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.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)
Insertion operator for diagnostics.
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...
U cast(CodeGen::Address addr)
@ None
The alignment was not explicit in code.
__packed_splat4 __packed_splat2 __packed_splat8 __packed_splat4 __packed_splat2 uint8_t
QualType operator()(const ParmVarDecl *PD) const
Describes how types, statements, expressions, and declarations should be printed.