clang 20.0.0git
TextNodeDumper.cpp
Go to the documentation of this file.
1//===--- TextNodeDumper.cpp - Printing of AST nodes -----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements AST dumping of components of individual AST nodes.
10//
11//===----------------------------------------------------------------------===//
12
14#include "clang/AST/APValue.h"
20#include "clang/AST/Type.h"
22#include "clang/Basic/Module.h"
26#include "llvm/ADT/StringExtras.h"
27
28#include <algorithm>
29#include <utility>
30
31using namespace clang;
32
33static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
34
35template <typename T>
36static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
37 const T *First = D->getFirstDecl();
38 if (First != D)
39 OS << " first " << First;
40}
41
42template <typename T>
43static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
44 const T *Prev = D->getPreviousDecl();
45 if (Prev)
46 OS << " prev " << Prev;
47}
48
49/// Dump the previous declaration in the redeclaration chain for a declaration,
50/// if any.
51static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
52 switch (D->getKind()) {
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
62TextNodeDumper::TextNodeDumper(raw_ostream &OS, const ASTContext &Context,
63 bool ShowColors)
65 Context(&Context), SM(&Context.getSourceManager()),
66 PrintPolicy(Context.getPrintingPolicy()),
67 Traits(&Context.getCommentCommandTraits()) {}
68
71
73 const comments::FullComment *FC) {
74 if (!C) {
75 ColorScope Color(OS, ShowColors, NullColor);
76 OS << "<<<NULL>>>";
77 return;
78 }
79
80 {
81 ColorScope Color(OS, ShowColors, CommentColor);
82 OS << C->getCommentKindName();
83 }
85 dumpSourceRange(C->getSourceRange());
86
87 ConstCommentVisitor<TextNodeDumper, void,
88 const comments::FullComment *>::visit(C, FC);
89}
90
92 {
93 ColorScope Color(OS, ShowColors, AttrColor);
94
95 switch (A->getKind()) {
96#define ATTR(X) \
97 case attr::X: \
98 OS << #X; \
99 break;
100#include "clang/Basic/AttrList.inc"
101 }
102 OS << "Attr";
103 }
104 dumpPointer(A);
106 if (A->isInherited())
107 OS << " Inherited";
108 if (A->isImplicit())
109 OS << " Implicit";
110
112}
113
115 const Decl *From, StringRef Label) {
116 OS << "TemplateArgument";
117 if (R.isValid())
119
120 if (From)
121 dumpDeclRef(From, Label);
122
124}
125
127 if (!Node) {
128 ColorScope Color(OS, ShowColors, NullColor);
129 OS << "<<<NULL>>>";
130 return;
131 }
132 {
133 ColorScope Color(OS, ShowColors, StmtColor);
134 OS << Node->getStmtClassName();
135 }
138
139 if (const auto *E = dyn_cast<Expr>(Node)) {
140 dumpType(E->getType());
141
142 if (E->containsErrors()) {
143 ColorScope Color(OS, ShowColors, ErrorsColor);
144 OS << " contains-errors";
145 }
146
147 {
148 ColorScope Color(OS, ShowColors, ValueKindColor);
149 switch (E->getValueKind()) {
150 case VK_PRValue:
151 break;
152 case VK_LValue:
153 OS << " lvalue";
154 break;
155 case VK_XValue:
156 OS << " xvalue";
157 break;
158 }
159 }
160
161 {
162 ColorScope Color(OS, ShowColors, ObjectKindColor);
163 switch (E->getObjectKind()) {
164 case OK_Ordinary:
165 break;
166 case OK_BitField:
167 OS << " bitfield";
168 break;
169 case OK_ObjCProperty:
170 OS << " objcproperty";
171 break;
172 case OK_ObjCSubscript:
173 OS << " objcsubscript";
174 break;
176 OS << " vectorcomponent";
177 break;
179 OS << " matrixcomponent";
180 break;
181 }
182 }
183 }
184
186}
187
189 if (!T) {
190 ColorScope Color(OS, ShowColors, NullColor);
191 OS << "<<<NULL>>>";
192 return;
193 }
194 if (isa<LocInfoType>(T)) {
195 {
196 ColorScope Color(OS, ShowColors, TypeColor);
197 OS << "LocInfo Type";
198 }
199 dumpPointer(T);
200 return;
201 }
202
203 {
204 ColorScope Color(OS, ShowColors, TypeColor);
205 OS << T->getTypeClassName() << "Type";
206 }
207 dumpPointer(T);
208 OS << " ";
209 dumpBareType(QualType(T, 0), false);
210
211 QualType SingleStepDesugar =
213 if (SingleStepDesugar != QualType(T, 0))
214 OS << " sugar";
215
216 if (T->containsErrors()) {
217 ColorScope Color(OS, ShowColors, ErrorsColor);
218 OS << " contains-errors";
219 }
220
221 if (T->isDependentType())
222 OS << " dependent";
224 OS << " instantiation_dependent";
225
227 OS << " variably_modified";
229 OS << " contains_unexpanded_pack";
230 if (T->isFromAST())
231 OS << " imported";
232
234}
235
237 OS << "QualType";
238 dumpPointer(T.getAsOpaquePtr());
239 OS << " ";
240 dumpBareType(T, false);
241 OS << " " << T.split().Quals.getAsString();
242}
243
245 if (!TL) {
246 ColorScope Color(OS, ShowColors, NullColor);
247 OS << "<<<NULL>>>";
248 return;
249 }
250
251 {
252 ColorScope Color(OS, ShowColors, TypeColor);
254 ? "Qualified"
255 : TL.getType()->getTypeClassName())
256 << "TypeLoc";
257 }
259 OS << ' ';
260 dumpBareType(TL.getType(), /*Desugar=*/false);
261
263}
264
266 if (!D) {
267 ColorScope Color(OS, ShowColors, NullColor);
268 OS << "<<<NULL>>>";
269 return;
270 }
271
272 {
273 ColorScope Color(OS, ShowColors, DeclKindNameColor);
274 OS << D->getDeclKindName() << "Decl";
275 }
276 dumpPointer(D);
278 OS << " parent " << cast<Decl>(D->getDeclContext());
279 dumpPreviousDecl(OS, D);
281 OS << ' ';
283 if (D->isFromASTFile())
284 OS << " imported";
285 if (Module *M = D->getOwningModule())
286 OS << " in " << M->getFullModuleName();
287 if (auto *ND = dyn_cast<NamedDecl>(D))
289 const_cast<NamedDecl *>(ND)))
290 AddChild([=] { OS << "also in " << M->getFullModuleName(); });
291 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
292 if (!ND->isUnconditionallyVisible())
293 OS << " hidden";
294 if (D->isImplicit())
295 OS << " implicit";
296
297 if (D->isUsed())
298 OS << " used";
299 else if (D->isThisDeclarationReferenced())
300 OS << " referenced";
301
302 if (D->isInvalidDecl())
303 OS << " invalid";
304 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(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<FunctionDecl>(*D)) {
316 const auto *MD = dyn_cast<ObjCMethodDecl>(D);
317 if (!MD || !MD->isThisDeclarationADefinition()) {
318 const auto *DC = dyn_cast<DeclContext>(D);
319 if (DC && DC->hasExternalLexicalStorage()) {
320 ColorScope Color(OS, ShowColors, UndeserializedColor);
321 OS << " <undeserialized declarations>";
322 }
323 }
324 }
325
326 switch (D->getFriendObjectKind()) {
327 case Decl::FOK_None:
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 << ' ';
344 dumpBareDeclRef(Init->getAnyMember());
345 } else if (Init->isBaseInitializer()) {
346 dumpType(QualType(Init->getBaseClass(), 0));
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 << ' ';
362 dumpBareDeclRef(C.getVariable());
363 }
364}
365
367 if (!C) {
368 ColorScope Color(OS, ShowColors, NullColor);
369 OS << "<<<NULL>>> OMPClause";
370 return;
371 }
372 {
373 ColorScope Color(OS, ShowColors, AttrColor);
374 StringRef ClauseName(llvm::omp::getOpenMPClauseName(C->getClauseKind()));
375 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
376 << ClauseName.drop_front() << "Clause";
377 }
378 dumpPointer(C);
379 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
380 if (C->isImplicit())
381 OS << " <implicit>";
382}
383
385 if (!C) {
386 ColorScope Color(OS, ShowColors, NullColor);
387 OS << "<<<NULL>>> OpenACCClause";
388 return;
389 }
390 {
391 ColorScope Color(OS, ShowColors, AttrColor);
392 OS << C->getClauseKind();
393
394 // Handle clauses with parens for types that have no children, likely
395 // because there is no sub expression.
396 switch (C->getClauseKind()) {
398 OS << '(' << cast<OpenACCDefaultClause>(C)->getDefaultClauseKind() << ')';
399 break;
418 // The condition expression will be printed as a part of the 'children',
419 // but print 'clause' here so it is clear what is happening from the dump.
420 OS << " clause";
421 break;
425 OS << " clause";
426 if (cast<OpenACCCopyInClause>(C)->isReadOnly())
427 OS << " : readonly";
428 break;
432 OS << " clause";
433 if (cast<OpenACCCopyOutClause>(C)->isZero())
434 OS << " : zero";
435 break;
439 OS << " clause";
440 if (cast<OpenACCCreateClause>(C)->isZero())
441 OS << " : zero";
442 break;
444 OS << " clause";
445 if (cast<OpenACCWaitClause>(C)->hasDevNumExpr())
446 OS << " has devnum";
447 if (cast<OpenACCWaitClause>(C)->hasQueuesTag())
448 OS << " has queues tag";
449 break;
452 OS << "(";
453 llvm::interleaveComma(
454 cast<OpenACCDeviceTypeClause>(C)->getArchitectures(), OS,
455 [&](const DeviceTypeArgument &Arch) {
456 if (Arch.first == nullptr)
457 OS << "*";
458 else
459 OS << Arch.first->getName();
460 });
461 OS << ")";
462 break;
464 OS << " clause Operator: "
465 << cast<OpenACCReductionClause>(C)->getReductionOp();
466 break;
467 default:
468 // Nothing to do here.
469 break;
470 }
471 }
472 dumpPointer(C);
473 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
474}
475
477 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
478 if (TSI) {
479 OS << "case ";
480 dumpType(TSI->getType());
481 } else {
482 OS << "default";
483 }
484
485 if (A.isSelected())
486 OS << " selected";
487}
488
490 if (!R) {
491 ColorScope Color(OS, ShowColors, NullColor);
492 OS << "<<<NULL>>> ConceptReference";
493 return;
494 }
495
496 OS << "ConceptReference";
497 dumpPointer(R);
499 OS << ' ';
501}
502
504 if (!R) {
505 ColorScope Color(OS, ShowColors, NullColor);
506 OS << "<<<NULL>>> Requirement";
507 return;
508 }
509
510 {
511 ColorScope Color(OS, ShowColors, StmtColor);
512 switch (R->getKind()) {
514 OS << "TypeRequirement";
515 break;
517 OS << "SimpleRequirement";
518 break;
520 OS << "CompoundRequirement";
521 break;
523 OS << "NestedRequirement";
524 break;
525 }
526 }
527
528 dumpPointer(R);
529
530 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
531 if (ER->hasNoexceptRequirement())
532 OS << " noexcept";
533 }
534
535 if (R->isDependent())
536 OS << " dependent";
537 else
538 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
540 OS << " contains_unexpanded_pack";
541}
542
543static double GetApproxValue(const llvm::APFloat &F) {
544 llvm::APFloat V = F;
545 bool ignored;
546 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
547 &ignored);
548 return V.convertToDouble();
549}
550
551/// True if the \p APValue \p Value can be folded onto the current line.
552static bool isSimpleAPValue(const APValue &Value) {
553 switch (Value.getKind()) {
554 case APValue::None:
556 case APValue::Int:
557 case APValue::Float:
561 case APValue::LValue:
564 return true;
565 case APValue::Vector:
566 case APValue::Array:
567 case APValue::Struct:
568 return false;
569 case APValue::Union:
570 return isSimpleAPValue(Value.getUnionValue());
571 }
572 llvm_unreachable("unexpected APValue kind!");
573}
574
575/// Dump the children of the \p APValue \p Value.
576///
577/// \param[in] Value The \p APValue to visit
578/// \param[in] Ty The \p QualType passed to \p Visit
579///
580/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
581/// to one of the child of the \p APValue
582///
583/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
584/// the indices in the range \p [0,NumChildren(
585///
586/// \param[in] LabelSingular The label to use on a line with a single child
587/// \param[in] LabelPlurial The label to use on a line with multiple children
588void TextNodeDumper::dumpAPValueChildren(
589 const APValue &Value, QualType Ty,
590 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
591 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
592 // To save some vertical space we print up to MaxChildrenPerLine APValues
593 // considered to be simple (by isSimpleAPValue) on a single line.
594 constexpr unsigned MaxChildrenPerLine = 4;
595 unsigned I = 0;
596 while (I < NumChildren) {
597 unsigned J = I;
598 while (J < NumChildren) {
599 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
600 (J - I < MaxChildrenPerLine)) {
601 ++J;
602 continue;
603 }
604 break;
605 }
606
607 J = std::max(I + 1, J);
608
609 // Print [I,J) on a single line.
610 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
611 for (unsigned X = I; X < J; ++X) {
612 Visit(IdxToChildFun(Value, X), Ty);
613 if (X + 1 != J)
614 OS << ", ";
615 }
616 });
617 I = J;
618 }
619}
620
622 ColorScope Color(OS, ShowColors, ValueKindColor);
623 switch (Value.getKind()) {
624 case APValue::None:
625 OS << "None";
626 return;
628 OS << "Indeterminate";
629 return;
630 case APValue::Int:
631 OS << "Int ";
632 {
633 ColorScope Color(OS, ShowColors, ValueColor);
634 OS << Value.getInt();
635 }
636 return;
637 case APValue::Float:
638 OS << "Float ";
639 {
640 ColorScope Color(OS, ShowColors, ValueColor);
641 OS << GetApproxValue(Value.getFloat());
642 }
643 return;
645 OS << "FixedPoint ";
646 {
647 ColorScope Color(OS, ShowColors, ValueColor);
648 OS << Value.getFixedPoint();
649 }
650 return;
651 case APValue::Vector: {
652 unsigned VectorLength = Value.getVectorLength();
653 OS << "Vector length=" << VectorLength;
654
655 dumpAPValueChildren(
656 Value, Ty,
657 [](const APValue &Value, unsigned Index) -> const APValue & {
658 return Value.getVectorElt(Index);
659 },
660 VectorLength, "element", "elements");
661 return;
662 }
664 OS << "ComplexInt ";
665 {
666 ColorScope Color(OS, ShowColors, ValueColor);
667 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
668 << 'i';
669 }
670 return;
672 OS << "ComplexFloat ";
673 {
674 ColorScope Color(OS, ShowColors, ValueColor);
675 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
676 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
677 }
678 return;
679 case APValue::LValue:
680 (void)Context;
681 OS << "LValue <todo>";
682 return;
683 case APValue::Array: {
684 unsigned ArraySize = Value.getArraySize();
685 unsigned NumInitializedElements = Value.getArrayInitializedElts();
686 OS << "Array size=" << ArraySize;
687
688 dumpAPValueChildren(
689 Value, Ty,
690 [](const APValue &Value, unsigned Index) -> const APValue & {
691 return Value.getArrayInitializedElt(Index);
692 },
693 NumInitializedElements, "element", "elements");
694
695 if (Value.hasArrayFiller()) {
696 AddChild("filler", [=] {
697 {
698 ColorScope Color(OS, ShowColors, ValueColor);
699 OS << ArraySize - NumInitializedElements << " x ";
700 }
701 Visit(Value.getArrayFiller(), Ty);
702 });
703 }
704
705 return;
706 }
707 case APValue::Struct: {
708 OS << "Struct";
709
710 dumpAPValueChildren(
711 Value, Ty,
712 [](const APValue &Value, unsigned Index) -> const APValue & {
713 return Value.getStructBase(Index);
714 },
715 Value.getStructNumBases(), "base", "bases");
716
717 dumpAPValueChildren(
718 Value, Ty,
719 [](const APValue &Value, unsigned Index) -> const APValue & {
720 return Value.getStructField(Index);
721 },
722 Value.getStructNumFields(), "field", "fields");
723
724 return;
725 }
726 case APValue::Union: {
727 OS << "Union";
728 {
729 ColorScope Color(OS, ShowColors, ValueColor);
730 if (const FieldDecl *FD = Value.getUnionField())
731 OS << " ." << *cast<NamedDecl>(FD);
732 }
733 // If the union value is considered to be simple, fold it into the
734 // current line to save some vertical space.
735 const APValue &UnionValue = Value.getUnionValue();
736 if (isSimpleAPValue(UnionValue)) {
737 OS << ' ';
738 Visit(UnionValue, Ty);
739 } else {
740 AddChild([=] { Visit(UnionValue, Ty); });
741 }
742
743 return;
744 }
746 OS << "MemberPointer <todo>";
747 return;
749 OS << "AddrLabelDiff <todo>";
750 return;
751 }
752 llvm_unreachable("Unknown APValue kind!");
753}
754
755void TextNodeDumper::dumpPointer(const void *Ptr) {
756 ColorScope Color(OS, ShowColors, AddressColor);
757 OS << ' ' << Ptr;
758}
759
761 if (!SM)
762 return;
763
764 ColorScope Color(OS, ShowColors, LocationColor);
765 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
766
767 // The general format we print out is filename:line:col, but we drop pieces
768 // that haven't changed since the last loc printed.
769 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
770
771 if (PLoc.isInvalid()) {
772 OS << "<invalid sloc>";
773 return;
774 }
775
776 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
777 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
778 << PLoc.getColumn();
779 LastLocFilename = PLoc.getFilename();
780 LastLocLine = PLoc.getLine();
781 } else if (PLoc.getLine() != LastLocLine) {
782 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
783 LastLocLine = PLoc.getLine();
784 } else {
785 OS << "col" << ':' << PLoc.getColumn();
786 }
787}
788
790 // Can't translate locations if a SourceManager isn't available.
791 if (!SM)
792 return;
793
794 OS << " <";
796 if (R.getBegin() != R.getEnd()) {
797 OS << ", ";
798 dumpLocation(R.getEnd());
799 }
800 OS << ">";
801
802 // <t2.c:123:421[blah], t2.c:412:321>
803}
804
806 ColorScope Color(OS, ShowColors, TypeColor);
807
808 SplitQualType T_split = T.split();
809 std::string T_str = QualType::getAsString(T_split, PrintPolicy);
810 OS << "'" << T_str << "'";
811
812 if (Desugar && !T.isNull()) {
813 // If the type is sugared, also dump a (shallow) desugared type when
814 // it is visibly different.
815 SplitQualType D_split = T.getSplitDesugaredType();
816 if (T_split != D_split) {
817 std::string D_str = QualType::getAsString(D_split, PrintPolicy);
818 if (T_str != D_str)
819 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
820 }
821 }
822}
823
825 OS << ' ';
827}
828
830 if (!D) {
831 ColorScope Color(OS, ShowColors, NullColor);
832 OS << "<<<NULL>>>";
833 return;
834 }
835
836 {
837 ColorScope Color(OS, ShowColors, DeclKindNameColor);
838 OS << D->getDeclKindName();
839 }
840 dumpPointer(D);
841
842 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
843 ColorScope Color(OS, ShowColors, DeclNameColor);
844 OS << " '" << ND->getDeclName() << '\'';
845 }
846
847 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
848 dumpType(VD->getType());
849}
850
852 if (ND->getDeclName()) {
853 ColorScope Color(OS, ShowColors, DeclNameColor);
854 OS << ' ' << ND->getDeclName();
855 }
856}
857
859 const auto AccessSpelling = getAccessSpelling(AS);
860 if (AccessSpelling.empty())
861 return;
862 OS << AccessSpelling;
863}
864
867 if (auto *BD = C.dyn_cast<BlockDecl *>())
868 dumpDeclRef(BD, "cleanup");
869 else if (auto *CLE = C.dyn_cast<CompoundLiteralExpr *>())
870 AddChild([=] {
871 OS << "cleanup ";
872 {
873 ColorScope Color(OS, ShowColors, StmtColor);
874 OS << CLE->getStmtClassName();
875 }
876 dumpPointer(CLE);
877 });
878 else
879 llvm_unreachable("unexpected cleanup type");
880}
881
884 switch (TSK) {
885 case TSK_Undeclared:
886 break;
888 OS << " implicit_instantiation";
889 break;
891 OS << " explicit_specialization";
892 break;
894 OS << " explicit_instantiation_declaration";
895 break;
897 OS << " explicit_instantiation_definition";
898 break;
899 }
900}
901
903 if (!NNS)
904 return;
905
906 AddChild([=] {
907 OS << "NestedNameSpecifier";
908
909 switch (NNS->getKind()) {
910 case NestedNameSpecifier::Identifier:
911 OS << " Identifier";
912 OS << " '" << NNS->getAsIdentifier()->getName() << "'";
913 break;
914 case NestedNameSpecifier::Namespace:
915 OS << " "; // "Namespace" is printed as the decl kind.
916 dumpBareDeclRef(NNS->getAsNamespace());
917 break;
918 case NestedNameSpecifier::NamespaceAlias:
919 OS << " "; // "NamespaceAlias" is printed as the decl kind.
920 dumpBareDeclRef(NNS->getAsNamespaceAlias());
921 break;
922 case NestedNameSpecifier::TypeSpec:
923 OS << " TypeSpec";
924 dumpType(QualType(NNS->getAsType(), 0));
925 break;
926 case NestedNameSpecifier::TypeSpecWithTemplate:
927 OS << " TypeSpecWithTemplate";
928 dumpType(QualType(NNS->getAsType(), 0));
929 break;
930 case NestedNameSpecifier::Global:
931 OS << " Global";
932 break;
933 case NestedNameSpecifier::Super:
934 OS << " Super";
935 break;
936 }
937
938 dumpNestedNameSpecifier(NNS->getPrefix());
939 });
940}
941
942void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
943 if (!D)
944 return;
945
946 AddChild([=] {
947 if (!Label.empty())
948 OS << Label << ' ';
950 });
951}
952
955 {
956 llvm::raw_svector_ostream SS(Str);
957 TA.print(PrintPolicy, SS, /*IncludeType=*/true);
958 }
959 OS << " '" << Str << "'";
960
961 if (!Context)
962 return;
963
964 if (TemplateArgument CanonTA = Context->getCanonicalTemplateArgument(TA);
965 !CanonTA.structurallyEquals(TA)) {
966 llvm::SmallString<128> CanonStr;
967 {
968 llvm::raw_svector_ostream SS(CanonStr);
969 CanonTA.print(PrintPolicy, SS, /*IncludeType=*/true);
970 }
971 if (CanonStr != Str)
972 OS << ":'" << CanonStr << "'";
973 }
974}
975
976const char *TextNodeDumper::getCommandName(unsigned CommandID) {
977 if (Traits)
978 return Traits->getCommandInfo(CommandID)->Name;
979 const comments::CommandInfo *Info =
981 if (Info)
982 return Info->Name;
983 return "<not a builtin command>";
984}
985
986void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
987#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
988 if (FPO.has##NAME##Override()) \
989 OS << " " #NAME "=" << FPO.get##NAME##Override();
990#include "clang/Basic/FPOptions.def"
991}
992
994 const comments::FullComment *) {
995 OS << " Text=\"" << C->getText() << "\"";
996}
997
1000 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
1001 switch (C->getRenderKind()) {
1003 OS << " RenderNormal";
1004 break;
1006 OS << " RenderBold";
1007 break;
1009 OS << " RenderMonospaced";
1010 break;
1012 OS << " RenderEmphasized";
1013 break;
1015 OS << " RenderAnchor";
1016 break;
1017 }
1018
1019 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
1020 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
1021}
1022
1025 OS << " Name=\"" << C->getTagName() << "\"";
1026 if (C->getNumAttrs() != 0) {
1027 OS << " Attrs: ";
1028 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
1029 const comments::HTMLStartTagComment::Attribute &Attr = C->getAttr(i);
1030 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
1031 }
1032 }
1033 if (C->isSelfClosing())
1034 OS << " SelfClosing";
1035}
1036
1039 OS << " Name=\"" << C->getTagName() << "\"";
1040}
1041
1044 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
1045 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
1046 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
1047}
1048
1051 OS << " "
1053
1054 if (C->isDirectionExplicit())
1055 OS << " explicitly";
1056 else
1057 OS << " implicitly";
1058
1059 if (C->hasParamName()) {
1060 if (C->isParamIndexValid())
1061 OS << " Param=\"" << C->getParamName(FC) << "\"";
1062 else
1063 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1064 }
1065
1066 if (C->isParamIndexValid() && !C->isVarArgParam())
1067 OS << " ParamIndex=" << C->getParamIndex();
1068}
1069
1072 if (C->hasParamName()) {
1073 if (C->isPositionValid())
1074 OS << " Param=\"" << C->getParamName(FC) << "\"";
1075 else
1076 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1077 }
1078
1079 if (C->isPositionValid()) {
1080 OS << " Position=<";
1081 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
1082 OS << C->getIndex(i);
1083 if (i != e - 1)
1084 OS << ", ";
1085 }
1086 OS << ">";
1087 }
1088}
1089
1092 OS << " Name=\"" << getCommandName(C->getCommandID())
1093 << "\""
1094 " CloseName=\""
1095 << C->getCloseName() << "\"";
1096}
1097
1100 const comments::FullComment *) {
1101 OS << " Text=\"" << C->getText() << "\"";
1102}
1103
1106 OS << " Text=\"" << C->getText() << "\"";
1107}
1108
1110 OS << " null";
1111}
1112
1114 OS << " type";
1116}
1117
1119 const TemplateArgument &TA) {
1120 OS << " decl";
1122 dumpDeclRef(TA.getAsDecl());
1123}
1124
1126 OS << " nullptr";
1128}
1129
1131 OS << " integral";
1133}
1134
1136 AddChild(Label, [=] {
1137 {
1139 {
1140 llvm::raw_svector_ostream SS(Str);
1141 TN.print(SS, PrintPolicy);
1142 }
1143 OS << "'" << Str << "'";
1144
1145 if (Context) {
1146 if (TemplateName CanonTN = Context->getCanonicalTemplateName(TN);
1147 CanonTN != TN) {
1148 llvm::SmallString<128> CanonStr;
1149 {
1150 llvm::raw_svector_ostream SS(CanonStr);
1151 CanonTN.print(SS, PrintPolicy);
1152 }
1153 if (CanonStr != Str)
1154 OS << ":'" << CanonStr << "'";
1155 }
1156 }
1157 }
1159 });
1160}
1161
1163 switch (TN.getKind()) {
1165 AddChild([=] { Visit(TN.getAsTemplateDecl()); });
1166 return;
1168 const UsingShadowDecl *USD = TN.getAsUsingShadowDecl();
1169 AddChild([=] { Visit(USD); });
1170 AddChild("target", [=] { Visit(USD->getTargetDecl()); });
1171 return;
1172 }
1174 OS << " qualified";
1176 if (QTN->hasTemplateKeyword())
1177 OS << " keyword";
1180 return;
1181 }
1183 OS << " dependent";
1186 return;
1187 }
1189 OS << " subst";
1192 OS << " index " << STS->getIndex();
1193 if (std::optional<unsigned int> PackIndex = STS->getPackIndex())
1194 OS << " pack_index " << *PackIndex;
1195 if (const TemplateTemplateParmDecl *P = STS->getParameter())
1196 AddChild("parameter", [=] { Visit(P); });
1197 dumpDeclRef(STS->getAssociatedDecl(), "associated");
1198 dumpTemplateName(STS->getReplacement(), "replacement");
1199 return;
1200 }
1201 // FIXME: Implement these.
1203 OS << " overloaded";
1204 return;
1206 OS << " assumed";
1207 return;
1209 OS << " subst_pack";
1210 return;
1211 }
1212 llvm_unreachable("Unexpected TemplateName Kind");
1213}
1214
1216 OS << " template";
1219}
1220
1222 const TemplateArgument &TA) {
1223 OS << " template expansion";
1226}
1227
1229 const TemplateArgument &TA) {
1230 OS << " expr";
1232}
1233
1235 OS << " pack";
1237}
1238
1239static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1240 if (Node->path_empty())
1241 return;
1242
1243 OS << " (";
1244 bool First = true;
1245 for (CastExpr::path_const_iterator I = Node->path_begin(),
1246 E = Node->path_end();
1247 I != E; ++I) {
1248 const CXXBaseSpecifier *Base = *I;
1249 if (!First)
1250 OS << " -> ";
1251
1252 const auto *RD =
1253 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
1254
1255 if (Base->isVirtual())
1256 OS << "virtual ";
1257 OS << RD->getName();
1258 First = false;
1259 }
1260
1261 OS << ')';
1262}
1263
1265 if (Node->hasInitStorage())
1266 OS << " has_init";
1267 if (Node->hasVarStorage())
1268 OS << " has_var";
1269 if (Node->hasElseStorage())
1270 OS << " has_else";
1271 if (Node->isConstexpr())
1272 OS << " constexpr";
1273 if (Node->isConsteval()) {
1274 OS << " ";
1275 if (Node->isNegatedConsteval())
1276 OS << "!";
1277 OS << "consteval";
1278 }
1279}
1280
1282 if (Node->hasInitStorage())
1283 OS << " has_init";
1284 if (Node->hasVarStorage())
1285 OS << " has_var";
1286}
1287
1289 if (Node->hasVarStorage())
1290 OS << " has_var";
1291}
1292
1294 OS << " '" << Node->getName() << "'";
1295 if (Node->isSideEntry())
1296 OS << " side_entry";
1297}
1298
1300 OS << " '" << Node->getLabel()->getName() << "'";
1301 dumpPointer(Node->getLabel());
1302}
1303
1305 if (Node->caseStmtIsGNURange())
1306 OS << " gnu_range";
1307}
1308
1310 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1311 OS << " nrvo_candidate(";
1312 dumpBareDeclRef(Cand);
1313 OS << ")";
1314 }
1315}
1316
1318 if (Node->isImplicit())
1319 OS << " implicit";
1320}
1321
1323 if (Node->isImplicit())
1324 OS << " implicit";
1325}
1326
1328 if (Node->hasAPValueResult())
1329 AddChild("value",
1330 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1331}
1332
1334 if (Node->usesADL())
1335 OS << " adl";
1336 if (Node->hasStoredFPFeatures())
1337 printFPOptions(Node->getFPFeatures());
1338}
1339
1341 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1342 if (OperatorSpelling)
1343 OS << " '" << OperatorSpelling << "'";
1344
1346}
1347
1349 OS << " <";
1350 {
1351 ColorScope Color(OS, ShowColors, CastColor);
1352 OS << Node->getCastKindName();
1353 }
1354 dumpBasePath(OS, Node);
1355 OS << ">";
1356 if (Node->hasStoredFPFeatures())
1357 printFPOptions(Node->getFPFeatures());
1358}
1359
1362 if (Node->isPartOfExplicitCast())
1363 OS << " part_of_explicit_cast";
1364}
1365
1367 OS << " ";
1368 dumpBareDeclRef(Node->getDecl());
1369 dumpNestedNameSpecifier(Node->getQualifier());
1370 if (Node->getDecl() != Node->getFoundDecl()) {
1371 OS << " (";
1372 dumpBareDeclRef(Node->getFoundDecl());
1373 OS << ")";
1374 }
1375 switch (Node->isNonOdrUse()) {
1376 case NOUR_None: break;
1377 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1378 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1379 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1380 }
1381 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1382 OS << " dependent_capture";
1383 else if (Node->refersToEnclosingVariableOrCapture())
1384 OS << " refers_to_enclosing_variable_or_capture";
1385
1386 if (Node->isImmediateEscalating())
1387 OS << " immediate-escalating";
1388}
1389
1392
1393 dumpNestedNameSpecifier(Node->getQualifier());
1394}
1395
1397 const UnresolvedLookupExpr *Node) {
1398 OS << " (";
1399 if (!Node->requiresADL())
1400 OS << "no ";
1401 OS << "ADL) = '" << Node->getName() << '\'';
1402
1403 UnresolvedLookupExpr::decls_iterator I = Node->decls_begin(),
1404 E = Node->decls_end();
1405 if (I == E)
1406 OS << " empty";
1407 for (; I != E; ++I)
1408 dumpPointer(*I);
1409}
1410
1412 {
1413 ColorScope Color(OS, ShowColors, DeclKindNameColor);
1414 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1415 }
1416 OS << "='" << *Node->getDecl() << "'";
1417 dumpPointer(Node->getDecl());
1418 if (Node->isFreeIvar())
1419 OS << " isFreeIvar";
1420}
1421
1424 dumpType(Node->getTypeSourceInfo()->getType());
1425}
1426
1428 OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
1429}
1430
1432 ColorScope Color(OS, ShowColors, ValueColor);
1433 OS << " " << Node->getValue();
1434}
1435
1437 bool isSigned = Node->getType()->isSignedIntegerType();
1438 ColorScope Color(OS, ShowColors, ValueColor);
1439 OS << " " << toString(Node->getValue(), 10, isSigned);
1440}
1441
1443 ColorScope Color(OS, ShowColors, ValueColor);
1444 OS << " " << Node->getValueAsString(/*Radix=*/10);
1445}
1446
1448 ColorScope Color(OS, ShowColors, ValueColor);
1449 OS << " " << Node->getValueAsApproximateDouble();
1450}
1451
1453 ColorScope Color(OS, ShowColors, ValueColor);
1454 OS << " ";
1455 Str->outputString(OS);
1456}
1457
1459 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1460 OS << " field ";
1461 dumpBareDeclRef(Field);
1462 }
1463}
1464
1466 if (E->isResultDependent())
1467 OS << " result_dependent";
1468}
1469
1471 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1472 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1473 if (!Node->canOverflow())
1474 OS << " cannot overflow";
1475 if (Node->hasStoredFPFeatures())
1476 printFPOptions(Node->getStoredFPFeatures());
1477}
1478
1481 OS << " " << getTraitSpelling(Node->getKind());
1482
1483 if (Node->isArgumentType())
1484 dumpType(Node->getArgumentType());
1485}
1486
1488 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1489 dumpPointer(Node->getMemberDecl());
1490 dumpNestedNameSpecifier(Node->getQualifier());
1491 switch (Node->isNonOdrUse()) {
1492 case NOUR_None: break;
1493 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1494 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1495 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1496 }
1497}
1498
1500 const ExtVectorElementExpr *Node) {
1501 OS << " " << Node->getAccessor().getNameStart();
1502}
1503
1505 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1506 if (Node->hasStoredFPFeatures())
1507 printFPOptions(Node->getStoredFPFeatures());
1508}
1509
1512 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1513 << "' ComputeLHSTy=";
1514 dumpBareType(Node->getComputationLHSType());
1515 OS << " ComputeResultTy=";
1516 dumpBareType(Node->getComputationResultType());
1517 if (Node->hasStoredFPFeatures())
1518 printFPOptions(Node->getStoredFPFeatures());
1519}
1520
1522 OS << " " << Node->getLabel()->getName();
1523 dumpPointer(Node->getLabel());
1524}
1525
1527 OS << " " << Node->getCastName() << "<"
1528 << Node->getTypeAsWritten().getAsString() << ">"
1529 << " <" << Node->getCastKindName();
1530 dumpBasePath(OS, Node);
1531 OS << ">";
1532}
1533
1535 OS << " " << (Node->getValue() ? "true" : "false");
1536}
1537
1539 if (Node->isImplicit())
1540 OS << " implicit";
1541 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1542 OS << " dependent_capture";
1543 OS << " this";
1544}
1545
1547 const CXXFunctionalCastExpr *Node) {
1548 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1549 << Node->getCastKindName() << ">";
1550 if (Node->hasStoredFPFeatures())
1551 printFPOptions(Node->getFPFeatures());
1552}
1553
1556 if (Node->hasStoredFPFeatures())
1557 printFPOptions(Node->getFPFeatures());
1558}
1559
1562 dumpType(Node->getTypeAsWritten());
1563 if (Node->isListInitialization())
1564 OS << " list";
1565}
1566
1568 CXXConstructorDecl *Ctor = Node->getConstructor();
1569 dumpType(Ctor->getType());
1570 if (Node->isElidable())
1571 OS << " elidable";
1572 if (Node->isListInitialization())
1573 OS << " list";
1574 if (Node->isStdInitListInitialization())
1575 OS << " std::initializer_list";
1576 if (Node->requiresZeroInitialization())
1577 OS << " zeroing";
1578 if (Node->isImmediateEscalating())
1579 OS << " immediate-escalating";
1580}
1581
1583 const CXXBindTemporaryExpr *Node) {
1584 OS << " (CXXTemporary";
1586 OS << ")";
1587}
1588
1590 if (Node->isGlobalNew())
1591 OS << " global";
1592 if (Node->isArray())
1593 OS << " array";
1594 if (Node->getOperatorNew()) {
1595 OS << ' ';
1596 dumpBareDeclRef(Node->getOperatorNew());
1597 }
1598 // We could dump the deallocation function used in case of error, but it's
1599 // usually not that interesting.
1600}
1601
1603 if (Node->isGlobalDelete())
1604 OS << " global";
1605 if (Node->isArrayForm())
1606 OS << " array";
1607 if (Node->getOperatorDelete()) {
1608 OS << ' ';
1609 dumpBareDeclRef(Node->getOperatorDelete());
1610 }
1611}
1612
1614 OS << " " << getTraitSpelling(Node->getTrait());
1615}
1616
1618 OS << " " << getTraitSpelling(Node->getTrait());
1619}
1620
1622 OS << " " << getTraitSpelling(Node->getTrait());
1623}
1624
1626 if (Node->hasRewrittenInit())
1627 OS << " has rewritten init";
1628}
1629
1631 if (Node->hasRewrittenInit())
1632 OS << " has rewritten init";
1633}
1634
1637 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1638 OS << " extended by ";
1639 dumpBareDeclRef(VD);
1640 }
1641}
1642
1644 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1645 dumpCleanupObject(Node->getObject(i));
1646}
1647
1649 dumpPointer(Node->getPack());
1650 dumpName(Node->getPack());
1651}
1652
1655 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1656}
1657
1659 OS << " selector=";
1660 Node->getSelector().print(OS);
1661 switch (Node->getReceiverKind()) {
1663 break;
1664
1666 OS << " class=";
1667 dumpBareType(Node->getClassReceiver());
1668 break;
1669
1671 OS << " super (instance)";
1672 break;
1673
1675 OS << " super (class)";
1676 break;
1677 }
1678}
1679
1681 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1682 OS << " selector=";
1683 BoxingMethod->getSelector().print(OS);
1684 }
1685}
1686
1688 if (!Node->getCatchParamDecl())
1689 OS << " catch all";
1690}
1691
1693 dumpType(Node->getEncodedType());
1694}
1695
1697 OS << " ";
1698 Node->getSelector().print(OS);
1699}
1700
1702 OS << ' ' << *Node->getProtocol();
1703}
1704
1706 if (Node->isImplicitProperty()) {
1707 OS << " Kind=MethodRef Getter=\"";
1708 if (Node->getImplicitPropertyGetter())
1709 Node->getImplicitPropertyGetter()->getSelector().print(OS);
1710 else
1711 OS << "(null)";
1712
1713 OS << "\" Setter=\"";
1714 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1715 Setter->getSelector().print(OS);
1716 else
1717 OS << "(null)";
1718 OS << "\"";
1719 } else {
1720 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1721 << '"';
1722 }
1723
1724 if (Node->isSuperReceiver())
1725 OS << " super";
1726
1727 OS << " Messaging=";
1728 if (Node->isMessagingGetter() && Node->isMessagingSetter())
1729 OS << "Getter&Setter";
1730 else if (Node->isMessagingGetter())
1731 OS << "Getter";
1732 else if (Node->isMessagingSetter())
1733 OS << "Setter";
1734}
1735
1737 const ObjCSubscriptRefExpr *Node) {
1738 if (Node->isArraySubscriptRefExpr())
1739 OS << " Kind=ArraySubscript GetterForArray=\"";
1740 else
1741 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1742 if (Node->getAtIndexMethodDecl())
1743 Node->getAtIndexMethodDecl()->getSelector().print(OS);
1744 else
1745 OS << "(null)";
1746
1747 if (Node->isArraySubscriptRefExpr())
1748 OS << "\" SetterForArray=\"";
1749 else
1750 OS << "\" SetterForDictionary=\"";
1751 if (Node->setAtIndexMethodDecl())
1752 Node->setAtIndexMethodDecl()->getSelector().print(OS);
1753 else
1754 OS << "(null)";
1755}
1756
1758 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1759}
1760
1762 OS << " ";
1763 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
1764 Visit(Node->getIteratorDecl(I));
1765 OS << " = ";
1766 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
1767 OS << " begin ";
1768 Visit(Range.Begin);
1769 OS << " end ";
1770 Visit(Range.End);
1771 if (Range.Step) {
1772 OS << " step ";
1773 Visit(Range.Step);
1774 }
1775 }
1776}
1777
1780 OS << " ";
1781 dumpBareDeclRef(Node->getFoundDecl());
1782}
1783
1785 const RequiresExpr *Node) {
1786 if (!Node->isValueDependent())
1787 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
1788}
1789
1791 if (T->isSpelledAsLValue())
1792 OS << " written as lvalue reference";
1793}
1794
1796 switch (T->getSizeModifier()) {
1798 break;
1800 OS << " static";
1801 break;
1803 OS << " *";
1804 break;
1805 }
1806 OS << " " << T->getIndexTypeQualifiers().getAsString();
1807}
1808
1810 OS << " " << T->getSize();
1812}
1813
1815 OS << " ";
1816 dumpSourceRange(T->getBracketsRange());
1818}
1819
1821 const DependentSizedArrayType *T) {
1823 OS << " ";
1824 dumpSourceRange(T->getBracketsRange());
1825}
1826
1829 OS << " ";
1830 dumpLocation(T->getAttributeLoc());
1831}
1832
1834 switch (T->getVectorKind()) {
1836 break;
1838 OS << " altivec";
1839 break;
1841 OS << " altivec pixel";
1842 break;
1844 OS << " altivec bool";
1845 break;
1846 case VectorKind::Neon:
1847 OS << " neon";
1848 break;
1850 OS << " neon poly";
1851 break;
1853 OS << " fixed-length sve data vector";
1854 break;
1856 OS << " fixed-length sve predicate vector";
1857 break;
1859 OS << " fixed-length rvv data vector";
1860 break;
1865 OS << " fixed-length rvv mask vector";
1866 break;
1867 }
1868 OS << " " << T->getNumElements();
1869}
1870
1872 auto EI = T->getExtInfo();
1873 if (EI.getNoReturn())
1874 OS << " noreturn";
1875 if (EI.getProducesResult())
1876 OS << " produces_result";
1877 if (EI.getHasRegParm())
1878 OS << " regparm " << EI.getRegParm();
1879 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1880}
1881
1883 auto EPI = T->getExtProtoInfo();
1884 if (EPI.HasTrailingReturn)
1885 OS << " trailing_return";
1886 if (T->isConst())
1887 OS << " const";
1888 if (T->isVolatile())
1889 OS << " volatile";
1890 if (T->isRestrict())
1891 OS << " restrict";
1892 if (T->getExtProtoInfo().Variadic)
1893 OS << " variadic";
1894 switch (EPI.RefQualifier) {
1895 case RQ_None:
1896 break;
1897 case RQ_LValue:
1898 OS << " &";
1899 break;
1900 case RQ_RValue:
1901 OS << " &&";
1902 break;
1903 }
1904
1905 switch (EPI.ExceptionSpec.Type) {
1906 case EST_None:
1907 break;
1908 case EST_DynamicNone:
1909 OS << " exceptionspec_dynamic_none";
1910 break;
1911 case EST_Dynamic:
1912 OS << " exceptionspec_dynamic";
1913 break;
1914 case EST_MSAny:
1915 OS << " exceptionspec_ms_any";
1916 break;
1917 case EST_NoThrow:
1918 OS << " exceptionspec_nothrow";
1919 break;
1920 case EST_BasicNoexcept:
1921 OS << " exceptionspec_basic_noexcept";
1922 break;
1924 OS << " exceptionspec_dependent_noexcept";
1925 break;
1926 case EST_NoexceptFalse:
1927 OS << " exceptionspec_noexcept_false";
1928 break;
1929 case EST_NoexceptTrue:
1930 OS << " exceptionspec_noexcept_true";
1931 break;
1932 case EST_Unevaluated:
1933 OS << " exceptionspec_unevaluated";
1934 break;
1935 case EST_Uninstantiated:
1936 OS << " exceptionspec_uninstantiated";
1937 break;
1938 case EST_Unparsed:
1939 OS << " exceptionspec_unparsed";
1940 break;
1941 }
1942 if (!EPI.ExceptionSpec.Exceptions.empty()) {
1943 AddChild([=] {
1944 OS << "Exceptions:";
1945 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
1946 ++I) {
1947 if (I)
1948 OS << ",";
1949 dumpType(EPI.ExceptionSpec.Exceptions[I]);
1950 }
1951 });
1952 }
1953 if (EPI.ExceptionSpec.NoexceptExpr) {
1954 AddChild([=] {
1955 OS << "NoexceptExpr: ";
1956 Visit(EPI.ExceptionSpec.NoexceptExpr);
1957 });
1958 }
1959 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
1960 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
1961
1962 // FIXME: Consumed parameters.
1964}
1965
1967 dumpDeclRef(T->getDecl());
1968}
1969
1971 dumpDeclRef(T->getFoundDecl());
1972 if (!T->typeMatchesDecl())
1973 OS << " divergent";
1974}
1975
1977 dumpDeclRef(T->getDecl());
1978 if (!T->typeMatchesDecl())
1979 OS << " divergent";
1980}
1981
1983 switch (T->getUTTKind()) {
1984#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
1985 case UnaryTransformType::Enum: \
1986 OS << " " #Trait; \
1987 break;
1988#include "clang/Basic/TransformTypeTraits.def"
1989 }
1990}
1991
1993 dumpDeclRef(T->getDecl());
1994}
1995
1997 OS << " depth " << T->getDepth() << " index " << T->getIndex();
1998 if (T->isParameterPack())
1999 OS << " pack";
2000 dumpDeclRef(T->getDecl());
2001}
2002
2005 dumpDeclRef(T->getAssociatedDecl());
2006 VisitTemplateTypeParmDecl(T->getReplacedParameter());
2007 if (auto PackIndex = T->getPackIndex())
2008 OS << " pack_index " << *PackIndex;
2009}
2010
2013 dumpDeclRef(T->getAssociatedDecl());
2014 VisitTemplateTypeParmDecl(T->getReplacedParameter());
2015}
2016
2018 if (T->isDecltypeAuto())
2019 OS << " decltype(auto)";
2020 if (!T->isDeduced())
2021 OS << " undeduced";
2022 if (T->isConstrained())
2023 dumpDeclRef(T->getTypeConstraintConcept());
2024}
2025
2028 dumpTemplateName(T->getTemplateName(), "name");
2029}
2030
2033 if (T->isTypeAlias())
2034 OS << " alias";
2035 dumpTemplateName(T->getTemplateName(), "name");
2036}
2037
2039 const InjectedClassNameType *T) {
2040 dumpDeclRef(T->getDecl());
2041}
2042
2044 dumpDeclRef(T->getDecl());
2045}
2046
2048 if (auto N = T->getNumExpansions())
2049 OS << " expansions " << *N;
2050}
2051
2053 // By default, add extra Type details with no extra loc info.
2055}
2056// FIXME: override behavior for TypeLocs that have interesting location
2057// information, such as the qualifier in ElaboratedTypeLoc.
2058
2060
2062 dumpName(D);
2063 dumpType(D->getUnderlyingType());
2064 if (D->isModulePrivate())
2065 OS << " __module_private__";
2066}
2067
2069 if (D->isScoped()) {
2070 if (D->isScopedUsingClassTag())
2071 OS << " class";
2072 else
2073 OS << " struct";
2074 }
2075 dumpName(D);
2076 if (D->isModulePrivate())
2077 OS << " __module_private__";
2078 if (D->isFixed())
2079 dumpType(D->getIntegerType());
2080}
2081
2083 OS << ' ' << D->getKindName();
2084 dumpName(D);
2085 if (D->isModulePrivate())
2086 OS << " __module_private__";
2087 if (D->isCompleteDefinition())
2088 OS << " definition";
2089}
2090
2092 dumpName(D);
2093 dumpType(D->getType());
2094}
2095
2097 dumpName(D);
2098 dumpType(D->getType());
2099
2100 for (const auto *Child : D->chain())
2101 dumpDeclRef(Child);
2102}
2103
2105 dumpName(D);
2106 dumpType(D->getType());
2107 dumpTemplateSpecializationKind(D->getTemplateSpecializationKind());
2108
2109 StorageClass SC = D->getStorageClass();
2110 if (SC != SC_None)
2112 if (D->isInlineSpecified())
2113 OS << " inline";
2114 if (D->isVirtualAsWritten())
2115 OS << " virtual";
2116 if (D->isModulePrivate())
2117 OS << " __module_private__";
2118
2119 if (D->isPureVirtual())
2120 OS << " pure";
2121 if (D->isDefaulted()) {
2122 OS << " default";
2123 if (D->isDeleted())
2124 OS << "_delete";
2125 }
2126 if (D->isDeletedAsWritten())
2127 OS << " delete";
2128 if (D->isTrivial())
2129 OS << " trivial";
2130
2131 if (const StringLiteral *M = D->getDeletedMessage())
2132 AddChild("delete message", [=] { Visit(M); });
2133
2134 if (D->isIneligibleOrNotSelected())
2135 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
2136
2137 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
2138 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
2139 switch (EPI.ExceptionSpec.Type) {
2140 default:
2141 break;
2142 case EST_Unevaluated:
2143 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
2144 break;
2145 case EST_Uninstantiated:
2146 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
2147 break;
2148 }
2149 }
2150
2151 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
2152 if (MD->size_overridden_methods() != 0) {
2153 auto dumpOverride = [=](const CXXMethodDecl *D) {
2154 SplitQualType T_split = D->getType().split();
2155 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
2156 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
2157 };
2158
2159 AddChild([=] {
2160 auto Overrides = MD->overridden_methods();
2161 OS << "Overrides: [ ";
2162 dumpOverride(*Overrides.begin());
2163 for (const auto *Override : llvm::drop_begin(Overrides)) {
2164 OS << ", ";
2165 dumpOverride(Override);
2166 }
2167 OS << " ]";
2168 });
2169 }
2170 }
2171
2172 if (!D->isInlineSpecified() && D->isInlined()) {
2173 OS << " implicit-inline";
2174 }
2175 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
2176 // the Params are set later, it is possible for a dump during debugging to
2177 // encounter a FunctionDecl that has been created but hasn't been assigned
2178 // ParmVarDecls yet.
2179 if (!D->param_empty() && !D->param_begin())
2180 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
2181
2182 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
2183 OS << " instantiated_from";
2184 dumpPointer(Instance);
2185 }
2186}
2187
2189 const CXXDeductionGuideDecl *D) {
2191 switch (D->getDeductionCandidateKind()) {
2194 return;
2196 OS << " aggregate ";
2197 break;
2198 }
2199}
2200
2203 OS << " extended by ";
2204 dumpBareDeclRef(D->getExtendingDecl());
2205 OS << " mangling ";
2206 {
2207 ColorScope Color(OS, ShowColors, ValueColor);
2208 OS << D->getManglingNumber();
2209 }
2210}
2211
2213 dumpName(D);
2214 dumpType(D->getType());
2215 if (D->isMutable())
2216 OS << " mutable";
2217 if (D->isModulePrivate())
2218 OS << " __module_private__";
2219}
2220
2222 dumpNestedNameSpecifier(D->getQualifier());
2223 dumpName(D);
2224 if (const auto *P = dyn_cast<ParmVarDecl>(D);
2225 P && P->isExplicitObjectParameter())
2226 OS << " this";
2227
2228 dumpType(D->getType());
2229 dumpTemplateSpecializationKind(D->getTemplateSpecializationKind());
2230 StorageClass SC = D->getStorageClass();
2231 if (SC != SC_None)
2233 switch (D->getTLSKind()) {
2234 case VarDecl::TLS_None:
2235 break;
2237 OS << " tls";
2238 break;
2240 OS << " tls_dynamic";
2241 break;
2242 }
2243 if (D->isModulePrivate())
2244 OS << " __module_private__";
2245 if (D->isNRVOVariable())
2246 OS << " nrvo";
2247 if (D->isInline())
2248 OS << " inline";
2249 if (D->isConstexpr())
2250 OS << " constexpr";
2251 if (D->hasInit()) {
2252 switch (D->getInitStyle()) {
2253 case VarDecl::CInit:
2254 OS << " cinit";
2255 break;
2256 case VarDecl::CallInit:
2257 OS << " callinit";
2258 break;
2259 case VarDecl::ListInit:
2260 OS << " listinit";
2261 break;
2263 OS << " parenlistinit";
2264 }
2265 }
2266 if (D->needsDestruction(D->getASTContext()))
2267 OS << " destroyed";
2268 if (D->isParameterPack())
2269 OS << " pack";
2270
2271 if (D->hasInit()) {
2272 const Expr *E = D->getInit();
2273 // Only dump the value of constexpr VarDecls for now.
2274 if (E && !E->isValueDependent() && D->isConstexpr() &&
2275 !D->getType()->isDependentType()) {
2276 const APValue *Value = D->evaluateValue();
2277 if (Value)
2278 AddChild("value", [=] { Visit(*Value, E->getType()); });
2279 }
2280 }
2281}
2282
2284 dumpName(D);
2285 dumpType(D->getType());
2286}
2287
2289 if (D->isNothrow())
2290 OS << " nothrow";
2291}
2292
2294 OS << ' ' << D->getImportedModule()->getFullModuleName();
2295
2296 for (Decl *InitD :
2297 D->getASTContext().getModuleInitializers(D->getImportedModule()))
2298 dumpDeclRef(InitD, "initializer");
2299}
2300
2302 OS << ' ';
2303 switch (D->getCommentKind()) {
2304 case PCK_Unknown:
2305 llvm_unreachable("unexpected pragma comment kind");
2306 case PCK_Compiler:
2307 OS << "compiler";
2308 break;
2309 case PCK_ExeStr:
2310 OS << "exestr";
2311 break;
2312 case PCK_Lib:
2313 OS << "lib";
2314 break;
2315 case PCK_Linker:
2316 OS << "linker";
2317 break;
2318 case PCK_User:
2319 OS << "user";
2320 break;
2321 }
2322 StringRef Arg = D->getArg();
2323 if (!Arg.empty())
2324 OS << " \"" << Arg << "\"";
2325}
2326
2328 const PragmaDetectMismatchDecl *D) {
2329 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2330}
2331
2333 const OMPExecutableDirective *D) {
2334 if (D->isStandaloneDirective())
2335 OS << " openmp_standalone_directive";
2336}
2337
2339 const OMPDeclareReductionDecl *D) {
2340 dumpName(D);
2341 dumpType(D->getType());
2342 OS << " combiner";
2343 dumpPointer(D->getCombiner());
2344 if (const auto *Initializer = D->getInitializer()) {
2345 OS << " initializer";
2347 switch (D->getInitializerKind()) {
2349 OS << " omp_priv = ";
2350 break;
2352 OS << " omp_priv ()";
2353 break;
2355 break;
2356 }
2357 }
2358}
2359
2361 for (const auto *C : D->clauselists()) {
2362 AddChild([=] {
2363 if (!C) {
2364 ColorScope Color(OS, ShowColors, NullColor);
2365 OS << "<<<NULL>>> OMPClause";
2366 return;
2367 }
2368 {
2369 ColorScope Color(OS, ShowColors, AttrColor);
2370 StringRef ClauseName(
2371 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2372 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2373 << ClauseName.drop_front() << "Clause";
2374 }
2375 dumpPointer(C);
2376 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2377 });
2378 }
2379}
2380
2382 dumpName(D);
2383 dumpType(D->getType());
2384}
2385
2387 dumpName(D);
2388 if (D->isInline())
2389 OS << " inline";
2390 if (D->isNested())
2391 OS << " nested";
2392 if (!D->isFirstDecl())
2393 dumpDeclRef(D->getFirstDecl(), "original");
2394}
2395
2397 OS << ' ';
2398 dumpBareDeclRef(D->getNominatedNamespace());
2399}
2400
2402 dumpName(D);
2403 dumpDeclRef(D->getAliasedNamespace());
2404}
2405
2407 dumpName(D);
2408 dumpType(D->getUnderlyingType());
2409}
2410
2412 const TypeAliasTemplateDecl *D) {
2413 dumpName(D);
2414}
2415
2418 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2419 OS << " instantiated_from";
2420 dumpPointer(Instance);
2421 }
2422 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
2423 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2424
2425 dumpNestedNameSpecifier(D->getQualifier());
2426
2427 if (!D->isCompleteDefinition())
2428 return;
2429
2430 AddChild([=] {
2431 {
2432 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2433 OS << "DefinitionData";
2434 }
2435#define FLAG(fn, name) \
2436 if (D->fn()) \
2437 OS << " " #name;
2438 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2439
2440 FLAG(isGenericLambda, generic);
2441 FLAG(isLambda, lambda);
2442
2443 FLAG(isAnonymousStructOrUnion, is_anonymous);
2444 FLAG(canPassInRegisters, pass_in_registers);
2445 FLAG(isEmpty, empty);
2446 FLAG(isAggregate, aggregate);
2447 FLAG(isStandardLayout, standard_layout);
2448 FLAG(isTriviallyCopyable, trivially_copyable);
2449 FLAG(isPOD, pod);
2450 FLAG(isTrivial, trivial);
2451 FLAG(isPolymorphic, polymorphic);
2452 FLAG(isAbstract, abstract);
2453 FLAG(isLiteral, literal);
2454
2455 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2456 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2457 FLAG(hasMutableFields, has_mutable_fields);
2458 FLAG(hasVariantMembers, has_variant_members);
2459 FLAG(allowConstDefaultInit, can_const_default_init);
2460
2461 AddChild([=] {
2462 {
2463 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2464 OS << "DefaultConstructor";
2465 }
2466 FLAG(hasDefaultConstructor, exists);
2467 FLAG(hasTrivialDefaultConstructor, trivial);
2468 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2469 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2470 FLAG(hasConstexprDefaultConstructor, constexpr);
2471 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2472 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2473 });
2474
2475 AddChild([=] {
2476 {
2477 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2478 OS << "CopyConstructor";
2479 }
2480 FLAG(hasSimpleCopyConstructor, simple);
2481 FLAG(hasTrivialCopyConstructor, trivial);
2482 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2483 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2484 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2485 FLAG(needsImplicitCopyConstructor, needs_implicit);
2486 FLAG(needsOverloadResolutionForCopyConstructor,
2487 needs_overload_resolution);
2488 if (!D->needsOverloadResolutionForCopyConstructor())
2489 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2490 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2491 });
2492
2493 AddChild([=] {
2494 {
2495 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2496 OS << "MoveConstructor";
2497 }
2498 FLAG(hasMoveConstructor, exists);
2499 FLAG(hasSimpleMoveConstructor, simple);
2500 FLAG(hasTrivialMoveConstructor, trivial);
2501 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2502 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2503 FLAG(needsImplicitMoveConstructor, needs_implicit);
2504 FLAG(needsOverloadResolutionForMoveConstructor,
2505 needs_overload_resolution);
2506 if (!D->needsOverloadResolutionForMoveConstructor())
2507 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2508 });
2509
2510 AddChild([=] {
2511 {
2512 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2513 OS << "CopyAssignment";
2514 }
2515 FLAG(hasSimpleCopyAssignment, simple);
2516 FLAG(hasTrivialCopyAssignment, trivial);
2517 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2518 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2519 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2520 FLAG(needsImplicitCopyAssignment, needs_implicit);
2521 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2522 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2523 });
2524
2525 AddChild([=] {
2526 {
2527 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2528 OS << "MoveAssignment";
2529 }
2530 FLAG(hasMoveAssignment, exists);
2531 FLAG(hasSimpleMoveAssignment, simple);
2532 FLAG(hasTrivialMoveAssignment, trivial);
2533 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2534 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2535 FLAG(needsImplicitMoveAssignment, needs_implicit);
2536 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2537 });
2538
2539 AddChild([=] {
2540 {
2541 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2542 OS << "Destructor";
2543 }
2544 FLAG(hasSimpleDestructor, simple);
2545 FLAG(hasIrrelevantDestructor, irrelevant);
2546 FLAG(hasTrivialDestructor, trivial);
2547 FLAG(hasNonTrivialDestructor, non_trivial);
2548 FLAG(hasUserDeclaredDestructor, user_declared);
2549 FLAG(hasConstexprDestructor, constexpr);
2550 FLAG(needsImplicitDestructor, needs_implicit);
2551 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2552 if (!D->needsOverloadResolutionForDestructor())
2553 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2554 });
2555 });
2556
2557 for (const auto &I : D->bases()) {
2558 AddChild([=] {
2559 if (I.isVirtual())
2560 OS << "virtual ";
2561 dumpAccessSpecifier(I.getAccessSpecifier());
2562 dumpType(I.getType());
2563 if (I.isPackExpansion())
2564 OS << "...";
2565 });
2566 }
2567}
2568
2570 dumpName(D);
2571}
2572
2574 dumpName(D);
2575}
2576
2578 dumpName(D);
2579}
2580
2582 dumpName(D);
2583}
2584
2586 if (const auto *TC = D->getTypeConstraint()) {
2587 OS << " ";
2588 dumpBareDeclRef(TC->getNamedConcept());
2589 if (TC->getNamedConcept() != TC->getFoundDecl()) {
2590 OS << " (";
2591 dumpBareDeclRef(TC->getFoundDecl());
2592 OS << ")";
2593 }
2594 } else if (D->wasDeclaredWithTypename())
2595 OS << " typename";
2596 else
2597 OS << " class";
2598 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2599 if (D->isParameterPack())
2600 OS << " ...";
2601 dumpName(D);
2602}
2603
2605 const NonTypeTemplateParmDecl *D) {
2606 dumpType(D->getType());
2607 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2608 if (D->isParameterPack())
2609 OS << " ...";
2610 dumpName(D);
2611}
2612
2614 const TemplateTemplateParmDecl *D) {
2615 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2616 if (D->isParameterPack())
2617 OS << " ...";
2618 dumpName(D);
2619}
2620
2622 OS << ' ';
2623 if (D->getQualifier())
2624 D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
2625 OS << D->getDeclName();
2626 dumpNestedNameSpecifier(D->getQualifier());
2627}
2628
2630 OS << ' ';
2631 dumpBareDeclRef(D->getEnumDecl());
2632}
2633
2636 OS << ' ';
2637 if (D->getQualifier())
2638 D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
2639 OS << D->getDeclName();
2640}
2641
2643 const UnresolvedUsingValueDecl *D) {
2644 OS << ' ';
2645 if (D->getQualifier())
2646 D->getQualifier()->print(OS, D->getASTContext().getPrintingPolicy());
2647 OS << D->getDeclName();
2648 dumpType(D->getType());
2649}
2650
2652 OS << ' ';
2653 dumpBareDeclRef(D->getTargetDecl());
2654}
2655
2658 if (D->constructsVirtualBase())
2659 OS << " virtual";
2660
2661 AddChild([=] {
2662 OS << "target ";
2663 dumpBareDeclRef(D->getTargetDecl());
2664 });
2665
2666 AddChild([=] {
2667 OS << "nominated ";
2668 dumpBareDeclRef(D->getNominatedBaseClass());
2669 OS << ' ';
2670 dumpBareDeclRef(D->getNominatedBaseClassShadowDecl());
2671 });
2672
2673 AddChild([=] {
2674 OS << "constructed ";
2675 dumpBareDeclRef(D->getConstructedBaseClass());
2676 OS << ' ';
2677 dumpBareDeclRef(D->getConstructedBaseClassShadowDecl());
2678 });
2679}
2680
2682 switch (D->getLanguage()) {
2684 OS << " C";
2685 break;
2687 OS << " C++";
2688 break;
2689 }
2690}
2691
2693 OS << ' ';
2695}
2696
2698 if (TypeSourceInfo *T = D->getFriendType())
2699 dumpType(T->getType());
2700 if (D->isPackExpansion())
2701 OS << "...";
2702}
2703
2705 dumpName(D);
2706 dumpType(D->getType());
2707 if (D->getSynthesize())
2708 OS << " synthesize";
2709
2710 switch (D->getAccessControl()) {
2711 case ObjCIvarDecl::None:
2712 OS << " none";
2713 break;
2715 OS << " private";
2716 break;
2718 OS << " protected";
2719 break;
2721 OS << " public";
2722 break;
2724 OS << " package";
2725 break;
2726 }
2727}
2728
2730 if (D->isInstanceMethod())
2731 OS << " -";
2732 else
2733 OS << " +";
2734 dumpName(D);
2735 dumpType(D->getReturnType());
2736
2737 if (D->isVariadic())
2738 OS << " variadic";
2739}
2740
2742 dumpName(D);
2743 switch (D->getVariance()) {
2745 break;
2746
2748 OS << " covariant";
2749 break;
2750
2752 OS << " contravariant";
2753 break;
2754 }
2755
2756 if (D->hasExplicitBound())
2757 OS << " bounded";
2758 dumpType(D->getUnderlyingType());
2759}
2760
2762 dumpName(D);
2763 dumpDeclRef(D->getClassInterface());
2764 dumpDeclRef(D->getImplementation());
2765 for (const auto *P : D->protocols())
2766 dumpDeclRef(P);
2767}
2768
2770 dumpName(D);
2771 dumpDeclRef(D->getClassInterface());
2772 dumpDeclRef(D->getCategoryDecl());
2773}
2774
2776 dumpName(D);
2777
2778 for (const auto *Child : D->protocols())
2779 dumpDeclRef(Child);
2780}
2781
2783 dumpName(D);
2784 dumpDeclRef(D->getSuperClass(), "super");
2785
2786 dumpDeclRef(D->getImplementation());
2787 for (const auto *Child : D->protocols())
2788 dumpDeclRef(Child);
2789}
2790
2792 const ObjCImplementationDecl *D) {
2793 dumpName(D);
2794 dumpDeclRef(D->getSuperClass(), "super");
2795 dumpDeclRef(D->getClassInterface());
2796}
2797
2799 const ObjCCompatibleAliasDecl *D) {
2800 dumpName(D);
2801 dumpDeclRef(D->getClassInterface());
2802}
2803
2805 dumpName(D);
2806 dumpType(D->getType());
2807
2808 if (D->getPropertyImplementation() == ObjCPropertyDecl::Required)
2809 OS << " required";
2810 else if (D->getPropertyImplementation() == ObjCPropertyDecl::Optional)
2811 OS << " optional";
2812
2813 ObjCPropertyAttribute::Kind Attrs = D->getPropertyAttributes();
2816 OS << " readonly";
2818 OS << " assign";
2820 OS << " readwrite";
2822 OS << " retain";
2824 OS << " copy";
2826 OS << " nonatomic";
2828 OS << " atomic";
2830 OS << " weak";
2832 OS << " strong";
2834 OS << " unsafe_unretained";
2836 OS << " class";
2838 OS << " direct";
2840 dumpDeclRef(D->getGetterMethodDecl(), "getter");
2842 dumpDeclRef(D->getSetterMethodDecl(), "setter");
2843 }
2844}
2845
2847 dumpName(D->getPropertyDecl());
2848 if (D->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize)
2849 OS << " synthesize";
2850 else
2851 OS << " dynamic";
2852 dumpDeclRef(D->getPropertyDecl());
2853 dumpDeclRef(D->getPropertyIvarDecl());
2854}
2855
2857 if (D->isVariadic())
2858 OS << " variadic";
2859
2860 if (D->capturesCXXThis())
2861 OS << " captures_this";
2862}
2863
2865 dumpName(D);
2866}
2867
2869 VisitStmt(S);
2870 if (S->hasStoredFPFeatures())
2871 printFPOptions(S->getStoredFPFeatures());
2872}
2873
2875 if (D->isCBuffer())
2876 OS << " cbuffer";
2877 else
2878 OS << " tbuffer";
2879 dumpName(D);
2880}
2881
2883 OS << " " << S->getDirectiveKind();
2884}
2886
2887 if (S->isOrphanedLoopConstruct())
2888 OS << " <orphan>";
2889 else
2890 OS << " parent: " << S->getParentComputeConstruct();
2891}
2892
2894 AddChild("begin", [=] { OS << S->getStartingElementPos(); });
2895 AddChild("number of elements", [=] { OS << S->getDataElementCount(); });
2896}
2897
2899 OS << ' ' << AE->getOpAsString();
2900}
static double GetApproxValue(const llvm::APFloat &F)
Definition: APValue.cpp:622
#define V(N, I)
Definition: ASTContext.h:3341
DynTypedNode Node
#define SM(sm)
Definition: Cuda.cpp:83
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
const Decl * D
Expr * E
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
#define X(type, name)
Definition: Value.h:143
bool ShowColors
Definition: Logger.cpp:29
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....
SourceRange Range
Definition: SemaObjC.cpp:758
SourceLocation Loc
Definition: SemaObjC.cpp:759
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.
#define FLAG(fn, name)
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.
std::string Label
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
@ Indeterminate
This object has an indeterminate value (C++ [basic.indet]).
Definition: APValue.h:131
@ None
There is no such object (it's outside its lifetime).
Definition: APValue.h:129
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:187
TemplateArgument getCanonicalTemplateArgument(const TemplateArgument &Arg) const
Retrieve the "canonical" template argument.
TemplateName getCanonicalTemplateName(const TemplateName &Name) const
Retrieves the "canonical" template name that refers to a given template.
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:713
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 ':'.
Definition: DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4372
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2853
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3566
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6629
StringRef getOpAsString() const
Definition: Expr.h:6694
Attr - This represents one attribute.
Definition: Attr.h:42
attr::Kind getKind() const
Definition: Attr.h:88
bool isInherited() const
Definition: Attr.h:97
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:101
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:6375
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3860
StringRef getOpcodeStr() const
Definition: Expr.h:3926
A binding in a decomposition declaration.
Definition: DeclCXX.h:4111
A class which contains all the information about a particular captured value.
Definition: Decl.h:4477
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4471
Represents the builtin template declaration which is used to implement __make_integer_seq and other b...
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1491
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1546
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2539
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2304
Represents a C++ deduction guide declaration.
Definition: DeclCXX.h:1956
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1268
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1375
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2498
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3683
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1817
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2064
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition: ExprCXX.h:372
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2241
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:433
Represents the this expression in C++.
Definition: ExprCXX.h:1152
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3557
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2830
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4670
CaseStmt - Represent a case statement.
Definition: Stmt.h:1811
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3498
const CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3565
Declaration of a class template.
Represents a 'co_await' expression.
Definition: ExprCXX.h:5185
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4122
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3428
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1611
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:124
SourceRange getSourceRange() const LLVM_READONLY
Definition: ASTConcept.h:191
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:199
Represents the specialization of a concept - evaluates to a prvalue of type bool.
Definition: ExprConcepts.h:42
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:3604
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1077
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3602
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1265
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Decl * getPreviousDecl()
Retrieve the previous declaration that declares the same entity as this declaration,...
Definition: DeclBase.h:1051
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:649
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition: DeclBase.h:1216
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:523
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:600
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition: DeclBase.cpp:242
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition: DeclBase.h:1209
@ FOK_None
Not a friend object.
Definition: DeclBase.h:1207
@ FOK_Declared
A friend of a previously-declared entity.
Definition: DeclBase.h:1208
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:836
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Definition: DeclBase.h:1060
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:787
bool isInvalidDecl() const
Definition: DeclBase.h:595
SourceLocation getLocation() const
Definition: DeclBase.h:446
const char * getDeclKindName() const
Definition: DeclBase.cpp:145
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:628
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:552
DeclContext * getDeclContext()
Definition: DeclBase.h:455
AccessSpecifier getAccess() const
Definition: DeclBase.h:514
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).
Definition: DeclBase.h:908
Kind getKind() const
Definition: DeclBase.h:449
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:434
Represents a C++17 deduced template specialization type.
Definition: Type.h:6423
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3323
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3849
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3947
Represents a dependent template name that cannot be resolved prior to template instantiation.
Definition: TemplateName.h:491
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:547
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.
Definition: Expr.h:4867
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3274
Represents an enum.
Definition: Decl.h:3844
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3474
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3480
This represents one expression.
Definition: Expr.h:110
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:175
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:437
bool containsErrors() const
Whether this expression contains subexpressions which had errors, e.g.
Definition: Expr.h:245
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
Definition: Expr.h:444
QualType getType() const
Definition: Expr.h:142
An expression trait intrinsic.
Definition: ExprCXX.h:2924
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6305
Represents difference between two FPOptions values.
Definition: LangOptions.h:947
Represents a member of a struct/union/class.
Definition: Decl.h:3030
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
Represents a function declaration or definition.
Definition: Decl.h:1932
Represents a prototype with parameter type info, e.g.
Definition: Type.h:5002
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:5266
Declaration of a template function.
Definition: DeclTemplate.h:957
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:4308
ExtInfo getExtInfo() const
Definition: Type.h:4642
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3492
bool isConst() const
Definition: Type.h:4648
bool isRestrict() const
Definition: Type.h:4650
bool isVolatile() const
Definition: Type.h:4649
Represents a C11 generic selection.
Definition: Expr.h:5917
AssociationTy< true > ConstAssociation
Definition: Expr.h:6149
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2872
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4924
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2148
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3675
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4783
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3318
Describes an C or C++ initializer list.
Definition: Expr.h:5039
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:5158
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:6612
Represents the declaration of a label.
Definition: Decl.h:499
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2041
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3233
Represents a linkage specification.
Definition: DeclCXX.h:2938
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4728
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3187
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
Definition: Redeclarable.h:315
Describes a module or submodule.
Definition: Module.h:105
This represents a decl that may have a name.
Definition: Decl.h:249
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
Represents a C++ namespace alias.
Definition: DeclCXX.h:3124
Represent a C++ namespace.
Definition: Decl.h:547
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
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.
Definition: DeclOpenMP.h:383
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
This represents '#pragma omp declare reduction ...' directive.
Definition: DeclOpenMP.h:177
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:151
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:417
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2328
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2544
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2774
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2596
Represents an ObjC class declaration.
Definition: DeclObjC.h:1153
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:7343
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1951
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:730
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2804
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2083
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:24
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
This class represents a 'loop' construct.
Definition: StmtOpenACC.h:200
Represents a pack expansion of types.
Definition: Type.h:6960
Represents a #pragma comment line.
Definition: Decl.h:142
Represents a #pragma detect_mismatch line.
Definition: Decl.h:176
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1991
StringRef getIdentKindName() const
Definition: Expr.h:2048
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.
Definition: Type.h:941
std::string getAsString() const
Represents a template name as written in source code.
Definition: TemplateName.h:434
TemplateName getUnderlyingTemplate() const
Return the underlying template name.
Definition: TemplateName.h:469
NestedNameSpecifier * getQualifier() const
Return the nested name specifier that qualifies this name.
Definition: TemplateName.h:462
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
Definition: TemplateName.h:466
Represents a struct/union/class.
Definition: Decl.h:4145
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5965
RecordDecl * getDecl() const
Definition: Type.h:5975
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3428
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3029
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4258
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
bool isValid() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:44
Stmt - This represents one statement.
Definition: Stmt.h:84
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1778
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1213
A structure for storing the information associated with a substituted template template parameter.
Definition: TemplateName.h:375
std::optional< unsigned > getPackIndex() const
Definition: TemplateName.h:399
TemplateTemplateParmDecl * getParameter() const
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TemplateName.h:397
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: TemplateName.h:393
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:6283
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:6213
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2398
Represents a template argument.
Definition: TemplateBase.h:61
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Definition: TemplateBase.h:343
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.
Definition: TemplateBase.h:326
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:350
Represents a C++ template name within the type system.
Definition: TemplateName.h:203
TemplateDecl * getAsTemplateDecl() const
Retrieve the underlying template declaration that this template name refers to, if known.
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.
NameKind getKind() const
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:248
@ OverloadedTemplate
A set of overloaded template declarations.
Definition: TemplateName.h:223
@ Template
A single template declaration.
Definition: TemplateName.h:220
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
Definition: TemplateName.h:235
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
Definition: TemplateName.h:239
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
Definition: TemplateName.h:244
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Definition: TemplateName.h:231
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
Definition: TemplateName.h:227
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...
Definition: Type.h:6480
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 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 dumpBareTemplateName(TemplateName TN)
void VisitOpenACCConstructStmt(const OpenACCConstructStmt *S)
void VisitCompoundStmt(const CompoundStmt *Node)
void VisitConstantExpr(const ConstantExpr *Node)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node)
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 VisitCaseStmt(const CaseStmt *Node)
void VisitRValueReferenceType(const ReferenceType *T)
void VisitPackExpansionType(const PackExpansionType *T)
void VisitConceptDecl(const ConceptDecl *D)
void VisitCallExpr(const CallExpr *Node)
void VisitCapturedDecl(const CapturedDecl *D)
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 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 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 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 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 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 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.
Definition: Decl.h:3532
Declaration of an alias template.
RetTy Visit(TypeLoc TyLoc)
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition: TypeLoc.h:153
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:116
const Type * getTypePtr() const
Definition: TypeLoc.h:137
A container of type source information.
Definition: Type.h:7721
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:7732
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2768
RetTy Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
The base class of the type hierarchy.
Definition: Type.h:1829
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:476
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2703
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2695
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2354
const char * getTypeClassName() const
Definition: Type.cpp:3273
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2689
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2713
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2337
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3511
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2578
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2188
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1405
A unary type transform, which is a type constructed from another.
Definition: Type.h:5882
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3203
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:5567
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3963
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3866
Represents a C++ using-declaration.
Definition: DeclCXX.h:3516
Represents C++ using-directive.
Definition: DeclCXX.h:3019
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3717
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3324
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3388
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:667
QualType getType() const
Definition: Decl.h:678
Kind getKind() const
Definition: Value.h:136
Represents a variable declaration or definition.
Definition: Decl.h:879
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2103
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:890
@ CInit
C-style initialization with assignment.
Definition: Decl.h:884
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:893
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:887
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:902
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:905
@ TLS_None
Not a TLS variable.
Definition: Decl.h:899
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3795
Represents a GCC generic vector type.
Definition: Type.h:4021
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2594
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:604
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
const CommandInfo * getCommandInfo(StringRef Name) const
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:65
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1083
An opening HTML tag with attributes.
Definition: Comment.h:433
A command with word-like arguments that is considered inline content.
Definition: Comment.h:335
Doxygen \param command.
Definition: Comment.h:711
static const char * getDirectionAsString(ParamCommandPassDirection D)
Definition: Comment.cpp:191
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:793
A verbatim block command (e.
Definition: Comment.h:879
A line of text contained in a verbatim block.
Definition: Comment.h:854
A verbatim line command.
Definition: Comment.h:930
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
RequirementKind getKind() const
Definition: ExprConcepts.h:198
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:218
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
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
@ Auto
'auto' clause, allowed on 'loop' directives.
@ 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'.
@ PresentOrCopy
'copy' clause alias 'present_or_copy'. Preserved for diagnostic purposes.
@ Private
'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...
@ Copy
'copy' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ 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',...
@ 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.
@ 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...
@ PCopy
'copy' clause alias 'pcopy'. Preserved for diagnostic purposes.
@ 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',...
@ Independent
'independent' clause, allowed on 'loop' directives.
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
@ PresentOrCopyIn
'copyin' clause alias 'present_or_copyin'.
static const TerminalColor CommentColor
static const TerminalColor DeclNameColor
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:401
static const TerminalColor AddressColor
@ PCK_ExeStr
Definition: PragmaKinds.h:19
@ PCK_Compiler
Definition: PragmaKinds.h:18
@ PCK_Linker
Definition: PragmaKinds.h:16
@ PCK_Lib
Definition: PragmaKinds.h:17
@ PCK_Unknown
Definition: PragmaKinds.h:15
@ PCK_User
Definition: PragmaKinds.h:20
@ RQ_None
No ref-qualifier was provided.
Definition: Type.h:1778
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1781
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1784
@ OK_VectorComponent
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:157
@ OK_ObjCProperty
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Definition: Specifiers.h:161
@ OK_ObjCSubscript
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition: Specifiers.h:166
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:151
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:154
@ OK_MatrixComponent
A matrix component is a single element of a matrix.
Definition: Specifiers.h:169
static const TerminalColor StmtColor
static const TerminalColor UndeserializedColor
StorageClass
Storage classes.
Definition: Specifiers.h:248
@ SC_None
Definition: Specifiers.h:250
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.
Definition: Specifiers.h:135
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:144
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:139
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...
Definition: Specifiers.h:188
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:206
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:202
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition: Specifiers.h:198
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition: Specifiers.h:194
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition: Specifiers.h:191
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> 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'
@ Neon
is ARM Neon vector
@ 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_DynamicNone
throw()
@ 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...
Definition: Specifiers.h:123
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:183
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:177
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:175
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:180
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition: Type.h:5071
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:5075
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:5061
Extra information about a function prototype.
Definition: Type.h:5087
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:5094
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:154
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:874
Information about a single command.