;
45 if(Elts == 0)
return;
47 List=
new(Ctx)
void*[Elts];
49 memcpy(
List, InList,
sizeof(
void*)*Elts);
59 set(InList, Elts, Ctx);
74voidObjCContainerDecl::anchor() {}
82Ivar != IvarEnd; ++Ivar) {
83 if(
auto*ivar = dyn_cast<ObjCIvarDecl>(*Ivar))
92 boolAllowHidden)
const{
95 if(
const auto*Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
97 if(!Def->isUnconditionallyVisible() && !AllowHidden)
110Meth != MethEnd; ++Meth) {
111 auto*MD = dyn_cast<ObjCMethodDecl>(*Meth);
112 if(MD && MD->isInstanceMethod() == isInstance)
128Meth != MethEnd; ++Meth) {
129 auto*MD = dyn_cast<ObjCMethodDecl>(*Meth);
130 if(MD && MD->isInstanceMethod() && !MD->isImplicit())
134 if(
const auto*ID = dyn_cast<ObjCInterfaceDecl>(
this)) {
137 for(
const auto*Cat : ID->visible_categories()) {
139 if(!MD->isImplicit())
141 if(Cat->IsClassExtension())
147 for(
const auto*
P: Cat->properties())
148 if(
P->getIdentifier() ==
Property->getIdentifier()) {
149 if(
P->getPropertyAttributes() &
157 for(
const auto*Proto : ID->all_referenced_protocols())
158 if(Proto->HasUserDeclaredSetterMethod(
Property))
169 if(
const auto*PD = dyn_cast<ObjCProtocolDecl>(
this))
170 for(
const auto*PI : PD->protocols())
171 if(PI->HasUserDeclaredSetterMethod(
Property))
182 if(
const auto*Proto = dyn_cast<ObjCProtocolDecl>(DC)) {
184 if(!Def->isUnconditionallyVisible())
190 if(
auto*IDecl = dyn_cast<ObjCInterfaceDecl>(DC)) {
191 for(
const auto*Ext : IDecl->visible_extensions())
202 if(
auto*PD = dyn_cast<ObjCPropertyDecl>(*I)) {
206!PD->isClassProperty()) ||
208PD->isClassProperty()) ||
210!PD->isClassProperty()))
213 if(PD->isClassProperty())
228llvm::raw_svector_ostream os(ivarName);
231 return&Ctx.
Idents.
get(ivarName.str());
235 boolIsInstance)
const{
237 if(
auto*Prop = dyn_cast<ObjCPropertyDecl>(
LookupResult)) {
238 if(Prop->isInstanceProperty() == IsInstance) {
252 if(
const auto*Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
254 if(!Def->isUnconditionallyVisible())
260 if(
const auto*ClassDecl = dyn_cast<ObjCInterfaceDecl>(
this)) {
261 for(
const auto*Ext : ClassDecl->visible_extensions()) {
262 if(
auto*
P= Ext->FindPropertyDeclaration(PropertyId, QueryKind))
275 caseDecl::ObjCProtocol: {
276 const auto*PID = cast<ObjCProtocolDecl>(
this);
277 for(
const auto*I : PID->protocols())
283 caseDecl::ObjCInterface: {
284 const auto*OID = cast<ObjCInterfaceDecl>(
this);
286 for(
const auto*Cat : OID->visible_categories()) {
287 if(!Cat->IsClassExtension())
289PropertyId, QueryKind))
294 for(
const auto*I : OID->all_referenced_protocols())
301 returnsuperClass->FindPropertyDeclaration(PropertyId, QueryKind);
304 caseDecl::ObjCCategory: {
305 const auto*OCD = cast<ObjCCategoryDecl>(
this);
307 if(!OCD->IsClassExtension())
308 for(
const auto*I : OCD->protocols())
318voidObjCInterfaceDecl::anchor() {}
327 returndef->getTypeParamListAsWritten();
346 for(
auto*typeParam : *TypeParamList)
347typeParam->setDeclContext(
this);
355 if(data().ExternallyCompleted)
356LoadExternalDefinition();
372 returnsuperTInfo->getTypeLoc().getBeginLoc();
386 if(data().ExternallyCompleted)
387LoadExternalDefinition();
405PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
409 for(
auto*Prop : ClassExt->
properties()) {
410PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
423 if(
Class->hasAttr<ArcWeakrefUnavailableAttr>())
433 if(
Class->hasAttr<ObjCRequiresPropertyDefsAttr>())
443 if(data().ExternallyCompleted)
444LoadExternalDefinition();
446 if(data().AllReferencedProtocols.empty() &&
447data().ReferencedProtocols.empty()) {
448data().AllReferencedProtocols.set(ExtList, ExtNum,
C);
456 for(
unsignedi = 0; i < ExtNum; i++) {
457 boolprotocolExists =
false;
460 if(
C.ProtocolCompatibleWithProtocol(ProtoInExtension, Proto)) {
461protocolExists =
true;
468ProtocolRefs.push_back(ProtoInExtension);
471 if(ProtocolRefs.empty())
478data().AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(),
C);
482ObjCInterfaceDecl::findInterfaceWithDesignatedInitializers()
const{
487 if(!IFace->inheritsDesignatedInitializers())
495 for(
const auto*MD :
D->instance_methods()) {
496 if(MD->getMethodFamily() ==
OMF_init&& !MD->isOverriding())
499 for(
const auto*Ext :
D->visible_extensions()) {
500 for(
const auto*MD : Ext->instance_methods()) {
501 if(MD->getMethodFamily() ==
OMF_init&& !MD->isOverriding())
505 if(
const auto*ImplD =
D->getImplementation()) {
506 for(
const auto*MD : ImplD->instance_methods()) {
507 if(MD->getMethodFamily() ==
OMF_init&& !MD->isOverriding())
514boolObjCInterfaceDecl::inheritsDesignatedInitializers()
const{
515 switch(data().InheritedDesignatedInitializers) {
516 caseDefinitionData::IDI_Inherited:
518 caseDefinitionData::IDI_NotInherited:
520 caseDefinitionData::IDI_Unknown:
525data().InheritedDesignatedInitializers = DefinitionData::IDI_NotInherited;
528data().InheritedDesignatedInitializers =
529SuperD->declaresOrInheritsDesignatedInitializers() ?
530DefinitionData::IDI_Inherited :
531DefinitionData::IDI_NotInherited;
533data().InheritedDesignatedInitializers =
534DefinitionData::IDI_NotInherited;
537assert(data().InheritedDesignatedInitializers
538!= DefinitionData::IDI_Unknown);
539 returndata().InheritedDesignatedInitializers ==
540DefinitionData::IDI_Inherited;
543llvm_unreachable(
"unexpected InheritedDesignatedInitializers value");
551 if(data().ExternallyCompleted)
552LoadExternalDefinition();
559 if(MD->isThisDeclarationADesignatedInitializer())
560Methods.push_back(MD);
562 for(
const auto*MD : Ext->instance_methods())
563 if(MD->isThisDeclarationADesignatedInitializer())
564Methods.push_back(MD);
576HasCompleteDef =
true;
582 if(data().ExternallyCompleted)
583LoadExternalDefinition();
590 if(MD->isThisDeclarationADesignatedInitializer()) {
598 if(MD->isThisDeclarationADesignatedInitializer()) {
608voidObjCInterfaceDecl::allocateDefinitionData() {
609assert(!
hasDefinition() &&
"ObjC class already has a definition");
611Data.getPointer()->Definition =
this;
615allocateDefinitionData();
625Data.setPointer(
nullptr);
626allocateDefinitionData();
641 if(data().ExternallyCompleted)
642LoadExternalDefinition();
645 while(ClassDecl !=
nullptr) {
647clsDeclared = ClassDecl;
653clsDeclared = ClassDecl;
672 if(data().ExternallyCompleted)
673LoadExternalDefinition();
676 while(ClassDecl !=
nullptr) {
687 if(
P->lookupProtocolNamed(Name))
699 boolshallowCategoryLookup,
710 if(data().ExternallyCompleted)
711LoadExternalDefinition();
715 if((MethodDecl = ClassDecl->
getMethod(Sel, isInstance)))
720 if((MethodDecl = Cat->getMethod(Sel, isInstance)))
725 for(
const auto*I : ClassDecl->
protocols())
726 if((MethodDecl = I->lookupMethod(Sel, isInstance)))
730 if(!shallowCategoryLookup)
734Cat->getReferencedProtocols();
735 for(
auto*Protocol : Protocols)
736 if((MethodDecl = Protocol->lookupMethod(Sel, isInstance)))
756 boolInstance)
const{
761 if(data().ExternallyCompleted)
762LoadExternalDefinition();
766Method = Instance ? ImpDecl->getInstanceMethod(Sel)
767: ImpDecl->getClassMethod(Sel);
790assert(
hasDefinition() &&
"ODRHash only for records with definitions");
794 returndata().ODRHash;
800setHasODRHash(
true);
802 returndata().ODRHash;
805boolObjCInterfaceDecl::hasODRHash()
const{
808 returndata().HasODRHash;
811voidObjCInterfaceDecl::setHasODRHash(
boolHasHash) {
812assert(
hasDefinition() &&
"Cannot set ODRHash without definition");
813data().HasODRHash = HasHash;
820ObjCMethodDecl::ObjCMethodDecl(
823 boolisInstance,
boolisVariadic,
boolisPropertyAccessor,
824 boolisSynthesizedAccessorStub,
boolisImplicitlyDeclared,
boolisDefined,
826:
NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),
827 DeclContext(ObjCMethod), MethodDeclType(
T), ReturnTInfo(ReturnTInfo),
833setInstanceMethod(isInstance);
834setVariadic(isVariadic);
835setPropertyAccessor(isPropertyAccessor);
836setSynthesizedAccessorStub(isSynthesizedAccessorStub);
837setDefined(isDefined);
838setIsRedeclaration(
false);
839setHasRedeclaration(
false);
840setDeclImplementation(impControl);
842setRelatedResultType(HasRelatedResultType);
844setOverriding(
false);
845setHasSkippedBody(
false);
853 DeclContext*contextDecl,
boolisInstance,
boolisVariadic,
854 boolisPropertyAccessor,
boolisSynthesizedAccessorStub,
855 boolisImplicitlyDeclared,
boolisDefined,
858beginLoc, endLoc, SelInfo,
T, ReturnTInfo, contextDecl, isInstance,
860isImplicitlyDeclared,
isDefined, impControl, HasRelatedResultType);
870 returnhasAttr<ObjCDirectAttr>() &&
876hasAttr<ObjCDesignatedInitializerAttr>();
880 if(
const auto*PD = dyn_cast<const ObjCProtocolDecl>(
getDeclContext()))
882 if(
const auto*ID = dyn_cast<const ObjCInterfaceDecl>(
getDeclContext()))
892 if(isa<ObjCProtocolDecl>(DC))
895 returnID->isDesignatedInitializer(
getSelector(), InitMethod);
901 if(param->isDestroyedInCallee())
918voidObjCMethodDecl::setParamsAndSelLocs(
ASTContext&
C,
921ParamsAndSelLocs =
nullptr;
922NumParams = Params.size();
923 if(Params.empty() && SelLocs.empty())
927 "Alignment not sufficient for SourceLocation");
929 unsignedSize =
sizeof(
ParmVarDecl*) * NumParams +
931ParamsAndSelLocs =
C.Allocate(Size);
932std::uninitialized_copy(Params.begin(), Params.end(), getParams());
933std::uninitialized_copy(SelLocs.begin(), SelLocs.end(), getStoredSelLocs());
946 "No selector locs for non-implicit method");
948 returnsetParamsAndSelLocs(
C, Params, {});
953 returnsetParamsAndSelLocs(
C, Params, {});
955setParamsAndSelLocs(
C, Params, SelLocs);
971 if(!CtxD->isInvalidDecl()) {
972 if(
auto*IFD = dyn_cast<ObjCInterfaceDecl>(CtxD)) {
974 if(!ImplD->isInvalidDecl())
977}
else if(
auto*CD = dyn_cast<ObjCCategoryDecl>(CtxD)) {
979 if(!ImplD->isInvalidDecl())
982}
else if(
auto*ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
984 if(!IFD->isInvalidDecl())
987}
else if(
auto*CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
989 if(!CatD->isInvalidDecl())
997 if(Redecl && cast<Decl>(Redecl->
getDeclContext())->isInvalidDecl())
1002 returncast<ObjCContainerDecl>(CtxD)->getMethod(
getSelector(),
1007 returnRedecl ? Redecl :
this;
1014 if(
auto*ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
1024 for(
auto*Ext : IFD->known_extensions())
1028}
else if(
auto*CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
1039 returnMD ? MD :
this;
1047 returnBody->getEndLoc();
1057 if(
constObjCMethodFamilyAttr *
attr= getAttr<ObjCMethodFamilyAttr>()) {
1060 switch(
attr->getFamily()) {
1061 caseObjCMethodFamilyAttr::OMF_None: family =
OMF_None;
break;
1062 caseObjCMethodFamilyAttr::OMF_alloc: family =
OMF_alloc;
break;
1063 caseObjCMethodFamilyAttr::OMF_copy: family =
OMF_copy;
break;
1064 caseObjCMethodFamilyAttr::OMF_init: family =
OMF_init;
break;
1065 caseObjCMethodFamilyAttr::OMF_mutableCopy: family =
OMF_mutableCopy;
break;
1066 caseObjCMethodFamilyAttr::OMF_new: family =
OMF_new;
break;
1115 if(noParams < 1 || noParams > 3)
1124 while(--noParams) {
1145 bool&selfIsPseudoStrong,
1146 bool&selfIsConsumed)
const{
1148selfIsPseudoStrong =
false;
1149selfIsConsumed =
false;
1164selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
1175selfIsPseudoStrong =
true;
1182selfIsPseudoStrong =
true;
1190 boolselfIsPseudoStrong, selfIsConsumed;
1192 getSelfType(Context, OID, selfIsPseudoStrong, selfIsConsumed);
1194&Context.
Idents.
get(
"self"), selfTy,
1199 Self->addAttr(NSConsumedAttr::CreateImplicit(Context));
1201 if(selfIsPseudoStrong)
1202 Self->setARCPseudoStrong(
true);
1213 returnCD->getClassInterface();
1215 returnIMD->getClassInterface();
1218llvm_unreachable(
"unknown method context");
1224 if(
auto*IMD = dyn_cast<ObjCCategoryImplDecl>(
getDeclContext()))
1225 returnIMD->getCategoryDecl();
1232 returnTSI->getTypeLoc().getSourceRange();
1253 boolMovedToSuper) {
1260 if(
const auto*
Category= dyn_cast<ObjCCategoryDecl>(Container)) {
1265Overridden = Container->getMethod(Method->
getSelector(),
1268 if(Method != Overridden) {
1271Methods.push_back(Overridden);
1275 for(
const auto*
P:
Category->protocols())
1282Overridden = Container->getMethod(Method->
getSelector(),
1285 if(Method != Overridden) {
1288Methods.push_back(Overridden);
1292 if(
const auto*Protocol = dyn_cast<ObjCProtocolDecl>(Container)){
1293 for(
const auto*
P: Protocol->protocols())
1297 if(
const auto*
Interface= dyn_cast<ObjCInterfaceDecl>(Container)) {
1298 for(
const auto*
P:
Interface->protocols())
1301 for(
const auto*Cat :
Interface->known_categories())
1321 if(
const auto*ProtD =
1325}
else if(
const auto*IMD =
1338}
else if(
const auto*CatD =
1354Method, overridden);
1370assert(!Overridden.empty() &&
1371 "ObjCMethodDecl's overriding bit is not as expected");
1383 const auto*Container = cast<ObjCContainerDecl>(
getParent());
1385 if(
auto*ImplDecl = dyn_cast<ObjCImplDecl>(Container))
1387Container = ImplDecl->getClassInterface();
1389 boolIsGetter = (NumArgs == 0);
1394 autofindMatchingProperty =
1397 for(
const auto*I : Container->instance_properties()) {
1398 SelectorNextSel = IsGetter ? I->getGetterName()
1399: I->getSetterName();
1404 for(
const auto*I : Container->class_properties()) {
1405 SelectorNextSel = IsGetter ? I->getGetterName()
1406: I->getSetterName();
1416 if(
const auto*
Found= findMatchingProperty(Container))
1421 if(
const auto*
Category= dyn_cast<ObjCCategoryDecl>(Container)) {
1422ClassDecl =
Category->getClassInterface();
1423 if(
const auto*
Found= findMatchingProperty(ClassDecl))
1427ClassDecl = cast<ObjCInterfaceDecl>(Container);
1429assert(ClassDecl &&
"Failed to find main class");
1433 if(Ext == Container)
1435 if(
const auto*
Found= findMatchingProperty(Ext))
1442 if(Cat == Container)
1444 if(
const auto*
Found= findMatchingProperty(Cat))
1448llvm_unreachable(
"Marked as a property accessor but no property found!");
1451 if(!CheckOverrides)
1456OverridesTy Overrides;
1458 for(
const auto*Override : Overrides)
1469voidObjCTypeParamDecl::anchor() {}
1481nameLoc, name, colonLoc, boundInfo);
1483TPDecl->setTypeForDecl(TPType.
getTypePtr());
1514: Brackets(lAngleLoc, rAngleLoc), NumParams(typeParams.size()) {
1515std::copy(typeParams.begin(), typeParams.end(), begin());
1524ctx.
Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
1531typeArgs.reserve(
size());
1532 for(
auto*typeParam : *
this)
1533typeArgs.push_back(typeParam->getUnderlyingType());
1547 Result->Data.setInt(!
C.getLangOpts().Modules);
1548 C.getObjCInterfaceType(
Result, PrevDecl);
1557 Result->Data.setInt(!
C.getLangOpts().Modules);
1561ObjCInterfaceDecl::ObjCInterfaceDecl(
1566redeclarable_base(
C) {
1571Data = PrevDecl->Data;
1578voidObjCInterfaceDecl::LoadExternalDefinition()
const{
1579assert(data().ExternallyCompleted &&
"Class is not externally completed");
1580data().ExternallyCompleted =
false;
1587 "Class can't be externally completed without an external source");
1589 "Forward declarations can't be externally completed");
1590data().ExternallyCompleted =
true;
1597data().HasDesignatedInitializers =
true;
1604 if(data().ExternallyCompleted)
1605LoadExternalDefinition();
1607 returndata().HasDesignatedInitializers;
1612 if(
const auto*ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
1613 returnObjCRTName->getMetadataName();
1622 returnID->getObjCRuntimeNameAsString();
1629 if(data().ExternallyCompleted)
1630LoadExternalDefinition();
1646structSynthesizeIvarChunk {
1651: Size(size), Ivar(ivar) {}
1654bool operator<(
constSynthesizeIvarChunk & LHS,
1655 constSynthesizeIvarChunk &RHS) {
1656 returnLHS.Size < RHS.Size;
1676 if(!data().IvarList) {
1680(void)Ext->ivar_empty();
1684data().IvarList = *I; ++I;
1685 for(curIvar = data().IvarList; I !=
E; curIvar = *I, ++I)
1690 if(!Ext->ivar_empty()) {
1692I = Ext->ivar_begin(),
1693 E= Ext->ivar_end();
1694 if(!data().IvarList) {
1695data().IvarList = *I; ++I;
1696curIvar = data().IvarList;
1698 for( ;I !=
E; curIvar = *I, ++I)
1702data().IvarListMissingImplementation =
true;
1706 if(!data().IvarListMissingImplementation)
1707 returndata().IvarList;
1710data().IvarListMissingImplementation =
false;
1711 if(!ImplDecl->ivar_empty()) {
1713 for(
auto*IV : ImplDecl->ivars()) {
1714 if(IV->getSynthesize() && !IV->isInvalidDecl()) {
1715layout.push_back(SynthesizeIvarChunk(
1716IV->getASTContext().getTypeSize(IV->getType()), IV));
1719 if(!data().IvarList)
1720data().IvarList = IV;
1726 if(!layout.empty()) {
1728llvm::stable_sort(layout);
1729 unsignedIx = 0, EIx = layout.size();
1730 if(!data().IvarList) {
1731data().IvarList = layout[0].Ivar; Ix++;
1732curIvar = data().IvarList;
1734 for( ; Ix != EIx; curIvar = layout[Ix].Ivar, Ix++)
1739 returndata().IvarList;
1752 if(data().ExternallyCompleted)
1753LoadExternalDefinition();
1756 if(Cat->getIdentifier() == CategoryId)
1787 boollookupCategory,
1788 boolRHSIsQualifiedID) {
1795 if(
getASTContext().ProtocolCompatibleWithProtocol(lProto, PI))
1803 if(RHSIsQualifiedID &&
1804 getASTContext().ProtocolCompatibleWithProtocol(PI, lProto))
1811 for(
auto*PI : Cat->protocols())
1812 if(
getASTContext().ProtocolCompatibleWithProtocol(lProto, PI))
1829voidObjCIvarDecl::anchor() {}
1836 Expr*BW,
boolsynthesized) {
1848assert((isa<ObjCInterfaceDecl>(DC) || isa<ObjCImplementationDecl>(DC) ||
1849isa<ObjCCategoryDecl>(DC)) &&
1850 "Invalid ivar decl context!");
1853 auto*ID = dyn_cast<ObjCInterfaceDecl>(DC);
1855 if(
auto*IM = dyn_cast<ObjCImplementationDecl>(DC))
1856ID = IM->getClassInterface();
1858ID = cast<ObjCCategoryDecl>(DC)->getClassInterface();
1860ID->setIvarList(
nullptr);
1863 return new(
C, DC)
ObjCIvarDecl(DC, StartLoc, IdLoc,
Id,
T, TInfo, ac, BW,
1876 switch(DC->getKind()) {
1878 caseObjCCategoryImpl:
1880llvm_unreachable(
"invalid ivar container!");
1883 caseObjCCategory: {
1884 auto*CD = cast<ObjCCategoryDecl>(DC);
1885assert(CD->IsClassExtension() &&
"invalid container for ivar!");
1886 returnCD->getClassInterface();
1889 caseObjCImplementation:
1890 returncast<ObjCImplementationDecl>(DC)->getClassInterface();
1893 returncast<ObjCInterfaceDecl>(DC);
1906voidObjCAtDefsFieldDecl::anchor() {}
1926voidObjCProtocolDecl::anchor() {}
1933redeclarable_base(
C) {
1934setPreviousDecl(PrevDecl);
1936 Data= PrevDecl->Data;
1946 Result->Data.setInt(!
C.getLangOpts().Modules);
1955 Result->Data.setInt(!
C.getLangOpts().Modules);
1960 returnhasAttr<ObjCNonRuntimeProtocolAttr>();
1964llvm::DenseSet<const ObjCProtocolDecl *> &IPs)
const{
1965std::queue<const ObjCProtocolDecl *> WorkQueue;
1966WorkQueue.push(
this);
1968 while(!WorkQueue.empty()) {
1969 const auto*PD = WorkQueue.front();
1971 for(
const auto*
Parent: PD->protocols()) {
1972 const auto*Can =
Parent->getCanonicalDecl();
1973 auto Result= IPs.insert(Can);
1975WorkQueue.push(
Parent);
1996 boolisInstance)
const{
2005 if((MethodDecl =
getMethod(Sel, isInstance)))
2009 if((MethodDecl = I->lookupMethod(Sel, isInstance)))
2014voidObjCProtocolDecl::allocateDefinitionData() {
2015assert(!Data.getPointer() &&
"Protocol already has a definition!");
2017Data.getPointer()->Definition =
this;
2018Data.getPointer()->HasODRHash =
false;
2022allocateDefinitionData();
2026RD->Data = this->Data;
2030Data.setPointer(
nullptr);
2031allocateDefinitionData();
2042 for(
auto*Prop : PDecl->properties()) {
2044PM.insert(std::make_pair(
2045std::make_pair(Prop->getIdentifier(), Prop->isClassProperty()),
2049 for(
const auto*PI : PDecl->protocols())
2050PI->collectPropertiesToImplement(PM);
2058 if(!PS.insert(PDecl).second)
2060 for(
auto*Prop : PDecl->properties()) {
2063 if(Prop->getIdentifier() ==
Property->getIdentifier()) {
2069 for(
const auto*PI : PDecl->protocols())
2070PI->collectInheritedProtocolProperties(
Property, PS, PO);
2076 if(
const auto*ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
2077 returnObjCRTName->getMetadataName();
2083assert(
hasDefinition() &&
"ODRHash only for records with definitions");
2087 returndata().ODRHash;
2093setHasODRHash(
true);
2095 returndata().ODRHash;
2098boolObjCProtocolDecl::hasODRHash()
const{
2101 returndata().HasODRHash;
2104voidObjCProtocolDecl::setHasODRHash(
boolHasHash) {
2105assert(
hasDefinition() &&
"Cannot set ODRHash without definition");
2106data().HasODRHash = HasHash;
2113voidObjCCategoryDecl::anchor() {}
2115ObjCCategoryDecl::ObjCCategoryDecl(
2121ClassInterface(IDecl), CategoryNameLoc(CategoryNameLoc),
2122IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc) {
2123setTypeParamList(typeParamList);
2134IDecl, typeParamList, IvarLBraceLoc,
2142L->AddedObjCCategoryToInterface(CatDecl, IDecl);
2153 nullptr,
nullptr,
nullptr);
2166TypeParamList = TPL;
2170 for(
auto*typeParam : *TypeParamList)
2171typeParam->setDeclContext(
this);
2178voidObjCCategoryImplDecl::anchor() {}
2187atStartLoc, CategoryNameLoc);
2204voidObjCImplDecl::anchor() {}
2208 property->setLexicalDeclContext(
this);
2215 if(
auto*ImplD = dyn_cast_or_null<ObjCImplementationDecl>(
this)) {
2219}
else if(
auto*ImplD = dyn_cast_or_null<ObjCCategoryImplDecl>(
this)) {
2224ClassInterface = IFace;
2233 if(PID->getPropertyIvarDecl() &&
2234PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
2249 if(PID->getPropertyDecl()->getIdentifier() ==
Id) {
2251!PID->getPropertyDecl()->isClassProperty()) ||
2253PID->getPropertyDecl()->isClassProperty()) ||
2255!PID->getPropertyDecl()->isClassProperty()))
2258 if(PID->getPropertyDecl()->isClassProperty())
2259ClassPropImpl = PID;
2264 returnClassPropImpl;
2279voidObjCImplementationDecl::anchor() {}
2293nameLoc, atStartLoc, superLoc,
2294IvarLBraceLoc, IvarRBraceLoc);
2305 unsignednumInitializers) {
2306 if(numInitializers > 0) {
2307NumIvarInitializers = numInitializers;
2309 memcpy(ivarInitializers, initializers,
2311IvarInitializers = ivarInitializers;
2330voidObjCCompatibleAliasDecl::anchor() {}
2343 nullptr,
nullptr);
2350voidObjCPropertyDecl::anchor() {}
Defines the clang::ASTContext interface.
static void CollectOverriddenMethodsRecurse(const ObjCContainerDecl *Container, const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl * > &Methods, bool MovedToSuper)
static bool isIntroducingInitializers(const ObjCInterfaceDecl *D)
static void collectOverriddenMethodsSlow(const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl * > &overridden)
static void CollectOverriddenMethods(const ObjCContainerDecl *Container, const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl * > &Methods)
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::LangOptions interface.
This file contains the declaration of the ODRHash class, which calculates a hash based on AST nodes,...
Defines the clang::SourceLocation class and associated facilities.
Defines the clang::TypeLoc interface and its subclasses.
C Language Family Type Representation.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
QualType getObjCClassType() const
Represents the Objective-C Class type.
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
const LangOptions & getLangOpts() const
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists.
QualType getObjCIdType() const
Represents the Objective-CC id type.
void * Allocate(size_t Size, unsigned Align=8) const
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl * > protocols) const
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
Represents a C++ base or member initializer.
The results of name lookup within 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...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
ObjCMethodDeclBitfields ObjCMethodDeclBits
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
void addDecl(Decl *D)
Add the declaration D into this context.
SourceLocation getEndLoc() const LLVM_READONLY
ASTContext & getASTContext() const LLVM_READONLY
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.
SourceLocation getLocation() const
void setImplicit(bool I=true)
DeclContext * getDeclContext()
This represents one expression.
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
Represents the results of name lookup.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
void AddObjCProtocolDecl(const ObjCProtocolDecl *P)
void AddObjCInterfaceDecl(const ObjCInterfaceDecl *Record)
Represents a field declaration created by an @defs(...).
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
ObjCCategoryDecl - Represents a category declaration.
static ObjCCategoryDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, const IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, ObjCTypeParamList *typeParamList, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCCategoryImplDecl * getImplementation() const
void setImplementation(ObjCCategoryImplDecl *ImplD)
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCCategoryDecl * getCategoryDecl() const
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, const IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCCompatibleAliasDecl - Represents alias of a class.
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCContainerDecl - Represents a container for method declarations.
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
void setAtStartLoc(SourceLocation Loc)
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
instmeth_range instance_methods() const
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
virtual void collectPropertiesToImplement(PropertyMap &PM) const
This routine collects list of properties to be implemented in the class.
prop_range properties() const
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
ObjCContainerDecl(Kind DK, DeclContext *DC, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
void addPropertyImplementation(ObjCPropertyImplDecl *property)
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...
const ObjCInterfaceDecl * getClassInterface() const
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
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.
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
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...
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
all_protocol_iterator all_referenced_protocol_end() const
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...
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, const IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
bool hasDefinition() const
Determine whether this class has been defined.
all_protocol_range all_referenced_protocols() const
visible_extensions_range visible_extensions() const
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
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...
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)
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...
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
all_protocol_iterator all_referenced_protocol_begin() const
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
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,...
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class,...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
ObjCImplementationDecl * getImplementation() const
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...
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
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.
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
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_...
void mergeDuplicateDefinitionWithCommon(const ObjCInterfaceDecl *Definition)
known_extensions_range known_extensions() const
ObjCIvarDecl - Represents an ObjC instance variable.
void setNextIvar(ObjCIvarDecl *ivar)
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
static ObjCIvarDecl * Create(ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false)
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
void ** List
List is an array of pointers to objects that are not owned by this object.
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCList - This is a simple template class used to hold various lists of decls etc,...
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.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
ArrayRef< ParmVarDecl * > parameters() const
unsigned param_size() const
void setSelfDecl(ImplicitParamDecl *SD)
bool isPropertyAccessor() const
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
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, ObjCImplementationControl impControl=ObjCImplementationControl::None, bool HasRelatedResultType=false)
void setHasRedeclaration(bool HRD) const
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
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)
param_type_iterator param_type_begin() const
bool isSynthesizedAccessorStub() const
SourceLocation getSelectorLoc(unsigned Index) const
SourceRange getReturnTypeSourceRange() const
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
Selector getSelector() const
bool isInstanceMethod() const
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
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
unsigned getNumSelectorLocs() const
bool isClassMethod() const
ObjCInterfaceDecl * getClassInterface()
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
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
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, const IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
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.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
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.
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
protocol_range protocols() const
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.
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Represents the declaration of an Objective-C type parameter.
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, GlobalDeclID ID)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
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.
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
Represents a parameter to a function.
A (possibly-)qualified type.
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type.
QualType withConst() const
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
QualType substObjCMemberType(QualType objectType, const DeclContext *dc, ObjCSubstitutionContext context) const
Substitute type arguments from an object type for the Objective-C type parameters used in the subject...
QualType substObjCTypeArgs(ASTContext &ctx, ArrayRef< QualType > typeArgs, ObjCSubstitutionContext context) const
Substitute type arguments for the Objective-C type parameters used in the subject type.
The collection of all-type qualifiers we support.
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
void setObjCLifetime(ObjCLifetime type)
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
void setPreviousDecl(ObjCInterfaceDecl *PrevDecl)
Set the previous declaration.
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.
ObjCMethodFamily getMethodFamily() const
Derive the conventional family of this method.
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.
bool isObjCSelType() const
bool isObjCIdType() const
TypeSourceInfo * getTypeSourceInfo() const
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
@ SelLoc_NonStandard
Non-standard.
@ SelLoc_StandardNoSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or immediately...
@ InvalidObjCMethodFamily
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
ObjCMethodFamily
A family of Objective-C methods.
@ OMF_None
No particular method family.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
SelectorLocationsKind hasStandardSelectorLocs(Selector Sel, ArrayRef< SourceLocation > SelLocs, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Returns true if all SelLocs are in a "standard" location.
@ Property
The type of a property.
@ Result
The result type of a method or function.
ObjCImplementationControl
const FunctionProtoType * T
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
@ Invariant
The parameter is invariant: must match exactly.
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
@ ObjCSelf
Parameter for Objective-C 'self' argument.
@ ObjCCmd
Parameter for Objective-C '_cmd' argument.
T * get(ExternalASTSource *Source) const
Retrieve the pointer to the AST node that this lazy pointer points to.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4