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

58

60protected:

61

62 void **List = nullptr;

64

65public:

69

72

73protected:

74 void set(void *const* InList, unsigned Elts, ASTContext &Ctx);

75};

76

77

78

79

80

81template

83public:

87

89

92

94 assert(Idx < NumElts && "Invalid access");

95 return (T*)List[Idx];

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

169 ObjCMethodDecl(

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

229 static ObjCMethodDecl *

232 DeclContext *contextDecl, bool isInstance = true,

235 bool isImplicitlyDeclared = false, bool isDefined = false,

237 bool HasRelatedResultType = false);

238

240

245

249

253

254

255

259

260

264

265

269

270

275

276

277

278

280

281

287

293

296 if (hasStandardSelLocs())

300 DeclEndLoc);

301 return getStoredSelLocs()[Index];

302 }

303

305

308 return 0;

311 return 1;

313 }

314

319

320

321

324 return const_cast<ObjCMethodDecl*>(this)->getCategory();

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

357

361

364

365

366

370

371

372

374 return {const_cast<ParmVarDecl **>(getParams()), NumParams};

375 }

376

378 assert(Idx < NumParams && "Index out of bounds!");

379 return getParams()[Idx];

380 }

382 return const_cast<ObjCMethodDecl *>(this)->getParamDecl(Idx);

383 }

384

385

386

387

390

391

395

397 llvm::mapped_iterator<param_const_iterator, GetTypeFn>;

398

402

406

407

408

409

410

412

413

414

416 bool &selfIsPseudoStrong, bool &selfIsConsumed) const;

417

422

423

425

430

433

435

439

443

447

451

454

455

456

457

458

459

460

461

464

465

466

467

468

469

470

471

472

475

476

481

482

484

485

487

488

489

490

491

492

494

495

499

504

508

509

510

512

513

514

515

516

517

518

521

522

523 bool hasBody() const override { return Body.isValid(); }

524

525

527

529

532

533

535

536

538

539

542

544 return static_cast<DeclContext *>(const_cast<ObjCMethodDecl*>(D));

545 }

546

548 return static_cast<ObjCMethodDecl *>(const_cast<DeclContext*>(DC));

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

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

619

621

622

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

648

649

652};

653

654

655

656

657

658

659

660

661class ObjCTypeParamList final

662 : private llvm::TrailingObjects<ObjCTypeParamList, ObjCTypeParamDecl *> {

663

665

666 unsigned NumParams;

667

671

672public:

674

675

680

681

683

685

687

688

689 unsigned size() const { return NumParams; }

690

691

693

695

699

701 assert(size() > 0 && "empty Objective-C type parameter list");

703 }

704

706 assert(size() > 0 && "empty Objective-C type parameter list");

707 return *(end() - 1);

708 }

709

713

714

715

717};

718

724

725

726

727

728

729

730

732 void anchor() override;

733

734public:

737

738private:

739

741

742

744

751

752

754 unsigned PropertyImplementation : 2;

755

756

758

759

761

762

764

765

767

768

770

771

773

774

776

780 : NamedDecl(ObjCProperty, DC, L, Id), AtLoc(AtLocation),

781 LParenLoc(LParenLocation), DeclType(T), DeclTypeSourceInfo(TSI),

784 PropertyImplementation(propControl) {}

785

786public:

788 SourceLocation L, const IdentifierInfo *Id,

789 SourceLocation AtLocation,

790 SourceLocation LParenLocation, QualType T,

791 TypeSourceInfo *TSI,

793

795

798

801

803

805

807 DeclType = T;

808 DeclTypeSourceInfo = TSI;

809 }

810

811

812

814

818

820 PropertyAttributes |= PRVal;

821 }

822

824 PropertyAttributes = PRVal;

825 }

826

830

832 PropertyAttributesAsWritten = PRVal;

833 }

834

835

836

837

841

842

846

847

853

859

864

869

870

871

872

884

887

889 GetterName = Sel;

890 GetterNameLoc = Loc;

891 }

892

895

897 SetterName = Sel;

898 SetterNameLoc = Loc;

899 }

900

903

906

907

909 PropertyImplementation = pc;

910 }

911

915

919

921 PropertyIvarDecl = Ivar;

922 }

923

925 return PropertyIvarDecl;

926 }

927

931

932

934

935

939

942};

943

944

945

946

947

949

950

951

952

953

955

956 void anchor() override;

957

958public:

961

962

965 llvm::iterator_range<specific_decl_iterator>;

966

968

972

976

981

985

989

993

998

1002

1006

1010

1011

1014 llvm::iterator_range<specific_decl_iterator>;

1015

1019

1023

1027

1032

1036

1040

1044

1049

1053

1057

1061

1062

1064 bool AllowHidden = false) const;

1065

1067 bool AllowHidden = false) const {

1068 return getMethod(Sel, true, AllowHidden);

1069 }

1070

1072 return getMethod(Sel, false, AllowHidden);

1073 }

1074

1077

1079 bool IsInstance) const;

1080

1084

1086 llvm::MapVector<std::pair<IdentifierInfo *, unsigned >,

1090

1091

1092

1093

1095

1097

1101

1102

1104

1106

1110

1111

1113

1115 return K >= firstObjCContainer &&

1116 K <= lastObjCContainer;

1117 }

1118

1122

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

1152

1157

1158

1159

1160 mutable const Type *TypeForDecl = nullptr;

1161

1162 struct DefinitionData {

1163

1164

1165 ObjCInterfaceDecl *Definition = nullptr;

1166

1167

1169

1170

1172

1173

1175

1176

1177

1178

1179

1180

1182

1183

1184

1186

1187

1188

1189 LLVM_PREFERRED_TYPE(bool)

1190 mutable unsigned ExternallyCompleted : 1;

1191

1192

1193

1194 LLVM_PREFERRED_TYPE(bool)

1195 mutable unsigned IvarListMissingImplementation : 1;

1196

1197

1198

1199 LLVM_PREFERRED_TYPE(bool)

1200 unsigned HasDesignatedInitializers : 1;

1201

1202 enum InheritedDesignatedInitializersState {

1203

1204

1205 IDI_Unknown = 0,

1206

1207

1208 IDI_Inherited = 1,

1209

1210

1211 IDI_NotInherited = 2

1212 };

1213

1214

1215 LLVM_PREFERRED_TYPE(InheritedDesignatedInitializersState)

1216 mutable unsigned InheritedDesignatedInitializers : 2;

1217

1218

1219 LLVM_PREFERRED_TYPE(bool)

1220 unsigned HasODRHash : 1;

1221

1222

1224

1225

1226

1227

1229

1230 DefinitionData()

1231 : ExternallyCompleted(false), IvarListMissingImplementation(true),

1232 HasDesignatedInitializers(false),

1233 InheritedDesignatedInitializers(IDI_Unknown), HasODRHash(false) {}

1234 };

1235

1236

1237 ObjCTypeParamList *TypeParamList = nullptr;

1238

1239

1240

1241

1242

1243

1244 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;

1245

1247 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,

1248 SourceLocation CLoc, ObjCInterfaceDecl *PrevDecl,

1249 bool IsInternal);

1250

1251 void anchor() override;

1252

1253 void LoadExternalDefinition() const;

1254

1255 DefinitionData &data() const {

1256 assert(Data.getPointer() && "Declaration has no definition!");

1257 return *Data.getPointer();

1258 }

1259

1260

1261 void allocateDefinitionData();

1262

1264

1267 }

1268

1271 }

1272

1275 }

1276

1277public:

1278 static ObjCInterfaceDecl *

1280 const IdentifierInfo *Id, ObjCTypeParamList *typeParamList,

1281 ObjCInterfaceDecl *PrevDecl,

1282 SourceLocation ClassLoc = SourceLocation(), bool isInternal = false);

1283

1285 GlobalDeclID ID);

1286

1287

1288

1289

1290

1291

1292

1294

1295

1296

1297

1298

1300

1301

1302

1304 return TypeParamList;

1305 }

1306

1313

1314

1315

1316

1318

1319

1320

1322

1323

1324

1326

1327

1328

1332

1334 assert(hasDefinition() && "Caller did not check for forward reference!");

1335 if (data().ExternallyCompleted)

1336 LoadExternalDefinition();

1337

1338 return data().ReferencedProtocols;

1339 }

1340

1343

1346

1347

1350

1355

1358

1362

1364

1367

1368 if (data().ExternallyCompleted)

1369 LoadExternalDefinition();

1370

1371 return data().ReferencedProtocols.begin();

1372 }

1373

1375

1378

1379 if (data().ExternallyCompleted)

1380 LoadExternalDefinition();

1381

1382 return data().ReferencedProtocols.end();

1383 }

1384

1387

1391

1393

1396

1397 if (data().ExternallyCompleted)

1398 LoadExternalDefinition();

1399

1400 return data().ReferencedProtocols.loc_begin();

1401 }

1402

1404

1407

1408 if (data().ExternallyCompleted)

1409 LoadExternalDefinition();

1410

1411 return data().ReferencedProtocols.loc_end();

1412 }

1413

1416

1421

1423

1426

1427 if (data().ExternallyCompleted)

1428 LoadExternalDefinition();

1429

1430 return data().AllReferencedProtocols.empty()

1432 : data().AllReferencedProtocols.begin();

1433 }

1434

1436

1439

1440 if (data().ExternallyCompleted)

1441 LoadExternalDefinition();

1442

1443 return data().AllReferencedProtocols.empty()

1445 : data().AllReferencedProtocols.end();

1446 }

1447

1449 using ivar_range = llvm::iterator_range<specific_decl_iterator>;

1450

1452

1454 if (const ObjCInterfaceDecl *Def = getDefinition())

1456

1457

1459 }

1460

1462 if (const ObjCInterfaceDecl *Def = getDefinition())

1464

1465

1467 }

1468

1472

1474

1482

1483

1484

1487 data().ReferencedProtocols.set(List, Num, Locs, C);

1488 }

1489

1490

1491

1493 unsigned Num,

1495

1496

1497

1499

1500

1501

1502

1503

1504

1507

1508

1509

1510

1511

1512

1513

1514

1515

1516

1517 bool

1520

1521

1522

1526

1527

1529

1530

1531

1532

1533 if (!Data.getOpaqueValue())

1535

1536 return Data.getPointer();

1537 }

1538

1539

1540

1541

1543 return hasDefinition()? Data.getPointer()->Definition : nullptr;

1544 }

1545

1546

1547

1548

1550 return hasDefinition()? Data.getPointer()->Definition : nullptr;

1551 }

1552

1553

1554

1556

1557

1558

1559

1560

1563

1564

1568

1569 return nullptr;

1570 }

1571

1572

1574

1576 return nullptr;

1577

1578 if (data().ExternallyCompleted)

1579 LoadExternalDefinition();

1580

1581 return data().SuperClassTInfo;

1582 }

1583

1584

1585

1587

1589 data().SuperClassTInfo = superClass;

1590 }

1591

1592

1593

1594

1595

1596

1597 template<bool (*Filter)(ObjCCategoryDecl *)>

1600

1601 void findAcceptableCategory();

1602

1603 public:

1609

1612 : Current(Current) {

1613 findAcceptableCategory();

1614 }

1615

1618

1620

1623 ++(*this);

1624 return Tmp;

1625 }

1626

1629 return X.Current == Y.Current;

1630 }

1631

1634 return X.Current != Y.Current;

1635 }

1636 };

1637

1638private:

1639

1640

1641

1643

1644public:

1645

1646

1649

1651 llvm::iterator_range<visible_categories_iterator>;

1652

1657

1658

1659

1663

1664

1668

1669

1673

1674private:

1675

1676

1677

1678 static bool isKnownCategory(ObjCCategoryDecl *) { return true; }

1679

1680public:

1681

1682

1685 llvm::iterator_range<known_categories_iterator>;

1686

1691

1692

1693

1697

1698

1702

1703

1707

1708private:

1709

1710

1711

1713

1714public:

1715

1716

1719

1721 llvm::iterator_range<visible_extensions_iterator>;

1722

1727

1728

1729

1733

1734

1738

1739

1743

1744private:

1745

1746

1747

1749

1750public:

1755

1756

1760 llvm::iterator_range<known_extensions_iterator>;

1761

1766

1767

1768

1772

1773

1777

1778

1782

1783

1784

1786

1788 return nullptr;

1789

1790 if (data().ExternallyCompleted)

1791 LoadExternalDefinition();

1792

1793 return data().CategoryList;

1794 }

1795

1796

1797

1799 data().CategoryList = category;

1800 }

1801

1805

1807

1808

1809

1811

1812 while (I != nullptr) {

1814 return true;

1815

1817 }

1818 return false;

1819 }

1820

1821

1822

1824

1825

1826

1827

1829

1833 ObjCInterfaceDecl *ClassDeclared;

1835 }

1836

1838

1839

1840

1842 bool shallowCategoryLookup = false,

1843 bool followSuper = true,

1845

1846

1850

1851

1855

1857

1858

1860 bool Instance=true) const;

1861

1865

1866

1867

1868

1871 bool IsClassProperty) const {

1872 return lookupMethod(Sel, !IsClassProperty,

1873 false,

1874 true ,

1875 Cat);

1876 }

1877

1881

1882 return data().EndLoc;

1883 }

1884

1886

1887

1889

1890

1891

1892

1896

1897

1898

1899

1901 bool lookupCategory,

1902 bool RHSIsQualifiedID = false);

1903

1906

1913

1914

1917

1918

1921

1922

1924

1927

1928private:

1929

1930 bool hasODRHash() const;

1931 void setHasODRHash(bool HasHash);

1932

1933 const ObjCInterfaceDecl *findInterfaceWithDesignatedInitializers() const;

1934 bool inheritsDesignatedInitializers() const;

1935};

1936

1937

1938

1939

1940

1941

1942

1943

1944

1945

1946

1947

1948

1949

1950

1951

1953 void anchor() override;

1954

1955public:

1959

1960private:

1964 bool synthesized)

1965 : FieldDecl(ObjCIvar, DC, StartLoc, IdLoc, Id, T, TInfo, BW,

1967 DeclAccess(ac), Synthesized(synthesized) {}

1968

1969public:

1970 static ObjCIvarDecl *Create(ASTContext &C, ObjCContainerDecl *DC,

1971 SourceLocation StartLoc, SourceLocation IdLoc,

1972 const IdentifierInfo *Id, QualType T,

1974 Expr *BW = nullptr, bool synthesized = false);

1975

1977

1978

1979

1980

1981

1986

1988 const ObjCIvarDecl *getNextIvar() const { return NextIvar; }

1989 void setNextIvar(ObjCIvarDecl *ivar) { NextIvar = ivar; }

1990

1997

1999

2001

2005

2008

2009

2010

2012

2013

2015 static bool classofKind(Kind K) { return K == ObjCIvar; }

2016

2017private:

2018

2019

2021

2022

2024 unsigned DeclAccess : 3;

2025 LLVM_PREFERRED_TYPE(bool)

2026 unsigned Synthesized : 1;

2027};

2028

2029

2034 : FieldDecl(ObjCAtDefsField, DC, StartLoc, IdLoc, Id, T,

2035 nullptr,

2036 BW, false, ICIS_NoInit) {}

2037

2038 void anchor() override;

2039

2040public:

2045

2048

2049

2051 static bool classofKind(Kind K) { return K == ObjCAtDefsField; }

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

2082

2085 struct DefinitionData {

2086

2088

2089

2091

2092

2093 LLVM_PREFERRED_TYPE(bool)

2094 unsigned HasODRHash : 1;

2095

2096

2098 };

2099

2100

2101

2102

2103

2104

2105 llvm::PointerIntPair<DefinitionData *, 1, bool> Data;

2106

2109 ObjCProtocolDecl *PrevDecl);

2110

2111 void anchor() override;

2112

2113 DefinitionData &data() const {

2114 assert(Data.getPointer() && "Objective-C protocol has no definition!");

2115 return *Data.getPointer();

2116 }

2117

2118 void allocateDefinitionData();

2119

2121

2124 }

2125

2128 }

2129

2132 }

2133

2134

2135 bool hasODRHash() const;

2136 void setHasODRHash(bool HasHash);

2137

2138public:

2144

2149 ObjCProtocolDecl *PrevDecl);

2150

2152

2154 assert(hasDefinition() && "No definition available!");

2155 return data().ReferencedProtocols;

2156 }

2157

2160

2164

2168

2169 return data().ReferencedProtocols.begin();

2170 }

2171

2175

2176 return data().ReferencedProtocols.end();

2177 }

2178

2181

2185

2189

2190 return data().ReferencedProtocols.loc_begin();

2191 }

2192

2196

2197 return data().ReferencedProtocols.loc_end();

2198 }

2199

2202 return 0;

2203

2204 return data().ReferencedProtocols.size();

2205 }

2206

2207

2208

2211 assert(hasDefinition() && "Protocol is not defined");

2212 data().ReferencedProtocols.set(List, Num, Locs, C);

2213 }

2214

2215

2216

2218

2219

2220

2221 void getImpliedProtocols(llvm::DenseSet<const ObjCProtocolDecl *> &IPs) const;

2222

2224

2225

2226

2228

2232

2236

2237

2239

2240

2241

2242

2243 if (!Data.getOpaqueValue())

2245

2246 return Data.getPointer();

2247 }

2248

2249

2251 return hasDefinition()? Data.getPointer()->Definition : nullptr;

2252 }

2253

2254

2256 return hasDefinition()? Data.getPointer()->Definition : nullptr;

2257 }

2258

2259

2260

2264

2265

2267

2268

2269

2270

2271

2274

2275

2276

2278

2285

2288

2295

2296

2299

2301

2305

2306

2308

2311};

2312

2313

2314

2315

2316

2317

2318

2319

2320

2321

2322

2323

2324

2325

2326

2327

2328

2330

2332

2333

2335

2336

2338

2339

2340

2341 ObjCCategoryDecl *NextClassCategory = nullptr;

2342

2343

2345

2346

2349

2356

2357 void anchor() override;

2358

2359public:

2362

2363 static ObjCCategoryDecl *

2371

2374

2375

2376

2378

2379

2380

2381

2382

2384

2385

2388

2389

2390

2393 ReferencedProtocols.set(List, Num, Locs, C);

2394 }

2395

2397 return ReferencedProtocols;

2398 }

2399

2402

2406

2408 return ReferencedProtocols.begin();

2409 }

2410

2412 unsigned protocol_size() const { return ReferencedProtocols.size(); }

2413

2416

2420

2422 return ReferencedProtocols.loc_begin();

2423 }

2424

2426 return ReferencedProtocols.loc_end();

2427 }

2428

2430

2431

2432

2434 return NextClassCategory;

2435 }

2436

2438

2440 using ivar_range = llvm::iterator_range<specific_decl_iterator>;

2441

2443

2447

2451

2455

2459

2462

2467

2470};

2471

2473

2475

2476 void anchor() override;

2477

2478protected:

2483 ClassInterface(classInterface) {}

2484

2485public:

2489

2495

2501

2503

2507

2508

2511 llvm::iterator_range<specific_decl_iterator>;

2512

2516

2520

2524

2526

2528 return K >= firstObjCImpl && K <= lastObjCImpl;

2529 }

2530};

2531

2532

2533

2534

2535

2536

2537

2538

2539

2540

2541

2542

2543

2544

2546

2548

2553 : ObjCImplDecl(ObjCCategoryImpl, DC, classInterface, Id, nameLoc,

2554 atStartLoc),

2555 CategoryNameLoc(CategoryNameLoc) {}

2556

2557 void anchor() override;

2558

2559public:

2562

2563 static ObjCCategoryImplDecl *

2569

2571

2573

2576};

2577

2578raw_ostream &operator<<(raw_ostream &OS, const ObjCCategoryImplDecl &CID);

2579

2580

2581

2582

2583

2584

2585

2586

2587

2588

2589

2590

2591

2592

2593

2594

2595

2596

2598

2601

2602

2605

2606

2607

2609 unsigned NumIvarInitializers = 0;

2610

2611

2612

2613 LLVM_PREFERRED_TYPE(bool)

2614 bool HasNonZeroConstructors : 1;

2615

2616

2617 LLVM_PREFERRED_TYPE(bool)

2618 bool HasDestructors : 1;

2619

2627 : ObjCImplDecl(ObjCImplementation, DC, classInterface,

2628 classInterface ? classInterface->getIdentifier()

2629 : nullptr,

2630 nameLoc, atStartLoc),

2631 SuperClass(superDecl), SuperLoc(superLoc),

2632 IvarLBraceLoc(IvarLBraceLoc), IvarRBraceLoc(IvarRBraceLoc),

2633 HasNonZeroConstructors(false), HasDestructors(false) {}

2634

2635 void anchor() override;

2636

2637public:

2640

2649

2652

2653

2655

2656

2658

2659 using init_range = llvm::iterator_range<init_iterator>;

2661

2663

2667

2668

2670 const auto *ConstThis = this;

2671 return const_cast<init_iterator>(ConstThis->init_begin());

2672 }

2673

2674

2676

2677

2679 return init_begin() + NumIvarInitializers;

2680 }

2681

2682

2684 return init_begin() + NumIvarInitializers;

2685 }

2686

2687

2689 return NumIvarInitializers;

2690 }

2691

2693 NumIvarInitializers = numNumIvarInitializers;

2694 }

2695

2698 unsigned numInitializers);

2699

2700

2701

2704

2705

2706

2709

2710

2711

2715

2716

2717

2718

2719

2720

2722 assert(getIdentifier() && "Name is not a simple identifier");

2724 }

2725

2726

2727

2728

2730

2731

2732

2734

2738

2740

2745

2747 using ivar_range = llvm::iterator_range<specific_decl_iterator>;

2748

2750

2754

2758

2762

2766

2769};

2770

2771raw_ostream &operator<<(raw_ostream &OS, const ObjCImplementationDecl &ID);

2772

2773

2774

2775class ObjCCompatibleAliasDecl : public NamedDecl {

2776

2778

2781 : NamedDecl(ObjCCompatibleAlias, DC, L, Id), AliasedClass(aliasedClass) {}

2782

2783 void anchor() override;

2784

2785public:

2789

2792

2796

2799};

2800

2801

2802

2803

2804

2805class ObjCPropertyImplDecl : public Decl {

2806public:

2811

2812private:

2813 SourceLocation AtLoc;

2814

2815

2816

2817

2818

2819

2820

2822

2823

2825

2826

2828

2829

2831

2833

2834

2835

2836 Expr *GetterCXXConstructor = nullptr;

2837

2838

2839

2840 Expr *SetterCXXAssignment = nullptr;

2841

2844 Kind PK,

2847 : Decl(ObjCPropertyImpl, DC, L), AtLoc(atLoc),

2848 IvarLoc(ivarLoc), PropertyDecl(property), PropertyIvarDecl(ivarDecl) {

2849 assert(PK == Dynamic || PropertyIvarDecl);

2850 }

2851

2852public:

2854

2861

2864

2866

2869

2871 return PropertyDecl;

2872 }

2874

2878

2880 return PropertyIvarDecl;

2881 }

2883

2886 PropertyIvarDecl = Ivar;

2887 this->IvarLoc = IvarLoc;

2888 }

2889

2890

2891

2892

2893

2894

2895

2896

2898 return IvarLoc.isValid() && IvarLoc != getLocation();

2899 }

2900

2903

2906

2908 return GetterCXXConstructor;

2909 }

2910

2912 GetterCXXConstructor = getterCXXConstructor;

2913 }

2914

2916 return SetterCXXAssignment;

2917 }

2918

2920 SetterCXXAssignment = setterCXXAssignment;

2921 }

2922

2925};

2926

2927template<bool (*Filter)(ObjCCategoryDecl *)>

2928void

2929ObjCInterfaceDecl::filtered_category_iterator::

2930findAcceptableCategory() {

2931 while (Current && !Filter(Current))

2932 Current = Current->getNextClassCategoryRaw();

2933}

2934

2935template<bool (*Filter)(ObjCCategoryDecl *)>

2939 findAcceptableCategory();

2940 return *this;

2941}

2942

2943inline bool ObjCInterfaceDecl::isVisibleCategory(ObjCCategoryDecl *Cat) {

2945}

2946

2947inline bool ObjCInterfaceDecl::isVisibleExtension(ObjCCategoryDecl *Cat) {

2950}

2951

2952inline bool ObjCInterfaceDecl::isKnownExtension(ObjCCategoryDecl *Cat) {

2953 return !Cat->isInvalidDecl() && Cat->IsClassExtension();

2954}

2955

2956}

2957

2958#endif

Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

Defines the clang::SourceLocation class and associated facilities.

Defines various enumerations that describe declaration and type specifiers.

C Language Family Type Representation.

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...

Represents a C++ base or member initializer.

CompoundStmt - This represents a group of statements like { stmt stmt }.

Iterates over a filtered subrange of declarations stored in a DeclContext.

specific_decl_iterator - Iterates over a subrange of declarations stored in a DeclContext,...

DeclContext - This is used only as base class of specific decl types that can act as declaration cont...

ObjCMethodDeclBitfields ObjCMethodDeclBits

ObjCContainerDeclBitfields ObjCContainerDeclBits

DeclContext(Decl::Kind K)

void addDecl(Decl *D)

Add the declaration D into this context.

decl_iterator decls_end() const

decl_iterator decls_begin() const

Decl - This represents one declaration (or definition), e.g.

bool isImplicit() const

isImplicit - Indicates whether the declaration was implicitly generated by the implementation.

friend class Redeclarable

virtual Decl * getPreviousDeclImpl()

Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.

bool isUnconditionallyVisible() const

Determine whether this declaration is definitely visible to name lookup, independent of whether the o...

Kind

Lists the kind of concrete classes of Decl.

ObjCDeclQualifier

ObjCDeclQualifier - 'Qualifiers' written next to the return and parameter types in method declaration...

bool isInvalidDecl() const

virtual Decl * getNextRedeclarationImpl()

Returns the next redeclaration or itself if this is the only decl.

SourceLocation getLocation() const

virtual Decl * getMostRecentDeclImpl()

Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chai...

void setLexicalDeclContext(DeclContext *DC)

Selector getObjCSelector() const

Get the Objective-C selector stored in this declaration name.

This represents one expression.

Represents a member of a struct/union/class.

FieldDecl(Kind DK, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, QualType T, TypeSourceInfo *TInfo, Expr *BW, bool Mutable, InClassInitStyle InitStyle)

FieldDecl * getCanonicalDecl() override

Retrieves the canonical declaration of this field.

One of these records is kept for each identifier that is lexed.

StringRef getName() const

Return the actual identifier string.

This represents a decl that may have a name.

IdentifierInfo * getIdentifier() const

Get the identifier that names this declaration, if there is one.

NamedDecl(Kind DK, DeclContext *DC, SourceLocation L, DeclarationName N)

DeclarationName getDeclName() const

Get the actual, stored name of the declaration, which may be a special name.

static bool classofKind(Kind K)

Definition DeclObjC.h:2051

static ObjCAtDefsFieldDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

static bool classof(const Decl *D)

Definition DeclObjC.h:2050

ObjCCategoryDecl - Represents a category declaration.

Definition DeclObjC.h:2329

ObjCCategoryDecl * getNextClassCategory() const

Definition DeclObjC.h:2429

unsigned ivar_size() const

Definition DeclObjC.h:2452

ivar_iterator ivar_begin() const

Definition DeclObjC.h:2444

void setTypeParamList(ObjCTypeParamList *TPL)

Set the type parameters of this category.

bool ivar_empty() const

Definition DeclObjC.h:2456

ivar_iterator ivar_end() const

Definition DeclObjC.h:2448

llvm::iterator_range< protocol_loc_iterator > protocol_loc_range

Definition DeclObjC.h:2415

void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)

setProtocolList - Set the list of protocols that this interface implements.

Definition DeclObjC.h:2391

protocol_loc_range protocol_locs() const

Definition DeclObjC.h:2417

static ObjCCategoryDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

void setIvarLBraceLoc(SourceLocation Loc)

Definition DeclObjC.h:2463

unsigned protocol_size() const

Definition DeclObjC.h:2412

ObjCCategoryImplDecl * getImplementation() const

void setCategoryNameLoc(SourceLocation Loc)

Definition DeclObjC.h:2461

ObjCInterfaceDecl * getClassInterface()

Definition DeclObjC.h:2372

friend class ASTDeclReader

Definition DeclObjC.h:2360

ObjCCategoryDecl * getNextClassCategoryRaw() const

Retrieve the pointer to the next stored category (or extension), which may be hidden.

Definition DeclObjC.h:2433

specific_decl_iterator< ObjCIvarDecl > ivar_iterator

Definition DeclObjC.h:2439

ObjCTypeParamList * getTypeParamList() const

Retrieve the type parameter list associated with this category or extension.

Definition DeclObjC.h:2377

static bool classofKind(Kind K)

Definition DeclObjC.h:2469

void setIvarRBraceLoc(SourceLocation Loc)

Definition DeclObjC.h:2465

protocol_iterator protocol_end() const

Definition DeclObjC.h:2411

const ObjCInterfaceDecl * getClassInterface() const

Definition DeclObjC.h:2373

llvm::iterator_range< protocol_iterator > protocol_range

Definition DeclObjC.h:2401

ObjCProtocolList::loc_iterator protocol_loc_iterator

Definition DeclObjC.h:2414

SourceLocation getIvarLBraceLoc() const

Definition DeclObjC.h:2464

bool IsClassExtension() const

Definition DeclObjC.h:2437

SourceLocation getIvarRBraceLoc() const

Definition DeclObjC.h:2466

friend class ASTDeclWriter

Definition DeclObjC.h:2361

protocol_loc_iterator protocol_loc_begin() const

Definition DeclObjC.h:2421

protocol_iterator protocol_begin() const

Definition DeclObjC.h:2407

protocol_range protocols() const

Definition DeclObjC.h:2403

llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range

Definition DeclObjC.h:2440

ivar_range ivars() const

Definition DeclObjC.h:2442

const ObjCProtocolList & getReferencedProtocols() const

Definition DeclObjC.h:2396

void setImplementation(ObjCCategoryImplDecl *ImplD)

ObjCProtocolList::iterator protocol_iterator

Definition DeclObjC.h:2400

static bool classof(const Decl *D)

Definition DeclObjC.h:2468

SourceLocation getCategoryNameLoc() const

Definition DeclObjC.h:2460

protocol_loc_iterator protocol_loc_end() const

Definition DeclObjC.h:2425

ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.

Definition DeclObjC.h:2545

static bool classofKind(Kind K)

Definition DeclObjC.h:2575

friend class ASTDeclReader

Definition DeclObjC.h:2560

SourceLocation getCategoryNameLoc() const

Definition DeclObjC.h:2572

friend class ASTDeclWriter

Definition DeclObjC.h:2561

ObjCCategoryDecl * getCategoryDecl() const

static bool classof(const Decl *D)

Definition DeclObjC.h:2574

static ObjCCategoryImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

const ObjCInterfaceDecl * getClassInterface() const

Definition DeclObjC.h:2793

static bool classofKind(Kind K)

Definition DeclObjC.h:2798

ObjCInterfaceDecl * getClassInterface()

Definition DeclObjC.h:2794

static bool classof(const Decl *D)

Definition DeclObjC.h:2797

static ObjCCompatibleAliasDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

void setClassInterface(ObjCInterfaceDecl *D)

Definition DeclObjC.h:2795

ObjCContainerDecl - Represents a container for method declarations.

Definition DeclObjC.h:948

ObjCMethodDecl * getMethod(Selector Sel, bool isInstance, bool AllowHidden=false) const

classmeth_iterator classmeth_end() const

Definition DeclObjC.h:1058

filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isInstanceMethod > instmeth_iterator

Definition DeclObjC.h:1028

prop_iterator prop_end() const

Definition DeclObjC.h:973

method_iterator meth_begin() const

Definition DeclObjC.h:1020

method_range methods() const

Definition DeclObjC.h:1016

instprop_iterator instprop_end() const

Definition DeclObjC.h:990

llvm::iterator_range< specific_decl_iterator< ObjCMethodDecl > > method_range

Definition DeclObjC.h:1013

void setAtStartLoc(SourceLocation Loc)

Definition DeclObjC.h:1098

SourceRange getAtEndRange() const

Definition DeclObjC.h:1103

classmeth_iterator classmeth_begin() const

Definition DeclObjC.h:1054

specific_decl_iterator< ObjCPropertyDecl > prop_iterator

Definition DeclObjC.h:963

prop_iterator prop_begin() const

Definition DeclObjC.h:969

llvm::iterator_range< instprop_iterator > instprop_range

Definition DeclObjC.h:980

instmeth_range instance_methods() const

Definition DeclObjC.h:1033

filtered_decl_iterator< ObjCMethodDecl, &ObjCMethodDecl::isClassMethod > classmeth_iterator

Definition DeclObjC.h:1045

llvm::SmallDenseSet< const ObjCProtocolDecl *, 8 > ProtocolPropertySet

Definition DeclObjC.h:1088

classprop_iterator classprop_end() const

Definition DeclObjC.h:1007

instmeth_iterator instmeth_end() const

Definition DeclObjC.h:1041

llvm::iterator_range< classprop_iterator > classprop_range

Definition DeclObjC.h:997

ObjCPropertyDecl * getProperty(const IdentifierInfo *Id, bool IsInstance) const

specific_decl_iterator< ObjCMethodDecl > method_iterator

Definition DeclObjC.h:1012

static DeclContext * castToDeclContext(const ObjCContainerDecl *D)

Definition DeclObjC.h:1119

ObjCIvarDecl * getIvarDecl(IdentifierInfo *Id) const

getIvarDecl - This method looks up an ivar in this ContextDecl.

classprop_iterator classprop_begin() const

Definition DeclObjC.h:1003

SourceLocation getAtStartLoc() const

Definition DeclObjC.h:1096

method_iterator meth_end() const

Definition DeclObjC.h:1024

filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isInstanceProperty > instprop_iterator

Definition DeclObjC.h:977

static bool classof(const Decl *D)

Definition DeclObjC.h:1112

instprop_range instance_properties() const

Definition DeclObjC.h:982

llvm::iterator_range< specific_decl_iterator< ObjCPropertyDecl > > prop_range

Definition DeclObjC.h:964

llvm::iterator_range< classmeth_iterator > classmeth_range

Definition DeclObjC.h:1048

llvm::MapVector< std::pair< IdentifierInfo *, unsigned >, ObjCPropertyDecl * > PropertyMap

Definition DeclObjC.h:1085

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)

Definition DeclObjC.h:1105

virtual void collectPropertiesToImplement(PropertyMap &PM) const

This routine collects list of properties to be implemented in the class.

Definition DeclObjC.h:1094

instmeth_iterator instmeth_begin() const

Definition DeclObjC.h:1037

classprop_range class_properties() const

Definition DeclObjC.h:999

instprop_iterator instprop_begin() const

Definition DeclObjC.h:986

llvm::SmallVector< ObjCPropertyDecl *, 8 > PropertyDeclOrder

Definition DeclObjC.h:1089

static ObjCContainerDecl * castFromDeclContext(const DeclContext *DC)

Definition DeclObjC.h:1123

ObjCMethodDecl * getClassMethod(Selector Sel, bool AllowHidden=false) const

Definition DeclObjC.h:1071

prop_range properties() const

Definition DeclObjC.h:967

filtered_decl_iterator< ObjCPropertyDecl, &ObjCPropertyDecl::isClassProperty > classprop_iterator

Definition DeclObjC.h:994

classmeth_range class_methods() const

Definition DeclObjC.h:1050

static bool classofKind(Kind K)

Definition DeclObjC.h:1114

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

Definition DeclObjC.h:1107

ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const

Definition DeclObjC.h:1066

ObjCContainerDecl(Kind DK, DeclContext *DC, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)

llvm::iterator_range< instmeth_iterator > instmeth_range

Definition DeclObjC.h:1031

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

Definition DeclObjC.h:2509

void addPropertyImplementation(ObjCPropertyImplDecl *property)

void addClassMethod(ObjCMethodDecl *method)

Definition DeclObjC.h:2496

ObjCImplDecl(Kind DK, DeclContext *DC, ObjCInterfaceDecl *classInterface, const IdentifierInfo *Id, SourceLocation nameLoc, SourceLocation atStartLoc)

Definition DeclObjC.h:2479

ObjCInterfaceDecl * getClassInterface()

Definition DeclObjC.h:2487

propimpl_iterator propimpl_begin() const

Definition DeclObjC.h:2517

static bool classof(const Decl *D)

Definition DeclObjC.h:2525

propimpl_range property_impls() const

Definition DeclObjC.h:2513

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

Definition DeclObjC.h:2521

llvm::iterator_range< specific_decl_iterator< ObjCPropertyImplDecl > > propimpl_range

Definition DeclObjC.h:2510

const ObjCInterfaceDecl * getClassInterface() const

Definition DeclObjC.h:2486

ObjCPropertyImplDecl * FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const

FindPropertyImplIvarDecl - This method lookup the ivar in the list of properties implemented in this ...

static bool classofKind(Kind K)

Definition DeclObjC.h:2527

void addInstanceMethod(ObjCMethodDecl *method)

Definition DeclObjC.h:2490

ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...

Definition DeclObjC.h:2597

void setNumIvarInitializers(unsigned numNumIvarInitializers)

Definition DeclObjC.h:2692

static bool classofKind(Kind K)

Definition DeclObjC.h:2768

bool ivar_empty() const

Definition DeclObjC.h:2763

init_iterator init_end()

init_end() - Retrieve an iterator past the last initializer.

Definition DeclObjC.h:2678

SourceLocation getIvarRBraceLoc() const

Definition DeclObjC.h:2744

bool hasNonZeroConstructors() const

Do any of the ivars of this class (not counting its base classes) require construction other than zer...

Definition DeclObjC.h:2702

llvm::iterator_range< init_iterator > init_range

Definition DeclObjC.h:2659

static ObjCImplementationDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

IdentifierInfo * getIdentifier() const

getIdentifier - Get the identifier that names the class interface associated with this implementation...

Definition DeclObjC.h:2712

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.

Definition DeclObjC.h:2657

std::string getNameAsString() const

Get the name of the class associated with this interface.

Definition DeclObjC.h:2729

SourceLocation getSuperClassLoc() const

Definition DeclObjC.h:2737

specific_decl_iterator< ObjCIvarDecl > ivar_iterator

Definition DeclObjC.h:2746

friend class ASTDeclReader

Definition DeclObjC.h:2638

ivar_range ivars() const

Definition DeclObjC.h:2749

ivar_iterator ivar_begin() const

Definition DeclObjC.h:2751

void setIvarLBraceLoc(SourceLocation Loc)

Definition DeclObjC.h:2741

init_range inits()

Definition DeclObjC.h:2662

CXXCtorInitializer ** init_iterator

init_iterator - Iterates through the ivar initializer list.

Definition DeclObjC.h:2654

ObjCInterfaceDecl * getSuperClass()

Definition DeclObjC.h:2736

StringRef getName() const

getName - Get the name of identifier for the class interface associated with this implementation as a...

Definition DeclObjC.h:2721

void setSuperClass(ObjCInterfaceDecl *superCls)

Definition DeclObjC.h:2739

bool hasDestructors() const

Do any of the ivars of this class (not counting its base classes) require non-trivial destruction?

Definition DeclObjC.h:2707

llvm::iterator_range< init_const_iterator > init_const_range

Definition DeclObjC.h:2660

init_iterator init_begin()

init_begin() - Retrieve an iterator to the first initializer.

Definition DeclObjC.h:2669

unsigned getNumIvarInitializers() const

getNumArgs - Number of ivars which must be initialized.

Definition DeclObjC.h:2688

void setIvarInitializers(ASTContext &C, CXXCtorInitializer **initializers, unsigned numInitializers)

init_const_range inits() const

Definition DeclObjC.h:2664

friend class ASTDeclWriter

Definition DeclObjC.h:2639

ivar_iterator ivar_end() const

Definition DeclObjC.h:2755

unsigned ivar_size() const

Definition DeclObjC.h:2759

void setIvarRBraceLoc(SourceLocation Loc)

Definition DeclObjC.h:2743

init_const_iterator init_end() const

end() - Retrieve an iterator past the last initializer.

Definition DeclObjC.h:2683

static bool classof(const Decl *D)

Definition DeclObjC.h:2767

const ObjCInterfaceDecl * getSuperClass() const

Definition DeclObjC.h:2735

SourceLocation getIvarLBraceLoc() const

Definition DeclObjC.h:2742

void setHasDestructors(bool val)

Definition DeclObjC.h:2708

llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range

Definition DeclObjC.h:2747

void setHasNonZeroConstructors(bool val)

Definition DeclObjC.h:2703

Iterator that walks over the list of categories, filtering out those that do not meet specific criter...

Definition DeclObjC.h:1598

filtered_category_iterator(ObjCCategoryDecl *Current)

Definition DeclObjC.h:1611

filtered_category_iterator()=default

friend bool operator!=(filtered_category_iterator X, filtered_category_iterator Y)

Definition DeclObjC.h:1632

pointer operator->() const

Definition DeclObjC.h:1617

std::ptrdiff_t difference_type

Definition DeclObjC.h:1607

reference operator*() const

Definition DeclObjC.h:1616

filtered_category_iterator operator++(int)

Definition DeclObjC.h:1621

friend bool operator==(filtered_category_iterator X, filtered_category_iterator Y)

Definition DeclObjC.h:1627

filtered_category_iterator & operator++()

Definition DeclObjC.h:2937

value_type pointer

Definition DeclObjC.h:1606

value_type reference

Definition DeclObjC.h:1605

std::input_iterator_tag iterator_category

Definition DeclObjC.h:1608

ObjCCategoryDecl * value_type

Definition DeclObjC.h:1604

Represents an ObjC class declaration.

Definition DeclObjC.h:1154

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...

Definition DeclObjC.h:1329

ObjCTypeParamList * getTypeParamList() const

Retrieve the type parameters of this class.

all_protocol_iterator all_referenced_protocol_end() const

Definition DeclObjC.h:1435

ObjCMethodDecl * lookupClassMethod(Selector Sel) const

Lookup a class method for a given selector.

Definition DeclObjC.h:1852

ObjCInterfaceDecl * lookupInheritedClass(const IdentifierInfo *ICName)

lookupInheritedClass - This method returns ObjCInterfaceDecl * of the super class whose name is passe...

ivar_iterator ivar_end() const

Definition DeclObjC.h:1461

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)

Definition DeclObjC.h:1926

ObjCMethodDecl * getCategoryMethod(Selector Sel, bool isInstance) const

Definition DeclObjC.h:1351

const ObjCInterfaceDecl * getCanonicalDecl() const

Definition DeclObjC.h:1916

unsigned ivar_size() const

Definition DeclObjC.h:1469

llvm::iterator_range< visible_categories_iterator > visible_categories_range

Definition DeclObjC.h:1650

ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)

void setCategoryListRaw(ObjCCategoryDecl *category)

Set the raw pointer to the start of the category/extension list.

Definition DeclObjC.h:1798

void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)

setProtocolList - Set the list of protocols that this interface implements.

Definition DeclObjC.h:1485

bool known_extensions_empty() const

Determine whether the known-extensions list is empty.

Definition DeclObjC.h:1779

ObjCInterfaceDecl * getPreviousDecl()

Return the previous declaration of this declaration or NULL if this is the first declaration.

friend class ODRDiagsEmitter

Definition DeclObjC.h:1156

visible_categories_iterator visible_categories_begin() const

Retrieve an iterator to the beginning of the visible-categories list.

Definition DeclObjC.h:1660

bool hasDefinition() const

Determine whether this class has been defined.

Definition DeclObjC.h:1528

llvm::iterator_range< known_extensions_iterator > known_extensions_range

Definition DeclObjC.h:1759

ivar_range ivars() const

Definition DeclObjC.h:1451

all_protocol_range all_referenced_protocols() const

Definition DeclObjC.h:1417

visible_extensions_range visible_extensions() const

Definition DeclObjC.h:1723

bool isImplicitInterfaceDecl() const

isImplicitInterfaceDecl - check that this is an implicitly declared ObjCInterfaceDecl node.

Definition DeclObjC.h:1893

ObjCTypeParamList * getTypeParamListAsWritten() const

Retrieve the type parameters written on this particular declaration of the class.

Definition DeclObjC.h:1303

protocol_loc_iterator protocol_loc_end() const

Definition DeclObjC.h:1403

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

Definition DeclObjC.h:1415

protocol_loc_iterator protocol_loc_begin() const

Definition DeclObjC.h:1392

ivar_iterator ivar_begin() const

Definition DeclObjC.h:1453

protocol_range protocols() const

Definition DeclObjC.h:1359

friend class ASTDeclMerger

Definition DeclObjC.h:1751

ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const

Lookup an instance method for a given selector.

Definition DeclObjC.h:1847

unsigned getODRHash()

Get precomputed ODRHash or add a new one.

friend class ASTReader

Definition DeclObjC.h:1754

llvm::iterator_range< specific_decl_iterator< ObjCIvarDecl > > ivar_range

Definition DeclObjC.h:1449

bool ivar_empty() const

Definition DeclObjC.h:1473

filtered_category_iterator< isKnownExtension > known_extensions_iterator

Iterator that walks over all of the known extensions.

Definition DeclObjC.h:1757

void setImplementation(ObjCImplementationDecl *ImplD)

protocol_loc_range protocol_locs() const

Definition DeclObjC.h:1388

known_categories_range known_categories() const

Definition DeclObjC.h:1687

const ObjCInterfaceDecl * isObjCRequiresPropertyDefs() const

isObjCRequiresPropertyDefs - Checks that a class or one of its super classes must not be auto-synthes...

void setSuperClass(TypeSourceInfo *superClass)

Definition DeclObjC.h:1588

protocol_iterator protocol_end() const

Definition DeclObjC.h:1374

SourceLocation getSuperClassLoc() const

Retrieve the starting location of the superclass.

friend class ASTDeclReader

Definition DeclObjC.h:1752

all_protocol_iterator all_referenced_protocol_begin() const

Definition DeclObjC.h:1422

ObjCMethodDecl * lookupPrivateClassMethod(const Selector &Sel)

Definition DeclObjC.h:1862

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

Definition DeclObjC.h:1414

ObjCMethodDecl * getCategoryClassMethod(Selector Sel) const

ObjCCategoryDecl * getCategoryListRaw() const

Retrieve the raw pointer to the start of the category/extension list.

Definition DeclObjC.h:1785

ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName)

Definition DeclObjC.h:1832

const ObjCIvarDecl * all_declared_ivar_begin() const

Definition DeclObjC.h:1476

const ObjCInterfaceDecl * getDefinition() const

Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...

Definition DeclObjC.h:1549

bool isThisDeclarationADefinition() const

Determine whether this particular declaration of this class is actually also a definition.

Definition DeclObjC.h:1523

friend class ASTContext

Definition DeclObjC.h:1155

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...

Definition DeclObjC.h:1869

llvm::iterator_range< visible_extensions_iterator > visible_extensions_range

Definition DeclObjC.h:1720

ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const

Lookup a method in the classes implementation hierarchy.

const ObjCProtocolList & getReferencedProtocols() const

Definition DeclObjC.h:1333

void setTypeParamList(ObjCTypeParamList *TPL)

Set the type parameters of this class.

ObjCMethodDecl * getCategoryInstanceMethod(Selector Sel) const

ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance, bool shallowCategoryLookup=false, bool followSuper=true, const ObjCCategoryDecl *C=nullptr) const

lookupMethod - This method returns an instance/class method by looking in the class,...

ObjCProtocolList::iterator protocol_iterator

Definition DeclObjC.h:1356

ObjCProtocolDecl * lookupNestedProtocol(IdentifierInfo *Name)

const Type * getTypeForDecl() const

Definition DeclObjC.h:1919

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

Definition DeclObjC.h:1920

filtered_category_iterator< isVisibleExtension > visible_extensions_iterator

Iterator that walks over all of the visible extensions, skipping any that are known but hidden.

Definition DeclObjC.h:1717

llvm::iterator_range< protocol_loc_iterator > protocol_loc_range

Definition DeclObjC.h:1386

StringRef getObjCRuntimeNameAsString() const

Produce a name to be used for class's metadata.

const ObjCObjectType * getSuperClassType() const

Retrieve the superclass type.

Definition DeclObjC.h:1565

friend class ASTDeclWriter

Definition DeclObjC.h:1753

known_categories_iterator known_categories_end() const

Retrieve an iterator to the end of the known-categories list.

Definition DeclObjC.h:1699

ObjCImplementationDecl * getImplementation() const

static bool classof(const Decl *D)

Definition DeclObjC.h:1925

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

Definition DeclObjC.h:1878

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

Definition DeclObjC.h:1307

llvm::iterator_range< protocol_iterator > protocol_range

Definition DeclObjC.h:1357

filtered_category_iterator< isKnownCategory > known_categories_iterator

Iterator that walks over all of the known categories and extensions, including those that are hidden.

Definition DeclObjC.h:1683

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.

Definition DeclObjC.h:1735

bool visible_extensions_empty() const

Determine whether the visible-extensions list is empty.

Definition DeclObjC.h:1740

protocol_iterator protocol_begin() const

Definition DeclObjC.h:1363

ObjCProtocolList::loc_iterator protocol_loc_iterator

Definition DeclObjC.h:1385

known_extensions_iterator known_extensions_end() const

Retrieve an iterator to the end of the known-extensions list.

Definition DeclObjC.h:1774

bool visible_categories_empty() const

Determine whether the visible-categories list is empty.

Definition DeclObjC.h:1670

filtered_category_iterator< isVisibleCategory > visible_categories_iterator

Iterator that walks over the list of categories and extensions that are visible, i....

Definition DeclObjC.h:1647

void setEndOfDefinitionLoc(SourceLocation LE)

Definition DeclObjC.h:1885

known_categories_iterator known_categories_begin() const

Retrieve an iterator to the beginning of the known-categories list.

Definition DeclObjC.h:1694

void startDefinition()

Starts the definition of this Objective-C class, taking it from a forward declaration (@class) to a d...

ObjCInterfaceDecl * getMostRecentDecl()

Returns the most recent (re)declaration of this declaration.

void collectPropertiesToImplement(PropertyMap &PM) const override

This routine collects list of properties to be implemented in the class.

redeclarable_base::redecl_range redecl_range

Definition DeclObjC.h:1904

bool known_categories_empty() const

Determine whether the known-categories list is empty.

Definition DeclObjC.h:1704

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.

Definition DeclObjC.h:1769

visible_categories_range visible_categories() const

Definition DeclObjC.h:1653

ObjCInterfaceDecl * getCanonicalDecl() override

Retrieves the canonical declaration of this Objective-C class.

Definition DeclObjC.h:1915

ObjCInterfaceDecl * getSuperClass() const

ObjCInterfaceDecl * getDefinition()

Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...

Definition DeclObjC.h:1542

TypeSourceInfo * getSuperClassTInfo() const

Definition DeclObjC.h:1573

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...

Definition DeclObjC.h:1810

specific_decl_iterator< ObjCIvarDecl > ivar_iterator

Definition DeclObjC.h:1448

redeclarable_base::redecl_iterator redecl_iterator

Definition DeclObjC.h:1905

void setIvarList(ObjCIvarDecl *ivar)

Definition DeclObjC.h:1481

void mergeDuplicateDefinitionWithCommon(const ObjCInterfaceDecl *Definition)

visible_categories_iterator visible_categories_end() const

Retrieve an iterator to the end of the visible-categories list.

Definition DeclObjC.h:1665

visible_extensions_iterator visible_extensions_begin() const

Retrieve an iterator to the beginning of the visible-extensions list.

Definition DeclObjC.h:1730

llvm::iterator_range< known_categories_iterator > known_categories_range

Definition DeclObjC.h:1684

known_extensions_range known_extensions() const

Definition DeclObjC.h:1762

ObjCIvarDecl - Represents an ObjC instance variable.

Definition DeclObjC.h:1952

AccessControl getAccessControl() const

Definition DeclObjC.h:2000

void setAccessControl(AccessControl ac)

Definition DeclObjC.h:1998

static bool classof(const Decl *D)

Definition DeclObjC.h:2014

void setNextIvar(ObjCIvarDecl *ivar)

Definition DeclObjC.h:1989

bool getSynthesize() const

Definition DeclObjC.h:2007

ObjCInterfaceDecl * getContainingInterface()

Return the class interface that this ivar is logically contained in; this is either the interface whe...

AccessControl

Definition DeclObjC.h:1956

@ Protected

Definition DeclObjC.h:1957

@ Package

Definition DeclObjC.h:1957

@ None

Definition DeclObjC.h:1957

@ Private

Definition DeclObjC.h:1957

@ Public

Definition DeclObjC.h:1957

void setSynthesize(bool synth)

Definition DeclObjC.h:2006

ObjCIvarDecl * getNextIvar()

Definition DeclObjC.h:1987

const ObjCIvarDecl * getNextIvar() const

Definition DeclObjC.h:1988

static ObjCIvarDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

const ObjCInterfaceDecl * getContainingInterface() const

Definition DeclObjC.h:1983

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

Definition DeclObjC.h:2002

const ObjCIvarDecl * getCanonicalDecl() const

Definition DeclObjC.h:1994

ObjCIvarDecl * getCanonicalDecl() override

Retrieves the canonical declaration of this field.

Definition DeclObjC.h:1991

static bool classofKind(Kind K)

Definition DeclObjC.h:2015

void ** List

List is an array of pointers to objects that are not owned by this object.

Definition DeclObjC.h:62

bool empty() const

Definition DeclObjC.h:71

ObjCListBase & operator=(const ObjCListBase &)=delete

void set(void *const *InList, unsigned Elts, ASTContext &Ctx)

unsigned NumElts

Definition DeclObjC.h:63

unsigned size() const

Definition DeclObjC.h:70

ObjCListBase(const ObjCListBase &)=delete

ObjCList - This is a simple template class used to hold various lists of decls etc,...

Definition DeclObjC.h:82

iterator end() const

Definition DeclObjC.h:91

iterator begin() const

Definition DeclObjC.h:90

T * operator[](unsigned Idx) const

Definition DeclObjC.h:93

T *const * iterator

Definition DeclObjC.h:88

void set(T *const *InList, unsigned Elts, ASTContext &Ctx)

Definition DeclObjC.h:84

ObjCMethodDecl - Represents an instance or class method declaration.

Definition DeclObjC.h:140

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

Definition DeclObjC.h:418

bool hasBody() const override

Determine whether this method has a body.

Definition DeclObjC.h:523

bool isOverriding() const

Whether this method overrides any other in the class hierarchy.

Definition DeclObjC.h:462

void setSynthesizedAccessorStub(bool isSynthesizedAccessorStub)

Definition DeclObjC.h:448

void setObjCDeclQualifier(ObjCDeclQualifier QV)

Definition DeclObjC.h:250

void setDefined(bool isDefined)

Definition DeclObjC.h:453

static bool classofKind(Kind K)

Definition DeclObjC.h:541

ObjCDeclQualifier getObjCDeclQualifier() const

Definition DeclObjC.h:246

ArrayRef< ParmVarDecl * > parameters() const

Definition DeclObjC.h:373

param_iterator param_end()

Definition DeclObjC.h:363

unsigned param_size() const

Definition DeclObjC.h:347

void setSelfDecl(ImplicitParamDecl *SD)

Definition DeclObjC.h:419

static ObjCMethodDecl * castFromDeclContext(const DeclContext *DC)

Definition DeclObjC.h:547

static DeclContext * castToDeclContext(const ObjCMethodDecl *D)

Definition DeclObjC.h:543

const ParmVarDecl * getParamDecl(unsigned Idx) const

Definition DeclObjC.h:381

static bool classof(const Decl *D)

Definition DeclObjC.h:540

void setReturnTypeSourceInfo(TypeSourceInfo *TInfo)

Definition DeclObjC.h:344

bool isPropertyAccessor() const

Definition DeclObjC.h:436

CompoundStmt * getCompoundBody()

Definition DeclObjC.h:530

void getOverriddenMethods(SmallVectorImpl< const ObjCMethodDecl * > &Overridden) const

Return overridden methods for the given Method.

void setHasRedeclaration(bool HRD) const

Definition DeclObjC.h:272

const ObjCPropertyDecl * findPropertyDecl(bool CheckOverrides=true) const

Returns the property associated with this method's selector.

param_const_iterator param_end() const

Definition DeclObjC.h:358

SourceLocation getSelectorStartLoc() const

Definition DeclObjC.h:288

QualType getSendResultType() const

Determine the type of an expression that sends a message to this function.

param_const_iterator param_begin() const

Definition DeclObjC.h:354

bool hasParamDestroyedInCallee() const

True if the method has a parameter that's destroyed in the callee.

void setIsRedeclaration(bool RD)

Definition DeclObjC.h:267

bool isVariadic() const

Definition DeclObjC.h:431

void setBody(Stmt *B)

Definition DeclObjC.h:531

void setCmdDecl(ImplicitParamDecl *CD)

Definition DeclObjC.h:421

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

Definition DeclObjC.h:343

QualType getSelfType(ASTContext &Context, const ObjCInterfaceDecl *OID, bool &selfIsPseudoStrong, bool &selfIsConsumed) const

bool hasRedeclaration() const

True if redeclared in the same interface.

Definition DeclObjC.h:271

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.

Definition DeclObjC.h:261

friend class ASTDeclReader

Definition DeclObjC.h:226

param_type_iterator param_type_begin() const

Definition DeclObjC.h:399

llvm::iterator_range< param_const_iterator > param_const_range

Definition DeclObjC.h:352

param_iterator param_begin()

Definition DeclObjC.h:362

bool isSynthesizedAccessorStub() const

Definition DeclObjC.h:444

SourceLocation getSelectorLoc(unsigned Index) const

Definition DeclObjC.h:294

SourceRange getReturnTypeSourceRange() const

void setOverriding(bool IsOver)

Definition DeclObjC.h:463

const ParmVarDecl *const * param_const_iterator

Definition DeclObjC.h:349

bool hasRelatedResultType() const

Determine whether this method has a result type that is related to the message receiver's type.

Definition DeclObjC.h:256

param_type_iterator param_type_end() const

Definition DeclObjC.h:403

SourceLocation getBeginLoc() const LLVM_READONLY

Definition DeclObjC.h:282

bool isRedeclaration() const

True if this is a method redeclaration in the same interface.

Definition DeclObjC.h:266

bool isDirectMethod() const

True if the method is tagged as objc_direct.

void setPropertyAccessor(bool isAccessor)

Definition DeclObjC.h:440

Selector getSelector() const

Definition DeclObjC.h:327

bool isOptional() const

Definition DeclObjC.h:505

void setDeclImplementation(ObjCImplementationControl ic)

Definition DeclObjC.h:496

friend class ASTDeclWriter

Definition DeclObjC.h:227

ImplicitParamDecl * getCmdDecl() const

Definition DeclObjC.h:420

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

Definition DeclObjC.h:284

bool isInstanceMethod() const

Definition DeclObjC.h:426

llvm::iterator_range< param_iterator > param_range

Definition DeclObjC.h:351

void setReturnType(QualType T)

Definition DeclObjC.h:330

void setLazyBody(uint64_t Offset)

Definition DeclObjC.h:528

bool isThisDeclarationADefinition() const

Returns whether this specific method is a definition.

Definition DeclObjC.h:534

ParmVarDecl * getParamDecl(unsigned Idx)

Definition DeclObjC.h:377

static ObjCMethodDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

bool isThisDeclarationADesignatedInitializer() const

Returns true if this specific method declaration is marked with the designated initializer attribute.

llvm::mapped_iterator< param_const_iterator, GetTypeFn > param_type_iterator

Definition DeclObjC.h:396

ObjCCategoryDecl * getCategory()

If this method is declared or implemented in a category, return that category.

bool isDefined() const

Definition DeclObjC.h:452

void setHasSkippedBody(bool Skipped=true)

Definition DeclObjC.h:478

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

Definition DeclObjC.h:329

ParmVarDecl *const * param_iterator

Definition DeclObjC.h:350

ObjCImplementationControl getImplementationControl() const

Definition DeclObjC.h:500

bool hasSkippedBody() const

True if the method was a definition but its body was skipped.

Definition DeclObjC.h:477

unsigned getNumSelectorLocs() const

Definition DeclObjC.h:306

bool isClassMethod() const

Definition DeclObjC.h:434

ObjCInterfaceDecl * getClassInterface()

void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const

SourceLocation getDeclaratorEndLoc() const

Returns the location where the declarator ends.

Definition DeclObjC.h:279

void setInstanceMethod(bool isInst)

Definition DeclObjC.h:427

void setVariadic(bool isVar)

Definition DeclObjC.h:432

param_const_iterator sel_param_end() const

Definition DeclObjC.h:367

const ObjCInterfaceDecl * getClassInterface() const

Definition DeclObjC.h:316

const ObjCMethodDecl * getCanonicalDecl() const

Definition DeclObjC.h:242

const ObjCCategoryDecl * getCategory() const

Definition DeclObjC.h:323

Represents one property declaration in an Objective-C interface.

Definition DeclObjC.h:731

void setAtLoc(SourceLocation L)

Definition DeclObjC.h:797

bool isAtomic() const

isAtomic - Return true if the property is atomic.

Definition DeclObjC.h:843

ObjCPropertyQueryKind getQueryKind() const

Definition DeclObjC.h:860

bool isClassProperty() const

Definition DeclObjC.h:855

void setPropertyImplementation(PropertyControl pc)

Definition DeclObjC.h:908

void setSetterName(Selector Sel, SourceLocation Loc=SourceLocation())

Definition DeclObjC.h:896

SourceLocation getGetterNameLoc() const

Definition DeclObjC.h:886

QualType getUsageType(QualType objectType) const

Retrieve the type when this property is used with a specific base object type.

ObjCMethodDecl * getGetterMethodDecl() const

Definition DeclObjC.h:901

bool isRetaining() const

isRetaining - Return true if the property retains its value.

Definition DeclObjC.h:848

bool isInstanceProperty() const

Definition DeclObjC.h:854

ObjCMethodDecl * getSetterMethodDecl() const

Definition DeclObjC.h:904

static ObjCPropertyQueryKind getQueryKind(bool isClassProperty)

Definition DeclObjC.h:865

SourceLocation getSetterNameLoc() const

Definition DeclObjC.h:894

SourceLocation getAtLoc() const

Definition DeclObjC.h:796

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

Definition DeclObjC.h:928

void setPropertyAttributes(ObjCPropertyAttribute::Kind PRVal)

Definition DeclObjC.h:819

bool isReadOnly() const

isReadOnly - Return true iff the property has a setter.

Definition DeclObjC.h:838

ObjCIvarDecl * getPropertyIvarDecl() const

Definition DeclObjC.h:924

static ObjCPropertyDecl * findPropertyDecl(const DeclContext *DC, const IdentifierInfo *propertyID, ObjCPropertyQueryKind queryKind)

Lookup a property by name in the specified DeclContext.

bool isOptional() const

Definition DeclObjC.h:916

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.

Definition DeclObjC.h:873

static bool classofKind(Kind K)

Definition DeclObjC.h:941

Selector getSetterName() const

Definition DeclObjC.h:893

PropertyControl

Definition DeclObjC.h:736

@ Optional

Definition DeclObjC.h:736

@ Required

Definition DeclObjC.h:736

@ None

Definition DeclObjC.h:736

TypeSourceInfo * getTypeSourceInfo() const

Definition DeclObjC.h:802

QualType getType() const

Definition DeclObjC.h:804

void setPropertyAttributesAsWritten(ObjCPropertyAttribute::Kind PRVal)

Definition DeclObjC.h:831

void overwritePropertyAttributes(unsigned PRVal)

Definition DeclObjC.h:823

SetterKind

Definition DeclObjC.h:735

@ Retain

Definition DeclObjC.h:735

@ Copy

Definition DeclObjC.h:735

@ Weak

Definition DeclObjC.h:735

@ Assign

Definition DeclObjC.h:735

Selector getGetterName() const

Definition DeclObjC.h:885

static bool classof(const Decl *D)

Definition DeclObjC.h:940

void setLParenLoc(SourceLocation L)

Definition DeclObjC.h:800

void setPropertyIvarDecl(ObjCIvarDecl *Ivar)

Definition DeclObjC.h:920

SourceLocation getLParenLoc() const

Definition DeclObjC.h:799

void setSetterMethodDecl(ObjCMethodDecl *gDecl)

Definition DeclObjC.h:905

ObjCPropertyAttribute::Kind getPropertyAttributesAsWritten() const

Definition DeclObjC.h:827

IdentifierInfo * getDefaultSynthIvarName(ASTContext &Ctx) const

Get the default name of the synthesized ivar.

ObjCPropertyAttribute::Kind getPropertyAttributes() const

Definition DeclObjC.h:815

void setType(QualType T, TypeSourceInfo *TSI)

Definition DeclObjC.h:806

void setGetterName(Selector Sel, SourceLocation Loc=SourceLocation())

Definition DeclObjC.h:888

PropertyControl getPropertyImplementation() const

Definition DeclObjC.h:912

void setGetterMethodDecl(ObjCMethodDecl *gDecl)

Definition DeclObjC.h:902

ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...

Definition DeclObjC.h:2805

ObjCIvarDecl * getPropertyIvarDecl() const

Definition DeclObjC.h:2879

SourceLocation getPropertyIvarDeclLoc() const

Definition DeclObjC.h:2882

void setPropertyIvarDecl(ObjCIvarDecl *Ivar, SourceLocation IvarLoc)

Definition DeclObjC.h:2884

Kind getPropertyImplementation() const

Definition DeclObjC.h:2875

bool isIvarNameSpecified() const

For @synthesize, returns true if an ivar name was explicitly specified.

Definition DeclObjC.h:2897

void setSetterMethodDecl(ObjCMethodDecl *MD)

Definition DeclObjC.h:2905

friend class ASTDeclReader

Definition DeclObjC.h:2853

Expr * getSetterCXXAssignment() const

Definition DeclObjC.h:2915

ObjCPropertyDecl * getPropertyDecl() const

Definition DeclObjC.h:2870

Expr * getGetterCXXConstructor() const

Definition DeclObjC.h:2907

void setSetterCXXAssignment(Expr *setterCXXAssignment)

Definition DeclObjC.h:2919

static ObjCPropertyImplDecl * CreateDeserialized(ASTContext &C, GlobalDeclID ID)

ObjCMethodDecl * getSetterMethodDecl() const

Definition DeclObjC.h:2904

static bool classof(const Decl *D)

Definition DeclObjC.h:2923

SourceLocation getBeginLoc() const LLVM_READONLY

Definition DeclObjC.h:2867

static bool classofKind(Decl::Kind K)

Definition DeclObjC.h:2924

void setGetterMethodDecl(ObjCMethodDecl *MD)

Definition DeclObjC.h:2902

void setAtLoc(SourceLocation Loc)

Definition DeclObjC.h:2868

Kind

Definition DeclObjC.h:2807

@ Dynamic

Definition DeclObjC.h:2809

@ Synthesize

Definition DeclObjC.h:2808

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

void setPropertyDecl(ObjCPropertyDecl *Prop)

Definition DeclObjC.h:2873

void setGetterCXXConstructor(Expr *getterCXXConstructor)

Definition DeclObjC.h:2911

ObjCMethodDecl * getGetterMethodDecl() const

Definition DeclObjC.h:2901

Represents an Objective-C protocol declaration.

Definition DeclObjC.h:2084

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.

Definition DeclObjC.h:2238

bool isThisDeclarationADefinition() const

Determine whether this particular declaration is also the definition.

Definition DeclObjC.h:2261

ObjCMethodDecl * lookupMethod(Selector Sel, bool isInstance) const

const ObjCProtocolList & getReferencedProtocols() const

Definition DeclObjC.h:2153

const ObjCProtocolDecl * getDefinition() const

Retrieve the definition of this protocol, if any.

Definition DeclObjC.h:2255

ObjCProtocolDecl * getPreviousDecl()

Return the previous declaration of this declaration or NULL if this is the first declaration.

friend class ODRDiagsEmitter

Definition DeclObjC.h:2143

void setProtocolList(ObjCProtocolDecl *const *List, unsigned Num, const SourceLocation *Locs, ASTContext &C)

setProtocolList - Set the list of protocols that this interface implements.

Definition DeclObjC.h:2209

redeclarable_base::redecl_iterator redecl_iterator

Definition DeclObjC.h:2287

protocol_loc_iterator protocol_loc_end() const

Definition DeclObjC.h:2193

friend class ASTDeclMerger

Definition DeclObjC.h:2139

ObjCProtocolDecl * getDefinition()

Retrieve the definition of this protocol, if any.

Definition DeclObjC.h:2250

StringRef getObjCRuntimeNameAsString() const

Produce a name to be used for protocol's metadata.

protocol_loc_range protocol_locs() const

Definition DeclObjC.h:2182

llvm::iterator_range< protocol_loc_iterator > protocol_loc_range

Definition DeclObjC.h:2180

llvm::iterator_range< protocol_iterator > protocol_range

Definition DeclObjC.h:2159

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.

friend class ASTReader

Definition DeclObjC.h:2142

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

Definition DeclObjC.h:2158

friend class ASTDeclReader

Definition DeclObjC.h:2140

void collectInheritedProtocolProperties(const ObjCPropertyDecl *Property, ProtocolPropertySet &PS, PropertyDeclOrder &PO) const

static bool classof(const Decl *D)

Definition DeclObjC.h:2309

protocol_iterator protocol_begin() const

Definition DeclObjC.h:2165

ObjCProtocolList::loc_iterator protocol_loc_iterator

Definition DeclObjC.h:2179

ObjCProtocolDecl * lookupProtocolNamed(IdentifierInfo *PName)

ObjCProtocolDecl * getCanonicalDecl() override

Retrieves the canonical declaration of this Objective-C protocol.

Definition DeclObjC.h:2297

ObjCProtocolDecl * getMostRecentDecl()

Returns the most recent (re)declaration of this declaration.

protocol_range protocols() const

Definition DeclObjC.h:2161

ObjCMethodDecl * lookupClassMethod(Selector Sel) const

Definition DeclObjC.h:2233

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

Definition DeclObjC.h:2279

const ObjCProtocolDecl * getCanonicalDecl() const

Definition DeclObjC.h:2298

friend class ASTDeclWriter

Definition DeclObjC.h:2141

static bool classofKind(Kind K)

Definition DeclObjC.h:2310

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

Definition DeclObjC.h:2286

unsigned protocol_size() const

Definition DeclObjC.h:2200

protocol_iterator protocol_end() const

Definition DeclObjC.h:2172

protocol_loc_iterator protocol_loc_begin() const

Definition DeclObjC.h:2186

ObjCMethodDecl * lookupInstanceMethod(Selector Sel) const

Definition DeclObjC.h:2229

A list of Objective-C protocols, along with the source locations at which they were referenced.

Definition DeclObjC.h:101

loc_iterator loc_begin() const

Definition DeclObjC.h:111

const SourceLocation * loc_iterator

Definition DeclObjC.h:109

loc_iterator loc_end() const

Definition DeclObjC.h:112

ObjCProtocolList()=default

void set(ObjCProtocolDecl *const *InList, unsigned Elts, const SourceLocation *Locs, ASTContext &Ctx)

Represents the declaration of an Objective-C type parameter.

Definition DeclObjC.h:578

static bool classof(const Decl *D)

Definition DeclObjC.h:650

unsigned getIndex() const

Retrieve the index into its type parameter list.

Definition DeclObjC.h:636

bool hasExplicitBound() const

Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".

Definition DeclObjC.h:640

SourceLocation getColonLoc() const

Retrieve the location of the ':' separating the type parameter name from the explicitly-specified bou...

Definition DeclObjC.h:644

friend class ASTDeclReader

Definition DeclObjC.h:606

ObjCTypeParamVariance getVariance() const

Determine the variance of this type parameter.

Definition DeclObjC.h:623

static bool classofKind(Kind K)

Definition DeclObjC.h:651

friend class ASTDeclWriter

Definition DeclObjC.h:607

void setVariance(ObjCTypeParamVariance variance)

Set the variance of this type parameter.

Definition DeclObjC.h:628

SourceRange getSourceRange() const override LLVM_READONLY

Source range that this declaration covers.

SourceLocation getVarianceLoc() const

Retrieve the location of the variance keyword.

Definition DeclObjC.h:633

static ObjCTypeParamDecl * CreateDeserialized(ASTContext &ctx, GlobalDeclID ID)

Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...

Definition DeclObjC.h:662

SourceRange getSourceRange() const

Definition DeclObjC.h:712

void gatherDefaultTypeArgs(SmallVectorImpl< QualType > &typeArgs) const

Gather the default set of type arguments to be substituted for these type parameters when dealing wit...

iterator end()

Definition DeclObjC.h:686

iterator begin()

Definition DeclObjC.h:684

unsigned size() const

Determine the number of type parameters in this list.

Definition DeclObjC.h:689

const_iterator begin() const

Definition DeclObjC.h:694

ObjCTypeParamDecl * front() const

Definition DeclObjC.h:700

const_iterator end() const

Definition DeclObjC.h:696

SourceLocation getRAngleLoc() const

Definition DeclObjC.h:711

ObjCTypeParamDecl *const * const_iterator

Definition DeclObjC.h:692

ObjCTypeParamDecl * back() const

Definition DeclObjC.h:705

friend TrailingObjects

Definition DeclObjC.h:673

ObjCTypeParamDecl ** iterator

Iterate through the type parameters in the list.

Definition DeclObjC.h:682

static ObjCTypeParamList * create(ASTContext &ctx, SourceLocation lAngleLoc, ArrayRef< ObjCTypeParamDecl * > typeParams, SourceLocation rAngleLoc)

Create a new Objective-C type parameter list.

SourceLocation getLAngleLoc() const

Definition DeclObjC.h:710

Represents a parameter to a function.

A (possibly-)qualified type.

ObjCInterfaceDecl * getFirstDecl()

ObjCInterfaceDecl * getNextRedeclaration() const

Redeclarable(const ASTContext &Ctx)

ObjCInterfaceDecl * getPreviousDecl()

redecl_iterator redecls_end() const

llvm::iterator_range< redecl_iterator > redecl_range

ObjCInterfaceDecl * getMostRecentDecl()

redecl_iterator redecls_begin() const

redecl_range redecls() const

Smart pointer class that efficiently represents Objective-C method names.

bool isUnarySelector() const

unsigned getNumArgs() const

Encodes a location in the source.

A trivial tuple used to represent a source range.

Stmt - This represents one statement.

void setTypeForDecl(const Type *TD)

const Type * getTypeForDecl() const

A container of type source information.

The base class of the type hierarchy.

bool isBlockPointerType() const

TypedefNameDecl(Kind DK, ASTContext &C, DeclContext *DC, SourceLocation StartLoc, SourceLocation IdLoc, const IdentifierInfo *Id, TypeSourceInfo *TInfo)

ObjCPropertyAttribute::Kind - list of property attributes.

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.

LazyOffsetPtr< Stmt, uint64_t, &ExternalASTSource::GetExternalDeclStmt > LazyDeclStmtPtr

A lazy pointer to a statement.

ObjCPropertyQueryKind

Definition DeclObjC.h:719

@ OBJC_PR_query_class

Definition DeclObjC.h:722

@ OBJC_PR_query_instance

Definition DeclObjC.h:721

@ OBJC_PR_query_unknown

Definition DeclObjC.h:720

@ ICIS_NoInit

No in-class initializer.

@ Create

'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...

LazyOffsetPtr< CXXCtorInitializer *, uint64_t, &ExternalASTSource::GetExternalCXXCtorInitializers > LazyCXXCtorInitializersPtr

A lazy pointer to a set of CXXCtorInitializers.

ObjCMethodFamily

A family of Objective-C methods.

@ Property

The type of a property.

const FunctionProtoType * T

ObjCImplementationControl

Definition DeclObjC.h:118

@ None

Definition DeclObjC.h:118

@ Required

Definition DeclObjC.h:118

@ Optional

Definition DeclObjC.h:118

@ NumObjCPropertyAttrsBits

Number of bits fitting all the property attributes.

SourceLocation getStandardSelectorLoc(unsigned Index, Selector Sel, bool WithArgSpace, ArrayRef< Expr * > Args, SourceLocation EndLoc)

Get the "standard" location of a selector identifier, e.g: For nullary selectors, immediately before ...

bool declaresSameEntity(const Decl *D1, const Decl *D2)

Determine whether two declarations declare the same entity.

const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ConceptReference *C)

Insertion operator for diagnostics.

ObjCTypeParamVariance

Describes the variance of a given generic parameter.

Definition DeclObjC.h:553

@ Invariant

The parameter is invariant: must match exactly.

Definition DeclObjC.h:555

@ Contravariant

The parameter is contravariant, e.g., X is a subtype of X when the type parameter is covariant and...

Definition DeclObjC.h:563

@ Covariant

The parameter is covariant, e.g., X is a subtype of X when the type parameter is covariant and T i...

Definition DeclObjC.h:559

U cast(CodeGen::Address addr)

@ None

The alignment was not explicit in code.

Definition DeclObjC.h:392

QualType operator()(const ParmVarDecl *PD) const

Definition DeclObjC.h:393