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

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_AST_TYPELOC_H

15#define LLVM_CLANG_AST_TYPELOC_H

16

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

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

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

28#include "llvm/Support/MathExtras.h"

29#include

30#include

31#include

32#include

33

35

36class Attr;

37class ASTContext;

38class CXXRecordDecl;

39class ConceptDecl;

40class Expr;

41class ObjCInterfaceDecl;

42class ObjCProtocolDecl;

43class ObjCTypeParamDecl;

44class ParmVarDecl;

45class TemplateTypeParmDecl;

46class UnqualTypeLoc;

47class UnresolvedUsingTypenameDecl;

48

49

50#define ABSTRACT_TYPELOC(Class, Base)

51#define TYPELOC(Class, Base) \

52 class Class##TypeLoc;

53#include "clang/AST/TypeLocNodes.def"

54

55

56

57

58

60protected:

61

62

63 const void *Ty = nullptr;

65

66public:

69 : Ty(ty.getAsOpaquePtr()), Data(opaqueData) {}

71 : Ty(ty), Data(opaqueData) {}

72

73

74

75

76

77 template

79 assert(T::isKind(*this));

80 T t;

82 tl = *this;

83 return t;

84 }

85

86

87

88 template

90 if (!T::isKind(*this))

91 return {};

92 T t;

94 tl = *this;

95 return t;

96 }

97

98

99

100

101

102 template

104

105

106

107

109#define ABSTRACT_TYPE(Class, Base)

110#define TYPE(Class, Base) \

111 Class = Type::Class,

112#include "clang/AST/TypeNodes.inc"

115

119 }

120

122 explicit operator bool() const { return Ty; }

123

124

126

127

128

130

131

132

135 }

136

139 }

140

141

144 }

145

146

148

149

151

152

155 }

156

157

158

160 return getLocalSourceRangeImpl(*this);

161 }

162

163

166 }

167

168

169

171 return getNextTypeLocImpl(*this);

172 }

173

174

176

178

179

180

181

182

183

184

186

187

188

189

191

192

194

195

196

197

198

199

201 initializeImpl(Context, *this, Loc);

202 }

203

204

205

209 }

210

211

212

213

218 }

219

220

222

224 return LHS.Ty == RHS.Ty && LHS.Data == RHS.Data;

225 }

226

228 return !(LHS == RHS);

229 }

230

231

232

234

235 void dump() const;

236 void dump(llvm::raw_ostream &, const ASTContext &) const;

237

238private:

239 static bool isKind(const TypeLoc&) {

240 return true;

241 }

242

243 static void initializeImpl(ASTContext &Context, TypeLoc TL,

244 SourceLocation Loc);

247 static SourceRange getLocalSourceRangeImpl(TypeLoc TL);

248};

249

250inline TypeSourceInfo::TypeSourceInfo(QualType ty, size_t DataSize) : Ty(ty) {

251

252 memset(static_cast<void *>(this + 1), 0, DataSize);

253}

254

255

257

258 return TypeLoc(Ty, const_cast<void*>(static_cast<const void*>(this + 1)));

259}

260

261

262

264public:

267

269 return reinterpret_cast<const Type*>(Ty);

270 }

271

274 }

275

276private:

278

279 static bool isKind(const TypeLoc &TL) {

281 }

282};

283

284

285

286

287

288

290public:

292

294 unsigned align =

296 auto dataInt = reinterpret_cast<uintptr_t>(Data);

297 dataInt = llvm::alignTo(dataInt, align);

299 }

300

301

302

304

305 }

306

308

309 }

310

313 }

314

315

316

318

319

320 return 0;

321 }

322

323

324

326

327 return 1;

328 }

329

330private:

332

333 static bool isKind(const TypeLoc &TL) {

335 }

336};

337

340 return Loc.getUnqualifiedLoc();

341 return castAs();

342}

343

344

345

346

347

348

349

350

351

352

353

354

355

356

357

358

359

360

361

362

363

364

365

366

367

368

369

370

371

372template <class Base, class Derived, class TypeClass, class LocalData>

375

376 const Derived *asDerived() const {

377 return static_cast<const Derived*>(this);

378 }

379

380 static bool isKind(const TypeLoc &TL) {

382 Derived::classofType(TL.getTypePtr());

383 }

384

385 static bool classofType(const Type *Ty) {

386 return TypeClass::classof(Ty);

387 }

388

389public:

391 return std::max(unsigned(alignof(LocalData)),

393 }

394

396 unsigned size = sizeof(LocalData);

397 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();

398 size = llvm::alignTo(size, extraAlign);

399 size += asDerived()->getExtraLocalDataSize();

401 return size;

402 }

403

405

407

408

410

411

412

413

416 }

417

420 }

421

423 return cast(Base::getTypePtr());

424 }

425

426protected:

428 return 0;

429 }

430

432 return 1;

433 }

434

436 return static_cast<LocalData*>(Base::Data);

437 }

438

439

440

441

443 unsigned size = sizeof(LocalData);

444 unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();

445 size = llvm::alignTo(size, extraAlign);

446 return reinterpret_cast<char *>(Base::Data) + size;

447 }

448

450 auto data = reinterpret_cast<uintptr_t>(Base::Data);

451 data += asDerived()->getLocalDataSize();

452 data = llvm::alignTo(data, getNextTypeAlign());

453 return reinterpret_cast<void*>(data);

454 }

455

458

461 }

462

463private:

464 unsigned getInnerTypeSize() const {

465 return getInnerTypeSize(asDerived()->getInnerType());

466 }

467

468 unsigned getInnerTypeSize(HasNoInnerType _) const {

469 return 0;

470 }

471

472 unsigned getInnerTypeSize(QualType _) const {

474 }

475

476 unsigned getNextTypeAlign() const {

477 return getNextTypeAlign(asDerived()->getInnerType());

478 }

479

480 unsigned getNextTypeAlign(HasNoInnerType _) const {

481 return 1;

482 }

483

484 unsigned getNextTypeAlign(QualType T) const {

486 }

487

489

492 }

493};

494

495

496

497

498template <class Base, class Derived, class TypeClass>

501

502 static bool classofType(const Type *Ty) {

503 return TypeClass::classof(Ty);

504 }

505

506 static bool isKind(const TypeLoc &TL) {

508 Derived::classofType(TL.getTypePtr());

509 }

510 static bool isKind(const UnqualTypeLoc &TL) {

511 return Derived::classofType(TL.getTypePtr());

512 }

513

514public:

516 return cast(Base::getTypePtr());

517 }

518};

519

522};

523

524

525

527 TypeSpecTypeLoc,

528 Type,

529 TypeSpecLocInfo> {

530public:

531 enum {

535

538 }

539

542 }

543

546 }

547

550 }

551

552private:

554

555 static bool isKind(const TypeLoc &TL);

556};

557

560};

561

562

564 BuiltinTypeLoc,

565 BuiltinType,

566 BuiltinLocInfo> {

567public:

570 }

571

574 }

575

579 BuiltinRange = Range;

580 } else {

582 BuiltinRange.setEnd(std::max(Range.getEnd(), BuiltinRange.getEnd()));

583 }

584 }

585

587

590 }

593 }

594

597 return (bk >= BuiltinType::UShort && bk <= BuiltinType::UInt128) ||

598 (bk >= BuiltinType::Short && bk <= BuiltinType::Ibm128) ||

599 bk == BuiltinType::UChar || bk == BuiltinType::SChar;

600 }

601

604 }

605

608 }

609

612 }

613

617 else

619 }

620

623 }

624

628 }

629

633 else

635 }

636

639 }

640

644 }

645

647

650 }

651

655 }

656

660 else

661 return false;

662 }

663

667 }

668

677 }

678 }

679};

680

681

683 UsingTypeLoc, UsingType> {

684public:

687 }

689};

690

691

693 TypedefTypeLoc,

694 TypedefType> {

695public:

698 }

699};

700

701

702

705 InjectedClassNameTypeLoc,

706 InjectedClassNameType> {

707public:

710 }

711};

712

713

716 UnresolvedUsingTypeLoc,

717 UnresolvedUsingType> {

718public:

721 }

722};

723

724

725

726

727

728

730 TagTypeLoc,

731 TagType> {

732public:

734

735

737};

738

739

741 RecordTypeLoc,

742 RecordType> {

743public:

745};

746

747

749 EnumTypeLoc,

750 EnumType> {

751public:

753};

754

755

758 TemplateTypeParmTypeLoc,

759 TemplateTypeParmType> {

760public:

762};

763

766};

767

768

769

771 ObjCTypeParamTypeLoc,

772 ObjCTypeParamType,

773 ObjCTypeParamTypeLocInfo> {

774

777 }

778

779public:

781

784 }

785

788 }

789

794 }

795

798 }

799

804 }

805

808 }

809

812 }

813

815 assert(i < getNumProtocols() && "Index is out of bounds!");

816 return getProtocolLocArray()[i];

817 }

818

820 assert(i < getNumProtocols() && "Index is out of bounds!");

821 getProtocolLocArray()[i] = Loc;

822 }

823

825 assert(i < getNumProtocols() && "Index is out of bounds!");

827 }

828

831 }

832

834

837

838

840 }

841

844 }

845

851 }

852};

853

854

857 SubstTemplateTypeParmTypeLoc,

858 SubstTemplateTypeParmType> {

859};

860

861

864 SubstTemplateTypeParmPackTypeLoc,

865 SubstTemplateTypeParmPackType> {

866};

867

870};

871

872

874 AttributedTypeLoc,

875 AttributedType,

876 AttributedLocInfo> {

877public:

880 }

881

884 }

885

886

887

888

889

892 }

893

896 }

897

898

901 }

904 }

905

907 return dyn_cast_or_null(getAttr());

908 }

909

911

914 }

915

918 }

919};

920

922

923

925 : public ConcreteTypeLoc<UnqualTypeLoc, BTFTagAttributedTypeLoc,

926 BTFTagAttributedType, BTFTagAttributedLocInfo> {

927public:

929

930

932

934 return dyn_cast_or_null(getAttr());

935 }

936

938

940

942};

943

947};

948

949

951 : public ConcreteTypeLoc<UnqualTypeLoc, HLSLAttributedResourceTypeLoc,

952 HLSLAttributedResourceType,

953 HLSLAttributedResourceLocInfo> {

954public:

956

959 }

962 }

963

968 }

972 }

973};

974

981};

982

983

984

985

986

987

989 ObjCObjectTypeLoc,

990 ObjCObjectType,

991 ObjCObjectTypeLocInfo> {

992

995 }

996

997

998

1001 }

1002

1003public:

1006 }

1007

1010 }

1011

1014 }

1015

1018 }

1019

1022 }

1023

1025 assert(i < getNumTypeArgs() && "Index is out of bounds!");

1026 return getTypeArgLocArray()[i];

1027 }

1028

1030 assert(i < getNumTypeArgs() && "Index is out of bounds!");

1031 getTypeArgLocArray()[i] = TInfo;

1032 }

1033

1036 }

1037

1040 }

1041

1044 }

1045

1048 }

1049

1052 }

1053

1055 assert(i < getNumProtocols() && "Index is out of bounds!");

1056 return getProtocolLocArray()[i];

1057 }

1058

1060 assert(i < getNumProtocols() && "Index is out of bounds!");

1061 getProtocolLocArray()[i] = Loc;

1062 }

1063

1065 assert(i < getNumProtocols() && "Index is out of bounds!");

1067 }

1068

1069

1072 }

1073

1076 }

1077

1080 }

1081

1084 }

1085

1094 }

1095

1097

1101 }

1102

1105 "not enough alignment for tail-allocated data");

1107 }

1108

1111 }

1112};

1113

1117};

1118

1119

1121 ObjCInterfaceTypeLoc,

1122 ObjCInterfaceType,

1123 ObjCInterfaceLocInfo> {

1124public:

1127 }

1128

1131 }

1132

1135 }

1136

1139 }

1140

1143 }

1144

1147 }

1148

1152 }

1153};

1154

1157 : public ConcreteTypeLoc<UnqualTypeLoc, BoundsAttributedTypeLoc,

1158 BoundsAttributedType, BoundsAttributedLocInfo> {

1159public:

1163

1164 }

1165

1167};

1168

1171 CountAttributedTypeLoc,

1172 CountAttributedType> {

1173public:

1177

1179};

1180

1183};

1184

1186 : public ConcreteTypeLoc<UnqualTypeLoc, MacroQualifiedTypeLoc,

1187 MacroQualifiedType, MacroQualifiedLocInfo> {

1188public:

1191 }

1192

1194

1197 }

1198

1201 }

1202

1205 }

1206

1208

1211 }

1212};

1213

1217};

1218

1220 : public ConcreteTypeLoc<UnqualTypeLoc, ParenTypeLoc, ParenType,

1221 ParenLocInfo> {

1222public:

1225 }

1226

1229 }

1230

1233 }

1234

1237 }

1238

1241 }

1242

1246 }

1247

1250 }

1251

1254 }

1255};

1256

1258 if (ParenTypeLoc::isKind(*this))

1259 return IgnoreParensImpl(*this);

1260 return *this;

1261}

1262

1264

1266 AdjustedType, AdjustedLocInfo> {

1267public:

1270 }

1271

1273

1274 }

1275

1277

1278

1280 }

1281

1283

1285

1286

1287 return 0;

1288 }

1289};

1290

1291

1292

1294 AdjustedTypeLoc, DecayedTypeLoc, DecayedType> {

1295};

1296

1299};

1300

1301

1302template <class Derived, class TypeClass, class LocalData = PointerLikeLocInfo>

1304 TypeClass, LocalData> {

1305public:

1308 }

1309

1312 }

1313

1316 }

1317

1320 }

1321

1324 }

1325

1327 return this->getTypePtr()->getPointeeType();

1328 }

1329};

1330

1331

1333 PointerType> {

1334public:

1337 }

1338

1341 }

1342};

1343

1344

1346 BlockPointerType> {

1347public:

1350 }

1351

1354 }

1355};

1356

1359};

1360

1361

1363 MemberPointerType,

1364 MemberPointerLocInfo> {

1365public:

1368 }

1369

1372 }

1373

1376 }

1377

1380 }

1381

1384 }

1385

1389 }

1390

1394 else

1396 }

1397};

1398

1399

1402 ObjCObjectPointerType> {

1403public:

1406 }

1407

1410 }

1411};

1412

1414 ReferenceType> {

1415public:

1417 return getTypePtr()->getPointeeTypeAsWritten();

1418 }

1419};

1420

1423 LValueReferenceTypeLoc,

1424 LValueReferenceType> {

1425public:

1428 }

1429

1432 }

1433};

1434

1437 RValueReferenceTypeLoc,

1438 RValueReferenceType> {

1439public:

1442 }

1443

1446 }

1447};

1448

1454};

1455

1456

1458 FunctionTypeLoc,

1459 FunctionType,

1460 FunctionLocInfo> {

1461 bool hasExceptionSpec() const {

1462 if (auto *FPT = dyn_cast(getTypePtr())) {

1463 return FPT->hasExceptionSpec();

1464 }

1465 return false;

1466 }

1467

1468 SourceRange *getExceptionSpecRangePtr() const {

1469 assert(hasExceptionSpec() && "No exception spec range");

1470

1471

1473 }

1474

1475public:

1478 }

1479

1482 }

1483

1486 }

1487

1490 }

1491

1494 }

1495

1498 }

1499

1502 }

1503

1506 }

1507

1510 }

1511

1513 if (hasExceptionSpec())

1514 return *getExceptionSpecRangePtr();

1515 return {};

1516 }

1517

1519 if (hasExceptionSpec())

1520 *getExceptionSpecRangePtr() = R;

1521 }

1522

1525 }

1526

1527

1530 }

1531

1533 if (isa(getTypePtr()))

1534 return 0;

1535 return cast(getTypePtr())->getNumParams();

1536 }

1537

1540

1543 }

1544

1547 }

1548

1554 for (unsigned i = 0, e = getNumParams(); i != e; ++i)

1556 if (hasExceptionSpec())

1558 }

1559

1560

1561

1563 unsigned ExceptSpecSize = hasExceptionSpec() ? sizeof(SourceRange) : 0;

1565 }

1566

1568

1570};

1571

1574 FunctionProtoTypeLoc,

1575 FunctionProtoType> {

1576};

1577

1580 FunctionNoProtoTypeLoc,

1581 FunctionNoProtoType> {

1582};

1583

1587};

1588

1589

1591 ArrayTypeLoc,

1592 ArrayType,

1593 ArrayLocInfo> {

1594public:

1597 }

1598

1601 }

1602

1605 }

1606

1609 }

1610

1613 }

1614

1617 }

1618

1621 }

1622

1625 }

1626

1629 }

1630

1635 }

1636

1638};

1639

1642 ConstantArrayTypeLoc,

1643 ConstantArrayType> {

1644};

1645

1646

1649 ConstantArrayTypeLoc, ArrayParameterTypeLoc, ArrayParameterType> {};

1650

1653 IncompleteArrayTypeLoc,

1654 IncompleteArrayType> {

1655};

1656

1659 DependentSizedArrayTypeLoc,

1660 DependentSizedArrayType> {

1661public:

1665 }

1666};

1667

1670 VariableArrayTypeLoc,

1671 VariableArrayType> {

1672};

1673

1674

1677};

1678

1683};

1684

1687 TemplateSpecializationTypeLoc,

1688 TemplateSpecializationType,

1689 TemplateSpecializationLocInfo> {

1690public:

1693 }

1694

1697 }

1698

1701 }

1702

1705 }

1706

1709 }

1710

1713 }

1714

1717 }

1718

1720 getArgInfos()[i] = AI;

1721 }

1722

1724 return getArgInfos()[i];

1725 }

1726

1730 }

1731

1734 }

1735

1738 }

1739

1740

1743 assert(size == Loc.getFullDataSize());

1744

1745

1746

1747

1748

1750 }

1751

1755 else

1757 }

1758

1765 getArgInfos(), Loc);

1766 }

1767

1772

1775 }

1776

1779 }

1780

1781private:

1784 }

1785};

1786

1791};

1792

1795 DependentAddressSpaceTypeLoc,

1796 DependentAddressSpaceType,

1797 DependentAddressSpaceLocInfo> {

1798public:

1799

1800

1801

1804 }

1807 }

1808

1809

1810

1811

1814 }

1817 }

1818

1819

1820

1821

1822

1825 }

1828 }

1829

1833 return range;

1834 }

1835

1836

1837

1838

1839

1842 }

1843

1846 }

1847

1853 }

1854};

1855

1856

1857

1858

1859

1860

1861

1862

1863

1866};

1867

1869 VectorType, VectorTypeLocInfo> {

1870public:

1872

1874

1877 }

1878

1881 }

1882

1884

1886};

1887

1888

1889

1891 : public ConcreteTypeLoc<UnqualTypeLoc, DependentVectorTypeLoc,

1892 DependentVectorType, VectorTypeLocInfo> {

1893public:

1895

1897

1900 }

1901

1904 }

1905

1907

1909};

1910

1911

1914 ExtVectorType> {};

1915

1916

1917

1919 : public ConcreteTypeLoc<UnqualTypeLoc, DependentSizedExtVectorTypeLoc,

1920 DependentSizedExtVectorType, VectorTypeLocInfo> {

1921public:

1923

1925

1928 }

1929

1932 }

1933

1935

1937};

1938

1944};

1945

1947 MatrixType, MatrixTypeLocInfo> {

1948public:

1949

1950

1951

1954

1955

1956

1957

1960

1961

1962

1963

1966

1967

1968

1969

1970

1973 }

1976 }

1977

1981 return range;

1982 }

1983

1989 }

1990};

1991

1994 ConstantMatrixType> {};

1995

1998 DependentSizedMatrixTypeLoc,

1999 DependentSizedMatrixType> {};

2000

2001

2003 ComplexTypeLoc,

2004 ComplexType> {

2005};

2006

2011};

2012

2014};

2015

2018};

2019

2020template <class Derived, class TypeClass, class LocalData = TypeofLocInfo>

2022 : public ConcreteTypeLoc<UnqualTypeLoc, Derived, TypeClass, LocalData> {

2023public:

2026 }

2027

2030 }

2031

2034 }

2035

2038 }

2039

2042 }

2043

2046 }

2047

2050 }

2051

2055 }

2056

2059 }

2060

2065 }

2066};

2067

2069 TypeOfExprType,

2070 TypeOfExprTypeLocInfo> {

2071public:

2073 return getTypePtr()->getUnderlyingExpr();

2074 }

2075

2076

2077

2078

2080};

2081

2083 : public TypeofLikeTypeLoc<TypeOfTypeLoc, TypeOfType, TypeOfTypeLocInfo> {

2084public:

2086 return this->getTypePtr()->getUnmodifiedType();

2087 }

2088

2090 return this->getLocalData()->UnmodifiedTInfo;

2091 }

2092

2095 }

2096

2098};

2099

2100

2101

2102

2103

2104

2108};

2110 : public ConcreteTypeLoc<UnqualTypeLoc, DecltypeTypeLoc, DecltypeType,

2111 DecltypeTypeLocInfo> {

2112public:

2114

2117

2120

2123 }

2124

2128 }

2129};

2130

2133};

2134

2136 : public ConcreteTypeLoc<UnqualTypeLoc, PackIndexingTypeLoc,

2137 PackIndexingType, PackIndexingTypeLocInfo> {

2138

2139public:

2142

2145

2148 }

2149

2151

2153

2156 }

2157};

2158

2160

2161

2164};

2165

2167 UnaryTransformTypeLoc,

2168 UnaryTransformType,

2169 UnaryTransformTypeLocInfo> {

2170public:

2173

2176

2179

2182 }

2183

2186 }

2187

2190 }

2191

2194 }

2195

2199 }

2200

2202};

2203

2206 DeducedType> {};

2207

2209

2211

2213};

2214

2217 AutoTypeLoc,

2218 AutoType,

2219 AutoTypeLocInfo> {

2220public:

2223 }

2224

2228

2231 }

2232

2234

2236

2237

2238

2241 return CR->getNestedNameSpecifierLoc();

2243 }

2244

2247 return CR->getTemplateKWLoc();

2249 }

2250

2253 return CR->getConceptNameLoc();

2255 }

2256

2259 return CR->getFoundDecl();

2260 return nullptr;

2261 }

2262

2265 return CR->getNamedConcept();

2266 return nullptr;

2267 }

2268

2271 }

2272

2277 ->getTemplateArgsAsWritten()

2279 .isValid());

2280 }

2281

2284 if (const auto *TAAW = CR->getTemplateArgsAsWritten())

2285 return TAAW->getLAngleLoc();

2287 }

2288

2291 if (const auto *TAAW = CR->getTemplateArgsAsWritten())

2292 return TAAW->getRAngleLoc();

2294 }

2295

2298 }

2299

2302 assert(CR && "No ConceptReference");

2303 return CR->getTemplateArgsAsWritten()->getTemplateArgs()[i];

2304 }

2305

2314 }

2315

2318 assert(size == Loc.getFullDataSize());

2320 }

2321

2323};

2324

2327 DeducedTemplateSpecializationTypeLoc,

2328 DeducedTemplateSpecializationType> {

2329public:

2332 }

2333

2336 }

2337};

2338

2341

2342

2344};

2345

2347 ElaboratedTypeLoc,

2348 ElaboratedType,

2349 ElaboratedLocInfo> {

2350public:

2353 }

2354

2357 assert(Loc.isInvalid());

2358 return;

2359 }

2361 }

2362

2367 }

2368

2372 "Inconsistent nested-name-specifier pointer");

2375 return;

2376 }

2378 }

2379

2385 else

2387 else

2389 }

2390

2392

2394

2396

2400 }

2401

2403

2404

2405

2407 }

2408

2411 }

2412

2415 assert(size == Loc.getFullDataSize());

2417 }

2418};

2419

2420

2421

2424};

2425

2427 DependentNameTypeLoc,

2428 DependentNameType,

2429 DependentNameLocInfo> {

2430public:

2433 }

2434

2437 }

2438

2442 }

2443

2447 "Inconsistent nested-name-specifier pointer");

2449 }

2450

2453 }

2454

2457 }

2458

2462 else

2464 }

2465

2468 assert(size == Loc.getFullDataSize());

2470 }

2471

2473};

2474

2479

2480};

2481

2484 DependentTemplateSpecializationTypeLoc,

2485 DependentTemplateSpecializationType,

2486 DependentTemplateSpecializationLocInfo> {

2487public:

2490 }

2491

2494 }

2495

2499

2502 }

2503

2505 if (!QualifierLoc) {

2506

2507

2508

2509

2511 return;

2512 }

2513

2516 "Inconsistent nested-name-specifier pointer");

2518 }

2519

2522 }

2523

2526 }

2527

2530 }

2531

2534 }

2535

2538 }

2539

2542 }

2543

2546 }

2547

2550 }

2551

2554 }

2555

2557 getArgInfos()[i] = AI;

2558 }

2559

2561 return getArgInfos()[i];

2562 }

2563

2567 }

2568

2576 else

2578 }

2579

2582 assert(size == Loc.getFullDataSize());

2584 }

2585

2587

2590 }

2591

2594 }

2595

2596private:

2599 }

2600};

2601

2604};

2605

2607 : public ConcreteTypeLoc<UnqualTypeLoc, PackExpansionTypeLoc,

2608 PackExpansionType, PackExpansionTypeLocInfo> {

2609public:

2612 }

2613

2616 }

2617

2620 }

2621

2624 }

2625

2628 }

2629

2632 }

2633};

2634

2637};

2638

2640 AtomicType, AtomicTypeLocInfo> {

2641public:

2644 }

2645

2648 }

2649

2652 }

2653

2656 }

2657

2660 }

2661

2664 }

2665

2668 }

2669

2672 }

2673

2676 }

2677

2681 }

2682

2687 }

2688

2691 }

2692};

2693

2696};

2697

2699 PipeTypeLocInfo> {

2700public:

2702

2704

2707

2710 }

2711

2713};

2714

2715template

2718 while (!T::isKind(Cur)) {

2720 Cur = PTL.getInnerLoc();

2722 Cur = ATL.getModifiedLoc();

2724 Cur = ATL.getWrappedLoc();

2726 Cur = ATL.getWrappedLoc();

2728 Cur = ETL.getNamedTypeLoc();

2730 Cur = ATL.getOriginalLoc();

2732 Cur = MQL.getInnerLoc();

2733 else

2734 break;

2735 }

2736 return Cur.getAs<T>();

2737}

2740 BitIntType> {};

2743 DependentBitIntType> {};

2744

2748

2749public:

2751 : Protocol(protocol), Loc(loc) {}

2754

2755

2758 }

2759};

2760

2761}

2762

2763#endif

This file provides AST data structures related to concepts.

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__ void * memcpy(void *__a, const void *__b, size_t __c)

__DEVICE__ void * memset(void *__a, int __b, size_t __c)

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

QualType getInnerType() const

unsigned getLocalDataSize() const

TypeLoc getOriginalLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceRange getLocalSourceRange() const

QualType getOriginalType() const

Wrapper for source info for array parameter types.

Wrapper for source info for arrays.

SourceLocation getLBracketLoc() const

Expr * getSizeExpr() const

void setLBracketLoc(SourceLocation Loc)

TypeLoc getElementLoc() const

void setRBracketLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getRBracketLoc() const

SourceRange getBracketsRange() const

SourceRange getLocalSourceRange() const

QualType getInnerType() const

void setSizeExpr(Expr *Size)

QualType getElementType() const

SourceLocation getRParenLoc() const

QualType getInnerType() const

SourceRange getLocalSourceRange() const

void setRParenLoc(SourceLocation Loc)

SourceRange getParensRange() const

TypeLoc getValueLoc() const

void setLParenLoc(SourceLocation Loc)

void setKWLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getKWLoc() const

SourceLocation getLParenLoc() const

void setParensRange(SourceRange Range)

QualType getValueType() const

Gets the type contained by this atomic type, i.e.

Attr - This represents one attribute.

Type source information for an attributed type.

const Attr * getAttr() const

The type attribute.

QualType getInnerType() const

TypeLoc getModifiedLoc() const

The modified type, which is generally canonically different from the attribute type.

TypeLoc getEquivalentTypeLoc() const

void initializeLocal(ASTContext &Context, SourceLocation loc)

SourceRange getLocalSourceRange() const

void setAttr(const Attr *A)

attr::Kind getAttrKind() const

QualType getModifiedType() const

bool isQualifier() const

Does this attribute behave like a type qualifier?

bool hasExplicitTemplateArgs() const

SourceLocation getTemplateKWLoc() const

AutoTypeKeyword getAutoKeyword() const

const NestedNameSpecifierLoc getNestedNameSpecifierLoc() const

SourceLocation getRAngleLoc() const

SourceLocation getRParenLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

ConceptDecl * getNamedConcept() const

SourceRange getLocalSourceRange() const

void copy(AutoTypeLoc Loc)

SourceLocation getLAngleLoc() const

void setConceptReference(ConceptReference *CR)

SourceLocation getConceptNameLoc() const

NamedDecl * getFoundDecl() const

TemplateArgumentLoc getArgLoc(unsigned i) const

bool isDecltypeAuto() const

bool isConstrained() const

unsigned getNumArgs() const

ConceptReference * getConceptReference() const

DeclarationNameInfo getConceptNameInfo() const

void setRParenLoc(SourceLocation Loc)

ArrayRef< TemplateArgument > getTypeConstraintArguments() const

bool isDecltypeAuto() const

AutoTypeKeyword getKeyword() const

bool isConstrained() const

Type source information for an btf_tag attributed type.

QualType getInnerType() const

TypeLoc getWrappedLoc() const

void initializeLocal(ASTContext &Context, SourceLocation loc)

const BTFTypeTagAttr * getAttr() const

The btf_type_tag attribute.

SourceRange getLocalSourceRange() const

const BTFTypeTagAttr * getAttr() const

QualType getWrappedType() const

Wrapper for source info for block pointers.

SourceLocation getCaretLoc() const

void setCaretLoc(SourceLocation Loc)

QualType getInnerType() const

unsigned getLocalDataSize() const

TypeLoc getInnerLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

Wrapper for source info for builtin types.

SourceLocation getBuiltinLoc() const

TypeSpecifierType getWrittenTypeSpec() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

TypeSpecifierWidth getWrittenWidthSpec() const

SourceRange getLocalSourceRange() const

void setWrittenTypeSpec(TypeSpecifierType written)

const WrittenBuiltinSpecs & getWrittenBuiltinSpecs() const

bool needsExtraLocalData() const

bool hasWrittenWidthSpec() const

void setModeAttr(bool written)

void setBuiltinLoc(SourceLocation Loc)

void setWrittenWidthSpec(TypeSpecifierWidth written)

SourceLocation getNameLoc() const

unsigned getExtraLocalDataAlignment() const

WrittenBuiltinSpecs & getWrittenBuiltinSpecs()

void setWrittenSignSpec(TypeSpecifierSign written)

bool hasWrittenSignSpec() const

unsigned getExtraLocalDataSize() const

bool hasWrittenTypeSpec() const

TypeSpecifierSign getWrittenSignSpec() const

void expandBuiltinRange(SourceRange Range)

Represents a C++ struct/union/class.

Declaration of a C++20 concept.

A reference to a concept and its template args, as it appears in the code.

const DeclarationNameInfo & getConceptNameInfo() const

A metaprogramming base class for TypeLoc classes which correspond to a particular Type subclass.

const TypeClass * getTypePtr() const

TypeLoc getInnerTypeLoc() const

unsigned getExtraLocalDataAlignment() const

HasNoInnerType getInnerType() const

void * getExtraLocalData() const

Gets a pointer past the Info structure; useful for classes with local data that can't be captured in ...

LocalData * getLocalData() const

unsigned getLocalDataAlignment() const

void * getNonLocalData() const

TypeLoc getNextTypeLoc() const

unsigned getExtraLocalDataSize() const

void copyLocal(Derived other)

unsigned getLocalDataSize() const

Expr * getCountExpr() const

bool isCountInBytes() const

SourceRange getLocalSourceRange() const

bool isCountInBytes() const

Expr * getCountExpr() const

Wrapper for source info for pointers decayed from arrays and functions.

SourceLocation getDecltypeLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

Expr * getUnderlyingExpr() const

SourceLocation getRParenLoc() const

void setRParenLoc(SourceLocation Loc)

void setDecltypeLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

Expr * getUnderlyingExpr() const

SourceLocation getTemplateNameLoc() const

void setTemplateNameLoc(SourceLocation Loc)

TypeLoc getPointeeTypeLoc() const

void setAttrNameLoc(SourceLocation loc)

SourceRange getLocalSourceRange() const

void setAttrOperandParensRange(SourceRange range)

QualType getInnerType() const

Returns the type before the address space attribute application area.

void setAttrExprOperand(Expr *e)

Expr * getAttrExprOperand() const

The attribute's expression operand, if it has one.

void initializeLocal(ASTContext &Context, SourceLocation loc)

SourceRange getAttrOperandParensRange() const

The location of the parentheses around the operand, if there is an operand.

SourceLocation getAttrNameLoc() const

The location of the attribute name, i.e.

QualType getPointeeType() const

void copy(DependentNameTypeLoc Loc)

NestedNameSpecifierLoc getQualifierLoc() const

SourceLocation getNameLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceRange getLocalSourceRange() const

SourceLocation getElaboratedKeywordLoc() const

void setNameLoc(SourceLocation Loc)

void setElaboratedKeywordLoc(SourceLocation Loc)

void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getNameLoc() const

QualType getInnerType() const

TypeLoc getElementLoc() const

SourceRange getLocalSourceRange() const

void setNameLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

QualType getElementType() const

void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)

unsigned getNumArgs() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getTemplateNameLoc() const

SourceRange getLocalSourceRange() const

SourceLocation getLAngleLoc() const

unsigned getExtraLocalDataSize() const

void setTemplateKeywordLoc(SourceLocation Loc)

void copy(DependentTemplateSpecializationTypeLoc Loc)

SourceLocation getTemplateKeywordLoc() const

void setElaboratedKeywordLoc(SourceLocation Loc)

void setRAngleLoc(SourceLocation Loc)

TemplateArgumentLoc getArgLoc(unsigned i) const

SourceLocation getRAngleLoc() const

TemplateArgumentLocInfo getArgLocInfo(unsigned i) const

SourceLocation getElaboratedKeywordLoc() const

void setLAngleLoc(SourceLocation Loc)

void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)

void setTemplateNameLoc(SourceLocation Loc)

NestedNameSpecifierLoc getQualifierLoc() const

unsigned getExtraLocalDataAlignment() const

ArrayRef< TemplateArgument > template_arguments() const

SourceLocation getNameLoc() const

SourceRange getLocalSourceRange() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

TypeLoc getElementLoc() const

void setNameLoc(SourceLocation Loc)

QualType getInnerType() const

QualType getElementType() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

unsigned getLocalDataAlignment() const

QualType getInnerType() const

SourceLocation getElaboratedKeywordLoc() const

NestedNameSpecifierLoc getQualifierLoc() const

void copy(ElaboratedTypeLoc Loc)

unsigned getLocalDataSize() const

SourceRange getLocalSourceRange() const

void setElaboratedKeywordLoc(SourceLocation Loc)

TypeLoc getNamedTypeLoc() const

void setQualifierLoc(NestedNameSpecifierLoc QualifierLoc)

NestedNameSpecifier * getQualifier() const

Retrieve the qualification on this type.

QualType getNamedType() const

Retrieve the type named by the qualified-id.

Wrapper for source info for enum types.

EnumDecl * getDecl() const

EnumDecl * getDecl() const

This represents one expression.

Wrapper for source info for functions.

ParmVarDecl ** getParmArray() const

QualType getInnerType() const

unsigned getNumParams() const

ParmVarDecl * getParam(unsigned i) const

SourceLocation getLocalRangeEnd() const

void setLocalRangeBegin(SourceLocation L)

void setLParenLoc(SourceLocation Loc)

SourceRange getExceptionSpecRange() const

void setParam(unsigned i, ParmVarDecl *VD)

ArrayRef< ParmVarDecl * > getParams() const

SourceRange getParensRange() const

void setRParenLoc(SourceLocation Loc)

unsigned getExtraLocalDataAlignment() const

void setLocalRangeEnd(SourceLocation L)

unsigned getExtraLocalDataSize() const

Returns the size of the type source info data block that is specific to this type.

void setExceptionSpecRange(SourceRange R)

TypeLoc getReturnLoc() const

SourceLocation getLocalRangeBegin() const

SourceRange getLocalSourceRange() const

SourceLocation getLParenLoc() const

SourceLocation getRParenLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

QualType getReturnType() const

Type source information for HLSL attributed resource type.

void initializeLocal(ASTContext &Context, SourceLocation loc)

unsigned getLocalDataSize() const

TypeLoc getWrappedLoc() const

TypeSourceInfo * getContainedTypeSourceInfo() const

void setContainedTypeSourceInfo(TypeSourceInfo *TSI) const

QualType getInnerType() const

SourceRange getLocalSourceRange() const

void setSourceRange(const SourceRange &R)

QualType getWrappedType() const

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

A metaprogramming class designed for concrete subtypes of abstract types where all subtypes share equ...

const TypeClass * getTypePtr() const

Wrapper for source info for injected class names of class templates.

CXXRecordDecl * getDecl() const

CXXRecordDecl * getDecl() const

void setAmpLoc(SourceLocation Loc)

SourceLocation getAmpLoc() const

const IdentifierInfo * getMacroIdentifier() const

SourceLocation getExpansionLoc() const

TypeLoc getInnerLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

void setExpansionLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

QualType getInnerType() const

QualType getUnderlyingType() const

const IdentifierInfo * getMacroIdentifier() const

Expr * getAttrColumnOperand() const

The attribute's column operand, if it has one.

SourceRange getAttrOperandParensRange() const

The location of the parentheses around the operand, if there is an operand.

void setAttrRowOperand(Expr *e)

SourceRange getLocalSourceRange() const

void setAttrColumnOperand(Expr *e)

void setAttrOperandParensRange(SourceRange range)

void setAttrNameLoc(SourceLocation loc)

SourceLocation getAttrNameLoc() const

The location of the attribute name, i.e.

void initializeLocal(ASTContext &Context, SourceLocation loc)

Expr * getAttrRowOperand() const

The attribute's row operand, if it has one.

Wrapper for source info for member pointers.

void initializeLocal(ASTContext &Context, SourceLocation Loc)

void setStarLoc(SourceLocation Loc)

TypeSourceInfo * getClassTInfo() const

SourceRange getLocalSourceRange() const

void setClassTInfo(TypeSourceInfo *TI)

SourceLocation getStarLoc() const

const Type * getClass() const

This represents a decl that may have a name.

A C++ nested-name-specifier augmented with source location information.

SourceLocation getBeginLoc() const

Retrieve the location of the beginning of this nested-name-specifier.

void * getOpaqueData() const

Retrieve the opaque pointer that refers to source-location data.

bool hasQualifier() const

Evaluates true when this nested-name-specifier location is non-empty.

NestedNameSpecifier * getNestedNameSpecifier() const

Retrieve the nested-name-specifier to which this instance refers.

SourceRange getSourceRange() const LLVM_READONLY

Retrieve the source range covering the entirety of this nested-name-specifier.

Represents an ObjC class declaration.

Wrapper for source info for ObjC interfaces.

void setNameLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

void setNameEndLoc(SourceLocation Loc)

ObjCInterfaceDecl * getIFaceDecl() const

SourceLocation getNameEndLoc() const

SourceLocation getNameLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

ObjCInterfaceDecl * getDecl() const

Get the declaration of this interface.

Wraps an ObjCPointerType with source location information.

SourceLocation getStarLoc() const

void setStarLoc(SourceLocation Loc)

unsigned getExtraLocalDataAlignment() const

void setTypeArgsRAngleLoc(SourceLocation Loc)

ObjCProtocolDecl * getProtocol(unsigned i) const

unsigned getExtraLocalDataSize() const

bool hasBaseTypeAsWritten() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getTypeArgsLAngleLoc() const

unsigned getNumTypeArgs() const

ArrayRef< SourceLocation > getProtocolLocs() const

unsigned getNumProtocols() const

void setTypeArgsLAngleLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

TypeSourceInfo * getTypeArgTInfo(unsigned i) const

void setTypeArgTInfo(unsigned i, TypeSourceInfo *TInfo)

void setProtocolLAngleLoc(SourceLocation Loc)

void setProtocolRAngleLoc(SourceLocation Loc)

SourceLocation getProtocolRAngleLoc() const

SourceLocation getProtocolLoc(unsigned i) const

void setHasBaseTypeAsWritten(bool HasBaseType)

void setProtocolLoc(unsigned i, SourceLocation Loc)

TypeLoc getBaseLoc() const

QualType getInnerType() const

SourceLocation getProtocolLAngleLoc() const

SourceLocation getTypeArgsRAngleLoc() const

ArrayRef< QualType > getTypeArgsAsWritten() const

Retrieve the type arguments of this object type as they were written.

QualType getBaseType() const

Gets the base type of this object type.

Represents an Objective-C protocol declaration.

SourceLocation getLocation() const

ObjCProtocolLoc(ObjCProtocolDecl *protocol, SourceLocation loc)

ObjCProtocolDecl * getProtocol() const

SourceRange getSourceRange() const LLVM_READONLY

The source range is just the protocol name.

unsigned getNumProtocols() const

Return the number of qualifying protocols in this type, or 0 if there are none.

qual_iterator qual_begin() const

Represents the declaration of an Objective-C type parameter.

ProtocolLAngleLoc, ProtocolRAngleLoc, and the source locations for protocol qualifiers are stored aft...

unsigned getExtraLocalDataAlignment() const

ObjCTypeParamDecl * getDecl() const

SourceRange getLocalSourceRange() const

unsigned getNumProtocols() const

SourceLocation getNameLoc() const

ObjCProtocolDecl * getProtocol(unsigned i) const

SourceLocation getProtocolLoc(unsigned i) const

ArrayRef< SourceLocation > getProtocolLocs() const

void setProtocolLoc(unsigned i, SourceLocation Loc)

void setProtocolLAngleLoc(SourceLocation Loc)

unsigned getExtraLocalDataSize() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getProtocolLAngleLoc() const

void setProtocolRAngleLoc(SourceLocation Loc)

void setNameLoc(SourceLocation Loc)

SourceLocation getProtocolRAngleLoc() const

ObjCTypeParamDecl * getDecl() const

SourceRange getLocalSourceRange() const

void setEllipsisLoc(SourceLocation Loc)

SourceLocation getEllipsisLoc() const

TypeLoc getPatternLoc() const

QualType getInnerType() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

QualType getPattern() const

Retrieve the pattern of this pack expansion, which is the type that will be repeatedly instantiated w...

SourceLocation getEllipsisLoc() const

Expr * getIndexExpr() const

TypeLoc getPatternLoc() const

QualType getPattern() const

QualType getInnerType() const

SourceRange getLocalSourceRange() const

void setEllipsisLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

QualType getPattern() const

Expr * getIndexExpr() const

void setRParenLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getRParenLoc() const

QualType getInnerType() const

SourceLocation getLParenLoc() const

SourceRange getLocalSourceRange() const

TypeLoc getInnerLoc() const

void setLParenLoc(SourceLocation Loc)

QualType getInnerType() const

Represents a parameter to a function.

TypeLoc getValueLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

QualType getInnerType() const

void setKWLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

SourceLocation getKWLoc() const

QualType getElementType() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceRange getLocalSourceRange() const

void setSigilLoc(SourceLocation Loc)

QualType getInnerType() const

TypeLoc getPointeeLoc() const

SourceLocation getSigilLoc() const

Wrapper for source info for pointers.

SourceLocation getStarLoc() const

void setStarLoc(SourceLocation Loc)

A (possibly-)qualified type.

bool hasLocalQualifiers() const

Determine whether this particular QualType instance has any qualifiers, without looking through any t...

const Type * getTypePtr() const

Retrieves a pointer to the underlying (unqualified) type.

static QualType getFromOpaquePtr(const void *Ptr)

Wrapper of type source information for a type with non-trivial direct qualifiers.

TypeLoc getNextTypeLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

Initializes the local data of this type source info block to provide no information.

unsigned getLocalDataSize() const

Returns the size of the type source info data block that is specific to this type.

unsigned getLocalDataAlignment() const

Returns the alignment of the type source info data block that is specific to this type.

void copyLocal(TypeLoc other)

SourceRange getLocalSourceRange() const

UnqualTypeLoc getUnqualifiedLoc() const

void setAmpAmpLoc(SourceLocation Loc)

SourceLocation getAmpAmpLoc() const

Represents a struct/union/class.

Wrapper for source info for record types.

RecordDecl * getDecl() const

RecordDecl * getDecl() const

QualType getInnerType() 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.

void setBegin(SourceLocation b)

SourceLocation getEnd() const

SourceLocation getBegin() const

void setEnd(SourceLocation e)

Wrapper for substituted template type parameters.

Wrapper for substituted template type parameters.

Represents the declaration of a struct/union/class/enum.

Wrapper for source info for tag types.

TagDecl * getDecl() const

bool isDefinition() const

True if the tag was defined in this type specifier.

TagDecl * getDecl() const

Location wrapper for a TemplateArgument.

unsigned getNumArgs() const

static void initializeArgLocs(ASTContext &Context, ArrayRef< TemplateArgument > Args, TemplateArgumentLocInfo *ArgInfos, SourceLocation Loc)

void setArgLocInfo(unsigned i, TemplateArgumentLocInfo AI)

SourceLocation getLAngleLoc() const

TemplateArgumentLocInfo getArgLocInfo(unsigned i) const

void setTemplateKeywordLoc(SourceLocation Loc)

TemplateArgumentLoc getArgLoc(unsigned i) const

SourceRange getLocalSourceRange() const

SourceLocation getRAngleLoc() const

void setTemplateNameLoc(SourceLocation Loc)

void setLAngleLoc(SourceLocation Loc)

SourceLocation getTemplateNameLoc() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

void copy(TemplateSpecializationTypeLoc Loc)

unsigned getExtraLocalDataAlignment() const

SourceLocation getTemplateKeywordLoc() const

void setRAngleLoc(SourceLocation Loc)

unsigned getExtraLocalDataSize() const

ArrayRef< TemplateArgument > template_arguments() const

Declaration of a template type parameter.

Wrapper for template type parameters.

TemplateTypeParmDecl * getDecl() const

TemplateTypeParmDecl * getDecl() const

Base wrapper for a particular "section" of type source info.

SourceLocation findNullabilityLoc() const

Find the location of the nullability specifier (__nonnull, __nullable, or __null_unspecifier),...

UnqualTypeLoc getUnqualifiedLoc() const

Skips past any qualifiers, if this is qualified.

static unsigned getLocalAlignmentForType(QualType Ty)

Returns the alignment of type source info data block for the given type.

TypeLoc findExplicitQualifierLoc() const

Find a type with the location of an explicit type qualifier.

QualType getType() const

Get the type for which this source info wrapper provides information.

TypeLoc getNextTypeLoc() const

Get the next TypeLoc pointed by this TypeLoc, e.g for "int*" the TypeLoc is a PointerLoc and next Typ...

T getAs() const

Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...

friend bool operator==(const TypeLoc &LHS, const TypeLoc &RHS)

TypeLoc IgnoreParens() const

T castAs() const

Convert to the specified TypeLoc type, asserting that this TypeLoc is of the desired type.

TypeLoc(QualType ty, void *opaqueData)

void initializeFullCopy(TypeLoc Other)

Initializes this by copying its information from another TypeLoc of the same type.

SourceRange getSourceRange() const LLVM_READONLY

Get the full source range.

SourceRange getLocalSourceRange() const

Get the local source range.

void initializeFullCopy(TypeLoc Other, unsigned Size)

Initializes this by copying its information from another TypeLoc of the same type.

unsigned getFullDataSize() const

Returns the size of the type source info data block.

AutoTypeLoc getContainedAutoTypeLoc() const

Get the typeloc of an AutoType whose type will be deduced for a variable with an initializer of this ...

TypeLoc(const Type *ty, void *opaqueData)

void * getOpaqueData() const

Get the pointer where source information is stored.

TypeLocClass

The kinds of TypeLocs.

SourceLocation getTemplateKeywordLoc() const

Get the SourceLocation of the template keyword (if any).

void copy(TypeLoc other)

Copies the other type loc into this one.

TypeLocClass getTypeLocClass() const

static unsigned getFullDataSizeForType(QualType Ty)

Returns the size of type source info data block for the given type.

void initialize(ASTContext &Context, SourceLocation Loc) const

Initializes this to state that every location in this type is the given location.

SourceLocation getEndLoc() const

Get the end source location.

T getAsAdjusted() const

Convert to the specified TypeLoc type, returning a null TypeLoc if this TypeLoc is not of the desired...

friend bool operator!=(const TypeLoc &LHS, const TypeLoc &RHS)

SourceLocation getBeginLoc() const

Get the begin source location.

const Type * getTypePtr() const

SourceRange getLocalSourceRange() const

Expr * getUnderlyingExpr() const

void initializeLocal(ASTContext &Context, SourceLocation Loc)

void setUnmodifiedTInfo(TypeSourceInfo *TI) const

TypeSourceInfo * getUnmodifiedTInfo() const

QualType getUnmodifiedType() const

A container of type source information.

TypeLoc getTypeLoc() const

Return the TypeLoc wrapper for the type source info.

A reasonable base class for TypeLocs that correspond to types that are written as a type-specifier.

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceLocation getNameLoc() const

void setNameLoc(SourceLocation Loc)

SourceRange getLocalSourceRange() const

ElaboratedTypeKeyword getKeyword() const

The base class of the type hierarchy.

TypeClass getTypeClass() const

Base class for declarations which introduce a typedef-name.

Wrapper for source info for typedefs.

TypedefNameDecl * getTypedefNameDecl() const

TypedefNameDecl * getDecl() const

void setParensRange(SourceRange range)

SourceRange getLocalSourceRange() const

SourceLocation getLParenLoc() const

SourceLocation getRParenLoc() const

SourceRange getParensRange() const

void setLParenLoc(SourceLocation Loc)

SourceLocation getTypeofLoc() const

void setTypeofLoc(SourceLocation Loc)

void setRParenLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

void setRParenLoc(SourceLocation Loc)

void setParensRange(SourceRange Range)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceRange getLocalSourceRange() const

void setKWLoc(SourceLocation Loc)

SourceLocation getKWLoc() const

SourceLocation getRParenLoc() const

TypeSourceInfo * getUnderlyingTInfo() const

SourceRange getParensRange() const

void setUnderlyingTInfo(TypeSourceInfo *TInfo)

void setLParenLoc(SourceLocation Loc)

SourceLocation getLParenLoc() const

Wrapper of type source information for a type with no direct qualifiers.

TypeLocClass getTypeLocClass() const

UnqualTypeLoc(const Type *Ty, void *Data)

const Type * getTypePtr() const

Wrapper for source info for unresolved typename using decls.

UnresolvedUsingTypenameDecl * getDecl() const

UnresolvedUsingTypenameDecl * getDecl() const

Represents a dependent using declaration which was marked with typename.

Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...

Wrapper for source info for types used via transparent aliases.

QualType getUnderlyingType() const

UsingShadowDecl * getFoundDecl() const

UsingShadowDecl * getFoundDecl() const

QualType getUnderlyingType() const

TypeLoc getElementLoc() const

void setNameLoc(SourceLocation Loc)

void initializeLocal(ASTContext &Context, SourceLocation Loc)

SourceRange getLocalSourceRange() const

QualType getInnerType() const

SourceLocation getNameLoc() const

QualType getElementType() const

The JSON file list parser is used to communicate input to InstallAPI.

TypeSpecifierType

Specifies the kind of type.

AutoTypeKeyword

Which keyword(s) were used to create an AutoType.

TypeSpecifierWidth

Specifies the width of a type, e.g., short, long, or long long.

TypeSpecifierSign

Specifies the signedness of a type, e.g., signed or unsigned.

const FunctionProtoType * T

@ None

No keyword precedes the qualified type name.

@ Other

Other implicit parameter.

__UINTPTR_TYPE__ uintptr_t

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

SourceLocation LBracketLoc

SourceLocation RBracketLoc

DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspon...

SourceLocation DecltypeLoc

SourceRange OperandParens

SourceLocation TemplateKWLoc

SourceLocation ElaboratedKWLoc

void * QualifierData

Data associated with the nested-name-specifier location.

SourceLocation LocalRangeEnd

SourceLocation LocalRangeBegin

TypeSourceInfo * ContainedTyInfo

SourceLocation ExpansionLoc

SourceRange OperandParens

TypeSourceInfo * ClassTInfo

SourceLocation NameEndLoc

SourceLocation TypeArgsLAngleLoc

SourceLocation ProtocolLAngleLoc

SourceLocation TypeArgsRAngleLoc

bool HasBaseTypeAsWritten

SourceLocation ProtocolRAngleLoc

SourceLocation EllipsisLoc

SourceLocation EllipsisLoc

Location information for a TemplateArgument.

SourceLocation TemplateKWLoc

TypeSourceInfo * UnmodifiedTInfo

TypeSourceInfo * UnderlyingTInfo

Structure that packs information about the type specifiers that were written in a particular type spe...