clang: include/clang/AST/DeclObjC.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_AST_DECLOBJC_H
14#define LLVM_CLANG_AST_DECLOBJC_H
15
27#include "llvm/ADT/ArrayRef.h"
28#include "llvm/ADT/DenseSet.h"
29#include "llvm/ADT/MapVector.h"
30#include "llvm/ADT/PointerIntPair.h"
31#include "llvm/ADT/STLExtras.h"
32#include "llvm/ADT/StringRef.h"
33#include "llvm/ADT/iterator_range.h"
34#include "llvm/Support/Compiler.h"
35#include "llvm/Support/TrailingObjects.h"
36#include
37#include
38#include
39#include
40#include
41#include
42
44
45class ASTContext;
46class CompoundStmt;
47class CXXCtorInitializer;
48class Expr;
49class ObjCCategoryDecl;
50class ObjCCategoryImplDecl;
51class ObjCImplementationDecl;
52class ObjCInterfaceDecl;
53class ObjCIvarDecl;
54class ObjCPropertyDecl;
55class ObjCPropertyImplDecl;
56class ObjCProtocolDecl;
57class Stmt;
58
60protected:
61
64
65public:
69
72
73protected:
74 void set(void *const* InList, unsigned Elts, ASTContext &Ctx);
75};
76
77
78
79
80
81template
83public:
85 ObjCListBase::set(reinterpret_cast<void*const*>(InList), Elts, Ctx);
86 }
87
89
92
94 assert(Idx < NumElts && "Invalid access");
96 }
97};
98
99
100
103
105
106public:
108
110
113
116};
117
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
141
142
143
144
146
147
149
150
151
152 void *ParamsAndSelLocs = nullptr;
153 unsigned NumParams = 0;
154
155
156 SourceLocation DeclEndLoc;
157
158
160
161
162
164
165
166
168
172 bool isInstance = true, bool isVariadic = false,
174 bool isImplicitlyDeclared = false, bool isDefined = false,
176 bool HasRelatedResultType = false);
177
180 }
181
184 }
185
186 bool hasStandardSelLocs() const {
188 }
189
190
191
193 return reinterpret_cast<SourceLocation *>(getParams() + NumParams);
194 }
196 return reinterpret_cast<const SourceLocation *>(getParams() + NumParams);
197 }
198
199
200
202 return reinterpret_cast<ParmVarDecl **>(ParamsAndSelLocs);
203 }
204 const ParmVarDecl *const *getParams() const {
205 return reinterpret_cast<const ParmVarDecl *const *>(ParamsAndSelLocs);
206 }
207
208
209
210 unsigned getNumStoredSelLocs() const {
211 if (hasStandardSelLocs())
212 return 0;
214 }
215
219
220
221
222
224
225public:
228
232 DeclContext *contextDecl, bool isInstance = true,
235 bool isImplicitlyDeclared = false, bool isDefined = false,
237 bool HasRelatedResultType = false);
238
240
244 }
245
248 }
249
252 }
253
254
255
258 }
259
260
263 }
264
265
269
270
274 }
275
276
277
278
280
281
286 }
287
292 }
293
296 if (hasStandardSelLocs())
300 DeclEndLoc);
301 return getStoredSelLocs()[Index];
302 }
303
305
308 return 0;
311 return 1;
313 }
314
318 }
319
320
321
325 }
326
328
332
333
334
335
336
338
339
340
342
345
346
347 unsigned param_size() const { return NumParams; }
348
351 using param_range = llvm::iterator_range<param_iterator>;
353
356 }
357
360 }
361
364
365
366
369 }
370
371
372
375 }
376
378 assert(Idx < NumParams && "Index out of bounds!");
379 return getParams()[Idx];
380 }
383 }
384
385
386
387
390
391
394 };
395
397 llvm::mapped_iterator<param_const_iterator, GetTypeFn>;
398
401 }
402
405 }
406
407
408
409
410
412
413
414
416 bool &selfIsPseudoStrong, bool &selfIsConsumed) const;
417
422
423
425
429 }
430
433
435
438 }
439
442 }
443
446 }
447
450 }
451
454
455
456
457
458
459
460
461
464
465
466
467
468
469
470
471
472
475
476
480 }
481
482
484
485
487
488
489
490
491
492
494
495
498 }
499
503 }
504
507 }
508
509
510
512
513
514
515
516
517
518
521
522
524
525
527
529
532
533
535
536
538
539
542
545 }
546
549 }
550};
551
552
554
556
557
558
560
561
562
564};
565
566
567
568
569
570
571
572
573
574
575
576
577
579
580 unsigned Index : 14;
581
582
584 unsigned Variance : 2;
585
586
588
589
590
592
595 unsigned index,
598 : TypedefNameDecl(ObjCTypeParam, ctx, dc, nameLoc, nameLoc, name,
599 boundInfo),
600 Index(index), Variance(static_cast<unsigned>(variance)),
601 VarianceLoc(varianceLoc), ColonLoc(colonLoc) {}
602
603 void anchor() override;
604
605public:
608
612 unsigned index,
619
621
622
625 }
626
627
629 Variance = static_cast<unsigned>(variance);
630 }
631
632
634
635
636 unsigned getIndex() const { return Index; }
637
638
639
641
642
643
645
646
649};
650
651
652
653
654
655
656
657
659 : private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {
660
662
663 unsigned NumParams;
664
668
669public:
671
672
677
678
680
681 iterator begin() { return getTrailingObjects<ObjCTypeParamDecl *>(); }
682
684
685
686 unsigned size() const { return NumParams; }
687
688
690
692 return getTrailingObjects<ObjCTypeParamDecl *>();
693 }
694
697 }
698
700 assert(size() > 0 && "empty Objective-C type parameter list");
702 }
703
705 assert(size() > 0 && "empty Objective-C type parameter list");
706 return *(end() - 1);
707 }
708
712
713
714
716};
717
722};
723
724
725
726
727
728
729
731 void anchor() override;
732
733public:
736
737private:
738
740
741
743
750
751
753 unsigned PropertyImplementation : 2;
754
755
757
758
760
761
763
764
766
767
769
770
772
773
775
779 : NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),
780 LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),
781 PropertyAttributes(ObjCPropertyAttribute::kind_noattr),
782 PropertyAttributesAsWritten(ObjCPropertyAttribute::kind_noattr),
783 PropertyImplementation(propControl) {}
784
785public:
786 static ObjCPropertyDecl *Create(ASTContext &C, DeclContext *DC,
787 SourceLocation L, const IdentifierInfo *Id,
788 SourceLocation AtLocation,
789 SourceLocation LParenLocation, QualType T,
790 TypeSourceInfo *TSI,
792
794
797
800
802
804
806 DeclType = T;
807 DeclTypeSourceInfo = TSI;
808 }
809
810
811
813
816 }
817
819 PropertyAttributes |= PRVal;
820 }
821
823 PropertyAttributes = PRVal;
824 }
825
828 }
829
831 PropertyAttributesAsWritten = PRVal;
832 }
833
834
835
836
839 }
840
841
844 }
845
846
851 }
852
856 }
858
862 }
863
867 }
868
869
870
871
882 }
883
886
888 GetterName = Sel;
889 GetterNameLoc = Loc;
890 }
891
894
896 SetterName = Sel;
897 SetterNameLoc = Loc;
898 }
899
902
905
906
908 PropertyImplementation = pc;
909 }
910
913 }
914
917 }
918
920 PropertyIvarDecl = Ivar;
921 }
922
924 return PropertyIvarDecl;
925 }
926
929 }
930
931
933
934
938
941};
942
943
944
945
946
948
949
950
951
952
954
955 void anchor() override;
956
957public:
960
961
964 llvm::iterator_range<specific_decl_iterator>;
965
967
970 }
971
974 }
975
980
983 }
984
987 }
988
991 }
992
997
1000 }
1001
1004 }
1005
1008 }
1009
1010
1013 llvm::iterator_range<specific_decl_iterator>;
1014
1017 }
1018
1021 }
1022
1025 }
1026
1031
1034 }
1035
1038 }
1039
1042 }
1043
1048
1051 }
1052
1055 }
1056
1059 }
1060
1061
1063 bool AllowHidden = false) const;
1064
1066 bool AllowHidden = false) const {
1067 return getMethod(Sel, true, AllowHidden);
1068 }
1069
1071 return getMethod(Sel, false, AllowHidden);
1072 }
1073
1076
1078 bool IsInstance) const;
1079
1083
1085 llvm::MapVector<std::pair<IdentifierInfo *, unsigned >,
1089
1090
1091
1092
1094
1096
1099 }
1100
1101
1103
1105
1108 }
1109
1110
1112
1114 return K >= firstObjCContainer &&
1115 K <= lastObjCContainer;
1116 }
1117
1120 }
1121
1124 }
1125};
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1156
1157
1158
1159 mutable const Type *TypeForDecl = nullptr;
1160
1161 struct DefinitionData {
1162
1163
1165
1166
1168
1169
1171
1172
1174
1175
1176
1177
1178
1179
1181
1182
1183
1185
1186
1187
1188 LLVM_PREFERRED_TYPE(bool)
1189 mutable unsigned ExternallyCompleted : 1;
1190
1191
1192
1193 LLVM_PREFERRED_TYPE(bool)
1194 mutable unsigned IvarListMissingImplementation : 1;
1195
1196
1197
1198 LLVM_PREFERRED_TYPE(bool)
1199 unsigned HasDesignatedInitializers : 1;
1200
1201 enum InheritedDesignatedInitializersState {
1202
1203
1204 IDI_Unknown = 0,
1205
1206
1207 IDI_Inherited = 1,
1208
1209
1210 IDI_NotInherited = 2
1211 };
1212
1213
1214 LLVM_PREFERRED_TYPE(InheritedDesignatedInitializersState)
1215 mutable unsigned InheritedDesignatedInitializers : 2;
1216
1217
1218 LLVM_PREFERRED_TYPE(bool)
1219 unsigned HasODRHash : 1;
1220
1221
1223
1224
1225
1226
1228
1229 DefinitionData()
1230 : ExternallyCompleted(false), IvarListMissingImplementation(true),
1231 HasDesignatedInitializers(false),
1232 InheritedDesignatedInitializers(IDI_Unknown), HasODRHash(false) {}
1233 };
1234
1235
1236 ObjCTypeParamList *TypeParamList = nullptr;
1237
1238
1239
1240
1241
1242
1243 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
1244
1245 ObjCInterfaceDecl(const ASTContext &C, DeclContext *DC, SourceLocation AtLoc,
1246 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1247 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,
1248 bool IsInternal);
1249
1250 void anchor() override;
1251
1252 void LoadExternalDefinition() const;
1253
1254 DefinitionData &data() const {
1255 assert(Data.getPointer() && "Declaration has no definition!");
1256 return *Data.getPointer();
1257 }
1258
1259
1260 void allocateDefinitionData();
1261
1262 using redeclarable_base = Redeclarable;
1263
1264 ObjCInterfaceDecl *getNextRedeclarationImpl() override {
1266 }
1267
1268 ObjCInterfaceDecl *getPreviousDeclImpl() override {
1270 }
1271
1272 ObjCInterfaceDecl *getMostRecentDeclImpl() override {
1274 }
1275
1276public:
1277 static ObjCInterfaceDecl *
1278 Create(const ASTContext &C, DeclContext *DC, SourceLocation atLoc,
1279 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,
1280 ObjCInterfaceDecl *PrevDecl,
1281 SourceLocation ClassLoc = SourceLocation(), bool isInternal = false);
1282
1284 GlobalDeclID ID);
1285
1286
1287
1288
1289
1290
1291
1293
1294
1295
1296
1297
1299
1300
1301
1303 return TypeParamList;
1304 }
1305
1309
1311 }
1312
1313
1314
1315
1317
1318
1319
1321
1322
1323
1325
1326
1327
1330 }
1331
1333 assert(hasDefinition() && "Caller did not check for forward reference!");
1334 if (data().ExternallyCompleted)
1335 LoadExternalDefinition();
1336
1337 return data().ReferencedProtocols;
1338 }
1339
1342
1345
1346
1349
1353 }
1354
1357
1360 }
1361
1363
1366
1367 if (data().ExternallyCompleted)
1368 LoadExternalDefinition();
1369
1370 return data().ReferencedProtocols.begin();
1371 }
1372
1374
1377
1378 if (data().ExternallyCompleted)
1379 LoadExternalDefinition();
1380
1381 return data().ReferencedProtocols.end();
1382 }
1383
1386
1389 }
1390
1392
1395
1396 if (data().ExternallyCompleted)
1397 LoadExternalDefinition();
1398
1399 return data().ReferencedProtocols.loc_begin();
1400 }
1401
1403
1406
1407 if (data().ExternallyCompleted)
1408 LoadExternalDefinition();
1409
1410 return data().ReferencedProtocols.loc_end();
1411 }
1412
1415
1419 }
1420
1422
1425
1426 if (data().ExternallyCompleted)
1427 LoadExternalDefinition();
1428
1429 return data().AllReferencedProtocols.empty()
1431 : data().AllReferencedProtocols.begin();
1432 }
1433
1435
1438
1439 if (data().ExternallyCompleted)
1440 LoadExternalDefinition();
1441
1442 return data().AllReferencedProtocols.empty()
1444 : data().AllReferencedProtocols.end();
1445 }
1446
1448 using ivar_range = llvm::iterator_range<specific_decl_iterator>;
1449
1451
1455
1456
1458 }
1459
1463
1464
1466 }
1467
1470 }
1471
1473
1476
1477
1479 }
1481
1482
1483
1486 data().ReferencedProtocols.set(List, Num, Locs, C);
1487 }
1488
1489
1490
1492 unsigned Num,
1494
1495
1496
1498
1499
1500
1501
1502
1503
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516 bool
1519
1520
1521
1524 }
1525
1526
1528
1529
1530
1531
1532 if (.getOpaqueValue())
1534
1535 return Data.getPointer();
1536 }
1537
1538
1539
1540
1542 return hasDefinition()? Data.getPointer()->Definition : nullptr;
1543 }
1544
1545
1546
1547
1549 return hasDefinition()? Data.getPointer()->Definition : nullptr;
1550 }
1551
1552
1553
1555
1556
1557
1558
1559
1562
1563
1567
1568 return nullptr;
1569 }
1570
1571
1573
1575 return nullptr;
1576
1577 if (data().ExternallyCompleted)
1578 LoadExternalDefinition();
1579
1580 return data().SuperClassTInfo;
1581 }
1582
1583
1584
1586
1588 data().SuperClassTInfo = superClass;
1589 }
1590
1591
1592
1593
1594
1595
1596 template<bool (*Filter)(ObjCCategoryDecl *)>
1599
1600 void findAcceptableCategory();
1601
1602 public:
1608
1611 : Current(Current) {
1612 findAcceptableCategory();
1613 }
1614
1617
1619
1622 ++(*this);
1623 return Tmp;
1624 }
1625
1628 return X.Current == Y.Current;
1629 }
1630
1633 return X.Current != Y.Current;
1634 }
1635 };
1636
1637private:
1638
1639
1640
1642
1643public:
1644
1645
1648
1650 llvm::iterator_range<visible_categories_iterator>;
1651
1655 }
1656
1657
1658
1661 }
1662
1663
1666 }
1667
1668
1671 }
1672
1673private:
1674
1675
1676
1677 static bool isKnownCategory(ObjCCategoryDecl *) { return true; }
1678
1679public:
1680
1681
1684 llvm::iterator_range<known_categories_iterator>;
1685
1689 }
1690
1691
1692
1695 }
1696
1697
1700 }
1701
1702
1705 }
1706
1707private:
1708
1709
1710
1712
1713public:
1714
1715
1718
1720 llvm::iterator_range<visible_extensions_iterator>;
1721
1725 }
1726
1727
1728
1731 }
1732
1733
1736 }
1737
1738
1741 }
1742
1743private:
1744
1745
1746
1748
1749public:
1754
1755
1759 llvm::iterator_range<known_extensions_iterator>;
1760
1764 }
1765
1766
1767
1770 }
1771
1772
1775 }
1776
1777
1780 }
1781
1782
1783
1785
1787 return nullptr;
1788
1789 if (data().ExternallyCompleted)
1790 LoadExternalDefinition();
1791
1792 return data().CategoryList;
1793 }
1794
1795
1796
1798 data().CategoryList = category;
1799 }
1800
1804
1806
1807
1808
1810
1811 while (I != nullptr) {
1813 return true;
1814
1816 }
1817 return false;
1818 }
1819
1820
1821
1823
1824
1825
1826
1828
1834 }
1835
1837
1838
1839
1841 bool shallowCategoryLookup = false,
1842 bool followSuper = true,
1844
1845
1847 return lookupMethod(Sel, true);
1848 }
1849
1850
1852 return lookupMethod(Sel, false);
1853 }
1854
1856
1857
1859 bool Instance=true) const;
1860
1863 }
1864
1865
1866
1867
1870 bool IsClassProperty) const {
1871 return lookupMethod(Sel, !IsClassProperty,
1872 false,
1873 true ,
1874 Cat);
1875 }
1876
1880
1881 return data().EndLoc;
1882 }
1883
1885
1886
1888
1889
1890
1891
1894 }
1895
1896
1897
1898
1900 bool lookupCategory,
1901 bool RHSIsQualifiedID = false);
1902
1905
1912
1913
1916
1917
1920
1921
1923
1926
1927private:
1928
1929 bool hasODRHash() const;
1930 void setHasODRHash(bool HasHash);
1931
1932 const ObjCInterfaceDecl *findInterfaceWithDesignatedInitializers() const;
1933 bool inheritsDesignatedInitializers() const;
1934};
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1952 void anchor() override;
1953
1954public:
1958
1959private:
1963 bool synthesized)
1964 : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,
1966 DeclAccess(ac), Synthesized(synthesized) {}
1967
1968public:
1969 static ObjCIvarDecl *Create(ASTContext &C, ObjCContainerDecl *DC,
1970 SourceLocation StartLoc, SourceLocation IdLoc,
1971 const IdentifierInfo *Id, QualType T,
1973 Expr *BW = nullptr, bool synthesized = false);
1974
1976
1977
1978
1979
1980
1984 }
1985
1989
1992 }
1995 }
1996
1998
2000
2003 }
2004
2007
2008
2009
2011
2012
2015
2016private:
2017
2018
2020
2021
2023 unsigned DeclAccess : 3;
2024 LLVM_PREFERRED_TYPE(bool)
2025 unsigned Synthesized : 1;
2026};
2027
2028
2033 : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,
2034 nullptr,
2035 BW, false, ICIS_NoInit) {}
2036
2037 void anchor() override;
2038
2039public:
2044
2047
2048
2051};
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2084 struct DefinitionData {
2085
2087
2088
2090
2091
2092 LLVM_PREFERRED_TYPE(bool)
2093 unsigned HasODRHash : 1;
2094
2095
2097 };
2098
2099
2100
2101
2102
2103
2104 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;
2105
2109
2110 void anchor() override;
2111
2112 DefinitionData &data() const {
2113 assert(Data.getPointer() && "Objective-C protocol has no definition!");
2114 return *Data.getPointer();
2115 }
2116
2117 void allocateDefinitionData();
2118
2120
2123 }
2124
2127 }
2128
2131 }
2132
2133
2134 bool hasODRHash() const;
2135 void setHasODRHash(bool HasHash);
2136
2137public:
2143
2149
2151
2153 assert(hasDefinition() && "No definition available!");
2154 return data().ReferencedProtocols;
2155 }
2156
2159
2162 }
2163
2167
2168 return data().ReferencedProtocols.begin();
2169 }
2170
2174
2175 return data().ReferencedProtocols.end();
2176 }
2177
2180
2183 }
2184
2188
2189 return data().ReferencedProtocols.loc_begin();
2190 }
2191
2195
2196 return data().ReferencedProtocols.loc_end();
2197 }
2198
2201 return 0;
2202
2203 return data().ReferencedProtocols.size();
2204 }
2205
2206
2207
2210 assert(hasDefinition() && "Protocol is not defined");
2211 data().ReferencedProtocols.set(List, Num, Locs, C);
2212 }
2213
2214
2215
2217
2218
2219
2220 void getImpliedProtocols(llvm::DenseSet<const ObjCProtocolDecl *> &IPs) const;
2221
2223
2224
2225
2227
2229 return lookupMethod(Sel, true);
2230 }
2231
2233 return lookupMethod(Sel, false);
2234 }
2235
2236
2238
2239
2240
2241
2242 if (.getOpaqueValue())
2244
2245 return Data.getPointer();
2246 }
2247
2248
2250 return hasDefinition()? Data.getPointer()->Definition : nullptr;
2251 }
2252
2253
2255 return hasDefinition()? Data.getPointer()->Definition : nullptr;
2256 }
2257
2258
2259
2262 }
2263
2264
2266
2267
2268
2269
2270
2273
2274
2275
2277
2281
2283 }
2284
2287
2294
2295
2298
2300
2304
2305
2307
2310};
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2329
2331
2332
2334
2335
2337
2338
2339
2341
2342
2344
2345
2348
2355
2356 void anchor() override;
2357
2358public:
2361
2370
2373
2374
2375
2377
2378
2379
2380
2381
2383
2384
2387
2388
2389
2392 ReferencedProtocols.set(List, Num, Locs, C);
2393 }
2394
2396 return ReferencedProtocols;
2397 }
2398
2401
2404 }
2405
2407 return ReferencedProtocols.begin();
2408 }
2409
2412
2415
2418 }
2419
2421 return ReferencedProtocols.loc_begin();
2422 }
2423
2425 return ReferencedProtocols.loc_end();
2426 }
2427
2429
2430
2431
2433 return NextClassCategory;
2434 }
2435
2437
2439 using ivar_range = llvm::iterator_range<specific_decl_iterator>;
2440
2442
2445 }
2446
2449 }
2450
2453 }
2454
2457 }
2458
2461
2466
2469};
2470
2472
2474
2475 void anchor() override;
2476
2477protected:
2482 ClassInterface(classInterface) {}
2483
2484public:
2488
2490
2493 }
2494
2496
2499 }
2500
2502
2506
2507
2510 llvm::iterator_range<specific_decl_iterator>;
2511
2514 }
2515
2518 }
2519
2522 }
2523
2525
2527 return K >= firstObjCImpl && K <= lastObjCImpl;
2528 }
2529};
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2545
2547
2552 : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id, nameLoc,
2553 atStartLoc),
2554 CategoryNameLoc(CategoryNameLoc) {}
2555
2556 void anchor() override;
2557
2558public:
2561
2568
2570
2572
2575};
2576
2577raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2597
2600
2601
2604
2605
2606
2608 unsigned NumIvarInitializers = 0;
2609
2610
2611
2612 LLVM_PREFERRED_TYPE(bool)
2613 bool HasNonZeroConstructors : 1;
2614
2615
2616 LLVM_PREFERRED_TYPE(bool)
2617 bool HasDestructors : 1;
2618
2626 : ObjCImplDecl(ObjCImplementation, DC, classInterface,
2627 classInterface ? classInterface->getIdentifier()
2628 : nullptr,
2629 nameLoc, atStartLoc),
2630 SuperClass(superDecl), SuperLoc(superLoc),
2631 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),
2632 HasNonZeroConstructors(false), HasDestructors(false) {}
2633
2634 void anchor() override;
2635
2636public:
2639
2648
2651
2652
2654
2655
2657
2658 using init_range = llvm::iterator_range<init_iterator>;
2660
2662
2665 }
2666
2667
2669 const auto *ConstThis = this;
2670 return const_cast<init_iterator>(ConstThis->init_begin());
2671 }
2672
2673
2675
2676
2678 return init_begin() + NumIvarInitializers;
2679 }
2680
2681
2683 return init_begin() + NumIvarInitializers;
2684 }
2685
2686
2688 return NumIvarInitializers;
2689 }
2690
2692 NumIvarInitializers = numNumIvarInitializers;
2693 }
2694
2697 unsigned numInitializers);
2698
2699
2700
2703
2704
2705
2708
2709
2710
2713 }
2714
2715
2716
2717
2718
2719
2721 assert(getIdentifier() && "Name is not a simple identifier");
2723 }
2724
2725
2726
2727
2729
2730
2731
2733
2737
2739
2744
2746 using ivar_range = llvm::iterator_range<specific_decl_iterator>;
2747
2749
2752 }
2753
2756 }
2757
2760 }
2761
2764 }
2765
2768};
2769
2770raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);
2771
2772
2773
2775
2777
2780 : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}
2781
2782 void anchor() override;
2783
2784public:
2788
2791
2795
2798};
2799
2800
2801
2802
2803
2805public:
2810
2811private:
2812 SourceLocation AtLoc;
2813
2814
2815
2816
2817
2818
2819
2821
2822
2824
2825
2827
2828
2830
2832
2833
2834
2835 Expr *GetterCXXConstructor = nullptr;
2836
2837
2838
2839 Expr *SetterCXXAssignment = nullptr;
2840
2846 : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),
2847 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {
2848 assert(PK == Dynamic || PropertyIvarDecl);
2849 }
2850
2851public:
2853
2860
2863
2865
2868
2870 return PropertyDecl;
2871 }
2873
2876 }
2877
2879 return PropertyIvarDecl;
2880 }
2882
2885 PropertyIvarDecl = Ivar;
2886 this->IvarLoc = IvarLoc;
2887 }
2888
2889
2890
2891
2892
2893
2894
2895
2898 }
2899
2902
2905
2907 return GetterCXXConstructor;
2908 }
2909
2911 GetterCXXConstructor = getterCXXConstructor;
2912 }
2913
2915 return SetterCXXAssignment;
2916 }
2917
2919 SetterCXXAssignment = setterCXXAssignment;
2920 }
2921
2924};
2925
2926template<bool (*Filter)(ObjCCategoryDecl *)>
2927void
2928ObjCInterfaceDecl::filtered_category_iterator::
2929findAcceptableCategory() {
2930 while (Current && !Filter(Current))
2931 Current = Current->getNextClassCategoryRaw();
2932}
2933
2934template<bool (*Filter)(ObjCCategoryDecl *)>
2935inline ObjCInterfaceDecl::filtered_category_iterator &
2937 Current = Current->getNextClassCategoryRaw();
2938 findAcceptableCategory();
2939 return *this;
2940}
2941
2942inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) {
2944}
2945
2946inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) {
2949}
2950
2951inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {
2952 return !Cat->isInvalidDecl() && Cat->IsClassExtension();
2953}
2954
2955}
2956
2957#endif
enum clang::sema::@1726::IndirectLocalPathEntry::EntryKind Kind
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Reads an AST files chain containing the contents of a translation unit.
Represents a C++ base or member initializer.
CompoundStmt - This represents a group of statements like { stmt stmt }.
Iterates over a filtered subrange of declarations stored in a DeclContext.
specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ObjCMethodDeclBitfields ObjCMethodDeclBits
ObjCContainerDeclBitfields ObjCContainerDeclBits
void addDecl(Decl *D)
Add the declaration D into this context.
decl_iterator decls_end() const
decl_iterator decls_begin() const
Decl - This represents one declaration (or definition), e.g.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isUnconditionallyVisible() const
Determine whether this declaration is definitely visible to name lookup, independent of whether the o...
Kind
Lists the kind of concrete classes of Decl.
ObjCDeclQualifier
ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...
bool isInvalidDecl() const
SourceLocation getLocation() const
void setLexicalDeclContext(DeclContext *DC)
Selector getObjCSelector() const
Get the Objective-C selector stored in this declaration name.
This represents one expression.
Represents a member of a struct/union/class.
FieldDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Represents a field declaration created by an @defs(...).
static bool classofKind(Kind K)
static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
static bool classof(const Decl *D)
ObjCCategoryDecl - Represents a category declaration.
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ObjCCategoryDecl * getNextClassCategory() const
unsigned ivar_size() const
ivar_iterator ivar_begin() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this category.
ivar_iterator ivar_end() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
protocol_loc_range protocol_locs() const
static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setIvarLBraceLoc(SourceLocation Loc)
unsigned protocol_size() const
ObjCCategoryImplDecl * getImplementation() const
void setCategoryNameLoc(SourceLocation Loc)
ObjCInterfaceDecl * getClassInterface()
ObjCCategoryDecl * getNextClassCategoryRaw() const
Retrieve the pointer to the next stored category (or extension), which may be hidden.
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
static bool classofKind(Kind K)
void setIvarRBraceLoc(SourceLocation Loc)
protocol_iterator protocol_end() const
const ObjCInterfaceDecl * getClassInterface() const
llvm::iterator_range< protocol_iterator > protocol_range
SourceLocation getIvarLBraceLoc() const
bool IsClassExtension() const
SourceLocation getIvarRBraceLoc() const
protocol_loc_iterator protocol_loc_begin() const
protocol_iterator protocol_begin() const
protocol_range protocols() const
const ObjCProtocolList & getReferencedProtocols() const
void setImplementation(ObjCCategoryImplDecl *ImplD)
ObjCProtocolList::iterator protocol_iterator
static bool classof(const Decl *D)
SourceLocation getCategoryNameLoc() const
protocol_loc_iterator protocol_loc_end() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
static bool classofKind(Kind K)
SourceLocation getCategoryNameLoc() const
ObjCCategoryDecl * getCategoryDecl() const
static bool classof(const Decl *D)
static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
static bool classofKind(Kind K)
ObjCInterfaceDecl * getClassInterface()
static bool classof(const Decl *D)
static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
void setClassInterface(ObjCInterfaceDecl *D)
ObjCContainerDecl - Represents a container for method declarations.
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator
ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const
filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator
llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range
classmeth_iterator classmeth_end() const
prop_iterator prop_end() const
method_iterator meth_begin() const
method_range methods() const
instprop_iterator instprop_end() const
void setAtStartLoc(SourceLocation Loc)
SourceRange getAtEndRange() const
classmeth_iterator classmeth_begin() const
specific_decl_iterator< ObjCPropertyDecl > prop_iterator
prop_iterator prop_begin() const
llvm::iterator_range< instprop_iterator > instprop_range
llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap
instmeth_range instance_methods() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator
llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range
llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet
classprop_iterator classprop_end() const
instmeth_iterator instmeth_end() const
llvm::iterator_range< classprop_iterator > classprop_range
ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const
specific_decl_iterator< ObjCMethodDecl > method_iterator
static DeclContext * castToDeclContext(const ObjCContainerDecl *D)
ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const
getIvarDecl - This method looks up an ivar in this ContextDecl.
classprop_iterator classprop_begin() const
SourceLocation getAtStartLoc() const
method_iterator meth_end() const
static bool classof(const Decl *D)
instprop_range instance_properties() const
llvm::iterator_range< classmeth_iterator > classmeth_range
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
void setAtEndRange(SourceRange atEnd)
virtual void collectPropertiesToImplement(PropertyMap &PM) const
This routine collects list of properties to be implemented in the class.
instmeth_iterator instmeth_begin() const
classprop_range class_properties() const
instprop_iterator instprop_begin() const
llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder
static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)
ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const
prop_range properties() const
filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator
classmeth_range class_methods() const
static bool classofKind(Kind K)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
llvm::iterator_range< instmeth_iterator > instmeth_range
bool HasUserDeclaredSetterMethod(const ObjCPropertyDecl *P) const
This routine returns 'true' if a user declared setter method was found in the class,...
specific_decl_iterator< ObjCPropertyImplDecl > propimpl_iterator
void addPropertyImplementation(ObjCPropertyImplDecl *property)
void addClassMethod(ObjCMethodDecl *method)
llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range
ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)
ObjCInterfaceDecl * getClassInterface()
propimpl_iterator propimpl_begin() const
static bool classof(const Decl *D)
propimpl_range property_impls() const
void setClassInterface(ObjCInterfaceDecl *IFace)
ObjCPropertyImplDecl * FindPropertyImplDecl(IdentifierInfo *propertyId, ObjCPropertyQueryKind queryKind) const
FindPropertyImplDecl - This method looks up a previous ObjCPropertyImplDecl added to the list of thos...
propimpl_iterator propimpl_end() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const
FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...
static bool classofKind(Kind K)
void addInstanceMethod(ObjCMethodDecl *method)
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
void setNumIvarInitializers(unsigned numNumIvarInitializers)
static bool classofKind(Kind K)
init_iterator init_end()
init_end() - Retrieve an iterator past the last initializer.
SourceLocation getIvarRBraceLoc() const
bool hasNonZeroConstructors() const
Do any of the ivars of this class (not counting its base classes) require construction other than zer...
llvm::iterator_range< init_iterator > init_range
static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
IdentifierInfo * getIdentifier() const
getIdentifier - Get the identifier that names the class interface associated with this implementation...
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
CXXCtorInitializer *const * init_const_iterator
init_const_iterator - Iterates through the ivar initializer list.
std::string getNameAsString() const
Get the name of the class associated with this interface.
SourceLocation getSuperClassLoc() const
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
ivar_iterator ivar_begin() const
void setIvarLBraceLoc(SourceLocation Loc)
ObjCInterfaceDecl * getSuperClass()
StringRef getName() const
getName - Get the name of identifier for the class interface associated with this implementation as a...
void setSuperClass(ObjCInterfaceDecl *superCls)
bool hasDestructors() const
Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?
llvm::iterator_range< init_const_iterator > init_const_range
init_iterator init_begin()
init_begin() - Retrieve an iterator to the first initializer.
unsigned getNumIvarInitializers() const
getNumArgs - Number of ivars which must be initialized.
void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)
init_const_range inits() const
ivar_iterator ivar_end() const
unsigned ivar_size() const
void setIvarRBraceLoc(SourceLocation Loc)
init_const_iterator init_end() const
end() - Retrieve an iterator past the last initializer.
static bool classof(const Decl *D)
const ObjCInterfaceDecl * getSuperClass() const
SourceLocation getIvarLBraceLoc() const
void setHasDestructors(bool val)
void setHasNonZeroConstructors(bool val)
Iterator that walks over the list of categories, filtering out those that do not meet specific criter...
filtered_category_iterator(ObjCCategoryDecl *Current)
filtered_category_iterator()=default
friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)
pointer operator->() const
std::ptrdiff_t difference_type
reference operator*() const
filtered_category_iterator operator++(int)
friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)
filtered_category_iterator & operator++()
std::input_iterator_tag iterator_category
ObjCCategoryDecl * value_type
Represents an ObjC class declaration.
void mergeClassExtensionProtocolList(ObjCProtocolDecl *const *List, unsigned Num, ASTContext &C)
mergeClassExtensionProtocolList - Merge class extension's protocol list into the protocol list for th...
bool declaresOrInheritsDesignatedInitializers() const
Returns true if this interface decl declares a designated initializer or it inherites one from its su...
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
all_protocol_iterator all_referenced_protocol_end() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)
lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...
ivar_iterator ivar_end() const
ObjCPropertyDecl * FindPropertyVisibleInPrimaryClass(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyVisibleInPrimaryClass - Finds declaration of the property with name 'PropertyId' in the p...
static bool classofKind(Kind K)
ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const
const ObjCInterfaceDecl * getCanonicalDecl() const
llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range
unsigned ivar_size() const
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
void setCategoryListRaw(ObjCCategoryDecl *category)
Set the raw pointer to the start of the category/extension list.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
bool known_extensions_empty() const
Determine whether the known-extensions list is empty.
visible_categories_iterator visible_categories_begin() const
Retrieve an iterator to the beginning of the visible-categories list.
bool hasDefinition() const
Determine whether this class has been defined.
all_protocol_range all_referenced_protocols() const
visible_extensions_range visible_extensions() const
bool isImplicitInterfaceDecl() const
isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.
ObjCTypeParamList * getTypeParamListAsWritten() const
Retrieve the type parameters written on this particular declaration of the class.
protocol_loc_iterator protocol_loc_end() const
ObjCIvarDecl * all_declared_ivar_begin()
all_declared_ivar_begin - return first ivar declared in this class, its extensions and its implementa...
ObjCCategoryDecl * FindCategoryDeclaration(const IdentifierInfo *CategoryId) const
FindCategoryDeclaration - Finds category declaration in the list of categories for this class and ret...
llvm::iterator_range< all_protocol_iterator > all_protocol_range
protocol_loc_iterator protocol_loc_begin() const
ivar_iterator ivar_begin() const
protocol_range protocols() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
Lookup an instance method for a given selector.
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void setImplementation(ObjCImplementationDecl *ImplD)
protocol_loc_range protocol_locs() const
known_categories_range known_categories() const
const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const
isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...
void setSuperClass(TypeSourceInfo *superClass)
protocol_iterator protocol_end() const
SourceLocation getSuperClassLoc() const
Retrieve the starting location of the superclass.
all_protocol_iterator all_referenced_protocol_begin() const
ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)
void setExternallyCompleted()
Indicate that this Objective-C class is complete, but that the external AST source will be responsibl...
ObjCList< ObjCProtocolDecl >::iterator all_protocol_iterator
ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const
ObjCCategoryDecl * getCategoryListRaw() const
Retrieve the raw pointer to the start of the category/extension list.
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)
filtered_category_iterator< isVisibleExtension > visible_extensions_iterator
Iterator that walks over all of the visible extensions, skipping any that are known but hidden.
llvm::iterator_range< visible_categories_iterator > visible_categories_range
const ObjCIvarDecl * all_declared_ivar_begin() const
const ObjCInterfaceDecl * getDefinition() const
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
bool isThisDeclarationADefinition() const
Determine whether this particular declaration of this class is actually also a definition.
ObjCMethodDecl * lookupPropertyAccessor(const Selector Sel, const ObjCCategoryDecl *Cat, bool IsClassProperty) const
Lookup a setter or getter in the class hierarchy, including in all categories except for category pas...
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
const ObjCProtocolList & getReferencedProtocols() const
void setTypeParamList(ObjCTypeParamList *TPL)
Set the type parameters of this class.
filtered_category_iterator< isVisibleCategory > visible_categories_iterator
Iterator that walks over the list of categories and extensions that are visible, i....
ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const
lookupMethod - This method returns an instance/class method by looking in the class,...
llvm::iterator_range< visible_extensions_iterator > visible_extensions_range
llvm::iterator_range< known_categories_iterator > known_categories_range
ObjCProtocolList::iterator protocol_iterator
ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)
const Type * getTypeForDecl() const
bool ClassImplementsProtocol(ObjCProtocolDecl *lProto, bool lookupCategory, bool RHSIsQualifiedID=false)
ClassImplementsProtocol - Checks that 'lProto' protocol has been implemented in IDecl class,...
void setTypeForDecl(const Type *TD) const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for class's metadata.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
known_categories_iterator known_categories_end() const
Retrieve an iterator to the end of the known-categories list.
filtered_category_iterator< isKnownExtension > known_extensions_iterator
Iterator that walks over all of the known extensions.
ObjCImplementationDecl * getImplementation() const
static bool classof(const Decl *D)
static ObjCInterfaceDecl * CreateDeserialized(const ASTContext &C, GlobalDeclID ID)
bool hasDesignatedInitializers() const
Returns true if this interface decl contains at least one initializer marked with the 'objc_designate...
SourceLocation getEndOfDefinitionLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
llvm::iterator_range< protocol_iterator > protocol_range
llvm::iterator_range< known_extensions_iterator > known_extensions_range
filtered_category_iterator< isKnownCategory > known_categories_iterator
Iterator that walks over all of the known categories and extensions, including those that are hidden.
void getDesignatedInitializers(llvm::SmallVectorImpl< const ObjCMethodDecl * > &Methods) const
Returns the designated initializers for the interface.
visible_extensions_iterator visible_extensions_end() const
Retrieve an iterator to the end of the visible-extensions list.
bool visible_extensions_empty() const
Determine whether the visible-extensions list is empty.
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
known_extensions_iterator known_extensions_end() const
Retrieve an iterator to the end of the known-extensions list.
bool visible_categories_empty() const
Determine whether the visible-categories list is empty.
void setEndOfDefinitionLoc(SourceLocation LE)
known_categories_iterator known_categories_begin() const
Retrieve an iterator to the beginning of the known-categories list.
void startDefinition()
Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
bool known_categories_empty() const
Determine whether the known-categories list is empty.
bool isArcWeakrefUnavailable() const
isArcWeakrefUnavailable - Checks for a class or one of its super classes to be incompatible with __we...
known_extensions_iterator known_extensions_begin() const
Retrieve an iterator to the beginning of the known-extensions list.
visible_categories_range visible_categories() const
ObjCInterfaceDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C class.
ObjCInterfaceDecl * getSuperClass() const
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
TypeSourceInfo * getSuperClassTInfo() const
bool isDesignatedInitializer(Selector Sel, const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the given selector is a designated initializer for the interface.
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
void setHasDesignatedInitializers()
Indicate that this interface decl contains at least one initializer marked with the 'objc_designated_...
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
specific_decl_iterator< ObjCIvarDecl > ivar_iterator
redeclarable_base::redecl_iterator redecl_iterator
void setIvarList(ObjCIvarDecl *ivar)
void mergeDuplicateDefinitionWithCommon(const ObjCInterfaceDecl *Definition)
visible_categories_iterator visible_categories_end() const
Retrieve an iterator to the end of the visible-categories list.
visible_extensions_iterator visible_extensions_begin() const
Retrieve an iterator to the beginning of the visible-extensions list.
known_extensions_range known_extensions() const
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
void setAccessControl(AccessControl ac)
static bool classof(const Decl *D)
void setNextIvar(ObjCIvarDecl *ivar)
bool getSynthesize() const
ObjCInterfaceDecl * getContainingInterface()
Return the class interface that this ivar is logically contained in; this is either the interface whe...
void setSynthesize(bool synth)
ObjCIvarDecl * getNextIvar()
const ObjCIvarDecl * getNextIvar() const
static ObjCIvarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
const ObjCInterfaceDecl * getContainingInterface() const
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
AccessControl getCanonicalAccessControl() const
const ObjCIvarDecl * getCanonicalDecl() const
ObjCIvarDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this field.
static bool classofKind(Kind K)
void ** List
List is an array of pointers to objects that are not owned by this object.
ObjCListBase & operator=(const ObjCListBase &)=delete
void set(void *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCListBase(const ObjCListBase &)=delete
ObjCList - This is a simple template class used to hold various lists of decls etc,...
T * operator[](unsigned Idx) const
void set(T *const *InList, unsigned Elts, ASTContext &Ctx)
ObjCMethodDecl - Represents an instance or class method declaration.
bool isDesignatedInitializerForTheInterface(const ObjCMethodDecl **InitMethod=nullptr) const
Returns true if the method selector resolves to a designated initializer in the class's interface.
ImplicitParamDecl * getSelfDecl() const
bool hasBody() const override
Determine whether this method has a body.
bool isOverriding() const
Whether this method overrides any other in the class hierarchy.
void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)
void setObjCDeclQualifier(ObjCDeclQualifier QV)
void setDefined(bool isDefined)
static bool classofKind(Kind K)
ObjCDeclQualifier getObjCDeclQualifier() const
ArrayRef< ParmVarDecl * > parameters() const
param_iterator param_end()
unsigned param_size() const
void setSelfDecl(ImplicitParamDecl *SD)
static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)
static DeclContext * castToDeclContext(const ObjCMethodDecl *D)
const ParmVarDecl * getParamDecl(unsigned Idx) const
static bool classof(const Decl *D)
void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)
bool isPropertyAccessor() const
CompoundStmt * getCompoundBody()
void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const
Return overridden methods for the given Method.
void setHasRedeclaration(bool HRD) const
const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const
Returns the property associated with this method's selector.
param_const_iterator param_end() const
SourceLocation getSelectorStartLoc() const
QualType getSendResultType() const
Determine the type of an expression that sends a message to this function.
param_const_iterator param_begin() const
bool hasParamDestroyedInCallee() const
True if the method has a parameter that's destroyed in the callee.
void setIsRedeclaration(bool RD)
void setCmdDecl(ImplicitParamDecl *CD)
Stmt * getBody() const override
Retrieve the body of this method, if it has one.
ObjCMethodDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
SourceLocation getEndLoc() const LLVM_READONLY
TypeSourceInfo * getReturnTypeSourceInfo() const
QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const
bool hasRedeclaration() const
True if redeclared in the same interface.
void setMethodParams(ASTContext &C, ArrayRef< ParmVarDecl * > Params, ArrayRef< SourceLocation > SelLocs={})
Sets the method's parameters and selector source locations.
void setAsRedeclaration(const ObjCMethodDecl *PrevMethod)
void setRelatedResultType(bool RRT=true)
Note whether this method has a related result type.
param_type_iterator param_type_begin() const
llvm::iterator_range< param_const_iterator > param_const_range
param_iterator param_begin()
bool isSynthesizedAccessorStub() const
SourceLocation getSelectorLoc(unsigned Index) const
SourceRange getReturnTypeSourceRange() const
void setOverriding(bool IsOver)
const ParmVarDecl *const * param_const_iterator
bool hasRelatedResultType() const
Determine whether this method has a result type that is related to the message receiver's type.
param_type_iterator param_type_end() const
SourceLocation getBeginLoc() const LLVM_READONLY
bool isRedeclaration() const
True if this is a method redeclaration in the same interface.
bool isDirectMethod() const
True if the method is tagged as objc_direct.
llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator
void setPropertyAccessor(bool isAccessor)
Selector getSelector() const
void setDeclImplementation(ObjCImplementationControl ic)
ImplicitParamDecl * getCmdDecl() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
bool isInstanceMethod() const
llvm::iterator_range< param_iterator > param_range
void setReturnType(QualType T)
void setLazyBody(uint64_t Offset)
bool isThisDeclarationADefinition() const
Returns whether this specific method is a definition.
ParmVarDecl * getParamDecl(unsigned Idx)
static ObjCMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isThisDeclarationADesignatedInitializer() const
Returns true if this specific method declaration is marked with the designated initializer attribute.
ObjCCategoryDecl * getCategory()
If this method is declared or implemented in a category, return that category.
void setHasSkippedBody(bool Skipped=true)
bool definedInNSObject(const ASTContext &) const
Is this method defined in the NSObject base class?
ObjCMethodFamily getMethodFamily() const
Determines the family of this method.
void createImplicitParams(ASTContext &Context, const ObjCInterfaceDecl *ID)
createImplicitParams - Used to lazily create the self and cmd implicit parameters.
QualType getReturnType() const
ParmVarDecl *const * param_iterator
ObjCImplementationControl getImplementationControl() const
bool hasSkippedBody() const
True if the method was a definition but its body was skipped.
unsigned getNumSelectorLocs() const
bool isClassMethod() const
ObjCInterfaceDecl * getClassInterface()
void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const
SourceLocation getDeclaratorEndLoc() const
Returns the location where the declarator ends.
void setInstanceMethod(bool isInst)
void setVariadic(bool isVar)
param_const_iterator sel_param_end() const
const ObjCInterfaceDecl * getClassInterface() const
const ObjCMethodDecl * getCanonicalDecl() const
const ObjCCategoryDecl * getCategory() const
Represents a class type in Objective C.
Represents one property declaration in an Objective-C interface.
void setAtLoc(SourceLocation L)
bool isAtomic() const
isAtomic - Return true if the property is atomic.
ObjCPropertyQueryKind getQueryKind() const
bool isClassProperty() const
void setPropertyImplementation(PropertyControl pc)
void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())
SourceLocation getGetterNameLoc() const
QualType getUsageType(QualType objectType) const
Retrieve the type when this property is used with a specific base object type.
ObjCMethodDecl * getGetterMethodDecl() const
bool isRetaining() const
isRetaining - Return true if the property retains its value.
bool isInstanceProperty() const
ObjCMethodDecl * getSetterMethodDecl() const
static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)
SourceLocation getSetterNameLoc() const
SourceLocation getAtLoc() const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)
bool isReadOnly() const
isReadOnly - Return true iff the property has a setter.
ObjCIvarDecl * getPropertyIvarDecl() const
static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)
Lookup a property by name in the specified DeclContext.
static ObjCPropertyDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isDirectProperty() const
SetterKind getSetterKind() const
getSetterKind - Return the method used for doing assignment in the property setter.
static bool classofKind(Kind K)
Selector getSetterName() const
TypeSourceInfo * getTypeSourceInfo() const
void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)
void overwritePropertyAttributes(unsigned PRVal)
Selector getGetterName() const
static bool classof(const Decl *D)
void setLParenLoc(SourceLocation L)
void setPropertyIvarDecl(ObjCIvarDecl *Ivar)
SourceLocation getLParenLoc() const
void setSetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const
IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const
Get the default name of the synthesized ivar.
ObjCPropertyAttribute::Kind getPropertyAttributes() const
void setType(QualType T, TypeSourceInfo *TSI)
void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())
PropertyControl getPropertyImplementation() const
void setGetterMethodDecl(ObjCMethodDecl *gDecl)
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
SourceLocation getPropertyIvarDeclLoc() const
void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)
Kind getPropertyImplementation() const
bool isIvarNameSpecified() const
For @synthesize, returns true if an ivar name was explicitly specified.
void setSetterMethodDecl(ObjCMethodDecl *MD)
Expr * getSetterCXXAssignment() const
ObjCPropertyDecl * getPropertyDecl() const
Expr * getGetterCXXConstructor() const
void setSetterCXXAssignment(Expr *setterCXXAssignment)
static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
ObjCMethodDecl * getSetterMethodDecl() const
static bool classof(const Decl *D)
SourceLocation getBeginLoc() const LLVM_READONLY
static bool classofKind(Decl::Kind K)
void setGetterMethodDecl(ObjCMethodDecl *MD)
void setAtLoc(SourceLocation Loc)
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
void setPropertyDecl(ObjCPropertyDecl *Prop)
void setGetterCXXConstructor(Expr *getterCXXConstructor)
ObjCMethodDecl * getGetterMethodDecl() const
Represents an Objective-C protocol declaration.
void mergeDuplicateDefinitionWithCommon(const ObjCProtocolDecl *Definition)
void startDuplicateDefinitionForComparison()
Starts the definition without sharing it with other redeclarations.
bool hasDefinition() const
Determine whether this protocol has a definition.
bool isThisDeclarationADefinition() const
Determine whether this particular declaration is also the definition.
ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const
const ObjCProtocolList & getReferencedProtocols() const
const ObjCProtocolDecl * getDefinition() const
Retrieve the definition of this protocol, if any.
void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)
setProtocolList - Set the list of protocols that this interface implements.
redeclarable_base::redecl_iterator redecl_iterator
protocol_loc_iterator protocol_loc_end() const
ObjCProtocolDecl * getDefinition()
Retrieve the definition of this protocol, if any.
StringRef getObjCRuntimeNameAsString() const
Produce a name to be used for protocol's metadata.
protocol_loc_range protocol_locs() const
llvm::iterator_range< protocol_loc_iterator > protocol_loc_range
llvm::iterator_range< protocol_iterator > protocol_range
void getImpliedProtocols(llvm::DenseSet< const ObjCProtocolDecl * > &IPs) const
Get the set of all protocols implied by this protocols inheritance hierarchy.
void startDefinition()
Starts the definition of this Objective-C protocol.
static ObjCProtocolDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)
bool isNonRuntimeProtocol() const
This is true iff the protocol is tagged with the objc_non_runtime_protocol attribute.
ObjCProtocolList::iterator protocol_iterator
void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const
static bool classof(const Decl *D)
protocol_iterator protocol_begin() const
ObjCProtocolList::loc_iterator protocol_loc_iterator
ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)
ObjCProtocolDecl * getCanonicalDecl() override
Retrieves the canonical declaration of this Objective-C protocol.
protocol_range protocols() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
const ObjCProtocolDecl * getCanonicalDecl() const
static bool classofKind(Kind K)
unsigned getODRHash()
Get precomputed ODRHash or add a new one.
void collectPropertiesToImplement(PropertyMap &PM) const override
This routine collects list of properties to be implemented in the class.
redeclarable_base::redecl_range redecl_range
unsigned protocol_size() const
protocol_iterator protocol_end() const
protocol_loc_iterator protocol_loc_begin() const
ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const
A list of Objective-C protocols, along with the source locations at which they were referenced.
loc_iterator loc_begin() const
const SourceLocation * loc_iterator
loc_iterator loc_end() const
ObjCProtocolList()=default
void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)
Represents the declaration of an Objective-C type parameter.
static bool classof(const Decl *D)
unsigned getIndex() const
Retrieve the index into its type parameter list.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
SourceLocation getColonLoc() const
Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
static bool classofKind(Kind K)
void setVariance(ObjCTypeParamVariance variance)
Set the variance of this type parameter.
SourceRange getSourceRange() const override LLVM_READONLY
Source range that this declaration covers.
SourceLocation getVarianceLoc() const
Retrieve the location of the variance keyword.
static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, GlobalDeclID ID)
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
SourceRange getSourceRange() const
void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const
Gather the default set of type arguments to be substituted for these type parameters when dealing wit...
unsigned size() const
Determine the number of type parameters in this list.
const_iterator begin() const
ObjCTypeParamDecl * front() const
const_iterator end() const
SourceLocation getRAngleLoc() const
ObjCTypeParamDecl *const * const_iterator
ObjCTypeParamDecl * back() const
static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)
Create a new Objective-C type parameter list.
SourceLocation getLAngleLoc() const
Represents a parameter to a function.
A (possibly-)qualified type.
Provides common interface for the Decls that can be redeclared.
ObjCInterfaceDecl * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
ObjCInterfaceDecl * getNextRedeclaration() const
ObjCInterfaceDecl * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
redecl_iterator redecls_end() const
llvm::iterator_range< redecl_iterator > redecl_range
ObjCInterfaceDecl * getMostRecentDecl()
Returns the most recent (re)declaration of this declaration.
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
redecl_iterator redecls_begin() const
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Smart pointer class that efficiently represents Objective-C method names.
bool isUnarySelector() const
unsigned getNumArgs() const
Encodes a location in the source.
bool isValid() const
Return true if this is a valid SourceLocation object.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
A container of type source information.
The base class of the type hierarchy.
bool isBlockPointerType() const
const T * castAs() const
Member-template castAs.
Base class for declarations which introduce a typedef-name.
The JSON file list parser is used to communicate input to InstallAPI.
SelectorLocationsKind
Whether all locations of the selector identifiers are in a "standard" position.
@ SelLoc_StandardWithSpace
For nullary selectors, immediately before the end: "[foo release]" / "-(void)release;" Or with a spac...
@ SelLoc_NonStandard
Non-standard.
@ NumObjCPropertyAttrsBits
Number of bits fitting all the property attributes.
@ ICIS_NoInit
No in-class initializer.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
ObjCMethodFamily
A family of Objective-C methods.
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
@ Property
The type of a property.
ObjCImplementationControl
SourceLocation getStandardSelectorLoc(unsigned Index, Selector Sel, bool WithArgSpace, ArrayRef< Expr * > Args, SourceLocation EndLoc)
Get the "standard" location of a selector identifier, e.g: For nullary selectors, immediately before ...
const FunctionProtoType * T
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
ObjCTypeParamVariance
Describes the variance of a given generic parameter.
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X is a subtype of X when the type parameter is covariant and T i...
@ None
The alignment was not explicit in code.
bool isValid() const
Whether this pointer is non-NULL.
QualType operator()(const ParmVarDecl *PD) const