clang 19.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);
277 if (D->getLexicalDeclContext() != D->getDeclContext())
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;
405 // The condition expression will be printed as a part of the 'children',
406 // but print 'clause' here so it is clear what is happening from the dump.
407 OS << " clause";
408 break;
409 default:
410 // Nothing to do here.
411 break;
412 }
413 }
414 dumpPointer(C);
415 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
416}
417
419 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
420 if (TSI) {
421 OS << "case ";
422 dumpType(TSI->getType());
423 } else {
424 OS << "default";
425 }
426
427 if (A.isSelected())
428 OS << " selected";
429}
430
432 if (!R) {
433 ColorScope Color(OS, ShowColors, NullColor);
434 OS << "<<<NULL>>> ConceptReference";
435 return;
436 }
437
438 OS << "ConceptReference";
439 dumpPointer(R);
441 OS << ' ';
443}
444
446 if (!R) {
447 ColorScope Color(OS, ShowColors, NullColor);
448 OS << "<<<NULL>>> Requirement";
449 return;
450 }
451
452 {
453 ColorScope Color(OS, ShowColors, StmtColor);
454 switch (R->getKind()) {
456 OS << "TypeRequirement";
457 break;
459 OS << "SimpleRequirement";
460 break;
462 OS << "CompoundRequirement";
463 break;
465 OS << "NestedRequirement";
466 break;
467 }
468 }
469
470 dumpPointer(R);
471
472 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
473 if (ER->hasNoexceptRequirement())
474 OS << " noexcept";
475 }
476
477 if (R->isDependent())
478 OS << " dependent";
479 else
480 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
482 OS << " contains_unexpanded_pack";
483}
484
485static double GetApproxValue(const llvm::APFloat &F) {
486 llvm::APFloat V = F;
487 bool ignored;
488 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
489 &ignored);
490 return V.convertToDouble();
491}
492
493/// True if the \p APValue \p Value can be folded onto the current line.
494static bool isSimpleAPValue(const APValue &Value) {
495 switch (Value.getKind()) {
496 case APValue::None:
498 case APValue::Int:
499 case APValue::Float:
503 case APValue::LValue:
506 return true;
507 case APValue::Vector:
508 case APValue::Array:
509 case APValue::Struct:
510 return false;
511 case APValue::Union:
512 return isSimpleAPValue(Value.getUnionValue());
513 }
514 llvm_unreachable("unexpected APValue kind!");
515}
516
517/// Dump the children of the \p APValue \p Value.
518///
519/// \param[in] Value The \p APValue to visit
520/// \param[in] Ty The \p QualType passed to \p Visit
521///
522/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
523/// to one of the child of the \p APValue
524///
525/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
526/// the indices in the range \p [0,NumChildren(
527///
528/// \param[in] LabelSingular The label to use on a line with a single child
529/// \param[in] LabelPlurial The label to use on a line with multiple children
530void TextNodeDumper::dumpAPValueChildren(
531 const APValue &Value, QualType Ty,
532 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
533 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
534 // To save some vertical space we print up to MaxChildrenPerLine APValues
535 // considered to be simple (by isSimpleAPValue) on a single line.
536 constexpr unsigned MaxChildrenPerLine = 4;
537 unsigned I = 0;
538 while (I < NumChildren) {
539 unsigned J = I;
540 while (J < NumChildren) {
541 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
542 (J - I < MaxChildrenPerLine)) {
543 ++J;
544 continue;
545 }
546 break;
547 }
548
549 J = std::max(I + 1, J);
550
551 // Print [I,J) on a single line.
552 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
553 for (unsigned X = I; X < J; ++X) {
554 Visit(IdxToChildFun(Value, X), Ty);
555 if (X + 1 != J)
556 OS << ", ";
557 }
558 });
559 I = J;
560 }
561}
562
564 ColorScope Color(OS, ShowColors, ValueKindColor);
565 switch (Value.getKind()) {
566 case APValue::None:
567 OS << "None";
568 return;
570 OS << "Indeterminate";
571 return;
572 case APValue::Int:
573 OS << "Int ";
574 {
575 ColorScope Color(OS, ShowColors, ValueColor);
576 OS << Value.getInt();
577 }
578 return;
579 case APValue::Float:
580 OS << "Float ";
581 {
582 ColorScope Color(OS, ShowColors, ValueColor);
583 OS << GetApproxValue(Value.getFloat());
584 }
585 return;
587 OS << "FixedPoint ";
588 {
589 ColorScope Color(OS, ShowColors, ValueColor);
590 OS << Value.getFixedPoint();
591 }
592 return;
593 case APValue::Vector: {
594 unsigned VectorLength = Value.getVectorLength();
595 OS << "Vector length=" << VectorLength;
596
597 dumpAPValueChildren(
598 Value, Ty,
599 [](const APValue &Value, unsigned Index) -> const APValue & {
600 return Value.getVectorElt(Index);
601 },
602 VectorLength, "element", "elements");
603 return;
604 }
606 OS << "ComplexInt ";
607 {
608 ColorScope Color(OS, ShowColors, ValueColor);
609 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
610 << 'i';
611 }
612 return;
614 OS << "ComplexFloat ";
615 {
616 ColorScope Color(OS, ShowColors, ValueColor);
617 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
618 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
619 }
620 return;
621 case APValue::LValue:
622 (void)Context;
623 OS << "LValue <todo>";
624 return;
625 case APValue::Array: {
626 unsigned ArraySize = Value.getArraySize();
627 unsigned NumInitializedElements = Value.getArrayInitializedElts();
628 OS << "Array size=" << ArraySize;
629
630 dumpAPValueChildren(
631 Value, Ty,
632 [](const APValue &Value, unsigned Index) -> const APValue & {
633 return Value.getArrayInitializedElt(Index);
634 },
635 NumInitializedElements, "element", "elements");
636
637 if (Value.hasArrayFiller()) {
638 AddChild("filler", [=] {
639 {
640 ColorScope Color(OS, ShowColors, ValueColor);
641 OS << ArraySize - NumInitializedElements << " x ";
642 }
643 Visit(Value.getArrayFiller(), Ty);
644 });
645 }
646
647 return;
648 }
649 case APValue::Struct: {
650 OS << "Struct";
651
652 dumpAPValueChildren(
653 Value, Ty,
654 [](const APValue &Value, unsigned Index) -> const APValue & {
655 return Value.getStructBase(Index);
656 },
657 Value.getStructNumBases(), "base", "bases");
658
659 dumpAPValueChildren(
660 Value, Ty,
661 [](const APValue &Value, unsigned Index) -> const APValue & {
662 return Value.getStructField(Index);
663 },
664 Value.getStructNumFields(), "field", "fields");
665
666 return;
667 }
668 case APValue::Union: {
669 OS << "Union";
670 {
671 ColorScope Color(OS, ShowColors, ValueColor);
672 if (const FieldDecl *FD = Value.getUnionField())
673 OS << " ." << *cast<NamedDecl>(FD);
674 }
675 // If the union value is considered to be simple, fold it into the
676 // current line to save some vertical space.
677 const APValue &UnionValue = Value.getUnionValue();
678 if (isSimpleAPValue(UnionValue)) {
679 OS << ' ';
680 Visit(UnionValue, Ty);
681 } else {
682 AddChild([=] { Visit(UnionValue, Ty); });
683 }
684
685 return;
686 }
688 OS << "MemberPointer <todo>";
689 return;
691 OS << "AddrLabelDiff <todo>";
692 return;
693 }
694 llvm_unreachable("Unknown APValue kind!");
695}
696
697void TextNodeDumper::dumpPointer(const void *Ptr) {
698 ColorScope Color(OS, ShowColors, AddressColor);
699 OS << ' ' << Ptr;
700}
701
703 if (!SM)
704 return;
705
706 ColorScope Color(OS, ShowColors, LocationColor);
707 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
708
709 // The general format we print out is filename:line:col, but we drop pieces
710 // that haven't changed since the last loc printed.
711 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
712
713 if (PLoc.isInvalid()) {
714 OS << "<invalid sloc>";
715 return;
716 }
717
718 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
719 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
720 << PLoc.getColumn();
721 LastLocFilename = PLoc.getFilename();
722 LastLocLine = PLoc.getLine();
723 } else if (PLoc.getLine() != LastLocLine) {
724 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
725 LastLocLine = PLoc.getLine();
726 } else {
727 OS << "col" << ':' << PLoc.getColumn();
728 }
729}
730
732 // Can't translate locations if a SourceManager isn't available.
733 if (!SM)
734 return;
735
736 OS << " <";
738 if (R.getBegin() != R.getEnd()) {
739 OS << ", ";
740 dumpLocation(R.getEnd());
741 }
742 OS << ">";
743
744 // <t2.c:123:421[blah], t2.c:412:321>
745}
746
748 ColorScope Color(OS, ShowColors, TypeColor);
749
750 SplitQualType T_split = T.split();
751 std::string T_str = QualType::getAsString(T_split, PrintPolicy);
752 OS << "'" << T_str << "'";
753
754 if (Desugar && !T.isNull()) {
755 // If the type is sugared, also dump a (shallow) desugared type when
756 // it is visibly different.
757 SplitQualType D_split = T.getSplitDesugaredType();
758 if (T_split != D_split) {
759 std::string D_str = QualType::getAsString(D_split, PrintPolicy);
760 if (T_str != D_str)
761 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
762 }
763 }
764}
765
767 OS << ' ';
769}
770
772 if (!D) {
773 ColorScope Color(OS, ShowColors, NullColor);
774 OS << "<<<NULL>>>";
775 return;
776 }
777
778 {
779 ColorScope Color(OS, ShowColors, DeclKindNameColor);
780 OS << D->getDeclKindName();
781 }
782 dumpPointer(D);
783
784 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
785 ColorScope Color(OS, ShowColors, DeclNameColor);
786 OS << " '" << ND->getDeclName() << '\'';
787 }
788
789 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
790 dumpType(VD->getType());
791}
792
794 if (ND->getDeclName()) {
795 ColorScope Color(OS, ShowColors, DeclNameColor);
796 OS << ' ' << ND->getDeclName();
797 }
798}
799
801 const auto AccessSpelling = getAccessSpelling(AS);
802 if (AccessSpelling.empty())
803 return;
804 OS << AccessSpelling;
805}
806
809 if (auto *BD = C.dyn_cast<BlockDecl *>())
810 dumpDeclRef(BD, "cleanup");
811 else if (auto *CLE = C.dyn_cast<CompoundLiteralExpr *>())
812 AddChild([=] {
813 OS << "cleanup ";
814 {
815 ColorScope Color(OS, ShowColors, StmtColor);
816 OS << CLE->getStmtClassName();
817 }
818 dumpPointer(CLE);
819 });
820 else
821 llvm_unreachable("unexpected cleanup type");
822}
823
826 switch (TSK) {
827 case TSK_Undeclared:
828 break;
830 OS << " implicit_instantiation";
831 break;
833 OS << " explicit_specialization";
834 break;
836 OS << " explicit_instantiation_declaration";
837 break;
839 OS << " explicit_instantiation_definition";
840 break;
841 }
842}
843
845 if (!NNS)
846 return;
847
848 AddChild([=] {
849 OS << "NestedNameSpecifier";
850
851 switch (NNS->getKind()) {
852 case NestedNameSpecifier::Identifier:
853 OS << " Identifier";
854 OS << " '" << NNS->getAsIdentifier()->getName() << "'";
855 break;
856 case NestedNameSpecifier::Namespace:
857 OS << " "; // "Namespace" is printed as the decl kind.
858 dumpBareDeclRef(NNS->getAsNamespace());
859 break;
860 case NestedNameSpecifier::NamespaceAlias:
861 OS << " "; // "NamespaceAlias" is printed as the decl kind.
862 dumpBareDeclRef(NNS->getAsNamespaceAlias());
863 break;
864 case NestedNameSpecifier::TypeSpec:
865 OS << " TypeSpec";
866 dumpType(QualType(NNS->getAsType(), 0));
867 break;
868 case NestedNameSpecifier::TypeSpecWithTemplate:
869 OS << " TypeSpecWithTemplate";
870 dumpType(QualType(NNS->getAsType(), 0));
871 break;
872 case NestedNameSpecifier::Global:
873 OS << " Global";
874 break;
875 case NestedNameSpecifier::Super:
876 OS << " Super";
877 break;
878 }
879
880 dumpNestedNameSpecifier(NNS->getPrefix());
881 });
882}
883
884void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
885 if (!D)
886 return;
887
888 AddChild([=] {
889 if (!Label.empty())
890 OS << Label << ' ';
892 });
893}
894
895const char *TextNodeDumper::getCommandName(unsigned CommandID) {
896 if (Traits)
897 return Traits->getCommandInfo(CommandID)->Name;
898 const comments::CommandInfo *Info =
900 if (Info)
901 return Info->Name;
902 return "<not a builtin command>";
903}
904
905void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
906#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
907 if (FPO.has##NAME##Override()) \
908 OS << " " #NAME "=" << FPO.get##NAME##Override();
909#include "clang/Basic/FPOptions.def"
910}
911
913 const comments::FullComment *) {
914 OS << " Text=\"" << C->getText() << "\"";
915}
916
919 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
920 switch (C->getRenderKind()) {
922 OS << " RenderNormal";
923 break;
925 OS << " RenderBold";
926 break;
928 OS << " RenderMonospaced";
929 break;
931 OS << " RenderEmphasized";
932 break;
934 OS << " RenderAnchor";
935 break;
936 }
937
938 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
939 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
940}
941
944 OS << " Name=\"" << C->getTagName() << "\"";
945 if (C->getNumAttrs() != 0) {
946 OS << " Attrs: ";
947 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
949 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
950 }
951 }
952 if (C->isSelfClosing())
953 OS << " SelfClosing";
954}
955
958 OS << " Name=\"" << C->getTagName() << "\"";
959}
960
963 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
964 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
965 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
966}
967
970 OS << " "
972
973 if (C->isDirectionExplicit())
974 OS << " explicitly";
975 else
976 OS << " implicitly";
977
978 if (C->hasParamName()) {
979 if (C->isParamIndexValid())
980 OS << " Param=\"" << C->getParamName(FC) << "\"";
981 else
982 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
983 }
984
985 if (C->isParamIndexValid() && !C->isVarArgParam())
986 OS << " ParamIndex=" << C->getParamIndex();
987}
988
991 if (C->hasParamName()) {
992 if (C->isPositionValid())
993 OS << " Param=\"" << C->getParamName(FC) << "\"";
994 else
995 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
996 }
997
998 if (C->isPositionValid()) {
999 OS << " Position=<";
1000 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
1001 OS << C->getIndex(i);
1002 if (i != e - 1)
1003 OS << ", ";
1004 }
1005 OS << ">";
1006 }
1007}
1008
1011 OS << " Name=\"" << getCommandName(C->getCommandID())
1012 << "\""
1013 " CloseName=\""
1014 << C->getCloseName() << "\"";
1015}
1016
1019 const comments::FullComment *) {
1020 OS << " Text=\"" << C->getText() << "\"";
1021}
1022
1025 OS << " Text=\"" << C->getText() << "\"";
1026}
1027
1029 OS << " null";
1030}
1031
1033 OS << " type";
1034 dumpType(TA.getAsType());
1035}
1036
1038 const TemplateArgument &TA) {
1039 OS << " decl";
1040 dumpDeclRef(TA.getAsDecl());
1041}
1042
1044 OS << " nullptr";
1045}
1046
1048 OS << " integral " << TA.getAsIntegral();
1049}
1050
1053 OS << " using";
1054 OS << " template ";
1055 TA.getAsTemplate().dump(OS);
1056}
1057
1059 const TemplateArgument &TA) {
1062 OS << " using";
1063 OS << " template expansion ";
1065}
1066
1068 OS << " expr";
1069}
1070
1072 OS << " pack";
1073}
1074
1075static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1076 if (Node->path_empty())
1077 return;
1078
1079 OS << " (";
1080 bool First = true;
1081 for (CastExpr::path_const_iterator I = Node->path_begin(),
1082 E = Node->path_end();
1083 I != E; ++I) {
1084 const CXXBaseSpecifier *Base = *I;
1085 if (!First)
1086 OS << " -> ";
1087
1088 const auto *RD =
1089 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
1090
1091 if (Base->isVirtual())
1092 OS << "virtual ";
1093 OS << RD->getName();
1094 First = false;
1095 }
1096
1097 OS << ')';
1098}
1099
1101 if (Node->hasInitStorage())
1102 OS << " has_init";
1103 if (Node->hasVarStorage())
1104 OS << " has_var";
1105 if (Node->hasElseStorage())
1106 OS << " has_else";
1107 if (Node->isConstexpr())
1108 OS << " constexpr";
1109 if (Node->isConsteval()) {
1110 OS << " ";
1111 if (Node->isNegatedConsteval())
1112 OS << "!";
1113 OS << "consteval";
1114 }
1115}
1116
1118 if (Node->hasInitStorage())
1119 OS << " has_init";
1120 if (Node->hasVarStorage())
1121 OS << " has_var";
1122}
1123
1125 if (Node->hasVarStorage())
1126 OS << " has_var";
1127}
1128
1130 OS << " '" << Node->getName() << "'";
1131 if (Node->isSideEntry())
1132 OS << " side_entry";
1133}
1134
1136 OS << " '" << Node->getLabel()->getName() << "'";
1137 dumpPointer(Node->getLabel());
1138}
1139
1141 if (Node->caseStmtIsGNURange())
1142 OS << " gnu_range";
1143}
1144
1146 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1147 OS << " nrvo_candidate(";
1148 dumpBareDeclRef(Cand);
1149 OS << ")";
1150 }
1151}
1152
1154 if (Node->isImplicit())
1155 OS << " implicit";
1156}
1157
1159 if (Node->isImplicit())
1160 OS << " implicit";
1161}
1162
1164 if (Node->hasAPValueResult())
1165 AddChild("value",
1166 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1167}
1168
1170 if (Node->usesADL())
1171 OS << " adl";
1172 if (Node->hasStoredFPFeatures())
1173 printFPOptions(Node->getFPFeatures());
1174}
1175
1177 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1178 if (OperatorSpelling)
1179 OS << " '" << OperatorSpelling << "'";
1180
1182}
1183
1185 OS << " <";
1186 {
1187 ColorScope Color(OS, ShowColors, CastColor);
1188 OS << Node->getCastKindName();
1189 }
1190 dumpBasePath(OS, Node);
1191 OS << ">";
1192 if (Node->hasStoredFPFeatures())
1193 printFPOptions(Node->getFPFeatures());
1194}
1195
1198 if (Node->isPartOfExplicitCast())
1199 OS << " part_of_explicit_cast";
1200}
1201
1203 OS << " ";
1204 dumpBareDeclRef(Node->getDecl());
1205 dumpNestedNameSpecifier(Node->getQualifier());
1206 if (Node->getDecl() != Node->getFoundDecl()) {
1207 OS << " (";
1208 dumpBareDeclRef(Node->getFoundDecl());
1209 OS << ")";
1210 }
1211 switch (Node->isNonOdrUse()) {
1212 case NOUR_None: break;
1213 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1214 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1215 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1216 }
1217 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1218 OS << " dependent_capture";
1219 else if (Node->refersToEnclosingVariableOrCapture())
1220 OS << " refers_to_enclosing_variable_or_capture";
1221
1222 if (Node->isImmediateEscalating())
1223 OS << " immediate-escalating";
1224}
1225
1228
1229 dumpNestedNameSpecifier(Node->getQualifier());
1230}
1231
1233 const UnresolvedLookupExpr *Node) {
1234 OS << " (";
1235 if (!Node->requiresADL())
1236 OS << "no ";
1237 OS << "ADL) = '" << Node->getName() << '\'';
1238
1239 UnresolvedLookupExpr::decls_iterator I = Node->decls_begin(),
1240 E = Node->decls_end();
1241 if (I == E)
1242 OS << " empty";
1243 for (; I != E; ++I)
1244 dumpPointer(*I);
1245}
1246
1248 {
1249 ColorScope Color(OS, ShowColors, DeclKindNameColor);
1250 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1251 }
1252 OS << "='" << *Node->getDecl() << "'";
1253 dumpPointer(Node->getDecl());
1254 if (Node->isFreeIvar())
1255 OS << " isFreeIvar";
1256}
1257
1260 dumpType(Node->getTypeSourceInfo()->getType());
1261}
1262
1264 OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
1265}
1266
1268 ColorScope Color(OS, ShowColors, ValueColor);
1269 OS << " " << Node->getValue();
1270}
1271
1273 bool isSigned = Node->getType()->isSignedIntegerType();
1274 ColorScope Color(OS, ShowColors, ValueColor);
1275 OS << " " << toString(Node->getValue(), 10, isSigned);
1276}
1277
1279 ColorScope Color(OS, ShowColors, ValueColor);
1280 OS << " " << Node->getValueAsString(/*Radix=*/10);
1281}
1282
1284 ColorScope Color(OS, ShowColors, ValueColor);
1285 OS << " " << Node->getValueAsApproximateDouble();
1286}
1287
1289 ColorScope Color(OS, ShowColors, ValueColor);
1290 OS << " ";
1291 Str->outputString(OS);
1292}
1293
1295 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1296 OS << " field ";
1297 dumpBareDeclRef(Field);
1298 }
1299}
1300
1302 if (E->isResultDependent())
1303 OS << " result_dependent";
1304}
1305
1307 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1308 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1309 if (!Node->canOverflow())
1310 OS << " cannot overflow";
1311 if (Node->hasStoredFPFeatures())
1312 printFPOptions(Node->getStoredFPFeatures());
1313}
1314
1317 OS << " " << getTraitSpelling(Node->getKind());
1318
1319 if (Node->isArgumentType())
1320 dumpType(Node->getArgumentType());
1321}
1322
1324 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1325 dumpPointer(Node->getMemberDecl());
1326 dumpNestedNameSpecifier(Node->getQualifier());
1327 switch (Node->isNonOdrUse()) {
1328 case NOUR_None: break;
1329 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1330 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1331 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1332 }
1333}
1334
1336 const ExtVectorElementExpr *Node) {
1337 OS << " " << Node->getAccessor().getNameStart();
1338}
1339
1341 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1342 if (Node->hasStoredFPFeatures())
1343 printFPOptions(Node->getStoredFPFeatures());
1344}
1345
1348 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1349 << "' ComputeLHSTy=";
1350 dumpBareType(Node->getComputationLHSType());
1351 OS << " ComputeResultTy=";
1352 dumpBareType(Node->getComputationResultType());
1353 if (Node->hasStoredFPFeatures())
1354 printFPOptions(Node->getStoredFPFeatures());
1355}
1356
1358 OS << " " << Node->getLabel()->getName();
1359 dumpPointer(Node->getLabel());
1360}
1361
1363 OS << " " << Node->getCastName() << "<"
1364 << Node->getTypeAsWritten().getAsString() << ">"
1365 << " <" << Node->getCastKindName();
1366 dumpBasePath(OS, Node);
1367 OS << ">";
1368}
1369
1371 OS << " " << (Node->getValue() ? "true" : "false");
1372}
1373
1375 if (Node->isImplicit())
1376 OS << " implicit";
1377 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1378 OS << " dependent_capture";
1379 OS << " this";
1380}
1381
1383 const CXXFunctionalCastExpr *Node) {
1384 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1385 << Node->getCastKindName() << ">";
1386 if (Node->hasStoredFPFeatures())
1387 printFPOptions(Node->getFPFeatures());
1388}
1389
1392 if (Node->hasStoredFPFeatures())
1393 printFPOptions(Node->getFPFeatures());
1394}
1395
1398 dumpType(Node->getTypeAsWritten());
1399 if (Node->isListInitialization())
1400 OS << " list";
1401}
1402
1404 CXXConstructorDecl *Ctor = Node->getConstructor();
1405 dumpType(Ctor->getType());
1406 if (Node->isElidable())
1407 OS << " elidable";
1408 if (Node->isListInitialization())
1409 OS << " list";
1410 if (Node->isStdInitListInitialization())
1411 OS << " std::initializer_list";
1412 if (Node->requiresZeroInitialization())
1413 OS << " zeroing";
1414 if (Node->isImmediateEscalating())
1415 OS << " immediate-escalating";
1416}
1417
1419 const CXXBindTemporaryExpr *Node) {
1420 OS << " (CXXTemporary";
1422 OS << ")";
1423}
1424
1426 if (Node->isGlobalNew())
1427 OS << " global";
1428 if (Node->isArray())
1429 OS << " array";
1430 if (Node->getOperatorNew()) {
1431 OS << ' ';
1432 dumpBareDeclRef(Node->getOperatorNew());
1433 }
1434 // We could dump the deallocation function used in case of error, but it's
1435 // usually not that interesting.
1436}
1437
1439 if (Node->isGlobalDelete())
1440 OS << " global";
1441 if (Node->isArrayForm())
1442 OS << " array";
1443 if (Node->getOperatorDelete()) {
1444 OS << ' ';
1445 dumpBareDeclRef(Node->getOperatorDelete());
1446 }
1447}
1448
1450 OS << " " << getTraitSpelling(Node->getTrait());
1451}
1452
1454 OS << " " << getTraitSpelling(Node->getTrait());
1455}
1456
1458 OS << " " << getTraitSpelling(Node->getTrait());
1459}
1460
1462 if (Node->hasRewrittenInit())
1463 OS << " has rewritten init";
1464}
1465
1467 if (Node->hasRewrittenInit())
1468 OS << " has rewritten init";
1469}
1470
1473 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1474 OS << " extended by ";
1475 dumpBareDeclRef(VD);
1476 }
1477}
1478
1480 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1481 dumpCleanupObject(Node->getObject(i));
1482}
1483
1485 dumpPointer(Node->getPack());
1486 dumpName(Node->getPack());
1487}
1488
1491 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1492}
1493
1495 OS << " selector=";
1496 Node->getSelector().print(OS);
1497 switch (Node->getReceiverKind()) {
1499 break;
1500
1502 OS << " class=";
1503 dumpBareType(Node->getClassReceiver());
1504 break;
1505
1507 OS << " super (instance)";
1508 break;
1509
1511 OS << " super (class)";
1512 break;
1513 }
1514}
1515
1517 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1518 OS << " selector=";
1519 BoxingMethod->getSelector().print(OS);
1520 }
1521}
1522
1524 if (!Node->getCatchParamDecl())
1525 OS << " catch all";
1526}
1527
1529 dumpType(Node->getEncodedType());
1530}
1531
1533 OS << " ";
1534 Node->getSelector().print(OS);
1535}
1536
1538 OS << ' ' << *Node->getProtocol();
1539}
1540
1542 if (Node->isImplicitProperty()) {
1543 OS << " Kind=MethodRef Getter=\"";
1544 if (Node->getImplicitPropertyGetter())
1545 Node->getImplicitPropertyGetter()->getSelector().print(OS);
1546 else
1547 OS << "(null)";
1548
1549 OS << "\" Setter=\"";
1550 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1551 Setter->getSelector().print(OS);
1552 else
1553 OS << "(null)";
1554 OS << "\"";
1555 } else {
1556 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1557 << '"';
1558 }
1559
1560 if (Node->isSuperReceiver())
1561 OS << " super";
1562
1563 OS << " Messaging=";
1564 if (Node->isMessagingGetter() && Node->isMessagingSetter())
1565 OS << "Getter&Setter";
1566 else if (Node->isMessagingGetter())
1567 OS << "Getter";
1568 else if (Node->isMessagingSetter())
1569 OS << "Setter";
1570}
1571
1573 const ObjCSubscriptRefExpr *Node) {
1574 if (Node->isArraySubscriptRefExpr())
1575 OS << " Kind=ArraySubscript GetterForArray=\"";
1576 else
1577 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1578 if (Node->getAtIndexMethodDecl())
1579 Node->getAtIndexMethodDecl()->getSelector().print(OS);
1580 else
1581 OS << "(null)";
1582
1583 if (Node->isArraySubscriptRefExpr())
1584 OS << "\" SetterForArray=\"";
1585 else
1586 OS << "\" SetterForDictionary=\"";
1587 if (Node->setAtIndexMethodDecl())
1588 Node->setAtIndexMethodDecl()->getSelector().print(OS);
1589 else
1590 OS << "(null)";
1591}
1592
1594 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1595}
1596
1598 OS << " ";
1599 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
1600 Visit(Node->getIteratorDecl(I));
1601 OS << " = ";
1602 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
1603 OS << " begin ";
1604 Visit(Range.Begin);
1605 OS << " end ";
1606 Visit(Range.End);
1607 if (Range.Step) {
1608 OS << " step ";
1609 Visit(Range.Step);
1610 }
1611 }
1612}
1613
1616 OS << " ";
1617 dumpBareDeclRef(Node->getFoundDecl());
1618}
1619
1621 const RequiresExpr *Node) {
1622 if (!Node->isValueDependent())
1623 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
1624}
1625
1627 if (T->isSpelledAsLValue())
1628 OS << " written as lvalue reference";
1629}
1630
1632 switch (T->getSizeModifier()) {
1634 break;
1636 OS << " static";
1637 break;
1639 OS << " *";
1640 break;
1641 }
1642 OS << " " << T->getIndexTypeQualifiers().getAsString();
1643}
1644
1646 OS << " " << T->getSize();
1648}
1649
1651 OS << " ";
1652 dumpSourceRange(T->getBracketsRange());
1654}
1655
1657 const DependentSizedArrayType *T) {
1659 OS << " ";
1660 dumpSourceRange(T->getBracketsRange());
1661}
1662
1665 OS << " ";
1666 dumpLocation(T->getAttributeLoc());
1667}
1668
1670 switch (T->getVectorKind()) {
1672 break;
1674 OS << " altivec";
1675 break;
1677 OS << " altivec pixel";
1678 break;
1680 OS << " altivec bool";
1681 break;
1682 case VectorKind::Neon:
1683 OS << " neon";
1684 break;
1686 OS << " neon poly";
1687 break;
1689 OS << " fixed-length sve data vector";
1690 break;
1692 OS << " fixed-length sve predicate vector";
1693 break;
1695 OS << " fixed-length rvv data vector";
1696 break;
1698 OS << " fixed-length rvv mask vector";
1699 break;
1700 }
1701 OS << " " << T->getNumElements();
1702}
1703
1705 auto EI = T->getExtInfo();
1706 if (EI.getNoReturn())
1707 OS << " noreturn";
1708 if (EI.getProducesResult())
1709 OS << " produces_result";
1710 if (EI.getHasRegParm())
1711 OS << " regparm " << EI.getRegParm();
1712 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1713}
1714
1716 auto EPI = T->getExtProtoInfo();
1717 if (EPI.HasTrailingReturn)
1718 OS << " trailing_return";
1719 if (T->isConst())
1720 OS << " const";
1721 if (T->isVolatile())
1722 OS << " volatile";
1723 if (T->isRestrict())
1724 OS << " restrict";
1725 if (T->getExtProtoInfo().Variadic)
1726 OS << " variadic";
1727 switch (EPI.RefQualifier) {
1728 case RQ_None:
1729 break;
1730 case RQ_LValue:
1731 OS << " &";
1732 break;
1733 case RQ_RValue:
1734 OS << " &&";
1735 break;
1736 }
1737
1738 switch (EPI.ExceptionSpec.Type) {
1739 case EST_None:
1740 break;
1741 case EST_DynamicNone:
1742 OS << " exceptionspec_dynamic_none";
1743 break;
1744 case EST_Dynamic:
1745 OS << " exceptionspec_dynamic";
1746 break;
1747 case EST_MSAny:
1748 OS << " exceptionspec_ms_any";
1749 break;
1750 case EST_NoThrow:
1751 OS << " exceptionspec_nothrow";
1752 break;
1753 case EST_BasicNoexcept:
1754 OS << " exceptionspec_basic_noexcept";
1755 break;
1757 OS << " exceptionspec_dependent_noexcept";
1758 break;
1759 case EST_NoexceptFalse:
1760 OS << " exceptionspec_noexcept_false";
1761 break;
1762 case EST_NoexceptTrue:
1763 OS << " exceptionspec_noexcept_true";
1764 break;
1765 case EST_Unevaluated:
1766 OS << " exceptionspec_unevaluated";
1767 break;
1768 case EST_Uninstantiated:
1769 OS << " exceptionspec_uninstantiated";
1770 break;
1771 case EST_Unparsed:
1772 OS << " exceptionspec_unparsed";
1773 break;
1774 }
1775 if (!EPI.ExceptionSpec.Exceptions.empty()) {
1776 AddChild([=] {
1777 OS << "Exceptions:";
1778 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
1779 ++I) {
1780 if (I)
1781 OS << ",";
1782 dumpType(EPI.ExceptionSpec.Exceptions[I]);
1783 }
1784 });
1785 }
1786 if (EPI.ExceptionSpec.NoexceptExpr) {
1787 AddChild([=] {
1788 OS << "NoexceptExpr: ";
1789 Visit(EPI.ExceptionSpec.NoexceptExpr);
1790 });
1791 }
1792 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
1793 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
1794
1795 // FIXME: Consumed parameters.
1797}
1798
1800 dumpDeclRef(T->getDecl());
1801}
1802
1804 dumpDeclRef(T->getFoundDecl());
1805 if (!T->typeMatchesDecl())
1806 OS << " divergent";
1807}
1808
1810 dumpDeclRef(T->getDecl());
1811 if (!T->typeMatchesDecl())
1812 OS << " divergent";
1813}
1814
1816 switch (T->getUTTKind()) {
1817#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
1818 case UnaryTransformType::Enum: \
1819 OS << " " #Trait; \
1820 break;
1821#include "clang/Basic/TransformTypeTraits.def"
1822 }
1823}
1824
1826 dumpDeclRef(T->getDecl());
1827}
1828
1830 OS << " depth " << T->getDepth() << " index " << T->getIndex();
1831 if (T->isParameterPack())
1832 OS << " pack";
1833 dumpDeclRef(T->getDecl());
1834}
1835
1838 dumpDeclRef(T->getAssociatedDecl());
1839 VisitTemplateTypeParmDecl(T->getReplacedParameter());
1840 if (auto PackIndex = T->getPackIndex())
1841 OS << " pack_index " << *PackIndex;
1842}
1843
1846 dumpDeclRef(T->getAssociatedDecl());
1847 VisitTemplateTypeParmDecl(T->getReplacedParameter());
1848}
1849
1851 if (T->isDecltypeAuto())
1852 OS << " decltype(auto)";
1853 if (!T->isDeduced())
1854 OS << " undeduced";
1855 if (T->isConstrained())
1856 dumpDeclRef(T->getTypeConstraintConcept());
1857}
1858
1861 if (T->getTemplateName().getKind() == TemplateName::UsingTemplate)
1862 OS << " using";
1863}
1864
1867 if (T->isTypeAlias())
1868 OS << " alias";
1869 if (T->getTemplateName().getKind() == TemplateName::UsingTemplate)
1870 OS << " using";
1871 OS << " ";
1872 T->getTemplateName().dump(OS);
1873}
1874
1876 const InjectedClassNameType *T) {
1877 dumpDeclRef(T->getDecl());
1878}
1879
1881 dumpDeclRef(T->getDecl());
1882}
1883
1885 if (auto N = T->getNumExpansions())
1886 OS << " expansions " << *N;
1887}
1888
1890 // By default, add extra Type details with no extra loc info.
1892}
1893// FIXME: override behavior for TypeLocs that have interesting location
1894// information, such as the qualifier in ElaboratedTypeLoc.
1895
1897
1899 dumpName(D);
1901 if (D->isModulePrivate())
1902 OS << " __module_private__";
1903}
1904
1906 if (D->isScoped()) {
1907 if (D->isScopedUsingClassTag())
1908 OS << " class";
1909 else
1910 OS << " struct";
1911 }
1912 dumpName(D);
1913 if (D->isModulePrivate())
1914 OS << " __module_private__";
1915 if (D->isFixed())
1917}
1918
1920 OS << ' ' << D->getKindName();
1921 dumpName(D);
1922 if (D->isModulePrivate())
1923 OS << " __module_private__";
1924 if (D->isCompleteDefinition())
1925 OS << " definition";
1926}
1927
1929 dumpName(D);
1930 dumpType(D->getType());
1931}
1932
1934 dumpName(D);
1935 dumpType(D->getType());
1936
1937 for (const auto *Child : D->chain())
1938 dumpDeclRef(Child);
1939}
1940
1942 dumpName(D);
1943 dumpType(D->getType());
1945
1946 StorageClass SC = D->getStorageClass();
1947 if (SC != SC_None)
1949 if (D->isInlineSpecified())
1950 OS << " inline";
1951 if (D->isVirtualAsWritten())
1952 OS << " virtual";
1953 if (D->isModulePrivate())
1954 OS << " __module_private__";
1955
1956 if (D->isPureVirtual())
1957 OS << " pure";
1958 if (D->isDefaulted()) {
1959 OS << " default";
1960 if (D->isDeleted())
1961 OS << "_delete";
1962 }
1963 if (D->isDeletedAsWritten())
1964 OS << " delete";
1965 if (D->isTrivial())
1966 OS << " trivial";
1967
1968 if (const StringLiteral *M = D->getDeletedMessage())
1969 AddChild("delete message", [=] { Visit(M); });
1970
1972 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
1973
1974 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1975 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1976 switch (EPI.ExceptionSpec.Type) {
1977 default:
1978 break;
1979 case EST_Unevaluated:
1980 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1981 break;
1982 case EST_Uninstantiated:
1983 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1984 break;
1985 }
1986 }
1987
1988 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1989 if (MD->size_overridden_methods() != 0) {
1990 auto dumpOverride = [=](const CXXMethodDecl *D) {
1991 SplitQualType T_split = D->getType().split();
1992 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
1993 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
1994 };
1995
1996 AddChild([=] {
1997 auto Overrides = MD->overridden_methods();
1998 OS << "Overrides: [ ";
1999 dumpOverride(*Overrides.begin());
2000 for (const auto *Override : llvm::drop_begin(Overrides)) {
2001 OS << ", ";
2002 dumpOverride(Override);
2003 }
2004 OS << " ]";
2005 });
2006 }
2007 }
2008
2009 if (!D->isInlineSpecified() && D->isInlined()) {
2010 OS << " implicit-inline";
2011 }
2012 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
2013 // the Params are set later, it is possible for a dump during debugging to
2014 // encounter a FunctionDecl that has been created but hasn't been assigned
2015 // ParmVarDecls yet.
2016 if (!D->param_empty() && !D->param_begin())
2017 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
2018
2019 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
2020 OS << " instantiated_from";
2021 dumpPointer(Instance);
2022 }
2023}
2024
2026 const CXXDeductionGuideDecl *D) {
2028 switch (D->getDeductionCandidateKind()) {
2031 return;
2033 OS << " aggregate ";
2034 break;
2035 }
2036}
2037
2040 OS << " extended by ";
2042 OS << " mangling ";
2043 {
2044 ColorScope Color(OS, ShowColors, ValueColor);
2045 OS << D->getManglingNumber();
2046 }
2047}
2048
2050 dumpName(D);
2051 dumpType(D->getType());
2052 if (D->isMutable())
2053 OS << " mutable";
2054 if (D->isModulePrivate())
2055 OS << " __module_private__";
2056}
2057
2060 dumpName(D);
2061 if (const auto *P = dyn_cast<ParmVarDecl>(D);
2062 P && P->isExplicitObjectParameter())
2063 OS << " this";
2064
2065 dumpType(D->getType());
2067 StorageClass SC = D->getStorageClass();
2068 if (SC != SC_None)
2070 switch (D->getTLSKind()) {
2071 case VarDecl::TLS_None:
2072 break;
2074 OS << " tls";
2075 break;
2077 OS << " tls_dynamic";
2078 break;
2079 }
2080 if (D->isModulePrivate())
2081 OS << " __module_private__";
2082 if (D->isNRVOVariable())
2083 OS << " nrvo";
2084 if (D->isInline())
2085 OS << " inline";
2086 if (D->isConstexpr())
2087 OS << " constexpr";
2088 if (D->hasInit()) {
2089 switch (D->getInitStyle()) {
2090 case VarDecl::CInit:
2091 OS << " cinit";
2092 break;
2093 case VarDecl::CallInit:
2094 OS << " callinit";
2095 break;
2096 case VarDecl::ListInit:
2097 OS << " listinit";
2098 break;
2100 OS << " parenlistinit";
2101 }
2102 }
2103 if (D->needsDestruction(D->getASTContext()))
2104 OS << " destroyed";
2105 if (D->isParameterPack())
2106 OS << " pack";
2107
2108 if (D->hasInit()) {
2109 const Expr *E = D->getInit();
2110 // Only dump the value of constexpr VarDecls for now.
2111 if (E && !E->isValueDependent() && D->isConstexpr() &&
2112 !D->getType()->isDependentType()) {
2113 const APValue *Value = D->evaluateValue();
2114 if (Value)
2115 AddChild("value", [=] { Visit(*Value, E->getType()); });
2116 }
2117 }
2118}
2119
2121 dumpName(D);
2122 dumpType(D->getType());
2123}
2124
2126 if (D->isNothrow())
2127 OS << " nothrow";
2128}
2129
2131 OS << ' ' << D->getImportedModule()->getFullModuleName();
2132
2133 for (Decl *InitD :
2135 dumpDeclRef(InitD, "initializer");
2136}
2137
2139 OS << ' ';
2140 switch (D->getCommentKind()) {
2141 case PCK_Unknown:
2142 llvm_unreachable("unexpected pragma comment kind");
2143 case PCK_Compiler:
2144 OS << "compiler";
2145 break;
2146 case PCK_ExeStr:
2147 OS << "exestr";
2148 break;
2149 case PCK_Lib:
2150 OS << "lib";
2151 break;
2152 case PCK_Linker:
2153 OS << "linker";
2154 break;
2155 case PCK_User:
2156 OS << "user";
2157 break;
2158 }
2159 StringRef Arg = D->getArg();
2160 if (!Arg.empty())
2161 OS << " \"" << Arg << "\"";
2162}
2163
2165 const PragmaDetectMismatchDecl *D) {
2166 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2167}
2168
2170 const OMPExecutableDirective *D) {
2171 if (D->isStandaloneDirective())
2172 OS << " openmp_standalone_directive";
2173}
2174
2176 const OMPDeclareReductionDecl *D) {
2177 dumpName(D);
2178 dumpType(D->getType());
2179 OS << " combiner";
2181 if (const auto *Initializer = D->getInitializer()) {
2182 OS << " initializer";
2184 switch (D->getInitializerKind()) {
2186 OS << " omp_priv = ";
2187 break;
2189 OS << " omp_priv ()";
2190 break;
2192 break;
2193 }
2194 }
2195}
2196
2198 for (const auto *C : D->clauselists()) {
2199 AddChild([=] {
2200 if (!C) {
2201 ColorScope Color(OS, ShowColors, NullColor);
2202 OS << "<<<NULL>>> OMPClause";
2203 return;
2204 }
2205 {
2206 ColorScope Color(OS, ShowColors, AttrColor);
2207 StringRef ClauseName(
2208 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2209 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2210 << ClauseName.drop_front() << "Clause";
2211 }
2212 dumpPointer(C);
2213 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2214 });
2215 }
2216}
2217
2219 dumpName(D);
2220 dumpType(D->getType());
2221}
2222
2224 dumpName(D);
2225 if (D->isInline())
2226 OS << " inline";
2227 if (D->isNested())
2228 OS << " nested";
2229 if (!D->isOriginalNamespace())
2230 dumpDeclRef(D->getOriginalNamespace(), "original");
2231}
2232
2234 OS << ' ';
2236}
2237
2239 dumpName(D);
2241}
2242
2244 dumpName(D);
2246}
2247
2249 const TypeAliasTemplateDecl *D) {
2250 dumpName(D);
2251}
2252
2254 VisitRecordDecl(D);
2255 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2256 OS << " instantiated_from";
2257 dumpPointer(Instance);
2258 }
2259 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
2260 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2261
2263
2264 if (!D->isCompleteDefinition())
2265 return;
2266
2267 AddChild([=] {
2268 {
2269 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2270 OS << "DefinitionData";
2271 }
2272#define FLAG(fn, name) \
2273 if (D->fn()) \
2274 OS << " " #name;
2275 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2276
2277 FLAG(isGenericLambda, generic);
2278 FLAG(isLambda, lambda);
2279
2280 FLAG(isAnonymousStructOrUnion, is_anonymous);
2281 FLAG(canPassInRegisters, pass_in_registers);
2282 FLAG(isEmpty, empty);
2283 FLAG(isAggregate, aggregate);
2284 FLAG(isStandardLayout, standard_layout);
2285 FLAG(isTriviallyCopyable, trivially_copyable);
2286 FLAG(isPOD, pod);
2287 FLAG(isTrivial, trivial);
2288 FLAG(isPolymorphic, polymorphic);
2289 FLAG(isAbstract, abstract);
2290 FLAG(isLiteral, literal);
2291
2292 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2293 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2294 FLAG(hasMutableFields, has_mutable_fields);
2295 FLAG(hasVariantMembers, has_variant_members);
2296 FLAG(allowConstDefaultInit, can_const_default_init);
2297
2298 AddChild([=] {
2299 {
2300 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2301 OS << "DefaultConstructor";
2302 }
2303 FLAG(hasDefaultConstructor, exists);
2304 FLAG(hasTrivialDefaultConstructor, trivial);
2305 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2306 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2307 FLAG(hasConstexprDefaultConstructor, constexpr);
2308 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2309 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2310 });
2311
2312 AddChild([=] {
2313 {
2314 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2315 OS << "CopyConstructor";
2316 }
2317 FLAG(hasSimpleCopyConstructor, simple);
2318 FLAG(hasTrivialCopyConstructor, trivial);
2319 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2320 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2321 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2322 FLAG(needsImplicitCopyConstructor, needs_implicit);
2323 FLAG(needsOverloadResolutionForCopyConstructor,
2324 needs_overload_resolution);
2326 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2327 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2328 });
2329
2330 AddChild([=] {
2331 {
2332 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2333 OS << "MoveConstructor";
2334 }
2335 FLAG(hasMoveConstructor, exists);
2336 FLAG(hasSimpleMoveConstructor, simple);
2337 FLAG(hasTrivialMoveConstructor, trivial);
2338 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2339 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2340 FLAG(needsImplicitMoveConstructor, needs_implicit);
2341 FLAG(needsOverloadResolutionForMoveConstructor,
2342 needs_overload_resolution);
2344 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2345 });
2346
2347 AddChild([=] {
2348 {
2349 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2350 OS << "CopyAssignment";
2351 }
2352 FLAG(hasSimpleCopyAssignment, simple);
2353 FLAG(hasTrivialCopyAssignment, trivial);
2354 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2355 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2356 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2357 FLAG(needsImplicitCopyAssignment, needs_implicit);
2358 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2359 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2360 });
2361
2362 AddChild([=] {
2363 {
2364 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2365 OS << "MoveAssignment";
2366 }
2367 FLAG(hasMoveAssignment, exists);
2368 FLAG(hasSimpleMoveAssignment, simple);
2369 FLAG(hasTrivialMoveAssignment, trivial);
2370 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2371 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2372 FLAG(needsImplicitMoveAssignment, needs_implicit);
2373 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2374 });
2375
2376 AddChild([=] {
2377 {
2378 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2379 OS << "Destructor";
2380 }
2381 FLAG(hasSimpleDestructor, simple);
2382 FLAG(hasIrrelevantDestructor, irrelevant);
2383 FLAG(hasTrivialDestructor, trivial);
2384 FLAG(hasNonTrivialDestructor, non_trivial);
2385 FLAG(hasUserDeclaredDestructor, user_declared);
2386 FLAG(hasConstexprDestructor, constexpr);
2387 FLAG(needsImplicitDestructor, needs_implicit);
2388 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2390 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2391 });
2392 });
2393
2394 for (const auto &I : D->bases()) {
2395 AddChild([=] {
2396 if (I.isVirtual())
2397 OS << "virtual ";
2398 dumpAccessSpecifier(I.getAccessSpecifier());
2399 dumpType(I.getType());
2400 if (I.isPackExpansion())
2401 OS << "...";
2402 });
2403 }
2404}
2405
2407 dumpName(D);
2408}
2409
2411 dumpName(D);
2412}
2413
2415 dumpName(D);
2416}
2417
2419 dumpName(D);
2420}
2421
2423 if (const auto *TC = D->getTypeConstraint()) {
2424 OS << " ";
2425 dumpBareDeclRef(TC->getNamedConcept());
2426 if (TC->getNamedConcept() != TC->getFoundDecl()) {
2427 OS << " (";
2428 dumpBareDeclRef(TC->getFoundDecl());
2429 OS << ")";
2430 }
2431 } else if (D->wasDeclaredWithTypename())
2432 OS << " typename";
2433 else
2434 OS << " class";
2435 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2436 if (D->isParameterPack())
2437 OS << " ...";
2438 dumpName(D);
2439}
2440
2442 const NonTypeTemplateParmDecl *D) {
2443 dumpType(D->getType());
2444 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2445 if (D->isParameterPack())
2446 OS << " ...";
2447 dumpName(D);
2448}
2449
2451 const TemplateTemplateParmDecl *D) {
2452 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2453 if (D->isParameterPack())
2454 OS << " ...";
2455 dumpName(D);
2456}
2457
2459 OS << ' ';
2460 if (D->getQualifier())
2462 OS << D->getDeclName();
2464}
2465
2467 OS << ' ';
2469}
2470
2472 const UnresolvedUsingTypenameDecl *D) {
2473 OS << ' ';
2474 if (D->getQualifier())
2476 OS << D->getDeclName();
2477}
2478
2480 const UnresolvedUsingValueDecl *D) {
2481 OS << ' ';
2482 if (D->getQualifier())
2484 OS << D->getDeclName();
2485 dumpType(D->getType());
2486}
2487
2489 OS << ' ';
2491}
2492
2494 const ConstructorUsingShadowDecl *D) {
2495 if (D->constructsVirtualBase())
2496 OS << " virtual";
2497
2498 AddChild([=] {
2499 OS << "target ";
2501 });
2502
2503 AddChild([=] {
2504 OS << "nominated ";
2506 OS << ' ';
2508 });
2509
2510 AddChild([=] {
2511 OS << "constructed ";
2513 OS << ' ';
2515 });
2516}
2517
2519 switch (D->getLanguage()) {
2521 OS << " C";
2522 break;
2524 OS << " C++";
2525 break;
2526 }
2527}
2528
2530 OS << ' ';
2532}
2533
2535 if (TypeSourceInfo *T = D->getFriendType())
2536 dumpType(T->getType());
2537}
2538
2540 dumpName(D);
2541 dumpType(D->getType());
2542 if (D->getSynthesize())
2543 OS << " synthesize";
2544
2545 switch (D->getAccessControl()) {
2546 case ObjCIvarDecl::None:
2547 OS << " none";
2548 break;
2550 OS << " private";
2551 break;
2553 OS << " protected";
2554 break;
2556 OS << " public";
2557 break;
2559 OS << " package";
2560 break;
2561 }
2562}
2563
2565 if (D->isInstanceMethod())
2566 OS << " -";
2567 else
2568 OS << " +";
2569 dumpName(D);
2570 dumpType(D->getReturnType());
2571
2572 if (D->isVariadic())
2573 OS << " variadic";
2574}
2575
2577 dumpName(D);
2578 switch (D->getVariance()) {
2580 break;
2581
2583 OS << " covariant";
2584 break;
2585
2587 OS << " contravariant";
2588 break;
2589 }
2590
2591 if (D->hasExplicitBound())
2592 OS << " bounded";
2594}
2595
2597 dumpName(D);
2600 for (const auto *P : D->protocols())
2601 dumpDeclRef(P);
2602}
2603
2605 dumpName(D);
2608}
2609
2611 dumpName(D);
2612
2613 for (const auto *Child : D->protocols())
2614 dumpDeclRef(Child);
2615}
2616
2618 dumpName(D);
2619 dumpDeclRef(D->getSuperClass(), "super");
2620
2622 for (const auto *Child : D->protocols())
2623 dumpDeclRef(Child);
2624}
2625
2627 const ObjCImplementationDecl *D) {
2628 dumpName(D);
2629 dumpDeclRef(D->getSuperClass(), "super");
2631}
2632
2634 const ObjCCompatibleAliasDecl *D) {
2635 dumpName(D);
2637}
2638
2640 dumpName(D);
2641 dumpType(D->getType());
2642
2644 OS << " required";
2646 OS << " optional";
2647
2651 OS << " readonly";
2653 OS << " assign";
2655 OS << " readwrite";
2657 OS << " retain";
2659 OS << " copy";
2661 OS << " nonatomic";
2663 OS << " atomic";
2665 OS << " weak";
2667 OS << " strong";
2669 OS << " unsafe_unretained";
2671 OS << " class";
2673 OS << " direct";
2675 dumpDeclRef(D->getGetterMethodDecl(), "getter");
2677 dumpDeclRef(D->getSetterMethodDecl(), "setter");
2678 }
2679}
2680
2684 OS << " synthesize";
2685 else
2686 OS << " dynamic";
2689}
2690
2692 if (D->isVariadic())
2693 OS << " variadic";
2694
2695 if (D->capturesCXXThis())
2696 OS << " captures_this";
2697}
2698
2700 dumpName(D);
2701}
2702
2704 VisitStmt(S);
2705 if (S->hasStoredFPFeatures())
2706 printFPOptions(S->getStoredFPFeatures());
2707}
2708
2710 if (D->isCBuffer())
2711 OS << " cbuffer";
2712 else
2713 OS << " tbuffer";
2714 dumpName(D);
2715}
2716
2718 OS << " " << S->getDirectiveKind();
2719}
static double GetApproxValue(const llvm::APFloat &F)
Definition: APValue.cpp:622
#define V(N, I)
Definition: ASTContext.h:3273
DynTypedNode Node
#define SM(sm)
Definition: Cuda.cpp:82
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
#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....
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:182
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:697
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:4338
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2846
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3308
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:5771
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3840
StringRef getOpcodeStr() const
Definition: Expr.h:3905
A binding in a decomposition declaration.
Definition: DeclCXX.h:4104
A class which contains all the information about a particular captured value.
Definition: Decl.h:4501
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4495
bool capturesCXXThis() const
Definition: Decl.h:4627
bool isVariadic() const
Definition: Decl.h:4570
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:1485
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1540
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2532
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2297
Represents a C++ deduction guide declaration.
Definition: DeclCXX.h:1951
DeductionCandidate getDeductionCandidateKind() const
Definition: DeclCXX.h:2004
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2491
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3652
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1811
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2057
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:2234
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
Definition: DeclCXX.cpp:1875
base_class_range bases()
Definition: DeclCXX.h:618
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:905
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1016
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:815
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:433
Represents the this expression in C++.
Definition: ExprCXX.h:1148
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3526
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2820
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4687
bool isNothrow() const
Definition: Decl.cpp:5444
CaseStmt - Represent a case statement.
Definition: Stmt.h:1801
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3483
const CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3550
Declaration of a class template.
Represents a 'co_await' expression.
Definition: ExprCXX.h:5151
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4088
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3413
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1606
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:128
SourceRange getSourceRange() const LLVM_READONLY
Definition: ASTConcept.h:195
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:203
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:3346
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1072
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3595
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3686
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Definition: DeclCXX.h:3695
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
Definition: DeclCXX.h:3676
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition: DeclCXX.h:3670
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:3133
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:2068
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1260
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition: DeclBase.h:1218
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:601
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition: DeclBase.h:1211
@ FOK_None
Not a friend object.
Definition: DeclBase.h:1209
@ FOK_Declared
A friend of a previously-declared entity.
Definition: DeclBase.h:1210
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:835
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:778
bool isInvalidDecl() const
Definition: DeclBase.h:596
SourceLocation getLocation() const
Definition: DeclBase.h:447
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:629
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:530
DeclContext * getDeclContext()
Definition: DeclBase.h:456
AccessSpecifier getAccess() const
Definition: DeclBase.h:515
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:910
Kind getKind() const
Definition: DeclBase.h:450
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:435
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:828
Represents a C++17 deduced template specialization type.
Definition: Type.h:5819
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3292
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3591
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3689
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.
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3298
Represents an enum.
Definition: Decl.h:3868
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4073
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4076
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4082
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:4028
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3443
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3449
This represents one expression.
Definition: Expr.h:110
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:175
QualType getType() const
Definition: Expr.h:142
An expression trait intrinsic.
Definition: ExprCXX.h:2917
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6113
Represents difference between two FPOptions values.
Definition: LangOptions.h:908
Represents a member of a struct/union/class.
Definition: Decl.h:3058
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3146
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:122
Represents a function declaration or definition.
Definition: Decl.h:1971
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition: Decl.h:2668
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition: Decl.h:2831
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2340
param_iterator param_begin()
Definition: Decl.h:2696
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2503
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2798
bool isDeletedAsWritten() const
Definition: Decl.h:2507
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2323
bool param_empty() const
Definition: Decl.h:2695
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2348
bool isIneligibleOrNotSelected() const
Definition: Decl.h:2381
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
Definition: Decl.cpp:4268
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2314
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization,...
Definition: Decl.cpp:4014
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Definition: Decl.cpp:3692
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2809
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4446
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4690
Declaration of a template function.
Definition: DeclTemplate.h:958
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:4046
ExtInfo getExtInfo() const
Definition: Type.h:4375
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3470
bool isConst() const
Definition: Type.h:4381
bool isRestrict() const
Definition: Type.h:4383
bool isVolatile() const
Definition: Type.h:4382
Represents a C11 generic selection.
Definition: Expr.h:5725
AssociationTy< true > ConstAssociation
Definition: Expr.h:5957
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5977
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2862
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4941
bool isCBuffer() const
Definition: Decl.h:4969
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2138
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3655
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4800
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4858
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3342
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:3364
Describes an C or C++ initializer list.
Definition: Expr.h:4847
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4966
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:6011
Represents the declaration of a label.
Definition: Decl.h:499
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2031
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3226
unsigned getManglingNumber() const
Definition: DeclCXX.h:3275
Represents a linkage specification.
Definition: DeclCXX.h:2931
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2954
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4686
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3172
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
Definition: Redeclarable.h:314
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:320
Describes a module or submodule.
Definition: Module.h:105
std::string getFullModuleName(bool AllowStringLiterals=false) const
Retrieve the full name of this module, including the path from its top-level module.
Definition: Module.cpp:244
This represents a decl that may have a name.
Definition: Decl.h:249
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:650
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:3117
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3212
Represent a C++ namespace.
Definition: Decl.h:547
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:3007
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:610
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2993
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:627
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.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
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
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:238
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:220
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:241
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:275
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:416
clauselist_range clauselists()
Definition: DeclOpenMP.h:441
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:2323
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2157
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2366
protocol_range protocols() const
Definition: DeclObjC.h:2397
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2539
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2198
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2767
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2785
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2480
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2590
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2727
Represents an ObjC class declaration.
Definition: DeclObjC.h:1152
protocol_range protocols() const
Definition: DeclObjC.h:1356
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1628
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:352
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6742
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1948
AccessControl getAccessControl() const
Definition: DeclObjC.h:1996
bool getSynthesize() const
Definition: DeclObjC.h:2003
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
bool isVariadic() const
Definition: DeclObjC.h:431
bool isInstanceMethod() const
Definition: DeclObjC.h:426
QualType getReturnType() const
Definition: DeclObjC.h:329
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:899
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:902
QualType getType() const
Definition: DeclObjC.h:802
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:813
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:910
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2797
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2870
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2866
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2861
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2079
protocol_range protocols() const
Definition: DeclObjC.h:2155
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
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:639
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:22
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
Represents a pack expansion of types.
Definition: Type.h:6359
Represents a #pragma comment line.
Definition: Decl.h:142
StringRef getArg() const
Definition: Decl.h:165
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:163
Represents a #pragma detect_mismatch line.
Definition: Decl.h:176
StringRef getName() const
Definition: Decl.h:197
StringRef getValue() const
Definition: Decl.h:198
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
StringRef getIdentKindName() const
Definition: Expr.h:2043
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:738
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:7170
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4169
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5339
RecordDecl * getDecl() const
Definition: Type.h:5349
Provides common interface for the Decls that can be redeclared.
Definition: Redeclarable.h:84
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Definition: Redeclarable.h:204
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3170
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:3019
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4227
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:1773
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1213
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5679
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5609
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2388
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:3822
StringRef getKindName() const
Definition: Decl.h:3776
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3688
Represents a template argument.
Definition: TemplateBase.h:61
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:363
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Definition: TemplateBase.h:343
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
NameKind getKind() const
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:247
void dump(raw_ostream &OS) const
Debugging aid that dumps the template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5879
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
unsigned getIndex() const
Retrieve the index of the template parameter.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template 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 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 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 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 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 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 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:3556
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:7120
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:7131
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2761
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:1607
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:475
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2451
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2443
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2114
const char * getTypeClassName() const
Definition: Type.cpp:3261
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2437
void dump() const
Definition: ASTDumper.cpp:196
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2461
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2097
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7913
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3535
QualType getUnderlyingType() const
Definition: Decl.h:3488
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2568
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2183
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:5256
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3173
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4934
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3956
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3993
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3859
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3903
Represents a C++ using-declaration.
Definition: DeclCXX.h:3509
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3546
Represents C++ using-directive.
Definition: DeclCXX.h:3012
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2956
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3710
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3754
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3317
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3381
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
QualType getType() const
Definition: Decl.h:717
Kind getKind() const
Definition: Value.h:136
Represents a variable declaration or definition.
Definition: Decl.h:918
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1549
TLSKind getTLSKind() const
Definition: Decl.cpp:2165
bool hasInit() const
Definition: Decl.cpp:2395
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1446
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2118
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:929
@ CInit
C-style initialization with assignment.
Definition: Decl.h:923
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:932
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:926
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
Definition: Decl.cpp:2551
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1492
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Would the destruction of this variable have any effect, and if so, what kind?
Definition: Decl.cpp:2820
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1531
const Expr * getInit() const
Definition: Decl.h:1355
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:941
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:944
@ TLS_None
Not a TLS variable.
Definition: Decl.h:938
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1155
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
Definition: Decl.cpp:2756
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
Definition: Decl.cpp:2663
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3537
Represents a GCC generic vector type.
Definition: Type.h:3759
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2584
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
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ 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.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
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:398
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:1556
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1559
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1562
@ OK_VectorComponent
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:154
@ 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:158
@ OK_ObjCSubscript
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition: Specifiers.h:163
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:148
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:151
@ OK_MatrixComponent
A matrix component is a single element of a matrix.
Definition: Specifiers.h:166
static const TerminalColor StmtColor
static const TerminalColor UndeserializedColor
StorageClass
Storage classes.
Definition: Specifiers.h:245
@ SC_None
Definition: Specifiers.h:247
static const TerminalColor DeclKindNameColor
static const TerminalColor LocationColor
static const TerminalColor ValueKindColor
static const TerminalColor CastColor
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:132
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:141
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:136
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:185
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:203
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:199
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition: Specifiers.h:195
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition: Specifiers.h:191
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition: Specifiers.h:188
@ 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:120
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:180
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:174
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:172
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:177
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition: Type.h:4509
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:4513
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4499
Extra information about a function prototype.
Definition: Type.h:4525
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4532
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:671
Information about a single command.