27 #include "llvm/ADT/None.h" 28 #include "llvm/ADT/SmallString.h" 29 #include "llvm/ADT/SmallVector.h" 30 #include "llvm/Support/Casting.h" 31 #include "llvm/Support/ErrorHandling.h" 32 #include "llvm/Support/raw_ostream.h" 39 using namespace clang;
47 if (Elts == 0)
return;
49 List =
new (Ctx)
void*[Elts];
61 set(InList, Elts, Ctx);
68 void ObjCContainerDecl::anchor() {}
76 Ivar != IvarEnd; ++Ivar) {
77 if (
auto *ivar = dyn_cast<ObjCIvarDecl>(*Ivar))
86 bool AllowHidden)
const {
89 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
91 if (Def->isHidden() && !AllowHidden)
104 Meth != MethEnd; ++Meth) {
106 if (MD && MD->isInstanceMethod() == isInstance)
122 Meth != MethEnd; ++Meth) {
124 if (MD && MD->isInstanceMethod() && !MD->isImplicit())
128 if (
const auto *
ID = dyn_cast<ObjCInterfaceDecl>(
this)) {
131 for (
const auto *Cat :
ID->visible_categories()) {
133 if (!MD->isImplicit())
135 if (Cat->IsClassExtension())
141 for (
const auto *
P : Cat->properties())
150 for (
const auto *Proto :
ID->all_referenced_protocols())
151 if (Proto->HasUserDeclaredSetterMethod(Property))
162 if (
const auto *PD = dyn_cast<ObjCProtocolDecl>(
this))
163 for (
const auto *PI : PD->protocols())
164 if (PI->HasUserDeclaredSetterMethod(Property))
175 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(DC)) {
183 if (
auto *IDecl = dyn_cast<ObjCInterfaceDecl>(DC)) {
184 for (
const auto *Ext : IDecl->visible_extensions())
195 if (
auto *PD = dyn_cast<ObjCPropertyDecl>(*I)) {
199 !PD->isClassProperty()) ||
201 PD->isClassProperty()) ||
203 !PD->isClassProperty()))
206 if (PD->isClassProperty())
221 llvm::raw_svector_ostream os(ivarName);
233 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
241 if (
const auto *ClassDecl = dyn_cast<ObjCInterfaceDecl>(
this)) {
242 for (
const auto *Ext : ClassDecl->visible_extensions()) {
243 if (
auto *
P = Ext->FindPropertyDeclaration(PropertyId, QueryKind))
256 case Decl::ObjCProtocol: {
257 const auto *PID = cast<ObjCProtocolDecl>(
this);
258 for (
const auto *I : PID->protocols())
264 case Decl::ObjCInterface: {
265 const auto *OID = cast<ObjCInterfaceDecl>(
this);
267 for (
const auto *Cat : OID->visible_categories()) {
268 if (!Cat->IsClassExtension())
270 PropertyId, QueryKind))
275 for (
const auto *I : OID->all_referenced_protocols())
282 return superClass->FindPropertyDeclaration(PropertyId, QueryKind);
285 case Decl::ObjCCategory: {
286 const auto *OCD = cast<ObjCCategoryDecl>(
this);
288 if (!OCD->IsClassExtension())
289 for (
const auto *I : OCD->protocols())
299 void ObjCInterfaceDecl::anchor() {}
308 return def->getTypeParamListAsWritten();
327 for (
auto *typeParam : *TypeParamList)
328 typeParam->setDeclContext(
this);
336 if (data().ExternallyCompleted)
337 LoadExternalDefinition();
353 return superTInfo->getTypeLoc().getLocStart();
369 if (data().ExternallyCompleted)
370 LoadExternalDefinition();
378 for (
const auto *I : all_referenced_protocols())
388 for (
auto *Prop : properties()) {
389 PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
392 for (
const auto *Ext : known_extensions()) {
395 PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
399 for (
const auto *PI : all_referenced_protocols())
400 PI->collectPropertiesToImplement(PM, PO);
409 if (Class->
hasAttr<ArcWeakrefUnavailableAttr>())
419 if (Class->
hasAttr<ObjCRequiresPropertyDefsAttr>())
429 if (data().ExternallyCompleted)
430 LoadExternalDefinition();
432 if (data().AllReferencedProtocols.empty() &&
433 data().ReferencedProtocols.empty()) {
434 data().AllReferencedProtocols.set(ExtList, ExtNum, C);
442 for (
unsigned i = 0; i < ExtNum; i++) {
443 bool protocolExists =
false;
445 for (
auto *Proto : all_referenced_protocols()) {
447 protocolExists =
true;
454 ProtocolRefs.push_back(ProtoInExtension);
457 if (ProtocolRefs.empty())
461 ProtocolRefs.append(all_referenced_protocol_begin(),
462 all_referenced_protocol_end());
464 data().AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(),
C);
468 ObjCInterfaceDecl::findInterfaceWithDesignatedInitializers()
const {
473 if (!IFace->inheritsDesignatedInitializers())
482 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
486 for (
const auto *MD : Ext->instance_methods()) {
487 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
492 for (
const auto *MD : ImplD->instance_methods()) {
493 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
500 bool ObjCInterfaceDecl::inheritsDesignatedInitializers()
const {
501 switch (data().InheritedDesignatedInitializers) {
502 case DefinitionData::IDI_Inherited:
504 case DefinitionData::IDI_NotInherited:
506 case DefinitionData::IDI_Unknown:
511 data().InheritedDesignatedInitializers = DefinitionData::IDI_NotInherited;
513 if (
auto SuperD = getSuperClass()) {
514 data().InheritedDesignatedInitializers =
515 SuperD->declaresOrInheritsDesignatedInitializers() ?
516 DefinitionData::IDI_Inherited :
517 DefinitionData::IDI_NotInherited;
519 data().InheritedDesignatedInitializers =
520 DefinitionData::IDI_NotInherited;
523 assert(data().InheritedDesignatedInitializers
524 != DefinitionData::IDI_Unknown);
525 return data().InheritedDesignatedInitializers ==
526 DefinitionData::IDI_Inherited;
529 llvm_unreachable(
"unexpected InheritedDesignatedInitializers value");
535 if (!isThisDeclarationADefinition())
537 if (data().ExternallyCompleted)
538 LoadExternalDefinition();
545 if (MD->isThisDeclarationADesignatedInitializer())
546 Methods.push_back(MD);
548 for (
const auto *MD : Ext->instance_methods())
549 if (MD->isThisDeclarationADesignatedInitializer())
550 Methods.push_back(MD);
556 bool HasCompleteDef = isThisDeclarationADefinition();
562 HasCompleteDef =
true;
568 if (data().ExternallyCompleted)
569 LoadExternalDefinition();
576 if (MD->isThisDeclarationADesignatedInitializer()) {
584 if (MD->isThisDeclarationADesignatedInitializer()) {
594 void ObjCInterfaceDecl::allocateDefinitionData() {
595 assert(!
hasDefinition() &&
"ObjC class already has a definition");
596 Data.setPointer(
new (getASTContext()) DefinitionData());
597 Data.getPointer()->Definition =
this;
601 cast<ObjCInterfaceType>(TypeForDecl)->
Decl =
this;
605 allocateDefinitionData();
608 for (
auto *RD : redecls()) {
620 if (data().ExternallyCompleted)
621 LoadExternalDefinition();
624 while (ClassDecl !=
nullptr) {
626 clsDeclared = ClassDecl;
632 clsDeclared = ClassDecl;
651 if (data().ExternallyCompleted)
652 LoadExternalDefinition();
655 while (ClassDecl !=
nullptr) {
665 for (
auto *
P : all_referenced_protocols())
666 if (
P->lookupProtocolNamed(Name))
678 bool shallowCategoryLookup,
689 if (data().ExternallyCompleted)
690 LoadExternalDefinition();
694 if ((MethodDecl = ClassDecl->
getMethod(Sel, isInstance)))
699 if ((MethodDecl = Cat->getMethod(Sel, isInstance)))
704 for (
const auto *I : ClassDecl->
protocols())
705 if ((MethodDecl = I->lookupMethod(Sel, isInstance)))
709 if (!shallowCategoryLookup)
713 Cat->getReferencedProtocols();
714 for (
auto *Protocol : Protocols)
715 if ((MethodDecl = Protocol->lookupMethod(Sel, isInstance)))
735 bool Instance)
const {
740 if (data().ExternallyCompleted)
741 LoadExternalDefinition();
745 Method = Instance ? ImpDecl->getInstanceMethod(Sel)
746 : ImpDecl->getClassMethod(Sel);
750 Method = getCategoryMethod(Sel, Instance);
755 if (!Instance && !Method && !getSuperClass()) {
756 Method = lookupInstanceMethod(Sel);
760 Method = lookupPrivateMethod(Sel,
true);
763 if (!Method && getSuperClass())
764 return getSuperClass()->lookupPrivateMethod(Sel, Instance);
775 DeclContext *contextDecl,
bool isInstance,
bool isVariadic,
776 bool isPropertyAccessor,
bool isImplicitlyDeclared,
bool isDefined,
779 beginLoc, endLoc, SelInfo, T, ReturnTInfo, contextDecl, isInstance,
780 isVariadic, isPropertyAccessor, isImplicitlyDeclared, isDefined,
781 impControl, HasRelatedResultType);
790 return getMethodFamily() ==
OMF_init &&
791 hasAttr<ObjCDesignatedInitializerAttr>();
799 if (isa<ObjCProtocolDecl>(DC))
802 return ID->isDesignatedInitializer(getSelector(), InitMethod);
807 return Body.get(getASTContext().getExternalSource());
812 getASTContext().setObjCMethodRedeclaration(PrevMethod,
this);
813 IsRedeclaration =
true;
814 PrevMethod->HasRedeclaration =
true;
817 void ObjCMethodDecl::setParamsAndSelLocs(
ASTContext &
C,
820 ParamsAndSelLocs =
nullptr;
821 NumParams = Params.size();
822 if (Params.empty() && SelLocs.empty())
826 "Alignment not sufficient for SourceLocation");
828 unsigned Size =
sizeof(
ParmVarDecl *) * NumParams +
830 ParamsAndSelLocs = C.
Allocate(Size);
831 std::copy(Params.begin(), Params.end(), getParams());
832 std::copy(SelLocs.begin(), SelLocs.end(), getStoredSelLocs());
837 for (
unsigned i = 0, e = getNumSelectorLocs(); i != e; ++i)
838 SelLocs.push_back(getSelectorLoc(i));
844 assert((!SelLocs.empty() || isImplicit()) &&
845 "No selector locs for non-implicit method");
847 return setParamsAndSelLocs(C, Params,
llvm::None);
852 return setParamsAndSelLocs(C, Params,
llvm::None);
854 setParamsAndSelLocs(C, Params, SelLocs);
863 if (HasRedeclaration)
868 auto *CtxD = cast<Decl>(getDeclContext());
870 if (!CtxD->isInvalidDecl()) {
871 if (
auto *IFD = dyn_cast<ObjCInterfaceDecl>(CtxD)) {
873 if (!ImplD->isInvalidDecl())
876 }
else if (
auto *CD = dyn_cast<ObjCCategoryDecl>(CtxD)) {
878 if (!ImplD->isInvalidDecl())
881 }
else if (
auto *ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
883 if (!IFD->isInvalidDecl())
886 }
else if (
auto *CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
888 if (!CatD->isInvalidDecl())
896 if (Redecl && cast<Decl>(Redecl->
getDeclContext())->isInvalidDecl())
899 if (!Redecl && isRedeclaration()) {
901 return cast<ObjCContainerDecl>(CtxD)->getMethod(getSelector(),
905 return Redecl ? Redecl :
this;
909 auto *CtxD = cast<Decl>(getDeclContext());
911 if (
auto *ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
916 }
else if (
auto *CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
923 if (isRedeclaration()) {
926 cast<ObjCContainerDecl>(CtxD)->getMethod(getSelector(),
928 return MD ? MD :
this;
935 if (
Stmt *Body = getBody())
936 return Body->getLocEnd();
946 if (
const ObjCMethodFamilyAttr *attr = getAttr<ObjCMethodFamilyAttr>()) {
949 switch (attr->getFamily()) {
957 Family =
static_cast<unsigned>(family);
961 family = getSelector().getMethodFamily();
978 if (!getReturnType()->isObjCObjectPointerType())
1003 unsigned noParams = param_size();
1004 if (noParams < 1 || noParams > 3)
1013 while (--noParams) {
1028 Family =
static_cast<unsigned>(family);
1034 bool &selfIsPseudoStrong,
1035 bool &selfIsConsumed) {
1037 selfIsPseudoStrong =
false;
1038 selfIsConsumed =
false;
1053 selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
1062 if (getMethodFamily() !=
OMF_init && !selfIsConsumed) {
1064 selfIsPseudoStrong =
true;
1068 assert(isClassMethod());
1071 selfIsPseudoStrong =
true;
1079 bool selfIsPseudoStrong, selfIsConsumed;
1081 getSelfType(Context, OID, selfIsPseudoStrong, selfIsConsumed);
1088 Self->addAttr(NSConsumedAttr::CreateImplicit(Context));
1090 if (selfIsPseudoStrong)
1091 Self->setARCPseudoStrong(
true);
1099 if (
auto *
ID = dyn_cast<ObjCInterfaceDecl>(getDeclContext()))
1101 if (
auto *CD = dyn_cast<ObjCCategoryDecl>(getDeclContext()))
1102 return CD->getClassInterface();
1103 if (
auto *IMD = dyn_cast<ObjCImplDecl>(getDeclContext()))
1104 return IMD->getClassInterface();
1105 if (isa<ObjCProtocolDecl>(getDeclContext()))
1107 llvm_unreachable(
"unknown method context");
1111 const auto *TSI = getReturnTypeSourceInfo();
1113 return TSI->getTypeLoc().getSourceRange();
1119 return getReturnType().getNonLValueExprType(Ctx)
1134 bool MovedToSuper) {
1141 if (
const auto *
Category = dyn_cast<ObjCCategoryDecl>(Container)) {
1149 if (Method != Overridden) {
1152 Methods.push_back(Overridden);
1156 for (
const auto *
P :
Category->protocols())
1166 if (Method != Overridden) {
1169 Methods.push_back(Overridden);
1173 if (
const auto *Protocol = dyn_cast<ObjCProtocolDecl>(Container)){
1174 for (
const auto *
P : Protocol->protocols())
1178 if (
const auto *Interface = dyn_cast<ObjCInterfaceDecl>(Container)) {
1179 for (
const auto *
P : Interface->protocols())
1182 for (
const auto *Cat : Interface->known_categories())
1202 if (
const auto *ProtD =
1206 }
else if (
const auto *IMD =
1219 }
else if (
const auto *CatD =
1235 Method, overridden);
1250 assert(!Overridden.empty() &&
1251 "ObjCMethodDecl's overriding bit is not as expected");
1262 if (isPropertyAccessor()) {
1263 const auto *Container = cast<ObjCContainerDecl>(getParent());
1264 bool IsGetter = (NumArgs == 0);
1269 auto findMatchingProperty =
1272 for (
const auto *I : Container->instance_properties()) {
1273 Selector NextSel = IsGetter ? I->getGetterName()
1274 : I->getSetterName();
1279 for (
const auto *I : Container->class_properties()) {
1280 Selector NextSel = IsGetter ? I->getGetterName()
1281 : I->getSetterName();
1291 if (
const auto *Found = findMatchingProperty(Container))
1296 if (
const auto *
Category = dyn_cast<ObjCCategoryDecl>(Container)) {
1297 ClassDecl =
Category->getClassInterface();
1298 if (
const auto *Found = findMatchingProperty(ClassDecl))
1308 if (Ext == Container)
1311 if (
const auto *Found = findMatchingProperty(Ext))
1316 llvm_unreachable(
"Marked as a property accessor but no property found!");
1319 if (!CheckOverrides)
1324 OverridesTy Overrides;
1325 getOverriddenMethods(Overrides);
1326 for (
const auto *Override : Overrides)
1337 void ObjCTypeParamDecl::anchor() {}
1349 nameLoc, name, colonLoc, boundInfo);
1366 startLoc = getLocation();
1368 if (hasExplicitBound()) {
1370 getTypeSourceInfo()->getTypeLoc().getEndLoc());
1382 : NumParams(typeParams.size()) {
1385 std::copy(typeParams.begin(), typeParams.end(), begin());
1394 ctx.
Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
1401 typeArgs.reserve(
size());
1402 for (
auto typeParam : *
this)
1403 typeArgs.push_back(typeParam->getUnderlyingType());
1443 setPreviousDecl(PrevDecl);
1447 Data = PrevDecl->Data;
1449 setImplicit(IsInternal);
1451 setTypeParamList(typeParamList);
1454 void ObjCInterfaceDecl::LoadExternalDefinition()
const {
1455 assert(data().ExternallyCompleted &&
"Class is not externally completed");
1456 data().ExternallyCompleted =
false;
1457 getASTContext().getExternalSource()->CompleteType(
1458 const_cast<ObjCInterfaceDecl *>(
this));
1462 assert(getASTContext().getExternalSource() &&
1463 "Class can't be externally completed without an external source");
1465 "Forward declarations can't be externally completed");
1466 data().ExternallyCompleted =
true;
1471 if (!isThisDeclarationADefinition())
1473 data().HasDesignatedInitializers =
true;
1478 if (!isThisDeclarationADefinition())
1480 if (data().ExternallyCompleted)
1481 LoadExternalDefinition();
1483 return data().HasDesignatedInitializers;
1488 if (
const auto *ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
1489 return ObjCRTName->getMetadataName();
1497 const_cast<ObjCImplementationDecl*>(
this)->getClassInterface())
1498 return ID->getObjCRuntimeNameAsString();
1505 if (data().ExternallyCompleted)
1506 LoadExternalDefinition();
1508 return getASTContext().getObjCImplementation(
1509 const_cast<ObjCInterfaceDecl*>(Def));
1517 getASTContext().setObjCImplementation(
getDefinition(), ImplD);
1522 struct SynthesizeIvarChunk {
1527 : Size(size), Ivar(ivar) {}
1530 bool operator<(
const SynthesizeIvarChunk & LHS,
1531 const SynthesizeIvarChunk &RHS) {
1532 return LHS.Size < RHS.Size;
1552 if (!data().IvarList) {
1553 if (!ivar_empty()) {
1555 data().IvarList = *I; ++I;
1556 for (curIvar = data().IvarList; I != E; curIvar = *I, ++I)
1560 for (
const auto *Ext : known_extensions()) {
1561 if (!Ext->ivar_empty()) {
1563 I = Ext->ivar_begin(),
1564 E = Ext->ivar_end();
1565 if (!data().IvarList) {
1566 data().IvarList = *I; ++I;
1567 curIvar = data().IvarList;
1569 for ( ;I != E; curIvar = *I, ++I)
1573 data().IvarListMissingImplementation =
true;
1577 if (!data().IvarListMissingImplementation)
1578 return data().IvarList;
1581 data().IvarListMissingImplementation =
false;
1582 if (!ImplDecl->ivar_empty()) {
1584 for (
auto *IV : ImplDecl->ivars()) {
1585 if (IV->getSynthesize() && !IV->isInvalidDecl()) {
1586 layout.push_back(SynthesizeIvarChunk(
1587 IV->getASTContext().getTypeSize(IV->getType()), IV));
1590 if (!data().IvarList)
1591 data().IvarList = IV;
1597 if (!layout.empty()) {
1599 std::stable_sort(layout.begin(), layout.end());
1600 unsigned Ix = 0, EIx = layout.size();
1601 if (!data().IvarList) {
1602 data().IvarList = layout[0].Ivar; Ix++;
1603 curIvar = data().IvarList;
1605 for ( ; Ix != EIx; curIvar = layout[Ix].Ivar, Ix++)
1610 return data().IvarList;
1623 if (data().ExternallyCompleted)
1624 LoadExternalDefinition();
1626 for (
auto *Cat : visible_categories())
1627 if (Cat->getIdentifier() == CategoryId)
1635 for (
const auto *Cat : visible_categories()) {
1645 for (
const auto *Cat : visible_categories()) {
1658 bool lookupCategory,
1659 bool RHSIsQualifiedID) {
1666 if (getASTContext().ProtocolCompatibleWithProtocol(lProto, PI))
1674 if (RHSIsQualifiedID &&
1675 getASTContext().ProtocolCompatibleWithProtocol(PI, lProto))
1681 for (
const auto *Cat : visible_categories()) {
1682 for (
auto *PI : Cat->protocols())
1683 if (getASTContext().ProtocolCompatibleWithProtocol(lProto, PI))
1700 void ObjCIvarDecl::anchor() {}
1719 assert((isa<ObjCInterfaceDecl>(DC) || isa<ObjCImplementationDecl>(DC) ||
1720 isa<ObjCCategoryDecl>(DC)) &&
1721 "Invalid ivar decl context!");
1726 if (
auto *IM = dyn_cast<ObjCImplementationDecl>(DC))
1727 ID = IM->getClassInterface();
1729 ID = cast<ObjCCategoryDecl>(DC)->getClassInterface();
1731 ID->setIvarList(
nullptr);
1734 return new (
C, DC)
ObjCIvarDecl(DC, StartLoc, IdLoc, Id, T, TInfo, ac, BW,
1745 const auto *DC = cast<ObjCContainerDecl>(getDeclContext());
1747 switch (DC->getKind()) {
1749 case ObjCCategoryImpl:
1751 llvm_unreachable(
"invalid ivar container!");
1754 case ObjCCategory: {
1755 const auto *CD = cast<ObjCCategoryDecl>(DC);
1756 assert(CD->IsClassExtension() &&
"invalid container for ivar!");
1757 return CD->getClassInterface();
1760 case ObjCImplementation:
1761 return cast<ObjCImplementationDecl>(DC)->getClassInterface();
1764 return cast<ObjCInterfaceDecl>(DC);
1777 void ObjCAtDefsFieldDecl::anchor() {}
1797 void ObjCProtocolDecl::anchor() {}
1804 redeclarable_base(C) {
1805 setPreviousDecl(PrevDecl);
1807 Data = PrevDecl->Data;
1836 for (
auto *I : protocols())
1837 if ((PDecl = I->lookupProtocolNamed(Name)))
1846 bool isInstance)
const {
1855 if ((MethodDecl = getMethod(Sel, isInstance)))
1858 for (
const auto *I : protocols())
1859 if ((MethodDecl = I->lookupMethod(Sel, isInstance)))
1864 void ObjCProtocolDecl::allocateDefinitionData() {
1865 assert(!Data.getPointer() &&
"Protocol already has a definition!");
1866 Data.setPointer(
new (getASTContext()) DefinitionData);
1867 Data.getPointer()->Definition =
this;
1871 allocateDefinitionData();
1874 for (
auto *RD : redecls())
1875 RD->Data = this->Data;
1881 for (
auto *Prop : PDecl->properties()) {
1883 PM.insert(std::make_pair(
1884 std::make_pair(Prop->getIdentifier(), Prop->isClassProperty()),
1889 for (
const auto *PI : PDecl->protocols())
1890 PI->collectPropertiesToImplement(PM, PO);
1898 if (!PS.insert(PDecl).second)
1900 for (
auto *Prop : PDecl->properties()) {
1901 if (Prop == Property)
1909 for (
const auto *PI : PDecl->protocols())
1910 PI->collectInheritedProtocolProperties(Property, PS, PO);
1916 if (
const auto *ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
1917 return ObjCRTName->getMetadataName();
1926 void ObjCCategoryDecl::anchor() {}
1936 ClassInterface(IDecl), CategoryNameLoc(CategoryNameLoc),
1937 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc) {
1938 setTypeParamList(typeParamList);
1952 IDecl, typeParamList, IvarLBraceLoc,
1960 L->AddedObjCCategoryToInterface(CatDecl, IDecl);
1971 nullptr,
nullptr,
nullptr);
1975 return getASTContext().getObjCImplementation(
1976 const_cast<ObjCCategoryDecl*>(
this));
1980 getASTContext().setObjCImplementation(
this, ImplD);
1984 TypeParamList = TPL;
1988 for (
auto *typeParam : *TypeParamList)
1989 typeParam->setDeclContext(
this);
1996 void ObjCCategoryImplDecl::anchor() {}
2008 atStartLoc, CategoryNameLoc);
2025 void ObjCImplDecl::anchor() {}
2029 property->setLexicalDeclContext(
this);
2036 if (
auto *ImplD = dyn_cast_or_null<ObjCImplementationDecl>(
this)) {
2040 }
else if (
auto *ImplD = dyn_cast_or_null<ObjCCategoryImplDecl>(
this)) {
2045 ClassInterface = IFace;
2053 for (
auto *PID : property_impls())
2054 if (PID->getPropertyIvarDecl() &&
2055 PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
2067 for (
auto *PID : property_impls())
2070 if (PID->getPropertyDecl()->getIdentifier() ==
Id) {
2072 !PID->getPropertyDecl()->isClassProperty()) ||
2074 PID->getPropertyDecl()->isClassProperty()) ||
2076 !PID->getPropertyDecl()->isClassProperty()))
2079 if (PID->getPropertyDecl()->isClassProperty())
2080 ClassPropImpl = PID;
2085 return ClassPropImpl;
2100 void ObjCImplementationDecl::anchor() {}
2114 nameLoc, atStartLoc, superLoc,
2115 IvarLBraceLoc, IvarRBraceLoc);
2126 unsigned numInitializers) {
2127 if (numInitializers > 0) {
2128 NumIvarInitializers = numInitializers;
2130 memcpy(ivarInitializers, initializers,
2132 IvarInitializers = ivarInitializers;
2138 return IvarInitializers.get(getASTContext().getExternalSource());
2151 void ObjCCompatibleAliasDecl::anchor() {}
2171 void ObjCPropertyDecl::anchor() {}
2222 if (IvarLoc.isValid())
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
Defines the clang::ASTContext interface.
bool hasDefinition() const
Determine whether this class has been defined.
static const Decl * getCanonicalDecl(const Decl *D)
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
protocol_range protocols() const
Smart pointer class that efficiently represents Objective-C method names.
QualType getObjCIdType() const
Represents the Objective-CC id type.
unsigned getRawEncoding() const
When a SourceLocation itself cannot be used, this returns an (opaque) 32-bit integer encoding for it...
A (possibly-)qualified type.
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl *> &Methods) const
Returns the designated initializers for the interface.
ObjCInterfaceDecl * getClassInterface()
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
static ClassTemplateDecl * getDefinition(ClassTemplateDecl *D)
Stmt - This represents one statement.
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
C Language Family Type Representation.
void setObjCLifetime(ObjCLifetime type)
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
Decl - This represents one declaration (or definition), e.g.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
static ObjCPropertyDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, SourceLocation AtLocation, SourceLocation LParenLocation, QualType T, TypeSourceInfo *TSI, PropertyControl propControl=None)
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
void ** List
List is an array of pointers to objects that are not owned by this object.
const DiagnosticBuilder & operator<<(const DiagnosticBuilder &DB, const Attr *At)
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface. ...
QualType withConst() const
A container of type source information.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implict parameters. ...
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
void setImplementation(ObjCCategoryImplDecl *ImplD)
ObjCCategoryImplDecl * getImplementation() const
Parameter for Objective-C '_cmd' argument.
ObjCMethodDecl - Represents an instance or class method declaration.
ObjCImplementationDecl * getObjCImplementation(ObjCInterfaceDecl *D)
Get the implementation of the ObjCInterfaceDecl D, or nullptr if none exists.
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class...
QualType getObjCClassType() const
Represents the Objective-C Class type.
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
Represents a parameter to a function.
std::string getName(ArrayRef< StringRef > Parts) const
Get the platform-specific name separator.
The collection of all-type qualifiers we support.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
One of these records is kept for each identifier that is lexed.
Represents a class type in Objective C.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
The results of name lookup within a DeclContext.
ObjCMethodFamily
A family of Objective-C methods.
bool isObjCIdType() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
SourceRange getReturnTypeSourceRange() const
instmeth_range instance_methods() const
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
prop_range properties() const
bool isObjCSelType() const
void startDefinition()
Starts the definition of this Objective-C protocol.
visible_categories_range visible_categories() const
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
bool ProtocolCompatibleWithProtocol(ObjCProtocolDecl *lProto, ObjCProtocolDecl *rProto) const
ProtocolCompatibleWithProtocol - return 'true' if 'lProto' is in the inheritance hierarchy of 'rProto...
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute...
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
static ObjCInterfaceDecl * Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, ObjCTypeParamList *typeParamList, ObjCInterfaceDecl *PrevDecl, SourceLocation ClassLoc=SourceLocation(), bool isInternal=false)
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCContainerDecl - Represents a container for method declarations.
static ObjCCategoryDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, ObjCTypeParamList *typeParamList, SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
static ObjCPropertyImplDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation atLoc, SourceLocation L, ObjCPropertyDecl *property, Kind PK, ObjCIvarDecl *ivarDecl, SourceLocation ivarLoc)
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
static ObjCAtDefsFieldDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, Expr *BW)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl *> &Overridden) const
Return overridden methods for the given Method.
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
Represents an Objective-C protocol declaration.
Represents an ObjC class declaration.
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl *> Params, ArrayRef< SourceLocation > SelLocs=llvm::None)
Sets the method's parameters and selector source locations.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
lookup_result lookup(DeclarationName Name) const
lookup - Find the declarations (if any) with the given Name in this context.
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
static ImplicitParamDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, ImplicitParamKind ParamKind)
Create implicit parameter.
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
visible_extensions_range visible_extensions() const
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
SourceLocation getEndLoc() const LLVM_READONLY
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type...
void setNextIvar(ObjCIvarDecl *ivar)
Expr - This represents one expression.
Defines the clang::LangOptions interface.
static ObjCMethodDecl * Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
Selector getSetterName() const
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class, its protocols, its super classes or categories.
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
static void collectOverriddenMethodsSlow(const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl *> &overridden)
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
static ObjCTypeParamDecl * Create(ASTContext &ctx, DeclContext *dc, ObjCTypeParamVariance variance, SourceLocation varianceLoc, unsigned index, SourceLocation nameLoc, IdentifierInfo *name, SourceLocation colonLoc, TypeSourceInfo *boundInfo)
DeclContext * getDeclContext()
ObjCInterfaceDecl * getSuperClass() const
An abstract interface that should be implemented by listeners that want to be notified when an AST en...
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl *> typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
Defines the clang::TypeLoc interface and its subclasses.
void setObjCImplementation(ObjCInterfaceDecl *IFaceD, ObjCImplementationDecl *ImplD)
Set the implementation of ObjCInterfaceDecl.
void setImplementation(ObjCImplementationDecl *ImplD)
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
const ObjCMethodDecl * getObjCMethodRedeclaration(const ObjCMethodDecl *MD) const
Get the duplicate declaration of a ObjCMethod in the same interface, or null if none exists...
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...
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl...
static bool hasDefinition(const ObjCObjectPointerType *ObjPtr)
bool isInstanceMethod() const
unsigned getNumArgs() const
Selector getSelector() const
The result type of a method or function.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, unsigned ID)
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
static bool isIntroducingInitializers(const ObjCInterfaceDecl *D)
static StringRef getIdentifier(const Token &Tok)
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, unsigned ID)
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
static ObjCCompatibleAliasDecl * Create(ASTContext &C, DeclContext *DC, SourceLocation L, IdentifierInfo *Id, ObjCInterfaceDecl *aliasedClass)
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, unsigned ID)
Assigning into this object requires the old value to be released and the new value to be retained...
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed)
Encodes a location in the source.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
ObjCCategoryDecl * getCategoryDecl() const
QualType getObjCSelType() const
Retrieve the type that corresponds to the predefined Objective-C 'SEL' type.
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
static void CollectOverriddenMethodsRecurse(const ObjCContainerDecl *Container, const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl *> &Methods, bool MovedToSuper)
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
ObjCCategoryDecl - Represents a category declaration.
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl *> protocols, QualType Canonical=QualType()) const
Represents one property declaration in an Objective-C interface.
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
ObjCImplementationDecl * getImplementation() const
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface...
void * Allocate(size_t Size, unsigned Align=8) const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
Dataflow Directional Tag Classes.
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
Parameter for Objective-C 'self' argument.
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
Represents the declaration of an Objective-C type parameter.
static ObjCImplementationDecl * Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *classInterface, ObjCInterfaceDecl *superDecl, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation superLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarRBraceLoc=SourceLocation())
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, unsigned ID)
const ObjCInterfaceDecl * getContainingInterface() const
Return the class interface that this ivar is logically contained in; this is either the interface whe...
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
llvm::DenseMap< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
bool isHidden() const
Determine whether this declaration might be hidden from name lookup.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext, providing only those that are of type SpecificDecl (or a class derived from it).
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
static ObjCIvarDecl * Create(ASTContext &C, ObjCContainerDecl *DC, SourceLocation StartLoc, SourceLocation IdLoc, IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, AccessControl ac, Expr *BW=nullptr, bool synthesized=false)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, unsigned ID)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
Represents a C++ base or member initializer.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class, its categories, and its super classes (using a linear search).
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type...
ASTMutationListener * getASTMutationListener() const
Retrieve a pointer to the AST mutation listener associated with this AST context, if any...
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
No particular method family.
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
Represents a field declaration created by an @defs(...).
Defines the clang::SourceLocation class and associated facilities.
static bool isInstanceMethod(const Decl *D)
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCIvarDecl - Represents an ObjC instance variable.
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Kind
Lists the kind of concrete classes of Decl.
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
static Decl::Kind getKind(const Decl *D)
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void addPropertyImplementation(ObjCPropertyImplDecl *property)
A trivial tuple used to represent a source range.
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
static ObjCCategoryImplDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, ObjCInterfaceDecl *classInterface, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc)
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, unsigned ID)
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
void collectPropertiesToImplement(PropertyMap &PM, PropertyDeclOrder &PO) const override
This routine collects list of properties to be implemented in the class.
const LangOptions & getLangOpts() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
The parameter is invariant: must match exactly.
ObjCCompatibleAliasDecl - Represents alias of a class.
static void CollectOverriddenMethods(const ObjCContainerDecl *Container, const ObjCMethodDecl *Method, SmallVectorImpl< const ObjCMethodDecl *> &Methods)
ObjCCategoryDecl * FindCategoryDeclaration(IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
SelectorLocationsKind hasStandardSelectorLocs(Selector Sel, ArrayRef< SourceLocation > SelLocs, ArrayRef< Expr *> Args, SourceLocation EndLoc)
Returns true if all SelLocs are in a "standard" location.