clang: include/clang/AST/ExprObjC.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef LLVM_CLANG_AST_EXPROBJC_H

14#define LLVM_CLANG_AST_EXPROBJC_H

15

29#include "llvm/ADT/ArrayRef.h"

30#include "llvm/ADT/PointerIntPair.h"

31#include "llvm/ADT/PointerUnion.h"

32#include "llvm/ADT/StringRef.h"

33#include "llvm/ADT/iterator_range.h"

34#include "llvm/Support/Casting.h"

35#include "llvm/Support/Compiler.h"

36#include "llvm/Support/TrailingObjects.h"

37#include "llvm/Support/VersionTuple.h"

38#include "llvm/Support/type_traits.h"

39#include

40#include

41#include

42#include

43

45

46class ASTContext;

47class CXXBaseSpecifier;

48

49

50

54

55public:

58 AtLoc(L) {

60 }

62 : Expr(ObjCStringLiteralClass, Empty) {}

63

67

70

73

74

76

79 }

80

82 return T->getStmtClass() == ObjCStringLiteralClass;

83 }

84};

85

86

90

91public:

96 }

98 : Expr(ObjCBoolLiteralExprClass, Empty) {}

99

102

105

108

109

112 }

113

116 }

117

119 return T->getStmtClass() == ObjCBoolLiteralExprClass;

120 }

121};

122

123

124

125

126

128 Stmt *SubExpr;

131

132public:

134

137 BoxingMethod(method), Range(R) {

139 }

141 : Expr(ObjCBoxedExprClass, Empty) {}

142

145

147 return BoxingMethod;

148 }

149

150

151

153 return !BoxingMethod && SubExpr;

154 }

155

157

160

163 }

164

165

167

170 }

171

173

175 return reinterpret_cast<Stmt const * const*>(&SubExpr);

176 }

177

179 return reinterpret_cast<Stmt const * const*>(&SubExpr + 1);

180 }

181

183 return T->getStmtClass() == ObjCBoxedExprClass;

184 }

185};

186

187

188

190 : public Expr,

191 private llvm::TrailingObjects<ObjCArrayLiteral, Expr *> {

192 unsigned NumElements;

195

199

201 : Expr(ObjCArrayLiteralClass, Empty), NumElements(NumElements) {}

202

203public:

206

211

213 unsigned NumElements);

214

218

219

221

222

224 return getTrailingObjects<Expr *>();

225 }

226

227

229

230

232 assert((Index < NumElements) && "Arg access out of range!");

234 }

236 assert((Index < NumElements) && "Arg access out of range!");

238 }

239

241 return ArrayWithObjectsMethod;

242 }

243

244

248 }

249

253 }

254

256 return T->getStmtClass() == ObjCArrayLiteralClass;

257 }

258};

259

260

261

263

265

266

268

269

271

272

273

275

276

278};

279

280}

281

283

284

288};

289

290

291

292

294

295

297

298

299

301};

302

303

304

306 : public Expr,

307 private llvm::TrailingObjects<ObjCDictionaryLiteral,

308 ObjCDictionaryLiteral_KeyValuePair,

309 ObjCDictionaryLiteral_ExpansionData> {

310

311 unsigned NumElements : 31;

312

313

314

315

316

317

318

319

320 LLVM_PREFERRED_TYPE(bool)

321 unsigned HasPackExpansions : 1;

322

325

328

330 bool HasPackExpansions,

333

335 bool HasPackExpansions)

336 : Expr(ObjCDictionaryLiteralClass, Empty), NumElements(NumElements),

337 HasPackExpansions(HasPackExpansions) {}

338

339 size_t numTrailingObjects(OverloadToken) const {

340 return NumElements;

341 }

342

343public:

347

350 bool HasPackExpansions,

353

355 unsigned NumElements,

356 bool HasPackExpansions);

357

358

359

361

363 assert((Index < NumElements) && "Arg access out of range!");

364 const KeyValuePair &KV = getTrailingObjects()[Index];

366 std::nullopt};

367 if (HasPackExpansions) {

369 getTrailingObjects()[Index];

373 }

375 }

376

378 return DictWithObjectsMethod;

379 }

380

384

385

387

388

390 "KeyValuePair is expected size");

392 reinterpret_cast<Stmt **>(getTrailingObjects()),

393 reinterpret_cast<Stmt **>(getTrailingObjects()) +

394 NumElements * 2);

395 }

396

400 }

401

403 return T->getStmtClass() == ObjCDictionaryLiteralClass;

404 }

405};

406

407

408

409

413

414public:

418 EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {

420 }

421

423

428

430

432

434 EncodedType = EncType;

435 }

436

439

440

443 }

444

447 }

448

450 return T->getStmtClass() == ObjCEncodeExprClass;

451 }

452};

453

454

458

459public:

463 SelName(selInfo), AtLoc(at), RParenLoc(rp) {

465 }

467 : Expr(ObjCSelectorExprClass, Empty) {}

468

471

476

479

480

482

483

486 }

487

490 }

491

493 return T->getStmtClass() == ObjCSelectorExprClass;

494 }

495};

496

497

498

499

500

501

502

503

504

508

509public:

512

516 TheProtocol(protocol), AtLoc(at), ProtoLoc(protoLoc), RParenLoc(rp) {

518 }

520 : Expr(ObjCProtocolExprClass, Empty) {}

521

524

530

533

534

537 }

538

541 }

542

544 return T->getStmtClass() == ObjCProtocolExprClass;

545 }

546};

547

548

553

554

556

557

558 LLVM_PREFERRED_TYPE(bool)

559 bool IsArrow : 1;

560

561

562 LLVM_PREFERRED_TYPE(bool)

563 bool IsFreeIvar : 1;

564

565public:

568 bool freeIvar = false)

571 D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow),

572 IsFreeIvar(freeIvar) {

574 }

575

577 : Expr(ObjCIvarRefExprClass, Empty) {}

578

582

586

587 bool isArrow() const { return IsArrow; }

591

594

597 }

599

602

603

605

608 }

609

611 return T->getStmtClass() == ObjCIvarRefExprClass;

612 }

613};

614

615

616

618private:

619

620

621

622

623 llvm::PointerIntPair<NamedDecl *, 1, bool> PropertyOrGetter;

624

625

626

627

628 enum MethodRefFlags {

629 MethodRef_None = 0,

630 MethodRef_Getter = 0x1,

631 MethodRef_Setter = 0x2

632 };

633

634

635 llvm::PointerIntPair<ObjCMethodDecl *, 2, unsigned> SetterAndMethodRefFlags;

636

637

638

639

640

641

643

644

645

646

648 llvm::PointerUnion<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver;

649

650public:

653 : Expr(ObjCPropertyRefExprClass, t, VK, OK), PropertyOrGetter(PD, false),

654 IdLoc(l), Receiver(base) {

657 }

658

662 : Expr(ObjCPropertyRefExprClass, t, VK, OK), PropertyOrGetter(PD, false),

663 IdLoc(l), ReceiverLoc(sl), Receiver(st.getTypePtr()) {

666 }

667

671 : Expr(ObjCPropertyRefExprClass, T, VK, OK),

672 PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),

673 IdLoc(IdLoc), Receiver(Base) {

676 }

677

682 : Expr(ObjCPropertyRefExprClass, T, VK, OK),

683 PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),

684 IdLoc(IdLoc), ReceiverLoc(SuperLoc), Receiver(SuperTy.getTypePtr()) {

687 }

688

693 : Expr(ObjCPropertyRefExprClass, T, VK, OK),

694 PropertyOrGetter(Getter, true), SetterAndMethodRefFlags(Setter, 0),

695 IdLoc(IdLoc), ReceiverLoc(ReceiverLoc), Receiver(Receiver) {

698 }

699

701 : Expr(ObjCPropertyRefExprClass, Empty) {}

702

705

708 return cast(PropertyOrGetter.getPointer());

709 }

710

713 return cast_or_null(PropertyOrGetter.getPointer());

714 }

715

718 return SetterAndMethodRefFlags.getPointer();

719 }

720

725 }

726

731 }

732

733

734

735

737 return SetterAndMethodRefFlags.getInt() & MethodRef_Getter;

738 }

739

740

741

742

744 return SetterAndMethodRefFlags.getInt() & MethodRef_Setter;

745 }

746

748 setMethodRefFlag(MethodRef_Getter, val);

749 }

750

752 setMethodRefFlag(MethodRef_Setter, val);

753 }

754

755 const Expr *getBase() const { return cast(cast<Stmt *>(Receiver)); }

756 Expr *getBase() { return cast(cast<Stmt *>(Receiver)); }

757

759

761

763 return QualType(cast<const Type *>(Receiver), 0);

764 }

765

767 return cast<ObjCInterfaceDecl *>(Receiver);

768 }

769

772 bool isClassReceiver() const { return isa<ObjCInterfaceDecl *>(Receiver); }

773

774

776

780 }

781

783

784

786 if (isa<Stmt *>(Receiver)) {

787 Stmt **begin = reinterpret_cast<Stmt**>(&Receiver);

789 }

791 }

792

796 }

797

799 return T->getStmtClass() == ObjCPropertyRefExprClass;

800 }

801

802private:

805

806 void setExplicitProperty(ObjCPropertyDecl *D, unsigned methRefFlags) {

807 PropertyOrGetter.setPointer(D);

808 PropertyOrGetter.setInt(false);

809 SetterAndMethodRefFlags.setPointer(nullptr);

810 SetterAndMethodRefFlags.setInt(methRefFlags);

811 }

812

814 unsigned methRefFlags) {

815 PropertyOrGetter.setPointer(Getter);

816 PropertyOrGetter.setInt(true);

817 SetterAndMethodRefFlags.setPointer(Setter);

818 SetterAndMethodRefFlags.setInt(methRefFlags);

819 }

820

821 void setBase(Expr *Base) { Receiver = Base; }

822 void setSuperReceiver(QualType T) { Receiver = T.getTypePtr(); }

823 void setClassReceiver(ObjCInterfaceDecl *D) { Receiver = D; }

824

825 void setLocation(SourceLocation L) { IdLoc = L; }

826 void setReceiverLocation(SourceLocation Loc) { ReceiverLoc = Loc; }

827

828 void setMethodRefFlag(MethodRefFlags flag, bool val) {

829 unsigned f = SetterAndMethodRefFlags.getInt();

830 if (val)

831 f |= flag;

832 else

833 f &= ~flag;

834 SetterAndMethodRefFlags.setInt(f);

835 }

836};

837

838

839

841

843

844

845

846

847 enum { BASE, KEY, END_EXPR };

848 Stmt* SubExprs[END_EXPR];

849

851

852

853

855

856public:

860 : Expr(ObjCSubscriptRefExprClass, T, VK, OK), RBracket(RB),

861 GetAtIndexMethodDecl(getMethod), SetAtIndexMethodDecl(setMethod) {

862 SubExprs[BASE] = base;

863 SubExprs[KEY] = key;

865 }

866

868 : Expr(ObjCSubscriptRefExprClass, Empty) {}

869

872

875 }

876

878

881

884

886 return GetAtIndexMethodDecl;

887 }

888

890 return SetAtIndexMethodDecl;

891 }

892

895 }

896

898 return child_range(SubExprs, SubExprs+END_EXPR);

899 }

900

903 }

904

906 return T->getStmtClass() == ObjCSubscriptRefExprClass;

907 }

908

909private:

911};

912

913

914

915

916

917

918

919

920

921

922

923

924

925

926

927

928

929

930

931

932

933

934

935

936

937

938

940 : public Expr,

941 private llvm::TrailingObjects<ObjCMessageExpr, void *, SourceLocation> {

942public:

943

945

947

948

950

951

953

954

957

958private:

959

960

961

963

964 enum { NumArgsBitWidth = 16 };

965

966

967

968 unsigned NumArgs : NumArgsBitWidth;

969

970

971

972

973

975 unsigned Kind : 8;

976

977

978

979

980

981

982 LLVM_PREFERRED_TYPE(bool)

983 unsigned HasMethod : 1;

984

985

986

987 LLVM_PREFERRED_TYPE(bool)

988 unsigned IsDelegateInitCall : 1;

989

990

991

992 LLVM_PREFERRED_TYPE(bool)

993 unsigned IsImplicit : 1;

994

995

996

998 unsigned SelLocsKind : 2;

999

1000

1001

1002 SourceLocation SuperLoc;

1003

1004

1005

1006 SourceLocation LBracLoc, RBracLoc;

1007

1008 ObjCMessageExpr(EmptyShell Empty, unsigned NumArgs)

1009 : Expr(ObjCMessageExprClass, Empty), Kind(0), HasMethod(false),

1010 IsDelegateInitCall(false), IsImplicit(false), SelLocsKind(0) {

1011 setNumArgs(NumArgs);

1012 }

1013

1015 SourceLocation LBracLoc,

1016 SourceLocation SuperLoc,

1017 bool IsInstanceSuper,

1018 QualType SuperType,

1019 Selector Sel,

1020 ArrayRef SelLocs,

1022 ObjCMethodDecl *Method,

1023 ArrayRef<Expr *> Args,

1024 SourceLocation RBracLoc,

1027 SourceLocation LBracLoc,

1028 TypeSourceInfo *Receiver,

1029 Selector Sel,

1030 ArrayRef SelLocs,

1032 ObjCMethodDecl *Method,

1033 ArrayRef<Expr *> Args,

1034 SourceLocation RBracLoc,

1037 SourceLocation LBracLoc,

1038 Expr *Receiver,

1039 Selector Sel,

1040 ArrayRef SelLocs,

1042 ObjCMethodDecl *Method,

1043 ArrayRef<Expr *> Args,

1044 SourceLocation RBracLoc,

1046

1047 size_t numTrailingObjects(OverloadToken<void *>) const { return NumArgs + 1; }

1048

1049 void setNumArgs(unsigned Num) {

1050 assert((Num >> NumArgsBitWidth) == 0 && "Num of args is out of range!");

1051 NumArgs = Num;

1052 }

1053

1054 void initArgsAndSelLocs(ArrayRef<Expr *> Args,

1055 ArrayRef SelLocs,

1057

1058

1059 void *getReceiverPointer() const { return *getTrailingObjects<void *>(); }

1060

1061

1062 void setReceiverPointer(void *Value) {

1063 *getTrailingObjects<void *>() = Value;

1064 }

1065

1068 }

1069

1070 bool hasStandardSelLocs() const {

1072 }

1073

1074

1075

1076 SourceLocation *getStoredSelLocs() {

1077 return getTrailingObjects();

1078 }

1079 const SourceLocation *getStoredSelLocs() const {

1080 return getTrailingObjects();

1081 }

1082

1083

1084

1085 unsigned getNumStoredSelLocs() const {

1086 if (hasStandardSelLocs())

1087 return 0;

1089 }

1090

1091 static ObjCMessageExpr *alloc(const ASTContext &C,

1092 ArrayRef<Expr *> Args,

1093 SourceLocation RBraceLoc,

1094 ArrayRef SelLocs,

1095 Selector Sel,

1097 static ObjCMessageExpr *alloc(const ASTContext &C,

1098 unsigned NumArgs,

1099 unsigned NumStoredSelLocs);

1100

1101public:

1105

1106

1107

1108

1109

1110

1111

1112

1113

1114

1115

1116

1117

1118

1119

1120

1121

1122

1123

1124

1125

1126

1127

1128

1129

1130

1135 bool IsInstanceSuper,

1143

1144

1145

1146

1147

1148

1149

1150

1151

1152

1153

1154

1155

1156

1157

1158

1159

1160

1161

1162

1163

1164

1165

1166

1177

1178

1179

1180

1181

1182

1183

1184

1185

1186

1187

1188

1189

1190

1191

1192

1193

1194

1195

1196

1197

1198

1199

1200

1204 Expr *Receiver,

1211

1212

1213

1214

1215

1216

1217

1218

1220 unsigned NumArgs,

1221 unsigned NumStoredSelLocs);

1222

1223

1224

1225

1227

1228

1229

1231

1232

1233

1234

1235

1236

1238

1239

1241

1242

1243

1246 }

1247

1248

1249

1252 }

1253

1254

1255

1258 return static_cast<Expr *>(getReceiverPointer());

1259

1260 return nullptr;

1261 }

1264 }

1265

1266

1267

1270 setReceiverPointer(rec);

1271 }

1272

1273

1274

1277 return TSInfo->getType();

1278

1279 return {};

1280 }

1281

1282

1283

1286 return reinterpret_cast<TypeSourceInfo *>(getReceiverPointer());

1287 return nullptr;

1288 }

1289

1292 setReceiverPointer(TSInfo);

1293 }

1294

1295

1296

1299 return SuperLoc;

1300

1302 }

1303

1304

1305

1306

1307

1308

1309

1310

1311

1312

1314

1315

1316

1317

1318

1319

1320

1321

1322

1323

1324

1326

1327

1328

1329

1330

1331

1335

1337 }

1338

1341 SuperLoc = Loc;

1342 setReceiverPointer(T.getAsOpaquePtr());

1343 }

1344

1346

1348 HasMethod = false;

1349 SelectorOrMethod = reinterpret_cast<uintptr_t>(S.getAsOpaquePtr());

1350 }

1351

1353 if (HasMethod)

1354 return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod);

1355

1356 return nullptr;

1357 }

1358

1360 if (HasMethod)

1361 return reinterpret_cast<ObjCMethodDecl *>(SelectorOrMethod);

1362

1363 return nullptr;

1364 }

1365

1367 HasMethod = true;

1368 SelectorOrMethod = reinterpret_cast<uintptr_t>(MD);

1369 }

1370

1374 }

1375

1376

1377

1379

1380

1381

1383 return reinterpret_cast<Expr **>(getTrailingObjects<void *>() + 1);

1384 }

1386 return reinterpret_cast<const Expr *const *>(getTrailingObjects<void *>() +

1387 1);

1388 }

1389

1390

1392 assert(Arg < NumArgs && "Arg access out of range!");

1394 }

1396 assert(Arg < NumArgs && "Arg access out of range!");

1398 }

1399

1400

1402 assert(Arg < NumArgs && "Arg access out of range!");

1403 getArgs()[Arg] = ArgExpr;

1404 }

1405

1406

1407

1408

1411

1414

1419 }

1420

1423 if (hasStandardSelLocs())

1427 RBracLoc);

1428 return getStoredSelLocs()[Index];

1429 }

1430

1432

1435 return 0;

1438 return 1;

1440 }

1441

1444 RBracLoc = R.getEnd();

1445 }

1446

1449

1450

1452

1454

1457

1458 llvm::iterator_range<arg_iterator> arguments() {

1460 }

1461

1462 llvm::iterator_range<const_arg_iterator> arguments() const {

1464 }

1465

1467

1469 return reinterpret_cast<Stmt **>(getArgs() + NumArgs);

1470 }

1471

1473 return reinterpret_cast<Stmt const * const*>(getArgs());

1474 }

1475

1477 return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs);

1478 }

1479

1481 return T->getStmtClass() == ObjCMessageExprClass;

1482 }

1483};

1484

1485

1486

1488

1490

1491

1493

1494

1496

1497

1498 bool IsArrow;

1499

1500public:

1504 IsaMemberLoc(l), OpLoc(oploc), IsArrow(isarrow) {

1506 }

1507

1508

1510

1513

1514 bool isArrow() const { return IsArrow; }

1516

1517

1518

1521

1524

1527 }

1528

1531 }

1532

1534

1536

1537

1539

1542 }

1543

1545 return T->getStmtClass() == ObjCIsaExprClass;

1546 }

1547};

1548

1549

1550

1551

1552

1553

1554

1555

1556

1557

1558

1559

1560

1561

1562

1563

1564

1565

1566

1567

1568

1569

1570

1574

1575 Stmt *Operand;

1576

1577

1578

1580 : Expr(ObjCIndirectCopyRestoreExprClass, Empty) {}

1581

1582 void setShouldCopy(bool shouldCopy) {

1584 }

1585

1586public:

1589 Operand(operand) {

1592 }

1593

1596

1597

1598

1600

1602

1605 }

1606

1607

1609 return Operand->getBeginLoc();

1610 }

1612 return Operand->getEndLoc();

1613 }

1614

1617 }

1618

1620 return s->getStmtClass() == ObjCIndirectCopyRestoreExprClass;

1621 }

1622};

1623

1624

1625

1626

1627

1628

1629

1632 private llvm::TrailingObjects<ObjCBridgedCastExpr, CXXBaseSpecifier *> {

1636 friend TrailingObjects;

1637

1641 unsigned Kind : 2;

1642

1643public:

1649 LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}

1650

1651

1654

1656

1657

1660 }

1661

1662

1664

1665

1667

1669

1672 }

1673

1675 return T->getStmtClass() == ObjCBridgedCastExprClass;

1676 }

1677};

1678

1679

1680

1681

1682

1683

1684

1685

1686

1687

1688

1689

1690

1691

1694

1695 VersionTuple VersionToCheck;

1697

1698public:

1702 VersionToCheck(VersionToCheck), AtLoc(AtLoc), RParen(RParen) {

1704 }

1705

1707 : Expr(ObjCAvailabilityCheckExprClass, Shell) {}

1708

1712

1713

1714 bool hasVersion() const { return !VersionToCheck.empty(); }

1715 VersionTuple getVersion() const { return VersionToCheck; }

1716

1719 }

1720

1723 }

1724

1726 return T->getStmtClass() == ObjCAvailabilityCheckExprClass;

1727 }

1728};

1729

1730}

1731

1732#endif

enum clang::sema::@1725::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.

__device__ __2f16 float __ockl_bool s

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.

CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...

ExplicitCastExpr - An explicit cast written in the source code.

This represents one expression.

SourceLocation getExprLoc() const LLVM_READONLY

getExprLoc - Return the preferred location for the arrow when diagnosing a problem with a generic exp...

void setDependence(ExprDependence Deps)

Each concrete expr subclass is expected to compute its dependence and call this in the constructor.

ObjCArrayLiteral - used for objective-c array containers; as in: @["Hello", NSApp,...

Expr * getElement(unsigned Index)

getElement - Return the Element at the specified index.

const Expr *const * getElements() const

Retrieve elements of array of literals.

static ObjCArrayLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements)

const_child_range children() const

SourceLocation getBeginLoc() const LLVM_READONLY

Expr ** getElements()

Retrieve elements of array of literals.

unsigned getNumElements() const

getNumElements - Return number of elements of objective-c array literal.

const Expr * getElement(unsigned Index) const

SourceRange getSourceRange() const LLVM_READONLY

ObjCMethodDecl * getArrayWithObjectsMethod() const

SourceLocation getEndLoc() const LLVM_READONLY

static bool classof(const Stmt *T)

A runtime availability query.

bool hasVersion() const

This may be '*', in which case this should fold to true.

const_child_range children() const

static bool classof(const Stmt *T)

ObjCAvailabilityCheckExpr(EmptyShell Shell)

SourceRange getSourceRange() const

SourceLocation getBeginLoc() const

SourceLocation getEndLoc() const

VersionTuple getVersion() const

ObjCAvailabilityCheckExpr(VersionTuple VersionToCheck, SourceLocation AtLoc, SourceLocation RParen, QualType Ty)

ObjCBoolLiteralExpr - Objective-C Boolean Literal.

SourceLocation getEndLoc() const LLVM_READONLY

void setLocation(SourceLocation L)

SourceLocation getBeginLoc() const LLVM_READONLY

SourceLocation getLocation() const

const_child_range children() const

ObjCBoolLiteralExpr(bool val, QualType Ty, SourceLocation l)

static bool classof(const Stmt *T)

ObjCBoolLiteralExpr(EmptyShell Empty)

ObjCBoxedExpr - used for generalized expression boxing.

const_arg_iterator arg_begin() const

const Expr * getSubExpr() const

SourceLocation getAtLoc() const

ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, SourceRange R)

SourceRange getSourceRange() const LLVM_READONLY

static bool classof(const Stmt *T)

ObjCBoxedExpr(EmptyShell Empty)

const_child_range children() const

ObjCMethodDecl * getBoxingMethod() const

SourceLocation getBeginLoc() const LLVM_READONLY

const_arg_iterator arg_end() const

bool isExpressibleAsConstantInitializer() const

SourceLocation getEndLoc() const LLVM_READONLY

An Objective-C "bridged" cast expression, which casts between Objective-C pointers and C pointers,...

SourceLocation getEndLoc() const LLVM_READONLY

ObjCBridgedCastExpr(EmptyShell Shell)

Construct an empty Objective-C bridged cast.

StringRef getBridgeKindName() const

Retrieve the kind of bridge being performed as a string.

SourceLocation getLParenLoc() const

static bool classof(const Stmt *T)

SourceLocation getBridgeKeywordLoc() const

The location of the bridge keyword.

ObjCBridgeCastKind getBridgeKind() const

Determine which kind of bridge is being performed via this cast.

ObjCBridgedCastExpr(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, CastKind CK, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *Operand)

SourceLocation getBeginLoc() const LLVM_READONLY

ObjCDictionaryLiteral - AST node to represent objective-c dictionary literals; as in:"name" : NSUserN...

static ObjCDictionaryLiteral * CreateEmpty(const ASTContext &C, unsigned NumElements, bool HasPackExpansions)

const_child_range children() const

unsigned getNumElements() const

getNumElements - Return number of elements of objective-c dictionary literal.

ObjCMethodDecl * getDictWithObjectsMethod() const

ObjCDictionaryElement getKeyValueElement(unsigned Index) const

SourceLocation getBeginLoc() const LLVM_READONLY

SourceLocation getEndLoc() const LLVM_READONLY

SourceRange getSourceRange() const LLVM_READONLY

static bool classof(const Stmt *T)

ObjCEncodeExpr, used for @encode in Objective-C.

void setEncodedTypeSourceInfo(TypeSourceInfo *EncType)

TypeSourceInfo * getEncodedTypeSourceInfo() const

const_child_range children() const

SourceLocation getBeginLoc() const LLVM_READONLY

SourceLocation getRParenLoc() const

void setRParenLoc(SourceLocation L)

static bool classof(const Stmt *T)

QualType getEncodedType() const

SourceLocation getEndLoc() const LLVM_READONLY

void setAtLoc(SourceLocation L)

ObjCEncodeExpr(QualType T, TypeSourceInfo *EncodedType, SourceLocation at, SourceLocation rp)

SourceLocation getAtLoc() const

ObjCEncodeExpr(EmptyShell Empty)

ObjCIndirectCopyRestoreExpr - Represents the passing of a function argument by indirect copy-restore ...

const Expr * getSubExpr() const

SourceLocation getEndLoc() const LLVM_READONLY

static bool classof(const Stmt *s)

bool shouldCopy() const

shouldCopy - True if we should do the 'copy' part of the copy-restore.

SourceLocation getExprLoc() const LLVM_READONLY

ObjCIndirectCopyRestoreExpr(Expr *operand, QualType type, bool shouldCopy)

const_child_range children() const

SourceLocation getBeginLoc() const LLVM_READONLY

Represents an ObjC class declaration.

ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.

SourceLocation getIsaMemberLoc() const

getMemberLoc - Return the location of the "member", in X->F, it is the location of 'F'.

ObjCIsaExpr(EmptyShell Empty)

Build an empty expression.

SourceLocation getOpLoc() const

void setIsaMemberLoc(SourceLocation L)

static bool classof(const Stmt *T)

SourceLocation getBaseLocEnd() const LLVM_READONLY

void setOpLoc(SourceLocation L)

SourceLocation getExprLoc() const LLVM_READONLY

SourceLocation getEndLoc() const LLVM_READONLY

const_child_range children() const

SourceLocation getBeginLoc() const LLVM_READONLY

ObjCIsaExpr(Expr *base, bool isarrow, SourceLocation l, SourceLocation oploc, QualType ty)

ObjCIvarDecl - Represents an ObjC instance variable.

ObjCIvarRefExpr - A reference to an ObjC instance variable.

SourceLocation getBeginLoc() const LLVM_READONLY

SourceLocation getLocation() const

SourceLocation getOpLoc() const

void setDecl(ObjCIvarDecl *d)

ObjCIvarRefExpr(EmptyShell Empty)

void setIsFreeIvar(bool A)

void setOpLoc(SourceLocation L)

SourceLocation getEndLoc() const LLVM_READONLY

const_child_range children() const

const ObjCIvarDecl * getDecl() const

const Expr * getBase() const

void setLocation(SourceLocation L)

static bool classof(const Stmt *T)

ObjCIvarRefExpr(ObjCIvarDecl *d, QualType t, SourceLocation l, SourceLocation oploc, Expr *base, bool arrow=false, bool freeIvar=false)

An expression that sends a message to the given Objective-C object or class.

const Expr * getArg(unsigned Arg) const

Expr * getArg(unsigned Arg)

getArg - Return the specified argument.

void getSelectorLocs(SmallVectorImpl< SourceLocation > &SelLocs) const

bool isImplicit() const

Indicates whether the message send was implicitly generated by the implementation.

llvm::iterator_range< const_arg_iterator > arguments() const

static ObjCMessageExpr * CreateEmpty(const ASTContext &Context, unsigned NumArgs, unsigned NumStoredSelLocs)

Create an empty Objective-C message expression, to be filled in by subsequent calls.

void setMethodDecl(ObjCMethodDecl *MD)

Expr ** getArgs()

Retrieve the arguments to this message, not including the receiver.

bool isDelegateInitCall() const

isDelegateInitCall - Answers whether this message send has been tagged as a "delegate init call",...

ObjCMethodDecl * getMethodDecl()

void setClassReceiver(TypeSourceInfo *TSInfo)

void setInstanceReceiver(Expr *rec)

Turn this message send into an instance message that computes the receiver object with the given expr...

const_arg_iterator arg_end() const

SourceLocation getBeginLoc() const LLVM_READONLY

void setSuper(SourceLocation Loc, QualType T, bool IsInstanceSuper)

SourceLocation getLeftLoc() const

Expr * getInstanceReceiver()

Returns the object expression (receiver) for an instance message, or null for a message that is not a...

QualType getCallReturnType(ASTContext &Ctx) const

SourceLocation getSuperLoc() const

Retrieve the location of the 'super' keyword for a class or instance message to 'super',...

ObjCMethodFamily getMethodFamily() const

Selector getSelector() const

ReceiverKind

The kind of receiver this message is sending to.

@ SuperInstance

The receiver is the instance of the superclass object.

@ Instance

The receiver is an object instance.

@ SuperClass

The receiver is a superclass.

@ Class

The receiver is a class.

TypeSourceInfo * getClassReceiverTypeInfo() const

Returns a type-source information of a class message send, or nullptr if the message is not a class m...

QualType getClassReceiver() const

Returns the type of a class message send, or NULL if the message is not a class message.

void setDelegateInitCall(bool isDelegate)

bool isInstanceMessage() const

Determine whether this is an instance message to either a computed object or to super.

llvm::iterator_range< arg_iterator > arguments()

ObjCInterfaceDecl * getReceiverInterface() const

Retrieve the Objective-C interface to which this message is being directed, if known.

QualType getSuperType() const

Retrieve the type referred to by 'super'.

const ObjCMethodDecl * getMethodDecl() const

SourceRange getReceiverRange() const

Source range of the receiver.

bool isClassMessage() const

Determine whether this is an class message to either a specified class or to super.

const Expr * getInstanceReceiver() const

unsigned getNumSelectorLocs() const

const Expr *const * getArgs() const

ReceiverKind getReceiverKind() const

Determine the kind of receiver that this message is being sent to.

SourceLocation getEndLoc() const LLVM_READONLY

QualType getReceiverType() const

Retrieve the receiver type to which this message is being directed.

SourceLocation getSelectorLoc(unsigned Index) const

SourceLocation getSelectorStartLoc() const

static bool classof(const Stmt *T)

void setSourceRange(SourceRange R)

SourceLocation getRightLoc() const

unsigned getNumArgs() const

Return the number of actual arguments in this message, not counting the receiver.

void setSelector(Selector S)

void setArg(unsigned Arg, Expr *ArgExpr)

setArg - Set the specified argument.

const_arg_iterator arg_begin() const

ObjCMethodDecl - Represents an instance or class method declaration.

Selector getSelector() const

ObjCMethodFamily getMethodFamily() const

Determines the family of this method.

Represents one property declaration in an Objective-C interface.

Selector getSetterName() const

Selector getGetterName() const

ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.

bool isMessagingGetter() const

True if the property reference will result in a message to the getter.

ObjCPropertyDecl * getExplicitProperty() const

Selector getSetterSelector() const

bool isMessagingSetter() const

True if the property reference will result in a message to the setter.

ObjCMethodDecl * getImplicitPropertyGetter() const

ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, SourceLocation ReceiverLoc, ObjCInterfaceDecl *Receiver)

ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, Expr *Base)

void setIsMessagingSetter(bool val=true)

SourceLocation getReceiverLocation() const

const Expr * getBase() const

const_child_range children() const

static bool classof(const Stmt *T)

bool isObjectReceiver() const

bool isExplicitProperty() const

SourceLocation getBeginLoc() const LLVM_READONLY

void setIsMessagingGetter(bool val=true)

QualType getSuperReceiverType() const

bool isImplicitProperty() const

SourceLocation getEndLoc() const LLVM_READONLY

ObjCMethodDecl * getImplicitPropertySetter() const

ObjCInterfaceDecl * getClassReceiver() const

SourceLocation getLocation() const

ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, Expr *base)

ObjCPropertyRefExpr(ObjCMethodDecl *Getter, ObjCMethodDecl *Setter, QualType T, ExprValueKind VK, ExprObjectKind OK, SourceLocation IdLoc, SourceLocation SuperLoc, QualType SuperTy)

Selector getGetterSelector() const

ObjCPropertyRefExpr(EmptyShell Empty)

QualType getReceiverType(const ASTContext &ctx) const

Determine the type of the base, regardless of the kind of receiver.

ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ExprValueKind VK, ExprObjectKind OK, SourceLocation l, SourceLocation sl, QualType st)

bool isClassReceiver() const

bool isSuperReceiver() const

Represents an Objective-C protocol declaration.

ObjCProtocolExpr used for protocol expression in Objective-C.

SourceLocation getBeginLoc() const LLVM_READONLY

ObjCProtocolDecl * getProtocol() const

ObjCProtocolExpr(QualType T, ObjCProtocolDecl *protocol, SourceLocation at, SourceLocation protoLoc, SourceLocation rp)

SourceLocation getProtocolIdLoc() const

const_child_range children() const

void setProtocol(ObjCProtocolDecl *P)

void setRParenLoc(SourceLocation L)

void setAtLoc(SourceLocation L)

SourceLocation getRParenLoc() const

static bool classof(const Stmt *T)

SourceLocation getAtLoc() const

ObjCProtocolExpr(EmptyShell Empty)

SourceLocation getEndLoc() const LLVM_READONLY

ObjCSelectorExpr used for @selector in Objective-C.

static bool classof(const Stmt *T)

SourceLocation getBeginLoc() const LLVM_READONLY

void setSelector(Selector S)

unsigned getNumArgs() const

getNumArgs - Return the number of actual arguments to this call.

ObjCSelectorExpr(EmptyShell Empty)

ObjCSelectorExpr(QualType T, Selector selInfo, SourceLocation at, SourceLocation rp)

void setAtLoc(SourceLocation L)

SourceLocation getRParenLoc() const

const_child_range children() const

Selector getSelector() const

SourceLocation getEndLoc() const LLVM_READONLY

void setRParenLoc(SourceLocation L)

SourceLocation getAtLoc() const

ObjCStringLiteral, used for Objective-C string literals i.e.

SourceLocation getEndLoc() const LLVM_READONLY

const StringLiteral * getString() const

SourceLocation getAtLoc() const

void setAtLoc(SourceLocation L)

void setString(StringLiteral *S)

const_child_range children() const

ObjCStringLiteral(EmptyShell Empty)

static bool classof(const Stmt *T)

StringLiteral * getString()

SourceLocation getBeginLoc() const LLVM_READONLY

ObjCStringLiteral(StringLiteral *SL, QualType T, SourceLocation L)

ObjCSubscriptRefExpr - used for array and dictionary subscripting.

SourceLocation getBeginLoc() const LLVM_READONLY

Expr * getKeyExpr() const

SourceLocation getEndLoc() const LLVM_READONLY

void setRBracket(SourceLocation RB)

bool isArraySubscriptRefExpr() const

ObjCSubscriptRefExpr(EmptyShell Empty)

ObjCSubscriptRefExpr(Expr *base, Expr *key, QualType T, ExprValueKind VK, ExprObjectKind OK, ObjCMethodDecl *getMethod, ObjCMethodDecl *setMethod, SourceLocation RB)

static bool classof(const Stmt *T)

void setBaseExpr(Stmt *S)

Expr * getBaseExpr() const

const_child_range children() const

ObjCMethodDecl * getAtIndexMethodDecl() const

SourceLocation getRBracket() const

ObjCMethodDecl * setAtIndexMethodDecl() const

A (possibly-)qualified type.

static QualType getFromOpaquePtr(const void *Ptr)

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

ObjCMethodFamily getMethodFamily() const

Derive the conventional family of this method.

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.

SourceLocation getEnd() const

SourceLocation getBegin() const

Stmt - This represents one statement.

SourceLocation getEndLoc() const LLVM_READONLY

StmtIterator child_iterator

Child Iterators: All subclasses must implement 'children' to permit easy iteration over the substatem...

ConstCastIterator< Expr > ConstExprIterator

llvm::iterator_range< child_iterator > child_range

ConstStmtIterator const_child_iterator

ObjCIndirectCopyRestoreExprBitfields ObjCIndirectCopyRestoreExprBits

SourceLocation getBeginLoc() const LLVM_READONLY

llvm::iterator_range< const_child_iterator > const_child_range

CastIterator< Expr > ExprIterator

StringLiteral - This represents a string literal expression, e.g.

A container of type source information.

QualType getType() const

Return the type wrapped by this type source info.

bool isSpecificPlaceholderType(unsigned K) const

Test for a specific placeholder type.

bool isIntegralOrEnumerationType() const

Determine whether this type is an integral or enumeration type.

const internal::VariadicAllOfMatcher< Type > type

Matches Types in the clang AST.

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.

ExprObjectKind

A further classification of the kind of object referenced by an l-value or x-value.

@ OK_Ordinary

An ordinary object is located at an address in memory.

@ OK_BitField

A bitfield object is a bitfield on a C or C++ record.

ExprDependence computeDependence(FullExpr *E)

@ Create

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

ObjCMethodFamily

A family of Objective-C methods.

@ Result

The result type of a method or function.

ObjCBridgeCastKind

The kind of bridging performed by the Objective-C bridge cast.

CastKind

CastKind - The kind of operation required for a conversion.

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

ExprValueKind

The categorization of expression values, currently following the C++11 scheme.

@ VK_PRValue

A pr-value expression (in the C++11 taxonomy) produces a temporary value.

@ VK_LValue

An l-value expression is a reference to an object with independent storage.

const FunctionProtoType * T

__UINTPTR_TYPE__ uintptr_t

An unsigned integer type with the property that any valid pointer to void can be converted to this ty...

An element in an Objective-C dictionary literal.

Expr * Value

The value of the dictionary element.

bool isPackExpansion() const

Determines whether this dictionary element is a pack expansion.

SourceLocation EllipsisLoc

The location of the ellipsis, if this is a pack expansion.

std::optional< unsigned > NumExpansions

The number of elements this pack expansion will expand to, if this is a pack expansion and is known.

Expr * Key

The key for the dictionary element.

Internal struct to describes an element that is a pack expansion, used if any of the elements in the ...

SourceLocation EllipsisLoc

The location of the ellipsis, if this element is a pack expansion.

unsigned NumExpansionsPlusOne

If non-zero, the number of elements that this pack expansion will expand to (+1).

Internal struct for storing Key/value pair.

Iterator for iterating over Stmt * arrays that contain only T *.

A placeholder type used to construct an empty shell of a type, that will be filled in later (e....