26 #include "llvm/ADT/None.h" 27 #include "llvm/ADT/SmallString.h" 28 #include "llvm/ADT/SmallVector.h" 29 #include "llvm/Support/Casting.h" 30 #include "llvm/Support/ErrorHandling.h" 31 #include "llvm/Support/raw_ostream.h" 38 using namespace clang;
46 if (Elts == 0)
return;
48 List =
new (Ctx)
void*[Elts];
60 set(InList, Elts, Ctx);
74 void ObjCContainerDecl::anchor() {}
82 Ivar != IvarEnd; ++Ivar) {
83 if (
auto *ivar = dyn_cast<ObjCIvarDecl>(*Ivar))
92 bool AllowHidden)
const {
95 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
97 if (Def->isHidden() && !AllowHidden)
110 Meth != MethEnd; ++Meth) {
112 if (MD && MD->isInstanceMethod() == isInstance)
128 Meth != MethEnd; ++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())
156 for (
const auto *Proto :
ID->all_referenced_protocols())
157 if (Proto->HasUserDeclaredSetterMethod(Property))
168 if (
const auto *PD = dyn_cast<ObjCProtocolDecl>(
this))
169 for (
const auto *PI : PD->protocols())
170 if (PI->HasUserDeclaredSetterMethod(Property))
181 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(DC)) {
189 if (
auto *IDecl = dyn_cast<ObjCInterfaceDecl>(DC)) {
190 for (
const auto *Ext : IDecl->visible_extensions())
201 if (
auto *PD = dyn_cast<ObjCPropertyDecl>(*I)) {
205 !PD->isClassProperty()) ||
207 PD->isClassProperty()) ||
209 !PD->isClassProperty()))
212 if (PD->isClassProperty())
227 llvm::raw_svector_ostream os(ivarName);
239 if (
const auto *Proto = dyn_cast<ObjCProtocolDecl>(
this)) {
247 if (
const auto *ClassDecl = dyn_cast<ObjCInterfaceDecl>(
this)) {
248 for (
const auto *Ext : ClassDecl->visible_extensions()) {
249 if (
auto *
P = Ext->FindPropertyDeclaration(PropertyId, QueryKind))
262 case Decl::ObjCProtocol: {
263 const auto *PID = cast<ObjCProtocolDecl>(
this);
264 for (
const auto *I : PID->protocols())
270 case Decl::ObjCInterface: {
271 const auto *OID = cast<ObjCInterfaceDecl>(
this);
273 for (
const auto *Cat : OID->visible_categories()) {
274 if (!Cat->IsClassExtension())
276 PropertyId, QueryKind))
281 for (
const auto *I : OID->all_referenced_protocols())
288 return superClass->FindPropertyDeclaration(PropertyId, QueryKind);
291 case Decl::ObjCCategory: {
292 const auto *OCD = cast<ObjCCategoryDecl>(
this);
294 if (!OCD->IsClassExtension())
295 for (
const auto *I : OCD->protocols())
305 void ObjCInterfaceDecl::anchor() {}
314 return def->getTypeParamListAsWritten();
333 for (
auto *typeParam : *TypeParamList)
334 typeParam->setDeclContext(
this);
342 if (data().ExternallyCompleted)
343 LoadExternalDefinition();
359 return superTInfo->getTypeLoc().getBeginLoc();
375 if (data().ExternallyCompleted)
376 LoadExternalDefinition();
384 for (
const auto *I : all_referenced_protocols())
395 PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
398 for (
const auto *Ext : known_extensions()) {
401 PM[std::make_pair(Prop->getIdentifier(), Prop->isClassProperty())] = Prop;
405 for (
const auto *PI : all_referenced_protocols())
406 PI->collectPropertiesToImplement(PM, PO);
415 if (Class->
hasAttr<ArcWeakrefUnavailableAttr>())
425 if (Class->
hasAttr<ObjCRequiresPropertyDefsAttr>())
435 if (data().ExternallyCompleted)
436 LoadExternalDefinition();
438 if (data().AllReferencedProtocols.empty() &&
439 data().ReferencedProtocols.empty()) {
440 data().AllReferencedProtocols.set(ExtList, ExtNum, C);
448 for (
unsigned i = 0; i < ExtNum; i++) {
449 bool protocolExists =
false;
451 for (
auto *Proto : all_referenced_protocols()) {
453 protocolExists =
true;
460 ProtocolRefs.push_back(ProtoInExtension);
463 if (ProtocolRefs.empty())
467 ProtocolRefs.append(all_referenced_protocol_begin(),
468 all_referenced_protocol_end());
470 data().AllReferencedProtocols.set(ProtocolRefs.data(), ProtocolRefs.size(),
C);
474 ObjCInterfaceDecl::findInterfaceWithDesignatedInitializers()
const {
479 if (!IFace->inheritsDesignatedInitializers())
488 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
492 for (
const auto *MD : Ext->instance_methods()) {
493 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
498 for (
const auto *MD : ImplD->instance_methods()) {
499 if (MD->getMethodFamily() ==
OMF_init && !MD->isOverriding())
506 bool ObjCInterfaceDecl::inheritsDesignatedInitializers()
const {
507 switch (data().InheritedDesignatedInitializers) {
508 case DefinitionData::IDI_Inherited:
510 case DefinitionData::IDI_NotInherited:
512 case DefinitionData::IDI_Unknown:
517 data().InheritedDesignatedInitializers = DefinitionData::IDI_NotInherited;
519 if (
auto SuperD = getSuperClass()) {
520 data().InheritedDesignatedInitializers =
521 SuperD->declaresOrInheritsDesignatedInitializers() ?
522 DefinitionData::IDI_Inherited :
523 DefinitionData::IDI_NotInherited;
525 data().InheritedDesignatedInitializers =
526 DefinitionData::IDI_NotInherited;
529 assert(data().InheritedDesignatedInitializers
530 != DefinitionData::IDI_Unknown);
531 return data().InheritedDesignatedInitializers ==
532 DefinitionData::IDI_Inherited;
535 llvm_unreachable(
"unexpected InheritedDesignatedInitializers value");
541 if (!isThisDeclarationADefinition())
543 if (data().ExternallyCompleted)
544 LoadExternalDefinition();
551 if (MD->isThisDeclarationADesignatedInitializer())
552 Methods.push_back(MD);
554 for (
const auto *MD : Ext->instance_methods())
555 if (MD->isThisDeclarationADesignatedInitializer())
556 Methods.push_back(MD);
562 bool HasCompleteDef = isThisDeclarationADefinition();
568 HasCompleteDef =
true;
574 if (data().ExternallyCompleted)
575 LoadExternalDefinition();
582 if (MD->isThisDeclarationADesignatedInitializer()) {
590 if (MD->isThisDeclarationADesignatedInitializer()) {
600 void ObjCInterfaceDecl::allocateDefinitionData() {
601 assert(!
hasDefinition() &&
"ObjC class already has a definition");
603 Data.getPointer()->Definition =
this;
607 cast<ObjCInterfaceType>(TypeForDecl)->
Decl =
this;
611 allocateDefinitionData();
626 if (data().ExternallyCompleted)
627 LoadExternalDefinition();
630 while (ClassDecl !=
nullptr) {
632 clsDeclared = ClassDecl;
638 clsDeclared = ClassDecl;
657 if (data().ExternallyCompleted)
658 LoadExternalDefinition();
661 while (ClassDecl !=
nullptr) {
671 for (
auto *
P : all_referenced_protocols())
672 if (
P->lookupProtocolNamed(Name))
684 bool shallowCategoryLookup,
695 if (data().ExternallyCompleted)
696 LoadExternalDefinition();
700 if ((MethodDecl = ClassDecl->
getMethod(Sel, isInstance)))
705 if ((MethodDecl = Cat->getMethod(Sel, isInstance)))
710 for (
const auto *I : ClassDecl->
protocols())
711 if ((MethodDecl = I->lookupMethod(Sel, isInstance)))
715 if (!shallowCategoryLookup)
719 Cat->getReferencedProtocols();
720 for (
auto *Protocol : Protocols)
721 if ((MethodDecl = Protocol->lookupMethod(Sel, isInstance)))
741 bool Instance)
const {
746 if (data().ExternallyCompleted)
747 LoadExternalDefinition();
751 Method = Instance ? ImpDecl->getInstanceMethod(Sel)
752 : ImpDecl->getClassMethod(Sel);
756 Method = getCategoryMethod(Sel, Instance);
761 if (!Instance && !Method && !getSuperClass()) {
762 Method = lookupInstanceMethod(Sel);
766 Method = lookupPrivateMethod(Sel,
true);
769 if (!Method && getSuperClass())
770 return getSuperClass()->lookupPrivateMethod(Sel, Instance);
778 ObjCMethodDecl::ObjCMethodDecl(
781 bool isInstance,
bool isVariadic,
bool isPropertyAccessor,
782 bool isSynthesizedAccessorStub,
bool isImplicitlyDeclared,
bool isDefined,
783 ImplementationControl impControl,
bool HasRelatedResultType)
784 :
NamedDecl(ObjCMethod, contextDecl, beginLoc, SelInfo),
785 DeclContext(ObjCMethod), MethodDeclType(T), ReturnTInfo(ReturnTInfo),
791 setInstanceMethod(isInstance);
792 setVariadic(isVariadic);
793 setPropertyAccessor(isPropertyAccessor);
794 setSynthesizedAccessorStub(isSynthesizedAccessorStub);
795 setDefined(isDefined);
796 setIsRedeclaration(
false);
797 setHasRedeclaration(
false);
798 setDeclImplementation(impControl);
800 setRelatedResultType(HasRelatedResultType);
802 setOverriding(
false);
803 setHasSkippedBody(
false);
811 DeclContext *contextDecl,
bool isInstance,
bool isVariadic,
812 bool isPropertyAccessor,
bool isSynthesizedAccessorStub,
814 bool HasRelatedResultType) {
816 beginLoc, endLoc, SelInfo, T, ReturnTInfo, contextDecl, isInstance,
817 isVariadic, isPropertyAccessor, isSynthesizedAccessorStub,
818 isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType);
827 return hasAttr<ObjCDirectAttr>();
831 return getMethodFamily() ==
OMF_init &&
832 hasAttr<ObjCDesignatedInitializerAttr>();
836 if (
const auto *PD = dyn_cast<const ObjCProtocolDecl>(
getDeclContext()))
848 if (isa<ObjCProtocolDecl>(DC))
851 return ID->isDesignatedInitializer(getSelector(), InitMethod);
862 setIsRedeclaration(
true);
866 void ObjCMethodDecl::setParamsAndSelLocs(
ASTContext &
C,
869 ParamsAndSelLocs =
nullptr;
870 NumParams = Params.size();
871 if (Params.empty() && SelLocs.empty())
875 "Alignment not sufficient for SourceLocation");
877 unsigned Size =
sizeof(
ParmVarDecl *) * NumParams +
879 ParamsAndSelLocs = C.
Allocate(Size);
880 std::copy(Params.begin(), Params.end(), getParams());
881 std::copy(SelLocs.begin(), SelLocs.end(), getStoredSelLocs());
886 for (
unsigned i = 0, e = getNumSelectorLocs(); i != e; ++i)
887 SelLocs.push_back(getSelectorLoc(i));
894 "No selector locs for non-implicit method");
896 return setParamsAndSelLocs(C, Params,
llvm::None);
901 return setParamsAndSelLocs(C, Params,
llvm::None);
903 setParamsAndSelLocs(C, Params, SelLocs);
912 if (hasRedeclaration())
919 if (!CtxD->isInvalidDecl()) {
920 if (
auto *IFD = dyn_cast<ObjCInterfaceDecl>(CtxD)) {
922 if (!ImplD->isInvalidDecl())
925 }
else if (
auto *CD = dyn_cast<ObjCCategoryDecl>(CtxD)) {
927 if (!ImplD->isInvalidDecl())
930 }
else if (
auto *ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
932 if (!IFD->isInvalidDecl())
935 }
else if (
auto *CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
937 if (!CatD->isInvalidDecl())
948 if (!Redecl && isRedeclaration()) {
950 return cast<ObjCContainerDecl>(CtxD)->
getMethod(getSelector(),
954 return Redecl ? Redecl :
this;
959 const auto &Sel = getSelector();
961 if (
auto *ImplD = dyn_cast<ObjCImplementationDecl>(CtxD)) {
971 for (
auto *Ext : IFD->known_extensions())
975 }
else if (
auto *CImplD = dyn_cast<ObjCCategoryImplDecl>(CtxD)) {
981 if (isRedeclaration()) {
985 return MD ? MD :
this;
993 return Body->getEndLoc();
1003 if (
const ObjCMethodFamilyAttr *attr = getAttr<ObjCMethodFamilyAttr>()) {
1006 switch (attr->getFamily()) {
1018 family = getSelector().getMethodFamily();
1035 if (!getReturnType()->isObjCObjectPointerType())
1060 unsigned noParams = param_size();
1061 if (noParams < 1 || noParams > 3)
1070 while (--noParams) {
1091 bool &selfIsPseudoStrong,
1092 bool &selfIsConsumed)
const {
1094 selfIsPseudoStrong =
false;
1095 selfIsConsumed =
false;
1110 selfIsConsumed = hasAttr<NSConsumesSelfAttr>();
1119 if (getMethodFamily() !=
OMF_init && !selfIsConsumed) {
1121 selfIsPseudoStrong =
true;
1125 assert(isClassMethod());
1128 selfIsPseudoStrong =
true;
1136 bool selfIsPseudoStrong, selfIsConsumed;
1138 getSelfType(Context, OID, selfIsPseudoStrong, selfIsConsumed);
1145 Self->addAttr(NSConsumedAttr::CreateImplicit(Context));
1147 if (selfIsPseudoStrong)
1148 Self->setARCPseudoStrong(
true);
1159 return CD->getClassInterface();
1161 return IMD->getClassInterface();
1164 llvm_unreachable(
"unknown method context");
1168 const auto *TSI = getReturnTypeSourceInfo();
1170 return TSI->getTypeLoc().getSourceRange();
1176 return getReturnType().getNonLValueExprType(Ctx)
1191 bool MovedToSuper) {
1198 if (
const auto *
Category = dyn_cast<ObjCCategoryDecl>(Container)) {
1206 if (Method != Overridden) {
1209 Methods.push_back(Overridden);
1213 for (
const auto *
P :
Category->protocols())
1223 if (Method != Overridden) {
1226 Methods.push_back(Overridden);
1230 if (
const auto *Protocol = dyn_cast<ObjCProtocolDecl>(Container)){
1231 for (
const auto *
P : Protocol->protocols())
1235 if (
const auto *Interface = dyn_cast<ObjCInterfaceDecl>(Container)) {
1236 for (
const auto *
P : Interface->protocols())
1239 for (
const auto *Cat : Interface->known_categories())
1259 if (
const auto *ProtD =
1263 }
else if (
const auto *IMD =
1276 }
else if (
const auto *CatD =
1292 Method, overridden);
1307 assert(!Overridden.empty() &&
1308 "ObjCMethodDecl's overriding bit is not as expected");
1319 if (isPropertyAccessor()) {
1320 const auto *Container = cast<ObjCContainerDecl>(
getParent());
1322 if (
auto *ImplDecl = dyn_cast<ObjCImplDecl>(Container))
1323 if (isSynthesizedAccessorStub())
1324 Container = ImplDecl->getClassInterface();
1326 bool IsGetter = (NumArgs == 0);
1331 auto findMatchingProperty =
1334 for (
const auto *I : Container->instance_properties()) {
1335 Selector NextSel = IsGetter ? I->getGetterName()
1336 : I->getSetterName();
1341 for (
const auto *I : Container->class_properties()) {
1342 Selector NextSel = IsGetter ? I->getGetterName()
1343 : I->getSetterName();
1353 if (
const auto *Found = findMatchingProperty(Container))
1358 if (
const auto *
Category = dyn_cast<ObjCCategoryDecl>(Container)) {
1359 ClassDecl =
Category->getClassInterface();
1360 if (
const auto *Found = findMatchingProperty(ClassDecl))
1370 if (Ext == Container)
1373 if (
const auto *Found = findMatchingProperty(Ext))
1378 assert(isSynthesizedAccessorStub() &&
"expected an accessor stub");
1380 if (Cat == Container)
1383 if (
const auto *Found = findMatchingProperty(Cat))
1387 llvm_unreachable(
"Marked as a property accessor but no property found!");
1390 if (!CheckOverrides)
1395 OverridesTy Overrides;
1396 getOverriddenMethods(Overrides);
1397 for (
const auto *Override : Overrides)
1408 void ObjCTypeParamDecl::anchor() {}
1420 nameLoc, name, colonLoc, boundInfo);
1439 if (hasExplicitBound()) {
1441 getTypeSourceInfo()->getTypeLoc().
getEndLoc());
1453 : NumParams(typeParams.size()) {
1456 std::copy(typeParams.begin(), typeParams.end(), begin());
1465 ctx.
Allocate(totalSizeToAlloc<ObjCTypeParamDecl *>(typeParams.size()),
1472 typeArgs.reserve(size());
1473 for (
auto typeParam : *
this)
1474 typeArgs.push_back(typeParam->getUnderlyingType());
1514 setPreviousDecl(PrevDecl);
1518 Data = PrevDecl->Data;
1522 setTypeParamList(typeParamList);
1525 void ObjCInterfaceDecl::LoadExternalDefinition()
const {
1526 assert(data().ExternallyCompleted &&
"Class is not externally completed");
1527 data().ExternallyCompleted =
false;
1529 const_cast<ObjCInterfaceDecl *>(
this));
1534 "Class can't be externally completed without an external source");
1536 "Forward declarations can't be externally completed");
1537 data().ExternallyCompleted =
true;
1542 if (!isThisDeclarationADefinition())
1544 data().HasDesignatedInitializers =
true;
1549 if (!isThisDeclarationADefinition())
1551 if (data().ExternallyCompleted)
1552 LoadExternalDefinition();
1554 return data().HasDesignatedInitializers;
1559 if (
const auto *ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
1560 return ObjCRTName->getMetadataName();
1568 const_cast<ObjCImplementationDecl*>(
this)->getClassInterface())
1569 return ID->getObjCRuntimeNameAsString();
1576 if (data().ExternallyCompleted)
1577 LoadExternalDefinition();
1580 const_cast<ObjCInterfaceDecl*>(Def));
1593 struct SynthesizeIvarChunk {
1598 : Size(size), Ivar(ivar) {}
1601 bool operator<(
const SynthesizeIvarChunk & LHS,
1602 const SynthesizeIvarChunk &RHS) {
1603 return LHS.Size < RHS.Size;
1623 if (!data().IvarList) {
1624 if (!ivar_empty()) {
1626 data().IvarList = *I; ++I;
1627 for (curIvar = data().IvarList; I != E; curIvar = *I, ++I)
1631 for (
const auto *Ext : known_extensions()) {
1632 if (!Ext->ivar_empty()) {
1634 I = Ext->ivar_begin(),
1635 E = Ext->ivar_end();
1636 if (!data().IvarList) {
1637 data().IvarList = *I; ++I;
1638 curIvar = data().IvarList;
1640 for ( ;I != E; curIvar = *I, ++I)
1644 data().IvarListMissingImplementation =
true;
1648 if (!data().IvarListMissingImplementation)
1649 return data().IvarList;
1652 data().IvarListMissingImplementation =
false;
1653 if (!ImplDecl->ivar_empty()) {
1655 for (
auto *IV : ImplDecl->ivars()) {
1656 if (IV->getSynthesize() && !IV->isInvalidDecl()) {
1657 layout.push_back(SynthesizeIvarChunk(
1658 IV->getASTContext().getTypeSize(IV->getType()), IV));
1661 if (!data().IvarList)
1662 data().IvarList = IV;
1668 if (!layout.empty()) {
1670 llvm::stable_sort(layout);
1671 unsigned Ix = 0, EIx = layout.size();
1672 if (!data().IvarList) {
1673 data().IvarList = layout[0].Ivar; Ix++;
1674 curIvar = data().IvarList;
1676 for ( ; Ix != EIx; curIvar = layout[Ix].Ivar, Ix++)
1681 return data().IvarList;
1694 if (data().ExternallyCompleted)
1695 LoadExternalDefinition();
1697 for (
auto *Cat : visible_categories())
1698 if (Cat->getIdentifier() == CategoryId)
1706 for (
const auto *Cat : visible_categories()) {
1716 for (
const auto *Cat : visible_categories()) {
1729 bool lookupCategory,
1730 bool RHSIsQualifiedID) {
1745 if (RHSIsQualifiedID &&
1752 for (
const auto *Cat : visible_categories()) {
1753 for (
auto *PI : Cat->protocols())
1771 void ObjCIvarDecl::anchor() {}
1790 assert((isa<ObjCInterfaceDecl>(DC) || isa<ObjCImplementationDecl>(DC) ||
1791 isa<ObjCCategoryDecl>(DC)) &&
1792 "Invalid ivar decl context!");
1797 if (
auto *IM = dyn_cast<ObjCImplementationDecl>(DC))
1798 ID = IM->getClassInterface();
1800 ID = cast<ObjCCategoryDecl>(DC)->getClassInterface();
1802 ID->setIvarList(
nullptr);
1805 return new (
C, DC)
ObjCIvarDecl(DC, StartLoc, IdLoc, Id, T, TInfo, ac, BW,
1818 switch (DC->getKind()) {
1820 case ObjCCategoryImpl:
1822 llvm_unreachable(
"invalid ivar container!");
1825 case ObjCCategory: {
1826 const auto *CD = cast<ObjCCategoryDecl>(DC);
1827 assert(CD->IsClassExtension() &&
"invalid container for ivar!");
1828 return CD->getClassInterface();
1831 case ObjCImplementation:
1832 return cast<ObjCImplementationDecl>(DC)->getClassInterface();
1835 return cast<ObjCInterfaceDecl>(DC);
1848 void ObjCAtDefsFieldDecl::anchor() {}
1868 void ObjCProtocolDecl::anchor() {}
1875 redeclarable_base(C) {
1876 setPreviousDecl(PrevDecl);
1878 Data = PrevDecl->Data;
1907 for (
auto *I : protocols())
1917 bool isInstance)
const {
1926 if ((MethodDecl =
getMethod(Sel, isInstance)))
1929 for (
const auto *I : protocols())
1930 if ((MethodDecl = I->lookupMethod(Sel, isInstance)))
1935 void ObjCProtocolDecl::allocateDefinitionData() {
1936 assert(!Data.getPointer() &&
"Protocol already has a definition!");
1938 Data.getPointer()->Definition =
this;
1942 allocateDefinitionData();
1946 RD->Data = this->Data;
1952 for (
auto *Prop : PDecl->properties()) {
1954 PM.insert(std::make_pair(
1955 std::make_pair(Prop->getIdentifier(), Prop->isClassProperty()),
1960 for (
const auto *PI : PDecl->protocols())
1961 PI->collectPropertiesToImplement(PM, PO);
1969 if (!PS.insert(PDecl).second)
1971 for (
auto *Prop : PDecl->properties()) {
1972 if (Prop == Property)
1980 for (
const auto *PI : PDecl->protocols())
1981 PI->collectInheritedProtocolProperties(Property, PS, PO);
1987 if (
const auto *ObjCRTName = getAttr<ObjCRuntimeNameAttr>())
1988 return ObjCRTName->getMetadataName();
1997 void ObjCCategoryDecl::anchor() {}
2007 ClassInterface(IDecl), CategoryNameLoc(CategoryNameLoc),
2008 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc) {
2009 setTypeParamList(typeParamList);
2023 IDecl, typeParamList, IvarLBraceLoc,
2031 L->AddedObjCCategoryToInterface(CatDecl, IDecl);
2042 nullptr,
nullptr,
nullptr);
2047 const_cast<ObjCCategoryDecl*>(
this));
2055 TypeParamList = TPL;
2059 for (
auto *typeParam : *TypeParamList)
2060 typeParam->setDeclContext(
this);
2067 void ObjCCategoryImplDecl::anchor() {}
2079 atStartLoc, CategoryNameLoc);
2096 void ObjCImplDecl::anchor() {}
2100 property->setLexicalDeclContext(
this);
2107 if (
auto *ImplD = dyn_cast_or_null<ObjCImplementationDecl>(
this)) {
2111 }
else if (
auto *ImplD = dyn_cast_or_null<ObjCCategoryImplDecl>(
this)) {
2116 ClassInterface = IFace;
2124 for (
auto *PID : property_impls())
2125 if (PID->getPropertyIvarDecl() &&
2126 PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
2138 for (
auto *PID : property_impls())
2141 if (PID->getPropertyDecl()->getIdentifier() ==
Id) {
2143 !PID->getPropertyDecl()->isClassProperty()) ||
2145 PID->getPropertyDecl()->isClassProperty()) ||
2147 !PID->getPropertyDecl()->isClassProperty()))
2150 if (PID->getPropertyDecl()->isClassProperty())
2151 ClassPropImpl = PID;
2156 return ClassPropImpl;
2171 void ObjCImplementationDecl::anchor() {}
2185 nameLoc, atStartLoc, superLoc,
2186 IvarLBraceLoc, IvarRBraceLoc);
2197 unsigned numInitializers) {
2198 if (numInitializers > 0) {
2199 NumIvarInitializers = numInitializers;
2201 memcpy(ivarInitializers, initializers,
2203 IvarInitializers = ivarInitializers;
2209 return IvarInitializers.get(
getASTContext().getExternalSource());
2222 void ObjCCompatibleAliasDecl::anchor() {}
2242 void ObjCPropertyDecl::anchor() {}
2293 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.
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
void setImplicit(bool I=true)
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...
virtual Stmt * getBody() const
getBody - If this Decl represents a declaration for a body of code, such as a function or method defi...
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.
NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)
static ObjCMethodDecl * Create(ASTContext &C, SourceLocation beginLoc, SourceLocation endLoc, Selector SelInfo, QualType T, TypeSourceInfo *ReturnTInfo, DeclContext *contextDecl, bool isInstance=true, bool isVariadic=false, bool isPropertyAccessor=false, bool isSynthesizedAccessorStub=false, bool isImplicitlyDeclared=false, bool isDefined=false, ImplementationControl impControl=None, bool HasRelatedResultType=false)
static ObjCProtocolDecl * Create(ASTContext &C, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc, ObjCProtocolDecl *PrevDecl)
known_categories_range known_categories() const
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. ...
SourceLocation getEndLoc() const LLVM_READONLY
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...
bool isInvalidDecl() const
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.
static const NamedDecl * getDefinition(const Decl *D)
Represents a parameter to a function.
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.
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
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.
bool isDirectMethod() const
True if the method is tagged as objc_direct.
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.
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
QualType getObjCTypeParamType(const ObjCTypeParamDecl *Decl, ArrayRef< ObjCProtocolDecl *> protocols) const
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
ObjCContainerDecl(Kind DK, DeclContext *DC, IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
visible_extensions_range visible_extensions() const
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, unsigned ID)
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
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)
This represents one expression.
Defines the clang::LangOptions interface.
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)
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD, const ObjCMethodDecl *Redecl)
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...
DeclContext * getParent()
getParent - Returns the containing DeclContext.
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 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)
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
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...
Encodes a location in the source.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
void setAtStartLoc(SourceLocation Loc)
ASTContext & getASTContext() const LLVM_READONLY
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.
DeclContext(Decl::Kind K)
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
StringRef getName() const
Return the actual identifier string.
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
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
ExternalASTSource * getExternalSource() const
Retrieve a pointer to the external AST source associated with this AST context, if any...
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.
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
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.
void addDecl(Decl *D)
Add the declaration D into this context.
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...
ObjCMethodDeclBitfields ObjCMethodDeclBits
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 setHasRedeclaration(bool HRD) const
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 ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, unsigned ID)
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or immediately...
NamedDecl * getMostRecentDecl()
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.
This represents a decl that may have a name.
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.
SourceLocation getLocation() const
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.