clang: lib/AST/TextNodeDumper.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

26#include "llvm/ADT/StringExtras.h"

27

28#include

29#include

30

31using namespace clang;

32

34

35template

37 const T *First = D->getFirstDecl();

39 OS << " first " << First;

40}

41

42template

45 if (Prev)

46 OS << " prev " << Prev;

47}

48

49

50

53#define DECL(DERIVED, BASE) \

54 case Decl::DERIVED: \

55 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));

56#define ABSTRACT_DECL(DECL)

57#include "clang/AST/DeclNodes.inc"

58 }

59 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");

60}

61

65 Context(&Context), SM(&Context.getSourceManager()),

66 PrintPolicy(Context.getPrintingPolicy()),

67 Traits(&Context.getCommentCommandTraits()) {}

68

71

74 if (C) {

76 OS << "<<>>";

77 return;

78 }

79

80 {

82 OS << C->getCommentKindName();

83 }

86

89}

90

92 {

94

96#define ATTR(X) \

97 case attr::X: \

98 OS << #X; \

99 break;

100#include "clang/Basic/AttrList.inc"

101 }

102 OS << "Attr";

103 }

107 OS << " Inherited";

109 OS << " Implicit";

110

112}

113

115 const Decl *From, StringRef Label) {

116 OS << "TemplateArgument";

119

120 if (From)

122

124}

125

129 OS << "<<>>";

130 return;

131 }

132 {

134 OS << Node->getStmtClassName();

135 }

138

139 if (const auto *E = dyn_cast(Node)) {

141

144 OS << " contains-errors";

145 }

146

147 {

151 break;

153 OS << " lvalue";

154 break;

156 OS << " xvalue";

157 break;

158 }

159 }

160

161 {

165 break;

167 OS << " bitfield";

168 break;

170 OS << " objcproperty";

171 break;

173 OS << " objcsubscript";

174 break;

176 OS << " vectorcomponent";

177 break;

179 OS << " matrixcomponent";

180 break;

181 }

182 }

183 }

184

186}

187

189 if (T) {

191 OS << "<<>>";

192 return;

193 }

194 if (isa(T)) {

195 {

197 OS << "LocInfo Type";

198 }

200 return;

201 }

202

203 {

206 }

208 OS << " ";

210

213 if (SingleStepDesugar != QualType(T, 0))

214 OS << " sugar";

215

218 OS << " contains-errors";

219 }

220

222 OS << " dependent";

224 OS << " instantiation_dependent";

225

227 OS << " variably_modified";

229 OS << " contains_unexpanded_pack";

231 OS << " imported";

232

234}

235

237 OS << "QualType";

239 OS << " ";

241 OS << " " << T.split().Quals.getAsString();

242}

243

245 if (!TL) {

247 OS << "<<>>";

248 return;

249 }

250

251 {

254 ? "Qualified"

256 << "TypeLoc";

257 }

259 OS << ' ';

261

263}

264

266 if (D) {

268 OS << "<<>>";

269 return;

270 }

271

272 {

275 }

281 OS << ' ';

284 OS << " imported";

286 OS << " in " << M->getFullModuleName();

287 if (auto *ND = dyn_cast(D))

290 AddChild([=] { OS << "also in " << M->getFullModuleName(); });

291 if (const NamedDecl *ND = dyn_cast(D))

292 if (!ND->isUnconditionallyVisible())

293 OS << " hidden";

295 OS << " implicit";

296

298 OS << " used";

300 OS << " referenced";

301

303 OS << " invalid";

304 if (const FunctionDecl *FD = dyn_cast(D)) {

305 if (FD->isConstexprSpecified())

306 OS << " constexpr";

307 if (FD->isConsteval())

308 OS << " consteval";

309 else if (FD->isImmediateFunction())

310 OS << " immediate";

311 if (FD->isMultiVersion())

312 OS << " multiversion";

313 }

314

315 if (!isa(*D)) {

316 const auto *MD = dyn_cast(D);

317 if (!MD || !MD->isThisDeclarationADefinition()) {

318 const auto *DC = dyn_cast(D);

319 if (DC && DC->hasExternalLexicalStorage()) {

321 OS << " ";

322 }

323 }

324 }

325

328 break;

330 OS << " friend";

331 break;

333 OS << " friend_undeclared";

334 break;

335 }

336

338}

339

341 OS << "CXXCtorInitializer";

342 if (Init->isAnyMemberInitializer()) {

343 OS << ' ';

345 } else if (Init->isBaseInitializer()) {

347 } else if (Init->isDelegatingInitializer()) {

348 dumpType(Init->getTypeSourceInfo()->getType());

349 } else {

350 llvm_unreachable("Unknown initializer type");

351 }

352}

353

355 OS << "capture";

356 if (C.isByRef())

357 OS << " byref";

358 if (C.isNested())

359 OS << " nested";

360 if (C.getVariable()) {

361 OS << ' ';

363 }

364}

365

367 if (C) {

369 OS << "<<>> OMPClause";

370 return;

371 }

372 {

374 StringRef ClauseName(llvm::omp::getOpenMPClauseName(C->getClauseKind()));

375 OS << "OMP" << ClauseName.substr(0, 1).upper()

376 << ClauseName.drop_front() << "Clause";

377 }

380 if (C->isImplicit())

381 OS << " ";

382}

383

386

387}

388

390 if (C) {

392 OS << "<<>> OpenACCClause";

393 return;

394 }

395 {

397 OS << C->getClauseKind();

398

399

400

401 switch (C->getClauseKind()) {

403 OS << '(' << cast(C)->getDefaultClauseKind() << ')';

404 break;

435

436

437 OS << " clause";

438 break;

440 OS << " clause";

441

442

443 auto *GC = cast(C);

444

445 for (unsigned I = 0; I < GC->getNumExprs(); ++I) {

446 OS << " " << GC->getExpr(I).first;

447 }

448 break;

449 }

451 OS << " clause";

452 if (cast(C)->hasForce())

453 OS << ": force";

454 break;

455

459 OS << " clause";

460 if (cast(C)->isReadOnly())

461 OS << " : readonly";

462 break;

466 OS << " clause";

467 if (cast(C)->isZero())

468 OS << " : zero";

469 break;

473 OS << " clause";

474 if (cast(C)->isZero())

475 OS << " : zero";

476 break;

478 OS << " clause";

479 if (cast(C)->hasDevNumExpr())

480 OS << " has devnum";

481 if (cast(C)->hasQueuesTag())

482 OS << " has queues tag";

483 break;

486 OS << "(";

487 llvm::interleaveComma(

488 cast(C)->getArchitectures(), OS,

490 if (Arch.first == nullptr)

491 OS << "*";

492 else

493 OS << Arch.first->getName();

494 });

495 OS << ")";

496 break;

498 OS << " clause Operator: "

499 << cast(C)->getReductionOp();

500 break;

501 default:

502

503 break;

504 }

505 }

508}

509

512 if (TSI) {

513 OS << "case ";

515 } else {

516 OS << "default";

517 }

518

519 if (A.isSelected())

520 OS << " selected";

521}

522

524 if (!R) {

526 OS << "<<>> ConceptReference";

527 return;

528 }

529

530 OS << "ConceptReference";

533 OS << ' ';

535}

536

538 if (!R) {

540 OS << "<<>> Requirement";

541 return;

542 }

543

544 {

548 OS << "TypeRequirement";

549 break;

551 OS << "SimpleRequirement";

552 break;

554 OS << "CompoundRequirement";

555 break;

557 OS << "NestedRequirement";

558 break;

559 }

560 }

561

563

564 if (auto *ER = dyn_castconcepts::ExprRequirement(R)) {

565 if (ER->hasNoexceptRequirement())

566 OS << " noexcept";

567 }

568

570 OS << " dependent";

571 else

572 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");

574 OS << " contains_unexpanded_pack";

575}

576

578 llvm::APFloat V = F;

579 bool ignored;

580 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,

581 &ignored);

582 return V.convertToDouble();

583}

584

585

598 return true;

602 return false;

605 }

606 llvm_unreachable("unexpected APValue kind!");

607}

608

609

610

611

612

613

614

615

616

617

618

619

620

621

622void TextNodeDumper::dumpAPValueChildren(

624 const APValue &(*IdxToChildFun)(const APValue &, unsigned),

625 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {

626

627

628 constexpr unsigned MaxChildrenPerLine = 4;

629 unsigned I = 0;

630 while (I < NumChildren) {

631 unsigned J = I;

632 while (J < NumChildren) {

634 (J - I < MaxChildrenPerLine)) {

635 ++J;

636 continue;

637 }

638 break;

639 }

640

641 J = std::max(I + 1, J);

642

643

644 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {

645 for (unsigned X = I; X < J; ++X) {

647 if (X + 1 != J)

648 OS << ", ";

649 }

650 });

651 I = J;

652 }

653}

654

659 OS << "None";

660 return;

662 OS << "Indeterminate";

663 return;

665 OS << "Int ";

666 {

668 OS << Value.getInt();

669 }

670 return;

672 OS << "Float ";

673 {

676 }

677 return;

679 OS << "FixedPoint ";

680 {

682 OS << Value.getFixedPoint();

683 }

684 return;

688

689 dumpAPValueChildren(

692 return Value.getVectorElt(Index);

693 },

695 return;

696 }

698 OS << "ComplexInt ";

699 {

701 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()

702 << 'i';

703 }

704 return;

706 OS << "ComplexFloat ";

707 {

711 }

712 return;

714 (void)Context;

715 OS << "LValue ";

716 return;

718 unsigned ArraySize = Value.getArraySize();

719 unsigned NumInitializedElements = Value.getArrayInitializedElts();

720 OS << "Array size=" << ArraySize;

721

722 dumpAPValueChildren(

725 return Value.getArrayInitializedElt(Index);

726 },

727 NumInitializedElements, "element", "elements");

728

729 if (Value.hasArrayFiller()) {

731 {

733 OS << ArraySize - NumInitializedElements << " x ";

734 }

736 });

737 }

738

739 return;

740 }

742 OS << "Struct";

743

744 dumpAPValueChildren(

747 return Value.getStructBase(Index);

748 },

749 Value.getStructNumBases(), "base", "bases");

750

751 dumpAPValueChildren(

754 return Value.getStructField(Index);

755 },

756 Value.getStructNumFields(), "field", "fields");

757

758 return;

759 }

761 OS << "Union";

762 {

765 OS << " ." << *cast(FD);

766 }

767

768

769 const APValue &UnionValue = Value.getUnionValue();

771 OS << ' ';

772 Visit(UnionValue, Ty);

773 } else {

775 }

776

777 return;

778 }

780 OS << "MemberPointer ";

781 return;

783 OS << "AddrLabelDiff ";

784 return;

785 }

786 llvm_unreachable("Unknown APValue kind!");

787}

788

791 OS << ' ' << Ptr;

792}

793

795 if (!SM)

796 return;

797

800

801

802

804

806 OS << "";

807 return;

808 }

809

810 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {

814 LastLocLine = PLoc.getLine();

815 } else if (PLoc.getLine() != LastLocLine) {

816 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();

817 LastLocLine = PLoc.getLine();

818 } else {

819 OS << "col" << ':' << PLoc.getColumn();

820 }

821}

822

824

825 if (!SM)

826 return;

827

828 OS << " <";

831 OS << ", ";

833 }

834 OS << ">";

835

836

837}

838

841

844 OS << "'" << T_str << "'";

845

846 if (Desugar && T.isNull()) {

847

848

850 if (T_split != D_split) {

852 if (T_str != D_str)

854 }

855 }

856}

857

859 OS << ' ';

861}

862

864 if (D) {

866 OS << "<<>>";

867 return;

868 }

869

870 {

873 }

875

876 if (const NamedDecl *ND = dyn_cast(D)) {

878 OS << " '" << ND->getDeclName() << '\'';

879 }

880

881 if (const ValueDecl *VD = dyn_cast(D))

883}

884

889 }

890}

891

894 if (AccessSpelling.empty())

895 return;

896 OS << AccessSpelling;

897}

898

901 if (auto *BD = C.dyn_cast<BlockDecl *>())

905 OS << "cleanup ";

906 {

908 OS << CLE->getStmtClassName();

909 }

911 });

912 else

913 llvm_unreachable("unexpected cleanup type");

914}

915

918 switch (TSK) {

920 break;

922 OS << " implicit_instantiation";

923 break;

925 OS << " explicit_specialization";

926 break;

928 OS << " explicit_instantiation_declaration";

929 break;

931 OS << " explicit_instantiation_definition";

932 break;

933 }

934}

935

937 if (!NNS)

938 return;

939

940 AddChild([=] {

941 OS << "NestedNameSpecifier";

942

943 switch (NNS->getKind()) {

944 case NestedNameSpecifier::Identifier:

945 OS << " Identifier";

946 OS << " '" << NNS->getAsIdentifier()->getName() << "'";

947 break;

948 case NestedNameSpecifier::Namespace:

949 OS << " ";

950 dumpBareDeclRef(NNS->getAsNamespace());

951 break;

952 case NestedNameSpecifier::NamespaceAlias:

953 OS << " ";

954 dumpBareDeclRef(NNS->getAsNamespaceAlias());

955 break;

956 case NestedNameSpecifier::TypeSpec:

957 OS << " TypeSpec";

958 dumpType(QualType(NNS->getAsType(), 0));

959 break;

960 case NestedNameSpecifier::TypeSpecWithTemplate:

961 OS << " TypeSpecWithTemplate";

962 dumpType(QualType(NNS->getAsType(), 0));

963 break;

964 case NestedNameSpecifier::Global:

965 OS << " Global";

966 break;

967 case NestedNameSpecifier::Super:

968 OS << " Super";

969 break;

970 }

971

972 dumpNestedNameSpecifier(NNS->getPrefix());

973 });

974}

975

977 if (D)

978 return;

979

981 if (Label.empty())

982 OS << Label << ' ';

984 });

985}

986

989 {

990 llvm::raw_svector_ostream SS(Str);

991 TA.print(PrintPolicy, SS, true);

992 }

993 OS << " '" << Str << "'";

994

995 if (!Context)

996 return;

997

1001 {

1002 llvm::raw_svector_ostream SS(CanonStr);

1003 CanonTA.print(PrintPolicy, SS, true);

1004 }

1005 if (CanonStr != Str)

1006 OS << ":'" << CanonStr << "'";

1007 }

1008}

1009

1010const char *TextNodeDumper::getCommandName(unsigned CommandID) {

1011 if (Traits)

1015 if (Info)

1016 return Info->Name;

1017 return "";

1018}

1019

1021#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \

1022 if (FPO.has##NAME##Override()) \

1023 OS << " " #NAME "=" << FPO.get##NAME##Override();

1024#include "clang/Basic/FPOptions.def"

1025}

1026

1029 OS << " Text=\"" << C->getText() << "\"";

1030}

1031

1034 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";

1035 switch (C->getRenderKind()) {

1037 OS << " RenderNormal";

1038 break;

1040 OS << " RenderBold";

1041 break;

1043 OS << " RenderMonospaced";

1044 break;

1046 OS << " RenderEmphasized";

1047 break;

1049 OS << " RenderAnchor";

1050 break;

1051 }

1052

1053 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)

1054 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";

1055}

1056

1059 OS << " Name=\"" << C->getTagName() << "\"";

1060 if (C->getNumAttrs() != 0) {

1061 OS << " Attrs: ";

1062 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {

1064 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";

1065 }

1066 }

1067 if (C->isSelfClosing())

1068 OS << " SelfClosing";

1069}

1070

1073 OS << " Name=\"" << C->getTagName() << "\"";

1074}

1075

1078 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";

1079 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)

1080 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";

1081}

1082

1085 OS << " "

1087

1088 if (C->isDirectionExplicit())

1089 OS << " explicitly";

1090 else

1091 OS << " implicitly";

1092

1093 if (C->hasParamName()) {

1094 if (C->isParamIndexValid())

1095 OS << " Param=\"" << C->getParamName(FC) << "\"";

1096 else

1097 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";

1098 }

1099

1100 if (C->isParamIndexValid() && C->isVarArgParam())

1101 OS << " ParamIndex=" << C->getParamIndex();

1102}

1103

1106 if (C->hasParamName()) {

1107 if (C->isPositionValid())

1108 OS << " Param=\"" << C->getParamName(FC) << "\"";

1109 else

1110 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";

1111 }

1112

1113 if (C->isPositionValid()) {

1114 OS << " Position=<";

1115 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {

1116 OS << C->getIndex(i);

1117 if (i != e - 1)

1118 OS << ", ";

1119 }

1120 OS << ">";

1121 }

1122}

1123

1126 OS << " Name=\"" << getCommandName(C->getCommandID())

1127 << "\""

1128 " CloseName=\""

1129 << C->getCloseName() << "\"";

1130}

1131

1135 OS << " Text=\"" << C->getText() << "\"";

1136}

1137

1140 OS << " Text=\"" << C->getText() << "\"";

1141}

1142

1144 OS << " null";

1145}

1146

1148 OS << " type";

1150}

1151

1154 OS << " decl";

1157}

1158

1160 OS << " nullptr";

1162}

1163

1165 OS << " integral";

1167}

1168

1171 {

1173 {

1174 llvm::raw_svector_ostream SS(Str);

1175 TN.print(SS, PrintPolicy);

1176 }

1177 OS << "'" << Str << "'";

1178

1179 if (Context) {

1181 CanonTN != TN) {

1183 {

1184 llvm::raw_svector_ostream SS(CanonStr);

1185 CanonTN.print(SS, PrintPolicy);

1186 }

1187 if (CanonStr != Str)

1188 OS << ":'" << CanonStr << "'";

1189 }

1190 }

1191 }

1193 });

1194}

1195

1200 return;

1205 return;

1206 }

1208 OS << " qualified";

1211 OS << " keyword";

1214 return;

1215 }

1217 OS << " dependent";

1220 return;

1221 }

1223 OS << " subst";

1226 OS << " index " << STS->getIndex();

1227 if (std::optional PackIndex = STS->getPackIndex())

1228 OS << " pack_index " << *PackIndex;

1233 return;

1234 }

1236 OS << " deduced";

1241 OS << " start " << StartPos;

1244 });

1245 return;

1246 }

1247

1249 OS << " overloaded";

1250 return;

1252 OS << " assumed";

1253 return;

1255 OS << " subst_pack";

1256 return;

1257 }

1258 llvm_unreachable("Unexpected TemplateName Kind");

1259}

1260

1262 OS << " template";

1265}

1266

1269 OS << " template expansion";

1272}

1273

1276 OS << " expr";

1278}

1279

1281 OS << " pack";

1283}

1284

1286 if (Node->path_empty())

1287 return;

1288

1289 OS << " (";

1290 bool First = true;

1292 E = Node->path_end();

1293 I != E; ++I) {

1296 OS << " -> ";

1297

1298 const auto *RD =

1300

1301 if (Base->isVirtual())

1302 OS << "virtual ";

1303 OS << RD->getName();

1305 }

1306

1307 OS << ')';

1308}

1309

1311 if (Node->hasInitStorage())

1312 OS << " has_init";

1313 if (Node->hasVarStorage())

1314 OS << " has_var";

1315 if (Node->hasElseStorage())

1316 OS << " has_else";

1317 if (Node->isConstexpr())

1318 OS << " constexpr";

1319 if (Node->isConsteval()) {

1320 OS << " ";

1321 if (Node->isNegatedConsteval())

1322 OS << "!";

1323 OS << "consteval";

1324 }

1325}

1326

1328 if (Node->hasInitStorage())

1329 OS << " has_init";

1330 if (Node->hasVarStorage())

1331 OS << " has_var";

1332}

1333

1335 if (Node->hasVarStorage())

1336 OS << " has_var";

1337}

1338

1340 OS << " '" << Node->getName() << "'";

1341 if (Node->isSideEntry())

1342 OS << " side_entry";

1343}

1344

1346 OS << " '" << Node->getLabel()->getName() << "'";

1348}

1349

1351 if (Node->caseStmtIsGNURange())

1352 OS << " gnu_range";

1353}

1354

1356 if (const VarDecl *Cand = Node->getNRVOCandidate()) {

1357 OS << " nrvo_candidate(";

1358 dumpBareDeclRef(Cand);

1359 OS << ")";

1360 }

1361}

1362

1364 if (Node->isImplicit())

1365 OS << " implicit";

1366}

1367

1369 if (Node->isImplicit())

1370 OS << " implicit";

1371}

1372

1374 if (Node->hasAPValueResult())

1376 [=] { Visit(Node->getAPValueResult(), Node->getType()); });

1377}

1378

1380 if (Node->usesADL())

1381 OS << " adl";

1382 if (Node->hasStoredFPFeatures())

1383 printFPOptions(Node->getFPFeatures());

1384}

1385

1388 if (OperatorSpelling)

1389 OS << " '" << OperatorSpelling << "'";

1390

1392}

1393

1395 OS << " <";

1396 {

1398 OS << Node->getCastKindName();

1399 }

1401 OS << ">";

1402 if (Node->hasStoredFPFeatures())

1403 printFPOptions(Node->getFPFeatures());

1404}

1405

1408 if (Node->isPartOfExplicitCast())

1409 OS << " part_of_explicit_cast";

1410}

1411

1413 OS << " ";

1416 if (Node->getDecl() != Node->getFoundDecl()) {

1417 OS << " (";

1419 OS << ")";

1420 }

1421 switch (Node->isNonOdrUse()) {

1423 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;

1424 case NOUR_Constant: OS << " non_odr_use_constant"; break;

1425 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;

1426 }

1427 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())

1428 OS << " dependent_capture";

1429 else if (Node->refersToEnclosingVariableOrCapture())

1430 OS << " refers_to_enclosing_variable_or_capture";

1431

1432 if (Node->isImmediateEscalating())

1433 OS << " immediate-escalating";

1434}

1435

1438

1439 dumpNestedNameSpecifier(Node->getQualifier());

1440}

1441

1444 OS << " (";

1445 if (Node->requiresADL())

1446 OS << "no ";

1447 OS << "ADL) = '" << Node->getName() << '\'';

1448

1450 E = Node->decls_end();

1451 if (I == E)

1452 OS << " empty";

1453 for (; I != E; ++I)

1455}

1456

1458 {

1460 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";

1461 }

1462 OS << "='" << *Node->getDecl() << "'";

1464 if (Node->isFreeIvar())

1465 OS << " isFreeIvar";

1466}

1467

1470 dumpType(Node->getTypeSourceInfo()->getType());

1471}

1472

1475}

1476

1479 OS << " " << Node->getValue();

1480}

1481

1483 bool isSigned = Node->getType()->isSignedIntegerType();

1485 OS << " " << toString(Node->getValue(), 10, isSigned);

1486}

1487

1490 OS << " " << Node->getValueAsString(10);

1491}

1492

1495 OS << " " << Node->getValueAsApproximateDouble();

1496}

1497

1500 OS << " ";

1502}

1503

1506 OS << " field ";

1508 }

1509}

1510

1512 if (E->isResultDependent())

1513 OS << " result_dependent";

1514}

1515

1517 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"

1519 if (Node->canOverflow())

1520 OS << " cannot overflow";

1521 if (Node->hasStoredFPFeatures())

1522 printFPOptions(Node->getStoredFPFeatures());

1523}

1524

1528

1529 if (Node->isArgumentType())

1531}

1532

1534 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();

1537 switch (Node->isNonOdrUse()) {

1539 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;

1540 case NOUR_Constant: OS << " non_odr_use_constant"; break;

1541 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;

1542 }

1543}

1544

1547 OS << " " << Node->getAccessor().getNameStart();

1548}

1549

1552 if (Node->hasStoredFPFeatures())

1553 printFPOptions(Node->getStoredFPFeatures());

1554}

1555

1559 << "' ComputeLHSTy=";

1561 OS << " ComputeResultTy=";

1563 if (Node->hasStoredFPFeatures())

1564 printFPOptions(Node->getStoredFPFeatures());

1565}

1566

1568 OS << " " << Node->getLabel()->getName();

1570}

1571

1573 OS << " " << Node->getCastName() << "<"

1574 << Node->getTypeAsWritten().getAsString() << ">"

1575 << " <" << Node->getCastKindName();

1577 OS << ">";

1578}

1579

1581 OS << " " << (Node->getValue() ? "true" : "false");

1582}

1583

1585 if (Node->isImplicit())

1586 OS << " implicit";

1587 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())

1588 OS << " dependent_capture";

1589 OS << " this";

1590}

1591

1594 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"

1595 << Node->getCastKindName() << ">";

1596 if (Node->hasStoredFPFeatures())

1597 printFPOptions(Node->getFPFeatures());

1598}

1599

1602 if (Node->hasStoredFPFeatures())

1603 printFPOptions(Node->getFPFeatures());

1604}

1605

1609 if (Node->isListInitialization())

1610 OS << " list";

1611}

1612

1616 if (Node->isElidable())

1617 OS << " elidable";

1618 if (Node->isListInitialization())

1619 OS << " list";

1620 if (Node->isStdInitListInitialization())

1621 OS << " std::initializer_list";

1622 if (Node->requiresZeroInitialization())

1623 OS << " zeroing";

1624 if (Node->isImmediateEscalating())

1625 OS << " immediate-escalating";

1626}

1627

1630 OS << " (CXXTemporary";

1632 OS << ")";

1633}

1634

1636 if (Node->isGlobalNew())

1637 OS << " global";

1638 if (Node->isArray())

1639 OS << " array";

1640 if (Node->getOperatorNew()) {

1641 OS << ' ';

1643 }

1644

1645

1646}

1647

1649 if (Node->isGlobalDelete())

1650 OS << " global";

1651 if (Node->isArrayForm())

1652 OS << " array";

1653 if (Node->getOperatorDelete()) {

1654 OS << ' ';

1656 }

1657}

1658

1661}

1662

1665}

1666

1669}

1670

1672 if (Node->hasRewrittenInit())

1673 OS << " has rewritten init";

1674}

1675

1677 if (Node->hasRewrittenInit())

1678 OS << " has rewritten init";

1679}

1680

1683 if (const ValueDecl *VD = Node->getExtendingDecl()) {

1684 OS << " extended by ";

1686 }

1687}

1688

1690 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)

1692}

1693

1697}

1698

1701 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();

1702}

1703

1705 OS << " selector=";

1707 switch (Node->getReceiverKind()) {

1709 break;

1710

1712 OS << " class=";

1714 break;

1715

1717 OS << " super (instance)";

1718 break;

1719

1721 OS << " super (class)";

1722 break;

1723 }

1724}

1725

1727 if (auto *BoxingMethod = Node->getBoxingMethod()) {

1728 OS << " selector=";

1729 BoxingMethod->getSelector().print(OS);

1730 }

1731}

1732

1734 if (Node->getCatchParamDecl())

1735 OS << " catch all";

1736}

1737

1740}

1741

1743 OS << " ";

1745}

1746

1748 OS << ' ' << *Node->getProtocol();

1749}

1750

1752 if (Node->isImplicitProperty()) {

1753 OS << " Kind=MethodRef Getter=\"";

1754 if (Node->getImplicitPropertyGetter())

1755 Node->getImplicitPropertyGetter()->getSelector().print(OS);

1756 else

1757 OS << "(null)";

1758

1759 OS << "\" Setter=\"";

1761 Setter->getSelector().print(OS);

1762 else

1763 OS << "(null)";

1764 OS << "\"";

1765 } else {

1766 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()

1767 << '"';

1768 }

1769

1770 if (Node->isSuperReceiver())

1771 OS << " super";

1772

1773 OS << " Messaging=";

1774 if (Node->isMessagingGetter() && Node->isMessagingSetter())

1775 OS << "Getter&Setter";

1776 else if (Node->isMessagingGetter())

1777 OS << "Getter";

1778 else if (Node->isMessagingSetter())

1779 OS << "Setter";

1780}

1781

1784 if (Node->isArraySubscriptRefExpr())

1785 OS << " Kind=ArraySubscript GetterForArray=\"";

1786 else

1787 OS << " Kind=DictionarySubscript GetterForDictionary=\"";

1788 if (Node->getAtIndexMethodDecl())

1789 Node->getAtIndexMethodDecl()->getSelector().print(OS);

1790 else

1791 OS << "(null)";

1792

1793 if (Node->isArraySubscriptRefExpr())

1794 OS << "\" SetterForArray=\"";

1795 else

1796 OS << "\" SetterForDictionary=\"";

1797 if (Node->setAtIndexMethodDecl())

1798 Node->setAtIndexMethodDecl()->getSelector().print(OS);

1799 else

1800 OS << "(null)";

1801}

1802

1804 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");

1805}

1806

1808 OS << " ";

1809 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {

1810 Visit(Node->getIteratorDecl(I));

1811 OS << " = ";

1813 OS << " begin ";

1815 OS << " end ";

1817 if (Range.Step) {

1818 OS << " step ";

1820 }

1821 }

1822}

1823

1826 OS << " ";

1828}

1829

1832 if (Node->isValueDependent())

1833 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");

1834}

1835

1837 if (T->isSpelledAsLValue())

1838 OS << " written as lvalue reference";

1839}

1840

1842 switch (T->getSizeModifier()) {

1844 break;

1846 OS << " static";

1847 break;

1849 OS << " *";

1850 break;

1851 }

1852 OS << " " << T->getIndexTypeQualifiers().getAsString();

1853}

1854

1856 OS << " " << T->getSize();

1858}

1859

1861 OS << " ";

1864}

1865

1869 OS << " ";

1871}

1872

1875 OS << " ";

1877}

1878

1880 switch (T->getVectorKind()) {

1882 break;

1884 OS << " altivec";

1885 break;

1887 OS << " altivec pixel";

1888 break;

1890 OS << " altivec bool";

1891 break;

1893 OS << " neon";

1894 break;

1896 OS << " neon poly";

1897 break;

1899 OS << " fixed-length sve data vector";

1900 break;

1902 OS << " fixed-length sve predicate vector";

1903 break;

1905 OS << " fixed-length rvv data vector";

1906 break;

1911 OS << " fixed-length rvv mask vector";

1912 break;

1913 }

1914 OS << " " << T->getNumElements();

1915}

1916

1919 if (EI.getNoReturn())

1920 OS << " noreturn";

1921 if (EI.getProducesResult())

1922 OS << " produces_result";

1923 if (EI.getHasRegParm())

1924 OS << " regparm " << EI.getRegParm();

1926}

1927

1930 if (EPI.HasTrailingReturn)

1931 OS << " trailing_return";

1933 OS << " const";

1935 OS << " volatile";

1937 OS << " restrict";

1939 OS << " variadic";

1940 switch (EPI.RefQualifier) {

1942 break;

1944 OS << " &";

1945 break;

1947 OS << " &&";

1948 break;

1949 }

1950

1951 switch (EPI.ExceptionSpec.Type) {

1953 break;

1955 OS << " exceptionspec_dynamic_none";

1956 break;

1958 OS << " exceptionspec_dynamic";

1959 break;

1961 OS << " exceptionspec_ms_any";

1962 break;

1964 OS << " exceptionspec_nothrow";

1965 break;

1967 OS << " exceptionspec_basic_noexcept";

1968 break;

1970 OS << " exceptionspec_dependent_noexcept";

1971 break;

1973 OS << " exceptionspec_noexcept_false";

1974 break;

1976 OS << " exceptionspec_noexcept_true";

1977 break;

1979 OS << " exceptionspec_unevaluated";

1980 break;

1982 OS << " exceptionspec_uninstantiated";

1983 break;

1985 OS << " exceptionspec_unparsed";

1986 break;

1987 }

1988 if (!EPI.ExceptionSpec.Exceptions.empty()) {

1990 OS << "Exceptions:";

1991 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;

1992 ++I) {

1993 if (I)

1994 OS << ",";

1995 dumpType(EPI.ExceptionSpec.Exceptions[I]);

1996 }

1997 });

1998 }

1999 if (EPI.ExceptionSpec.NoexceptExpr) {

2001 OS << "NoexceptExpr: ";

2002 Visit(EPI.ExceptionSpec.NoexceptExpr);

2003 });

2004 }

2005 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");

2006 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");

2007

2008

2010}

2011

2014}

2015

2018 if (T->typeMatchesDecl())

2019 OS << " divergent";

2020}

2021

2024 if (T->typeMatchesDecl())

2025 OS << " divergent";

2026}

2027

2029 switch (T->getUTTKind()) {

2030#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \

2031 case UnaryTransformType::Enum: \

2032 OS << " " #Trait; \

2033 break;

2034#include "clang/Basic/TransformTypeTraits.def"

2035 }

2036}

2037

2040}

2041

2043 OS << " depth " << T->getDepth() << " index " << T->getIndex();

2044 if (T->isParameterPack())

2045 OS << " pack";

2047}

2048

2053 if (auto PackIndex = T->getPackIndex())

2054 OS << " pack_index " << *PackIndex;

2055}

2056

2061}

2062

2064 if (T->isDecltypeAuto())

2065 OS << " decltype(auto)";

2066 if (T->isDeduced())

2067 OS << " undeduced";

2068 if (T->isConstrained())

2070}

2071

2075}

2076

2079 if (T->isTypeAlias())

2080 OS << " alias";

2082}

2083

2087}

2088

2091}

2092

2094 if (auto N = T->getNumExpansions())

2095 OS << " expansions " << *N;

2096}

2097

2099

2101}

2102

2103

2104

2106

2109 dumpType(D->getUnderlyingType());

2111 OS << " __module_private__";

2112}

2113

2115 if (D->isScoped()) {

2116 if (D->isScopedUsingClassTag())

2117 OS << " class";

2118 else

2119 OS << " struct";

2120 }

2123 OS << " __module_private__";

2124 if (D->isFixed())

2126}

2127

2129 OS << ' ' << D->getKindName();

2132 OS << " __module_private__";

2133 if (D->isCompleteDefinition())

2134 OS << " definition";

2135}

2136

2140}

2141

2145

2146 for (const auto *Child : D->chain())

2148}

2149

2154

2158 if (D->isInlineSpecified())

2159 OS << " inline";

2160 if (D->isVirtualAsWritten())

2161 OS << " virtual";

2163 OS << " __module_private__";

2164

2165 if (D->isPureVirtual())

2166 OS << " pure";

2167 if (D->isDefaulted()) {

2168 OS << " default";

2169 if (D->isDeleted())

2170 OS << "_delete";

2171 }

2172 if (D->isDeletedAsWritten())

2173 OS << " delete";

2174 if (D->isTrivial())

2175 OS << " trivial";

2176

2177 if (const StringLiteral *M = D->getDeletedMessage())

2179

2180 if (D->isIneligibleOrNotSelected())

2181 OS << (isa(D) ? " not_selected" : " ineligible");

2182

2186 default:

2187 break;

2190 break;

2193 break;

2194 }

2195 }

2196

2197 if (const auto *MD = dyn_cast(D)) {

2198 if (MD->size_overridden_methods() != 0) {

2201 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()

2203 };

2204

2206 auto Overrides = MD->overridden_methods();

2207 OS << "Overrides: [ ";

2208 dumpOverride(*Overrides.begin());

2209 for (const auto *Override : llvm::drop_begin(Overrides)) {

2210 OS << ", ";

2211 dumpOverride(Override);

2212 }

2213 OS << " ]";

2214 });

2215 }

2216 }

2217

2218 if (D->isInlineSpecified() && D->isInlined()) {

2219 OS << " implicit-inline";

2220 }

2221

2222

2223

2224

2225 if (D->param_empty() && D->param_begin())

2226 OS << " <<<NULL params x " << D->getNumParams() << ">>>";

2227

2228 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {

2229 OS << " instantiated_from";

2231 }

2232}

2233

2237 switch (D->getDeductionCandidateKind()) {

2240 return;

2242 OS << " aggregate ";

2243 break;

2244 }

2245}

2246

2249 OS << " extended by ";

2251 OS << " mangling ";

2252 {

2254 OS << D->getManglingNumber();

2255 }

2256}

2257

2261 if (D->isMutable())

2262 OS << " mutable";

2264 OS << " __module_private__";

2265}

2266

2270 if (const auto *P = dyn_cast(D);

2271 P && P->isExplicitObjectParameter())

2272 OS << " this";

2273

2279 switch (D->getTLSKind()) {

2281 break;

2283 OS << " tls";

2284 break;

2286 OS << " tls_dynamic";

2287 break;

2288 }

2290 OS << " __module_private__";

2291 if (D->isNRVOVariable())

2292 OS << " nrvo";

2293 if (D->isInline())

2294 OS << " inline";

2295 if (D->isConstexpr())

2296 OS << " constexpr";

2297 if (D->hasInit()) {

2298 switch (D->getInitStyle()) {

2300 OS << " cinit";

2301 break;

2303 OS << " callinit";

2304 break;

2306 OS << " listinit";

2307 break;

2309 OS << " parenlistinit";

2310 }

2311 }

2313 OS << " destroyed";

2315 OS << " pack";

2316

2317 if (D->hasInit()) {

2318 const Expr *E = D->getInit();

2319

2321 D->getType()->isDependentType()) {

2325 }

2326 }

2327}

2328

2332}

2333

2335 if (D->isNothrow())

2336 OS << " nothrow";

2337}

2338

2340 OS << ' ' << D->getImportedModule()->getFullModuleName();

2341

2342 for (Decl *InitD :

2345}

2346

2348 OS << ' ';

2349 switch (D->getCommentKind()) {

2351 llvm_unreachable("unexpected pragma comment kind");

2353 OS << "compiler";

2354 break;

2356 OS << "exestr";

2357 break;

2359 OS << "lib";

2360 break;

2362 OS << "linker";

2363 break;

2365 OS << "user";

2366 break;

2367 }

2368 StringRef Arg = D->getArg();

2369 if (!Arg.empty())

2370 OS << " \"" << Arg << "\"";

2371}

2372

2375 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";

2376}

2377

2380 if (D->isStandaloneDirective())

2381 OS << " openmp_standalone_directive";

2382}

2383

2388 OS << " combiner";

2390 if (const auto *Initializer = D->getInitializer()) {

2391 OS << " initializer";

2393 switch (D->getInitializerKind()) {

2395 OS << " omp_priv = ";

2396 break;

2398 OS << " omp_priv ()";

2399 break;

2401 break;

2402 }

2403 }

2404}

2405

2407 for (const auto *C : D->clauselists()) {

2409 if (C) {

2411 OS << "<<>> OMPClause";

2412 return;

2413 }

2414 {

2416 StringRef ClauseName(

2417 llvm::omp::getOpenMPClauseName(C->getClauseKind()));

2418 OS << "OMP" << ClauseName.substr(0, 1).upper()

2419 << ClauseName.drop_front() << "Clause";

2420 }

2423 });

2424 }

2425}

2426

2430}

2431

2434 if (D->isInline())

2435 OS << " inline";

2436 if (D->isNested())

2437 OS << " nested";

2440}

2441

2443 OS << ' ';

2445}

2446

2450}

2451

2454 dumpType(D->getUnderlyingType());

2455}

2456

2460}

2461

2464 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {

2465 OS << " instantiated_from";

2467 }

2468 if (const auto *CTSD = dyn_cast(D))

2470

2472

2473 if (D->isCompleteDefinition())

2474 return;

2475

2477 {

2479 OS << "DefinitionData";

2480 }

2481#define FLAG(fn, name) \

2482 if (D->fn()) \

2483 OS << " " #name;

2484 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);

2485

2486 FLAG(isGenericLambda, generic);

2487 FLAG(isLambda, lambda);

2488

2489 FLAG(isAnonymousStructOrUnion, is_anonymous);

2491 FLAG(isEmpty, empty);

2492 FLAG(isAggregate, aggregate);

2493 FLAG(isStandardLayout, standard_layout);

2494 FLAG(isTriviallyCopyable, trivially_copyable);

2495 FLAG(isPOD, pod);

2497 FLAG(isPolymorphic, polymorphic);

2498 FLAG(isAbstract, abstract);

2499 FLAG(isLiteral, literal);

2500

2501 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);

2502 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);

2503 FLAG(hasMutableFields, has_mutable_fields);

2504 FLAG(hasVariantMembers, has_variant_members);

2505 FLAG(allowConstDefaultInit, can_const_default_init);

2506

2508 {

2510 OS << "DefaultConstructor";

2511 }

2512 FLAG(hasDefaultConstructor, exists);

2513 FLAG(hasTrivialDefaultConstructor, trivial);

2514 FLAG(hasNonTrivialDefaultConstructor, non_trivial);

2515 FLAG(hasUserProvidedDefaultConstructor, user_provided);

2516 FLAG(hasConstexprDefaultConstructor, constexpr);

2517 FLAG(needsImplicitDefaultConstructor, needs_implicit);

2518 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);

2519 });

2520

2522 {

2524 OS << "CopyConstructor";

2525 }

2526 FLAG(hasSimpleCopyConstructor, simple);

2527 FLAG(hasTrivialCopyConstructor, trivial);

2528 FLAG(hasNonTrivialCopyConstructor, non_trivial);

2529 FLAG(hasUserDeclaredCopyConstructor, user_declared);

2530 FLAG(hasCopyConstructorWithConstParam, has_const_param);

2531 FLAG(needsImplicitCopyConstructor, needs_implicit);

2532 FLAG(needsOverloadResolutionForCopyConstructor,

2533 needs_overload_resolution);

2534 if (D->needsOverloadResolutionForCopyConstructor())

2535 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);

2536 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);

2537 });

2538

2540 {

2542 OS << "MoveConstructor";

2543 }

2544 FLAG(hasMoveConstructor, exists);

2545 FLAG(hasSimpleMoveConstructor, simple);

2546 FLAG(hasTrivialMoveConstructor, trivial);

2547 FLAG(hasNonTrivialMoveConstructor, non_trivial);

2548 FLAG(hasUserDeclaredMoveConstructor, user_declared);

2549 FLAG(needsImplicitMoveConstructor, needs_implicit);

2550 FLAG(needsOverloadResolutionForMoveConstructor,

2551 needs_overload_resolution);

2552 if (D->needsOverloadResolutionForMoveConstructor())

2553 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);

2554 });

2555

2557 {

2559 OS << "CopyAssignment";

2560 }

2561 FLAG(hasSimpleCopyAssignment, simple);

2562 FLAG(hasTrivialCopyAssignment, trivial);

2563 FLAG(hasNonTrivialCopyAssignment, non_trivial);

2564 FLAG(hasCopyAssignmentWithConstParam, has_const_param);

2565 FLAG(hasUserDeclaredCopyAssignment, user_declared);

2566 FLAG(needsImplicitCopyAssignment, needs_implicit);

2567 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);

2568 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);

2569 });

2570

2572 {

2574 OS << "MoveAssignment";

2575 }

2576 FLAG(hasMoveAssignment, exists);

2577 FLAG(hasSimpleMoveAssignment, simple);

2578 FLAG(hasTrivialMoveAssignment, trivial);

2579 FLAG(hasNonTrivialMoveAssignment, non_trivial);

2580 FLAG(hasUserDeclaredMoveAssignment, user_declared);

2581 FLAG(needsImplicitMoveAssignment, needs_implicit);

2582 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);

2583 });

2584

2586 {

2588 OS << "Destructor";

2589 }

2590 FLAG(hasSimpleDestructor, simple);

2591 FLAG(hasIrrelevantDestructor, irrelevant);

2592 FLAG(hasTrivialDestructor, trivial);

2593 FLAG(hasNonTrivialDestructor, non_trivial);

2594 FLAG(hasUserDeclaredDestructor, user_declared);

2595 FLAG(hasConstexprDestructor, constexpr);

2596 FLAG(needsImplicitDestructor, needs_implicit);

2597 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);

2598 if (D->needsOverloadResolutionForDestructor())

2599 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);

2600 });

2601 });

2602

2603 for (const auto &I : D->bases()) {

2605 if (I.isVirtual())

2606 OS << "virtual ";

2609 if (I.isPackExpansion())

2610 OS << "...";

2611 });

2612 }

2613}

2614

2617}

2618

2621}

2622

2625}

2626

2629}

2630

2632 if (const auto *TC = D->getTypeConstraint()) {

2633 OS << " ";

2635 if (TC->getNamedConcept() != TC->getFoundDecl()) {

2636 OS << " (";

2638 OS << ")";

2639 }

2640 } else if (D->wasDeclaredWithTypename())

2641 OS << " typename";

2642 else

2643 OS << " class";

2644 OS << " depth " << D->getDepth() << " index " << D->getIndex();

2646 OS << " ...";

2648}

2649

2653 OS << " depth " << D->getDepth() << " index " << D->getIndex();

2655 OS << " ...";

2657}

2658

2661 OS << " depth " << D->getDepth() << " index " << D->getIndex();

2663 OS << " ...";

2665}

2666

2668 OS << ' ';

2669 if (D->getQualifier())

2671 OS << D->getDeclName();

2673}

2674

2676 OS << ' ';

2678}

2679

2682 OS << ' ';

2683 if (D->getQualifier())

2685 OS << D->getDeclName();

2686}

2687

2690 OS << ' ';

2691 if (D->getQualifier())

2693 OS << D->getDeclName();

2695}

2696

2698 OS << ' ';

2700}

2701

2704 if (D->constructsVirtualBase())

2705 OS << " virtual";

2706

2708 OS << "target ";

2710 });

2711

2713 OS << "nominated ";

2715 OS << ' ';

2717 });

2718

2720 OS << "constructed ";

2722 OS << ' ';

2724 });

2725}

2726

2728 switch (D->getLanguage()) {

2730 OS << " C";

2731 break;

2733 OS << " C++";

2734 break;

2735 }

2736}

2737

2739 OS << ' ';

2741}

2742

2746 if (D->isPackExpansion())

2747 OS << "...";

2748}

2749

2753 if (D->getSynthesize())

2754 OS << " synthesize";

2755

2756 switch (D->getAccessControl()) {

2758 OS << " none";

2759 break;

2761 OS << " private";

2762 break;

2764 OS << " protected";

2765 break;

2767 OS << " public";

2768 break;

2770 OS << " package";

2771 break;

2772 }

2773}

2774

2776 if (D->isInstanceMethod())

2777 OS << " -";

2778 else

2779 OS << " +";

2782

2783 if (D->isVariadic())

2784 OS << " variadic";

2785}

2786

2789 switch (D->getVariance()) {

2791 break;

2792

2794 OS << " covariant";

2795 break;

2796

2798 OS << " contravariant";

2799 break;

2800 }

2801

2802 if (D->hasExplicitBound())

2803 OS << " bounded";

2804 dumpType(D->getUnderlyingType());

2805}

2806

2811 for (const auto *P : D->protocols())

2813}

2814

2819}

2820

2823

2824 for (const auto *Child : D->protocols())

2826}

2827

2831

2833 for (const auto *Child : D->protocols())

2835}

2836

2842}

2843

2848}

2849

2853

2855 OS << " required";

2857 OS << " optional";

2858

2862 OS << " readonly";

2864 OS << " assign";

2866 OS << " readwrite";

2868 OS << " retain";

2870 OS << " copy";

2872 OS << " nonatomic";

2874 OS << " atomic";

2876 OS << " weak";

2878 OS << " strong";

2880 OS << " unsafe_unretained";

2882 OS << " class";

2884 OS << " direct";

2886 dumpDeclRef(D->getGetterMethodDecl(), "getter");

2888 dumpDeclRef(D->getSetterMethodDecl(), "setter");

2889 }

2890}

2891

2895 OS << " synthesize";

2896 else

2897 OS << " dynamic";

2900}

2901

2903 if (D->isVariadic())

2904 OS << " variadic";

2905

2906 if (D->capturesCXXThis())

2907 OS << " captures_this";

2908}

2909

2912}

2913

2915 VisitStmt(S);

2916 if (S->hasStoredFPFeatures())

2917 printFPOptions(S->getStoredFPFeatures());

2918}

2919

2921 if (D->isCBuffer())

2922 OS << " cbuffer";

2923 else

2924 OS << " tbuffer";

2926}

2927

2929 OS << (E->isInOut() ? " inout" : " out");

2930}

2931

2933 OS << " " << S->getDirectiveKind();

2934}

2936 if (S->isOrphanedLoopConstruct())

2937 OS << " ";

2938 else

2939 OS << " parent: " << S->getParentComputeConstructKind();

2940}

2941

2945}

2946

2949}

2950

2954}

2955

2959}

2960

2964}

2965

2968}

2971}

2975}

2978}

2982}

2983

2985 AddChild("begin", [=] { OS << S->getStartingElementPos(); });

2986 AddChild("number of elements", [=] { OS << S->getDataElementCount(); });

2987}

2988

2991}

static double GetApproxValue(const llvm::APFloat &F)

static bool isTrivial(ASTContext &Ctx, const Expr *E)

Checks if the expression is constant or does not have non-trivial function calls.

This file defines OpenMP nodes for declarative directives.

Defines the C++ template declaration subclasses.

Defines the clang::Module class, which describes a module in the source code.

static std::string toString(const clang::SanitizerSet &Sanitizers)

Produce a string containing comma-separated names of sanitizers in Sanitizers set.

static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)

Determine whether a type is permitted to be passed or returned in registers, per C++ [class....

Defines the SourceManager interface.

Defines various enumerations that describe declaration and type specifiers.

static bool isSimpleAPValue(const APValue &Value)

True if the APValue Value can be folded onto the current line.

static void dumpBasePath(raw_ostream &OS, const CastExpr *Node)

static void dumpPreviousDeclImpl(raw_ostream &OS,...)

static void dumpPreviousDecl(raw_ostream &OS, const Decl *D)

Dump the previous declaration in the redeclaration chain for a declaration, if any.

Defines enumerations for the type traits support.

C Language Family Type Representation.

APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...

@ Indeterminate

This object has an indeterminate value (C++ [basic.indet]).

@ None

There is no such object (it's outside its lifetime).

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

TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const

Retrieve the "canonical" template argument.

ArrayRef< Decl * > getModuleInitializers(Module *M)

Get the initializations to perform when importing a module, if any.

TemplateName getCanonicalTemplateName(TemplateName Name, bool IgnoreDeduced=false) const

Retrieves the "canonical" template name that refers to a given template.

const clang::PrintingPolicy & getPrintingPolicy() const

ArrayRef< Module * > getModulesWithMergedDefinition(const NamedDecl *Def)

Get the additional modules in which the definition Def has been merged.

Represents an access specifier followed by colon ':'.

AddrLabelExpr - The GNU address of label extension, representing &&label.

An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.

Represents an array type, per C99 6.7.5.2 - Array Declarators.

AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...

StringRef getOpAsString() const

Attr - This represents one attribute.

attr::Kind getKind() const

bool isImplicit() const

Returns true if the attribute has been implicitly created instead of explicitly written by the user.

SourceRange getRange() const

Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.

A builtin binary operation expression such as "x + y" or "x <= y".

StringRef getOpcodeStr() const

A binding in a decomposition declaration.

A class which contains all the information about a particular captured value.

Represents a block literal declaration, which is like an unnamed FunctionDecl.

Represents the builtin template declaration which is used to implement __make_integer_seq and other b...

Represents a base class of a C++ class.

Represents binding an expression to a temporary.

A boolean literal, per ([C++ lex.bool] Boolean literals).

Represents a call to a C++ constructor.

Represents a C++ constructor within a class.

Represents a C++ base or member initializer.

Represents a C++ deduction guide declaration.

A default argument (C++ [dcl.fct.default]).

A use of a default initializer in a constructor or in aggregate initialization.

Represents a delete expression for memory deallocation and destructor calls, e.g.

Represents a C++ member access expression where the actual member referenced could not be resolved be...

Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....

Represents a static or instance method of a struct/union/class.

Abstract class common to all of the C++ "named"/"keyword" casts.

Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".

A call to an overloaded operator written using operator syntax.

Represents a C++ struct/union/class.

A C++ static_cast expression (C++ [expr.static.cast]).

Represents the this expression in C++.

Describes an explicit type conversion that uses functional notion but could not be resolved because o...

CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).

Represents the body of a CapturedStmt, and serves as its DeclContext.

CaseStmt - Represent a case statement.

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

const CXXBaseSpecifier *const * path_const_iterator

Declaration of a class template.

Represents a 'co_await' expression.

CompoundAssignOperator - For compound assignments (e.g.

CompoundLiteralExpr - [C99 6.5.2.5].

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

Declaration of a C++20 concept.

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

SourceRange getSourceRange() const LLVM_READONLY

ConceptDecl * getNamedConcept() const

Represents the specialization of a concept - evaluates to a prvalue of type bool.

Represents the canonical version of C arrays with a specified constant size.

ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...

Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...

Represents a 'co_return' statement in the C++ Coroutines TS.

A reference to a declared variable, function, enum, etc.

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

Decl * getPreviousDecl()

Retrieve the previous declaration that declares the same entity as this declaration,...

bool isModulePrivate() const

Whether this declaration was marked as being private to the module in which it was defined.

FriendObjectKind getFriendObjectKind() const

Determines whether this declaration is the object of a friend declaration and, if so,...

ASTContext & getASTContext() const LLVM_READONLY

bool isImplicit() const

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

bool isParameterPack() const

Whether this declaration is a parameter pack.

@ FOK_Undeclared

A friend of a previously-undeclared entity.

@ FOK_None

Not a friend object.

@ FOK_Declared

A friend of a previously-declared entity.

Module * getOwningModule() const

Get the module that owns this declaration (for visibility purposes).

bool isFirstDecl() const

True if this is the first declaration in its redeclaration chain.

bool isFromASTFile() const

Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...

bool isInvalidDecl() const

SourceLocation getLocation() const

const char * getDeclKindName() const

bool isThisDeclarationReferenced() const

Whether this declaration was referenced.

bool isUsed(bool CheckUsedAttr=true) const

Whether any (re-)declaration of the entity was used, meaning that a definition is required.

DeclContext * getDeclContext()

AccessSpecifier getAccess() const

void print(raw_ostream &Out, unsigned Indentation=0, bool PrintInstantiation=false) const

DeclContext * getLexicalDeclContext()

getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).

virtual SourceRange getSourceRange() const LLVM_READONLY

Source range that this declaration covers.

Represents a C++17 deduced template specialization type.

TemplateName getUnderlying() const

DefaultArguments getDefaultArguments() const

A qualified reference to a name whose declaration cannot yet be resolved.

Represents an array type in C++ whose size is a value-dependent expression.

Represents an extended vector type where either the type or size is dependent.

Represents a dependent template name that cannot be resolved prior to template instantiation.

NestedNameSpecifier * getQualifier() const

Return the nested name specifier that qualifies this name.

SourceRange getSourceRange() const

For nodes which represent textual entities in the source code, return their SourceRange.

void print(llvm::raw_ostream &OS, const PrintingPolicy &PP) const

Prints the node to the given output stream.

Represents a reference to #emded data.

An instance of this object exists for each enum constant that is defined.

Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...

llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject

The type of objects that are kept in the cleanup.

This represents one expression.

bool isValueDependent() const

Determines whether the value of this expression depends on.

ExprValueKind getValueKind() const

getValueKind - The value kind that this expression produces.

bool containsErrors() const

Whether this expression contains subexpressions which had errors, e.g.

ExprObjectKind getObjectKind() const

getObjectKind - The object kind that this expression produces.

An expression trait intrinsic.

ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...

Represents difference between two FPOptions values.

Represents a member of a struct/union/class.

FriendDecl - Represents the declaration of a friend entity, which can be a function,...

Represents a function declaration or definition.

Represents a prototype with parameter type info, e.g.

ExtProtoInfo getExtProtoInfo() const

Declaration of a template function.

FunctionType - C99 6.7.5.3 - Function Declarators.

ExtInfo getExtInfo() const

static StringRef getNameForCallConv(CallingConv CC)

Represents a C11 generic selection.

AssociationTy< true > ConstAssociation

GotoStmt - This represents a direct goto.

HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.

This class represents temporary values used to represent inout and out arguments in HLSL.

IfStmt - This represents an if/then/else.

ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...

Describes a module import declaration, which makes the contents of the named module visible in the cu...

Represents a field injected from an anonymous union/struct into the parent scope.

Describes an C or C++ initializer list.

FieldDecl * getInitializedFieldInUnion()

If this initializes a union, specifies which field in the union to initialize.

The injected class name of a C++ class template or class template partial specialization.

Represents the declaration of a label.

LabelStmt - Represents a label, which has a substatement.

Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...

Represents a linkage specification.

Represents a prvalue temporary that is written into memory so that a reference can bind to it.

MemberExpr - [C99 6.5.2.3] Structure and Union Members.

Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...

Describes a module or submodule.

This represents a decl that may have a name.

DeclarationName getDeclName() const

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

Represents a C++ namespace alias.

Represent a C++ namespace.

Represents a C++ nested name specifier, such as "\::std::vector::".

SpecifierKind getKind() const

Determine what kind of nested name specifier is stored.

NestedNameSpecifier * getPrefix() const

Return the prefix of this nested name specifier.

NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.

Pseudo declaration for capturing expressions.

This is a basic class for representing single OpenMP clause.

This represents '#pragma omp declare reduction ...' directive.

This is a basic class for representing single OpenMP executable directive.

OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...

This represents '#pragma omp requires...' directive.

Represents Objective-C's @catch statement.

ObjCBoolLiteralExpr - Objective-C Boolean Literal.

ObjCBoxedExpr - used for generalized expression boxing.

ObjCCategoryDecl - Represents a category declaration.

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

ObjCCompatibleAliasDecl - Represents alias of a class.

ObjCEncodeExpr, used for @encode in Objective-C.

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

Represents an ObjC class declaration.

Interfaces are the core concept in Objective-C for object oriented design.

ObjCIvarDecl - Represents an ObjC instance variable.

ObjCIvarRefExpr - A reference to an ObjC instance variable.

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

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

ObjCMethodDecl - Represents an instance or class method declaration.

Represents one property declaration in an Objective-C interface.

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

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

Represents an Objective-C protocol declaration.

ObjCProtocolExpr used for protocol expression in Objective-C.

ObjCSelectorExpr used for @selector in Objective-C.

ObjCSubscriptRefExpr - used for array and dictionary subscripting.

Represents the declaration of an Objective-C type parameter.

This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...

This is the base type for all OpenACC Clauses.

This is the base class for an OpenACC statement-level construct, other construct types are expected t...

This class represents a 'loop' construct.

Represents a pack expansion of types.

Represents a #pragma detect_mismatch line.

[C99 6.4.2.2] - A predefined identifier such as func.

StringRef getIdentKindName() const

Represents an unpacked "presumed" location which can be presented to the user.

unsigned getColumn() const

Return the presumed column number of this location.

const char * getFilename() const

Return the presumed filename of this location.

unsigned getLine() const

Return the presumed line number of this location.

bool isInvalid() const

Return true if this object is invalid or uninitialized.

A (possibly-)qualified type.

std::string getAsString() const

Represents a template name as written in source code.

TemplateName getUnderlyingTemplate() const

Return the underlying template name.

NestedNameSpecifier * getQualifier() const

Return the nested name specifier that qualifies this name.

bool hasTemplateKeyword() const

Whether the template name was prefixed by the "template" keyword.

Represents a struct/union/class.

A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...

RecordDecl * getDecl() const

Provides common interface for the Decls that can be redeclared.

Base for LValueReferenceType and RValueReferenceType.

C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...

ReturnStmt - This represents a return, optionally of an expression: return; return 4;.

Represents an expression that computes the length of a parameter pack.

Encodes a location in the source.

PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const

Returns the "presumed" location of a SourceLocation specifies.

SourceLocation getSpellingLoc(SourceLocation Loc) const

Given a SourceLocation object, return the spelling location referenced by the ID.

A trivial tuple used to represent a source range.

SourceLocation getEnd() const

SourceLocation getBegin() const

RetTy Visit(PTR(Stmt) S, ParamTys... P)

Stmt - This represents one statement.

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

void outputString(raw_ostream &OS) const

A structure for storing the information associated with a substituted template template parameter.

TemplateName getReplacement() const

std::optional< unsigned > getPackIndex() const

TemplateTemplateParmDecl * getParameter() const

unsigned getIndex() const

Returns the index of the replaced parameter in the associated declaration.

Decl * getAssociatedDecl() const

A template-like entity which owns the whole pattern being substituted.

Represents the result of substituting a set of types for a template type parameter pack.

Represents the result of substituting a type for a template type parameter.

SwitchStmt - This represents a 'switch' stmt.

Represents a template argument.

TemplateName getAsTemplate() const

Retrieve the template name for a template name argument.

bool structurallyEquals(const TemplateArgument &Other) const

Determines whether two template arguments are superficially the same.

void print(const PrintingPolicy &Policy, raw_ostream &Out, bool IncludeType) const

Print this template argument to the given output stream.

ValueDecl * getAsDecl() const

Retrieve the declaration for a declaration non-type template argument.

TemplateName getAsTemplateOrTemplatePattern() const

Retrieve the template argument as a template name; if the argument is a pack expansion,...

Represents a C++ template name within the type system.

TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const

Retrieve the underlying template declaration that this template name refers to, if known.

DeducedTemplateStorage * getAsDeducedTemplateName() const

Retrieve the deduced template info, if any.

DependentTemplateName * getAsDependentTemplateName() const

Retrieve the underlying dependent template name structure, if any.

QualifiedTemplateName * getAsQualifiedTemplateName() const

Retrieve the underlying qualified template name structure, if any.

void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const

Print the template name.

@ UsingTemplate

A template name that refers to a template declaration found through a specific using shadow declarati...

@ OverloadedTemplate

A set of overloaded template declarations.

@ Template

A single template declaration.

@ DependentTemplate

A dependent template name that has not been resolved to a template (or set of templates).

@ SubstTemplateTemplateParm

A template template parameter that has been substituted for some other template name.

@ SubstTemplateTemplateParmPack

A template template parameter pack that has been substituted for a template template argument pack,...

@ DeducedTemplate

A template name that refers to another TemplateName with deduced default arguments.

@ QualifiedTemplate

A qualified template name, where the qualification is kept to describe the source code as written.

@ AssumedTemplate

An unqualified-id that has been assumed to name a function template that will be found by ADL.

UsingShadowDecl * getAsUsingShadowDecl() const

Retrieve the using shadow declaration through which the underlying template declaration is introduced...

SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const

Retrieve the substituted template template parameter, if known.

Represents a type template specialization; the template must be a class template, a type alias templa...

TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.

Declaration of a template type parameter.

void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node)

void VisitEnumDecl(const EnumDecl *D)

void VisitExprWithCleanups(const ExprWithCleanups *Node)

void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)

void VisitCXXStaticCastExpr(const CXXStaticCastExpr *Node)

void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)

void dumpPointer(const void *Ptr)

void VisitDeclarationTemplateArgument(const TemplateArgument &TA)

void VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *S)

void VisitLinkageSpecDecl(const LinkageSpecDecl *D)

void VisitVectorType(const VectorType *T)

void VisitCoawaitExpr(const CoawaitExpr *Node)

void VisitUnaryOperator(const UnaryOperator *Node)

void dumpAccessSpecifier(AccessSpecifier AS)

void VisitHLSLOutArgExpr(const HLSLOutArgExpr *E)

void VisitDeducedTemplateSpecializationType(const DeducedTemplateSpecializationType *T)

void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node)

void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *Node)

void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *Node)

void VisitPragmaCommentDecl(const PragmaCommentDecl *D)

void VisitDependentScopeDeclRefExpr(const DependentScopeDeclRefExpr *Node)

void VisitImportDecl(const ImportDecl *D)

void VisitUsingEnumDecl(const UsingEnumDecl *D)

void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D)

void VisitUnresolvedUsingType(const UnresolvedUsingType *T)

void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node)

void VisitIntegralTemplateArgument(const TemplateArgument &TA)

void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)

void VisitIndirectFieldDecl(const IndirectFieldDecl *D)

void VisitNullTemplateArgument(const TemplateArgument &TA)

void VisitPackTemplateArgument(const TemplateArgument &TA)

void VisitUsingType(const UsingType *T)

void VisitInjectedClassNameType(const InjectedClassNameType *T)

void VisitBinaryOperator(const BinaryOperator *Node)

void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)

void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)

void VisitBlockDecl(const BlockDecl *D)

void VisitCXXDeleteExpr(const CXXDeleteExpr *Node)

void VisitObjCBoxedExpr(const ObjCBoxedExpr *Node)

void VisitNullPtrTemplateArgument(const TemplateArgument &TA)

void VisitVarTemplateDecl(const VarTemplateDecl *D)

void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)

void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *Node)

void VisitCXXDeductionGuideDecl(const CXXDeductionGuideDecl *D)

TextNodeDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)

void VisitPredefinedExpr(const PredefinedExpr *Node)

void dumpType(QualType T)

void VisitObjCEncodeExpr(const ObjCEncodeExpr *Node)

void VisitHLSLBufferDecl(const HLSLBufferDecl *D)

void VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D)

void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D)

void VisitObjCMessageExpr(const ObjCMessageExpr *Node)

void dumpSourceRange(SourceRange R)

void VisitMemberExpr(const MemberExpr *Node)

void VisitOpenACCDataConstruct(const OpenACCDataConstruct *S)

void dumpBareTemplateName(TemplateName TN)

void VisitOpenACCConstructStmt(const OpenACCConstructStmt *S)

void VisitCompoundStmt(const CompoundStmt *Node)

void VisitConstantExpr(const ConstantExpr *Node)

void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node)

void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *S)

void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Node)

void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D)

void VisitWhileStmt(const WhileStmt *Node)

void VisitCharacterLiteral(const CharacterLiteral *Node)

void VisitAccessSpecDecl(const AccessSpecDecl *D)

void VisitFunctionType(const FunctionType *T)

void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)

void VisitReturnStmt(const ReturnStmt *Node)

void VisitTypeLoc(TypeLoc TL)

void VisitAutoType(const AutoType *T)

void VisitObjCInterfaceType(const ObjCInterfaceType *T)

void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)

void VisitTypedefDecl(const TypedefDecl *D)

void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node)

void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)

void VisitIntegerLiteral(const IntegerLiteral *Node)

void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)

void VisitGotoStmt(const GotoStmt *Node)

void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T)

void VisitFriendDecl(const FriendDecl *D)

void VisitSwitchStmt(const SwitchStmt *Node)

void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *Node)

void VisitEmbedExpr(const EmbedExpr *S)

void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)

void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)

void VisitUsingDecl(const UsingDecl *D)

void VisitConstantArrayType(const ConstantArrayType *T)

void VisitTypeTemplateArgument(const TemplateArgument &TA)

void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)

void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)

void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)

void VisitArrayType(const ArrayType *T)

void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)

void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node)

void visitTextComment(const comments::TextComment *C, const comments::FullComment *)

void VisitLifetimeExtendedTemporaryDecl(const LifetimeExtendedTemporaryDecl *D)

void VisitCXXRecordDecl(const CXXRecordDecl *D)

void VisitTemplateTemplateArgument(const TemplateArgument &TA)

void dumpCleanupObject(const ExprWithCleanups::CleanupObject &C)

void VisitOpenACCExitDataConstruct(const OpenACCExitDataConstruct *S)

void VisitCaseStmt(const CaseStmt *Node)

void VisitRValueReferenceType(const ReferenceType *T)

void VisitPackExpansionType(const PackExpansionType *T)

void VisitConceptDecl(const ConceptDecl *D)

void VisitOpenACCEnterDataConstruct(const OpenACCEnterDataConstruct *S)

void VisitCallExpr(const CallExpr *Node)

void VisitCapturedDecl(const CapturedDecl *D)

void VisitOpenACCWaitConstruct(const OpenACCWaitConstruct *S)

void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D)

void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node)

void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D)

void VisitCoreturnStmt(const CoreturnStmt *Node)

void VisitSizeOfPackExpr(const SizeOfPackExpr *Node)

void VisitDeclRefExpr(const DeclRefExpr *Node)

void VisitLabelStmt(const LabelStmt *Node)

void VisitOpenACCUpdateConstruct(const OpenACCUpdateConstruct *S)

void Visit(const comments::Comment *C, const comments::FullComment *FC)

void dumpNestedNameSpecifier(const NestedNameSpecifier *NNS)

void VisitLabelDecl(const LabelDecl *D)

void VisitUnaryTransformType(const UnaryTransformType *T)

void VisitStringLiteral(const StringLiteral *Str)

void VisitOMPRequiresDecl(const OMPRequiresDecl *D)

void dumpBareType(QualType T, bool Desugar=true)

void VisitTemplateSpecializationType(const TemplateSpecializationType *T)

void VisitOpenACCInitConstruct(const OpenACCInitConstruct *S)

void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)

void VisitCompoundAssignOperator(const CompoundAssignOperator *Node)

void VisitCXXThisExpr(const CXXThisExpr *Node)

void dumpName(const NamedDecl *ND)

void dumpTemplateName(TemplateName TN, StringRef Label={})

void VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *Node)

void VisitObjCIvarDecl(const ObjCIvarDecl *D)

void VisitFieldDecl(const FieldDecl *D)

void dumpDeclRef(const Decl *D, StringRef Label={})

void VisitRecordDecl(const RecordDecl *D)

void VisitCXXNewExpr(const CXXNewExpr *Node)

void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)

void VisitCastExpr(const CastExpr *Node)

void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)

void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T)

void VisitExpressionTraitExpr(const ExpressionTraitExpr *Node)

void VisitAddrLabelExpr(const AddrLabelExpr *Node)

void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)

void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node)

void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)

void VisitExpressionTemplateArgument(const TemplateArgument &TA)

void VisitTypeAliasDecl(const TypeAliasDecl *D)

void VisitVarDecl(const VarDecl *D)

void VisitFixedPointLiteral(const FixedPointLiteral *Node)

void VisitOMPIteratorExpr(const OMPIteratorExpr *Node)

void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D)

void VisitObjCMethodDecl(const ObjCMethodDecl *D)

void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)

void VisitUsingShadowDecl(const UsingShadowDecl *D)

void VisitNamespaceDecl(const NamespaceDecl *D)

void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)

void VisitOpenACCHostDataConstruct(const OpenACCHostDataConstruct *S)

void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *Node)

void VisitIfStmt(const IfStmt *Node)

void VisitCXXConstructExpr(const CXXConstructExpr *Node)

void VisitFunctionProtoType(const FunctionProtoType *T)

void dumpTemplateArgument(const TemplateArgument &TA)

void dumpLocation(SourceLocation Loc)

void VisitDependentSizedArrayType(const DependentSizedArrayType *T)

void VisitOpenACCCombinedConstruct(const OpenACCCombinedConstruct *S)

void VisitOMPExecutableDirective(const OMPExecutableDirective *D)

void VisitImplicitCastExpr(const ImplicitCastExpr *Node)

void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)

void VisitCXXNamedCastExpr(const CXXNamedCastExpr *Node)

void VisitTagType(const TagType *T)

void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)

void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *Node)

void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)

void VisitOpenACCSetConstruct(const OpenACCSetConstruct *S)

void VisitFunctionDecl(const FunctionDecl *D)

void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)

void VisitTypeTraitExpr(const TypeTraitExpr *Node)

void dumpBareDeclRef(const Decl *D)

void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node)

void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)

void VisitOpenACCShutdownConstruct(const OpenACCShutdownConstruct *S)

void VisitFloatingLiteral(const FloatingLiteral *Node)

void VisitInitListExpr(const InitListExpr *ILE)

void VisitRequiresExpr(const RequiresExpr *Node)

void VisitVariableArrayType(const VariableArrayType *T)

void VisitGenericSelectionExpr(const GenericSelectionExpr *E)

void VisitTemplateTypeParmType(const TemplateTypeParmType *T)

void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)

void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)

void VisitEnumConstantDecl(const EnumConstantDecl *D)

void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)

void dumpTemplateSpecializationKind(TemplateSpecializationKind TSK)

void VisitAtomicExpr(const AtomicExpr *AE)

void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)

void VisitClassTemplateDecl(const ClassTemplateDecl *D)

void VisitBindingDecl(const BindingDecl *D)

void VisitTypedefType(const TypedefType *T)

void AddChild(Fn DoAddChild)

Add a child of the current node. Calls DoAddChild without arguments.

Represents the declaration of a typedef-name via a C++11 alias-declaration.

Declaration of an alias template.

RetTy Visit(TypeLoc TyLoc)

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

QualType getType() const

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

SourceRange getSourceRange() const LLVM_READONLY

Get the full source range.

TypeLocClass getTypeLocClass() const

const Type * getTypePtr() const

A container of type source information.

QualType getType() const

Return the type wrapped by this type source info.

A type trait used in the implementation of various C++11 and Library TR1 trait templates.

RetTy Visit(const Type *T)

Performs the operation associated with this visitor object.

The base class of the type hierarchy.

QualType getLocallyUnqualifiedSingleStepDesugaredType() const

Pull a single level of sugar off of this locally-unqualified type.

bool isInstantiationDependentType() const

Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...

bool isDependentType() const

Whether this type is a dependent type, meaning that its definition somehow depends on a template para...

bool containsUnexpandedParameterPack() const

Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...

const char * getTypeClassName() const

bool containsErrors() const

Whether this type is an error type.

bool isVariablyModifiedType() const

Whether this type is a variably-modified type (C99 6.7.5).

bool isFromAST() const

Whether this type comes from an AST file.

Represents the declaration of a typedef-name via the 'typedef' type specifier.

UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.

UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...

static StringRef getOpcodeStr(Opcode Op)

getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...

A unary type transform, which is a type constructed from another.

A reference to a name which we were able to look up during parsing but could not resolve to a specifi...

The iterator over UnresolvedSets.

Represents the dependent type named by a dependently-scoped typename using declaration,...

Represents a dependent using declaration which was marked with typename.

Represents a dependent using declaration which was not marked with typename.

Represents a C++ using-declaration.

Represents C++ using-directive.

Represents a C++ using-enum-declaration.

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

NamedDecl * getTargetDecl() const

Gets the underlying declaration which has been brought into the local scope.

Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...

Represents a variable declaration or definition.

static const char * getStorageClassSpecifierString(StorageClass SC)

Return the string used to specify the storage class SC.

@ ListInit

Direct list-initialization (C++11)

@ CInit

C-style initialization with assignment.

@ ParenListInit

Parenthesized list-initialization (C++20)

@ CallInit

Call-style initialization (C++98)

@ TLS_Static

TLS with a known-constant initializer.

@ TLS_Dynamic

TLS with a dynamic initializer.

@ TLS_None

Not a TLS variable.

Declaration of a variable template.

Represents a C array with a specified size that is not an integer-constant-expression.

Represents a GCC generic vector type.

WhileStmt - This represents a 'while' stmt.

A static requirement that can be used in a requires-expression to check properties of types and expre...

RequirementKind getKind() const

bool containsUnexpandedParameterPack() const

RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)

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

static const TerminalColor NullColor

static const TerminalColor ErrorsColor

static const TerminalColor CommentColor

static const TerminalColor DeclNameColor

if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))

llvm::StringRef getAccessSpelling(AccessSpecifier AS)

static const TerminalColor AddressColor

@ RQ_None

No ref-qualifier was provided.

@ RQ_LValue

An lvalue ref-qualifier was provided (&).

@ RQ_RValue

An rvalue ref-qualifier was provided (&&).

@ OK_VectorComponent

A vector component is an element or range of elements on a vector.

@ OK_ObjCProperty

An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...

@ OK_ObjCSubscript

An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...

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

@ OK_MatrixComponent

A matrix component is a single element of a matrix.

static const TerminalColor StmtColor

static const TerminalColor UndeserializedColor

@ Auto

'auto' clause, allowed on 'loop' directives.

@ Gang

'gang' clause, allowed on 'loop' and Combined constructs.

@ Wait

'wait' clause, allowed on Compute, Data, 'update', and Combined constructs.

@ DevicePtr

'deviceptr' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.

@ PCopyOut

'copyout' clause alias 'pcopyout'. Preserved for diagnostic purposes.

@ VectorLength

'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...

@ Async

'async' clause, allowed on Compute, Data, 'update', 'wait', and Combined constructs.

@ PresentOrCreate

'create' clause alias 'present_or_create'.

@ Collapse

'collapse' clause, allowed on 'loop' and Combined constructs.

@ PresentOrCopy

'copy' clause alias 'present_or_copy'. Preserved for diagnostic purposes.

@ DeviceNum

'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.

@ Private

'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...

@ Vector

'vector' clause, allowed on 'loop', Combined, and 'routine' directives.

@ Copy

'copy' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.

@ Worker

'worker' clause, allowed on 'loop', Combined, and 'routine' directives.

@ Create

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

@ DeviceType

'device_type' clause, allowed on Compute, 'data', 'init', 'shutdown', 'set', update',...

@ DefaultAsync

'default_async' clause, allowed on 'set' construct.

@ Attach

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

@ NumGangs

'num_gangs' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs.

@ If

'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...

@ Default

'default' clause, allowed on parallel, serial, kernel (and compound) constructs.

@ UseDevice

'use_device' clause, allowed on 'host_data' construct.

@ NoCreate

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

@ PresentOrCopyOut

'copyout' clause alias 'present_or_copyout'.

@ Reduction

'reduction' clause, allowed on Parallel, Serial, Loop, and the combined constructs.

@ Self

'self' clause, allowed on Compute and Combined Constructs, plus 'update'.

@ CopyOut

'copyout' clause, allowed on Compute and Combined constructs, plus 'data', 'exit data',...

@ Seq

'seq' clause, allowed on 'loop' and 'routine' directives.

@ FirstPrivate

'firstprivate' clause, allowed on 'parallel', 'serial', 'parallel loop', and 'serial loop' constructs...

@ Host

'host' clause, allowed on 'update' construct.

@ PCopy

'copy' clause alias 'pcopy'. Preserved for diagnostic purposes.

@ Tile

'tile' clause, allowed on 'loop' and Combined constructs.

@ PCopyIn

'copyin' clause alias 'pcopyin'. Preserved for diagnostic purposes.

@ PCreate

'create' clause alias 'pcreate'. Preserved for diagnostic purposes.

@ Present

'present' clause, allowed on Compute and Combined constructs, plus 'data' and 'declare'.

@ DType

'dtype' clause, an alias for 'device_type', stored separately for diagnostic purposes.

@ CopyIn

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

@ Device

'device' clause, allowed on the 'update' construct.

@ Independent

'independent' clause, allowed on 'loop' directives.

@ NumWorkers

'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...

@ IfPresent

'if_present' clause, allowed on 'host_data' and 'update' directives.

@ Detach

'detach' clause, allowed on the 'exit data' construct.

@ Delete

'delete' clause, allowed on the 'exit data' construct.

@ PresentOrCopyIn

'copyin' clause alias 'present_or_copyin'.

@ Finalize

'finalize' clause, allowed on 'exit data' directive.

StorageClass

Storage classes.

static const TerminalColor DeclKindNameColor

static const TerminalColor LocationColor

static const TerminalColor ValueKindColor

std::pair< IdentifierInfo *, SourceLocation > DeviceTypeArgument

static const TerminalColor CastColor

@ VK_PRValue

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

@ VK_XValue

An x-value expression is a reference to an object with independent storage but which can be "moved",...

@ VK_LValue

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

const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY

Return the spelling of the type trait TT. Never null.

const FunctionProtoType * T

static const TerminalColor AttrColor

static const TerminalColor TypeColor

TemplateSpecializationKind

Describes the kind of template specialization that a particular template specialization declaration r...

@ TSK_ExplicitInstantiationDefinition

This template specialization was instantiated from a template due to an explicit instantiation defini...

@ TSK_ExplicitInstantiationDeclaration

This template specialization was instantiated from a template due to an explicit instantiation declar...

@ TSK_ExplicitSpecialization

This template specialization was declared or defined by an explicit specialization (C++ [temp....

@ TSK_ImplicitInstantiation

This template specialization was implicitly instantiated from a template.

@ TSK_Undeclared

This template specialization was formed from a template-id but has not yet been declared,...

@ Invariant

The parameter is invariant: must match exactly.

@ Contravariant

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

@ Covariant

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

const char * getOperatorSpelling(OverloadedOperatorKind Operator)

Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.

@ AltiVecBool

is AltiVec 'vector bool ...'

@ SveFixedLengthData

is AArch64 SVE fixed-length data vector

@ AltiVecVector

is AltiVec vector

@ AltiVecPixel

is AltiVec 'vector Pixel'

@ Generic

not a target-specific vector type

@ RVVFixedLengthData

is RISC-V RVV fixed-length data vector

@ RVVFixedLengthMask

is RISC-V RVV fixed-length mask vector

@ NeonPoly

is ARM Neon polynomial vector

@ SveFixedLengthPredicate

is AArch64 SVE fixed-length predicate vector

static const TerminalColor ValueColor

@ EST_DependentNoexcept

noexcept(expression), value-dependent

@ EST_Uninstantiated

not instantiated yet

@ EST_Unparsed

not parsed yet

@ EST_NoThrow

Microsoft __declspec(nothrow) extension.

@ EST_None

no exception specification

@ EST_MSAny

Microsoft throw(...) extension.

@ EST_BasicNoexcept

noexcept

@ EST_NoexceptFalse

noexcept(expression), evals to 'false'

@ EST_Unevaluated

not evaluated yet, for special member function

@ EST_NoexceptTrue

noexcept(expression), evals to 'true'

@ EST_Dynamic

throw(T1, T2)

static const TerminalColor ObjectKindColor

AccessSpecifier

A C++ access specifier (public, private, protected), plus the special value "none" which means differ...

@ NOUR_Discarded

This name appears as a potential result of a discarded value expression.

@ NOUR_Unevaluated

This name appears in an unevaluated operand.

@ NOUR_None

This is an odr-use.

@ NOUR_Constant

This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...

FunctionDecl * SourceDecl

The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.

FunctionDecl * SourceTemplate

The function template whose exception specification this is instantiated from, for EST_Uninstantiated...

ExceptionSpecificationType Type

The kind of exception specification this is.

Extra information about a function prototype.

ExceptionSpecInfo ExceptionSpec

Iterator range representation begin:end[:step].

A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...