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;
415 // The condition expression will be printed as a part of the 'children',
416 // but print 'clause' here so it is clear what is happening from the dump.
417 OS << " clause";
418 break;
422 OS << " clause";
423 if (cast<OpenACCCopyInClause>(C)->isReadOnly())
424 OS << " : readonly";
425 break;
429 OS << " clause";
430 if (cast<OpenACCCopyOutClause>(C)->isZero())
431 OS << " : zero";
432 break;
436 OS << " clause";
437 if (cast<OpenACCCreateClause>(C)->isZero())
438 OS << " : zero";
439 break;
441 OS << " clause";
442 if (cast<OpenACCWaitClause>(C)->hasDevNumExpr())
443 OS << " has devnum";
444 if (cast<OpenACCWaitClause>(C)->hasQueuesTag())
445 OS << " has queues tag";
446 break;
449 OS << "(";
450 llvm::interleaveComma(
451 cast<OpenACCDeviceTypeClause>(C)->getArchitectures(), OS,
452 [&](const DeviceTypeArgument &Arch) {
453 if (Arch.first == nullptr)
454 OS << "*";
455 else
456 OS << Arch.first->getName();
457 });
458 OS << ")";
459 break;
460 default:
461 // Nothing to do here.
462 break;
463 }
464 }
465 dumpPointer(C);
466 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
467}
468
470 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
471 if (TSI) {
472 OS << "case ";
473 dumpType(TSI->getType());
474 } else {
475 OS << "default";
476 }
477
478 if (A.isSelected())
479 OS << " selected";
480}
481
483 if (!R) {
484 ColorScope Color(OS, ShowColors, NullColor);
485 OS << "<<<NULL>>> ConceptReference";
486 return;
487 }
488
489 OS << "ConceptReference";
490 dumpPointer(R);
492 OS << ' ';
494}
495
497 if (!R) {
498 ColorScope Color(OS, ShowColors, NullColor);
499 OS << "<<<NULL>>> Requirement";
500 return;
501 }
502
503 {
504 ColorScope Color(OS, ShowColors, StmtColor);
505 switch (R->getKind()) {
507 OS << "TypeRequirement";
508 break;
510 OS << "SimpleRequirement";
511 break;
513 OS << "CompoundRequirement";
514 break;
516 OS << "NestedRequirement";
517 break;
518 }
519 }
520
521 dumpPointer(R);
522
523 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
524 if (ER->hasNoexceptRequirement())
525 OS << " noexcept";
526 }
527
528 if (R->isDependent())
529 OS << " dependent";
530 else
531 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
533 OS << " contains_unexpanded_pack";
534}
535
536static double GetApproxValue(const llvm::APFloat &F) {
537 llvm::APFloat V = F;
538 bool ignored;
539 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
540 &ignored);
541 return V.convertToDouble();
542}
543
544/// True if the \p APValue \p Value can be folded onto the current line.
545static bool isSimpleAPValue(const APValue &Value) {
546 switch (Value.getKind()) {
547 case APValue::None:
549 case APValue::Int:
550 case APValue::Float:
554 case APValue::LValue:
557 return true;
558 case APValue::Vector:
559 case APValue::Array:
560 case APValue::Struct:
561 return false;
562 case APValue::Union:
563 return isSimpleAPValue(Value.getUnionValue());
564 }
565 llvm_unreachable("unexpected APValue kind!");
566}
567
568/// Dump the children of the \p APValue \p Value.
569///
570/// \param[in] Value The \p APValue to visit
571/// \param[in] Ty The \p QualType passed to \p Visit
572///
573/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
574/// to one of the child of the \p APValue
575///
576/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
577/// the indices in the range \p [0,NumChildren(
578///
579/// \param[in] LabelSingular The label to use on a line with a single child
580/// \param[in] LabelPlurial The label to use on a line with multiple children
581void TextNodeDumper::dumpAPValueChildren(
582 const APValue &Value, QualType Ty,
583 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
584 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
585 // To save some vertical space we print up to MaxChildrenPerLine APValues
586 // considered to be simple (by isSimpleAPValue) on a single line.
587 constexpr unsigned MaxChildrenPerLine = 4;
588 unsigned I = 0;
589 while (I < NumChildren) {
590 unsigned J = I;
591 while (J < NumChildren) {
592 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
593 (J - I < MaxChildrenPerLine)) {
594 ++J;
595 continue;
596 }
597 break;
598 }
599
600 J = std::max(I + 1, J);
601
602 // Print [I,J) on a single line.
603 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
604 for (unsigned X = I; X < J; ++X) {
605 Visit(IdxToChildFun(Value, X), Ty);
606 if (X + 1 != J)
607 OS << ", ";
608 }
609 });
610 I = J;
611 }
612}
613
615 ColorScope Color(OS, ShowColors, ValueKindColor);
616 switch (Value.getKind()) {
617 case APValue::None:
618 OS << "None";
619 return;
621 OS << "Indeterminate";
622 return;
623 case APValue::Int:
624 OS << "Int ";
625 {
626 ColorScope Color(OS, ShowColors, ValueColor);
627 OS << Value.getInt();
628 }
629 return;
630 case APValue::Float:
631 OS << "Float ";
632 {
633 ColorScope Color(OS, ShowColors, ValueColor);
634 OS << GetApproxValue(Value.getFloat());
635 }
636 return;
638 OS << "FixedPoint ";
639 {
640 ColorScope Color(OS, ShowColors, ValueColor);
641 OS << Value.getFixedPoint();
642 }
643 return;
644 case APValue::Vector: {
645 unsigned VectorLength = Value.getVectorLength();
646 OS << "Vector length=" << VectorLength;
647
648 dumpAPValueChildren(
649 Value, Ty,
650 [](const APValue &Value, unsigned Index) -> const APValue & {
651 return Value.getVectorElt(Index);
652 },
653 VectorLength, "element", "elements");
654 return;
655 }
657 OS << "ComplexInt ";
658 {
659 ColorScope Color(OS, ShowColors, ValueColor);
660 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
661 << 'i';
662 }
663 return;
665 OS << "ComplexFloat ";
666 {
667 ColorScope Color(OS, ShowColors, ValueColor);
668 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
669 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
670 }
671 return;
672 case APValue::LValue:
673 (void)Context;
674 OS << "LValue <todo>";
675 return;
676 case APValue::Array: {
677 unsigned ArraySize = Value.getArraySize();
678 unsigned NumInitializedElements = Value.getArrayInitializedElts();
679 OS << "Array size=" << ArraySize;
680
681 dumpAPValueChildren(
682 Value, Ty,
683 [](const APValue &Value, unsigned Index) -> const APValue & {
684 return Value.getArrayInitializedElt(Index);
685 },
686 NumInitializedElements, "element", "elements");
687
688 if (Value.hasArrayFiller()) {
689 AddChild("filler", [=] {
690 {
691 ColorScope Color(OS, ShowColors, ValueColor);
692 OS << ArraySize - NumInitializedElements << " x ";
693 }
694 Visit(Value.getArrayFiller(), Ty);
695 });
696 }
697
698 return;
699 }
700 case APValue::Struct: {
701 OS << "Struct";
702
703 dumpAPValueChildren(
704 Value, Ty,
705 [](const APValue &Value, unsigned Index) -> const APValue & {
706 return Value.getStructBase(Index);
707 },
708 Value.getStructNumBases(), "base", "bases");
709
710 dumpAPValueChildren(
711 Value, Ty,
712 [](const APValue &Value, unsigned Index) -> const APValue & {
713 return Value.getStructField(Index);
714 },
715 Value.getStructNumFields(), "field", "fields");
716
717 return;
718 }
719 case APValue::Union: {
720 OS << "Union";
721 {
722 ColorScope Color(OS, ShowColors, ValueColor);
723 if (const FieldDecl *FD = Value.getUnionField())
724 OS << " ." << *cast<NamedDecl>(FD);
725 }
726 // If the union value is considered to be simple, fold it into the
727 // current line to save some vertical space.
728 const APValue &UnionValue = Value.getUnionValue();
729 if (isSimpleAPValue(UnionValue)) {
730 OS << ' ';
731 Visit(UnionValue, Ty);
732 } else {
733 AddChild([=] { Visit(UnionValue, Ty); });
734 }
735
736 return;
737 }
739 OS << "MemberPointer <todo>";
740 return;
742 OS << "AddrLabelDiff <todo>";
743 return;
744 }
745 llvm_unreachable("Unknown APValue kind!");
746}
747
748void TextNodeDumper::dumpPointer(const void *Ptr) {
749 ColorScope Color(OS, ShowColors, AddressColor);
750 OS << ' ' << Ptr;
751}
752
754 if (!SM)
755 return;
756
757 ColorScope Color(OS, ShowColors, LocationColor);
758 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
759
760 // The general format we print out is filename:line:col, but we drop pieces
761 // that haven't changed since the last loc printed.
762 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
763
764 if (PLoc.isInvalid()) {
765 OS << "<invalid sloc>";
766 return;
767 }
768
769 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
770 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
771 << PLoc.getColumn();
772 LastLocFilename = PLoc.getFilename();
773 LastLocLine = PLoc.getLine();
774 } else if (PLoc.getLine() != LastLocLine) {
775 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
776 LastLocLine = PLoc.getLine();
777 } else {
778 OS << "col" << ':' << PLoc.getColumn();
779 }
780}
781
783 // Can't translate locations if a SourceManager isn't available.
784 if (!SM)
785 return;
786
787 OS << " <";
789 if (R.getBegin() != R.getEnd()) {
790 OS << ", ";
791 dumpLocation(R.getEnd());
792 }
793 OS << ">";
794
795 // <t2.c:123:421[blah], t2.c:412:321>
796}
797
799 ColorScope Color(OS, ShowColors, TypeColor);
800
801 SplitQualType T_split = T.split();
802 std::string T_str = QualType::getAsString(T_split, PrintPolicy);
803 OS << "'" << T_str << "'";
804
805 if (Desugar && !T.isNull()) {
806 // If the type is sugared, also dump a (shallow) desugared type when
807 // it is visibly different.
808 SplitQualType D_split = T.getSplitDesugaredType();
809 if (T_split != D_split) {
810 std::string D_str = QualType::getAsString(D_split, PrintPolicy);
811 if (T_str != D_str)
812 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
813 }
814 }
815}
816
818 OS << ' ';
820}
821
823 if (!D) {
824 ColorScope Color(OS, ShowColors, NullColor);
825 OS << "<<<NULL>>>";
826 return;
827 }
828
829 {
830 ColorScope Color(OS, ShowColors, DeclKindNameColor);
831 OS << D->getDeclKindName();
832 }
833 dumpPointer(D);
834
835 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
836 ColorScope Color(OS, ShowColors, DeclNameColor);
837 OS << " '" << ND->getDeclName() << '\'';
838 }
839
840 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
841 dumpType(VD->getType());
842}
843
845 if (ND->getDeclName()) {
846 ColorScope Color(OS, ShowColors, DeclNameColor);
847 OS << ' ' << ND->getDeclName();
848 }
849}
850
852 const auto AccessSpelling = getAccessSpelling(AS);
853 if (AccessSpelling.empty())
854 return;
855 OS << AccessSpelling;
856}
857
860 if (auto *BD = C.dyn_cast<BlockDecl *>())
861 dumpDeclRef(BD, "cleanup");
862 else if (auto *CLE = C.dyn_cast<CompoundLiteralExpr *>())
863 AddChild([=] {
864 OS << "cleanup ";
865 {
866 ColorScope Color(OS, ShowColors, StmtColor);
867 OS << CLE->getStmtClassName();
868 }
869 dumpPointer(CLE);
870 });
871 else
872 llvm_unreachable("unexpected cleanup type");
873}
874
877 switch (TSK) {
878 case TSK_Undeclared:
879 break;
881 OS << " implicit_instantiation";
882 break;
884 OS << " explicit_specialization";
885 break;
887 OS << " explicit_instantiation_declaration";
888 break;
890 OS << " explicit_instantiation_definition";
891 break;
892 }
893}
894
896 if (!NNS)
897 return;
898
899 AddChild([=] {
900 OS << "NestedNameSpecifier";
901
902 switch (NNS->getKind()) {
903 case NestedNameSpecifier::Identifier:
904 OS << " Identifier";
905 OS << " '" << NNS->getAsIdentifier()->getName() << "'";
906 break;
907 case NestedNameSpecifier::Namespace:
908 OS << " "; // "Namespace" is printed as the decl kind.
909 dumpBareDeclRef(NNS->getAsNamespace());
910 break;
911 case NestedNameSpecifier::NamespaceAlias:
912 OS << " "; // "NamespaceAlias" is printed as the decl kind.
913 dumpBareDeclRef(NNS->getAsNamespaceAlias());
914 break;
915 case NestedNameSpecifier::TypeSpec:
916 OS << " TypeSpec";
917 dumpType(QualType(NNS->getAsType(), 0));
918 break;
919 case NestedNameSpecifier::TypeSpecWithTemplate:
920 OS << " TypeSpecWithTemplate";
921 dumpType(QualType(NNS->getAsType(), 0));
922 break;
923 case NestedNameSpecifier::Global:
924 OS << " Global";
925 break;
926 case NestedNameSpecifier::Super:
927 OS << " Super";
928 break;
929 }
930
931 dumpNestedNameSpecifier(NNS->getPrefix());
932 });
933}
934
935void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
936 if (!D)
937 return;
938
939 AddChild([=] {
940 if (!Label.empty())
941 OS << Label << ' ';
943 });
944}
945
946const char *TextNodeDumper::getCommandName(unsigned CommandID) {
947 if (Traits)
948 return Traits->getCommandInfo(CommandID)->Name;
949 const comments::CommandInfo *Info =
951 if (Info)
952 return Info->Name;
953 return "<not a builtin command>";
954}
955
956void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
957#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
958 if (FPO.has##NAME##Override()) \
959 OS << " " #NAME "=" << FPO.get##NAME##Override();
960#include "clang/Basic/FPOptions.def"
961}
962
964 const comments::FullComment *) {
965 OS << " Text=\"" << C->getText() << "\"";
966}
967
970 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
971 switch (C->getRenderKind()) {
973 OS << " RenderNormal";
974 break;
976 OS << " RenderBold";
977 break;
979 OS << " RenderMonospaced";
980 break;
982 OS << " RenderEmphasized";
983 break;
985 OS << " RenderAnchor";
986 break;
987 }
988
989 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
990 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
991}
992
995 OS << " Name=\"" << C->getTagName() << "\"";
996 if (C->getNumAttrs() != 0) {
997 OS << " Attrs: ";
998 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
1000 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
1001 }
1002 }
1003 if (C->isSelfClosing())
1004 OS << " SelfClosing";
1005}
1006
1009 OS << " Name=\"" << C->getTagName() << "\"";
1010}
1011
1014 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
1015 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
1016 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
1017}
1018
1021 OS << " "
1023
1024 if (C->isDirectionExplicit())
1025 OS << " explicitly";
1026 else
1027 OS << " implicitly";
1028
1029 if (C->hasParamName()) {
1030 if (C->isParamIndexValid())
1031 OS << " Param=\"" << C->getParamName(FC) << "\"";
1032 else
1033 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1034 }
1035
1036 if (C->isParamIndexValid() && !C->isVarArgParam())
1037 OS << " ParamIndex=" << C->getParamIndex();
1038}
1039
1042 if (C->hasParamName()) {
1043 if (C->isPositionValid())
1044 OS << " Param=\"" << C->getParamName(FC) << "\"";
1045 else
1046 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1047 }
1048
1049 if (C->isPositionValid()) {
1050 OS << " Position=<";
1051 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
1052 OS << C->getIndex(i);
1053 if (i != e - 1)
1054 OS << ", ";
1055 }
1056 OS << ">";
1057 }
1058}
1059
1062 OS << " Name=\"" << getCommandName(C->getCommandID())
1063 << "\""
1064 " CloseName=\""
1065 << C->getCloseName() << "\"";
1066}
1067
1070 const comments::FullComment *) {
1071 OS << " Text=\"" << C->getText() << "\"";
1072}
1073
1076 OS << " Text=\"" << C->getText() << "\"";
1077}
1078
1080 OS << " null";
1081}
1082
1084 OS << " type";
1085 dumpType(TA.getAsType());
1086}
1087
1089 const TemplateArgument &TA) {
1090 OS << " decl";
1091 dumpDeclRef(TA.getAsDecl());
1092}
1093
1095 OS << " nullptr";
1096}
1097
1099 OS << " integral " << TA.getAsIntegral();
1100}
1101
1104 OS << " using";
1105 OS << " template ";
1106 TA.getAsTemplate().dump(OS);
1107}
1108
1110 const TemplateArgument &TA) {
1113 OS << " using";
1114 OS << " template expansion ";
1116}
1117
1119 OS << " expr";
1120}
1121
1123 OS << " pack";
1124}
1125
1126static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1127 if (Node->path_empty())
1128 return;
1129
1130 OS << " (";
1131 bool First = true;
1132 for (CastExpr::path_const_iterator I = Node->path_begin(),
1133 E = Node->path_end();
1134 I != E; ++I) {
1135 const CXXBaseSpecifier *Base = *I;
1136 if (!First)
1137 OS << " -> ";
1138
1139 const auto *RD =
1140 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
1141
1142 if (Base->isVirtual())
1143 OS << "virtual ";
1144 OS << RD->getName();
1145 First = false;
1146 }
1147
1148 OS << ')';
1149}
1150
1152 if (Node->hasInitStorage())
1153 OS << " has_init";
1154 if (Node->hasVarStorage())
1155 OS << " has_var";
1156 if (Node->hasElseStorage())
1157 OS << " has_else";
1158 if (Node->isConstexpr())
1159 OS << " constexpr";
1160 if (Node->isConsteval()) {
1161 OS << " ";
1162 if (Node->isNegatedConsteval())
1163 OS << "!";
1164 OS << "consteval";
1165 }
1166}
1167
1169 if (Node->hasInitStorage())
1170 OS << " has_init";
1171 if (Node->hasVarStorage())
1172 OS << " has_var";
1173}
1174
1176 if (Node->hasVarStorage())
1177 OS << " has_var";
1178}
1179
1181 OS << " '" << Node->getName() << "'";
1182 if (Node->isSideEntry())
1183 OS << " side_entry";
1184}
1185
1187 OS << " '" << Node->getLabel()->getName() << "'";
1188 dumpPointer(Node->getLabel());
1189}
1190
1192 if (Node->caseStmtIsGNURange())
1193 OS << " gnu_range";
1194}
1195
1197 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1198 OS << " nrvo_candidate(";
1199 dumpBareDeclRef(Cand);
1200 OS << ")";
1201 }
1202}
1203
1205 if (Node->isImplicit())
1206 OS << " implicit";
1207}
1208
1210 if (Node->isImplicit())
1211 OS << " implicit";
1212}
1213
1215 if (Node->hasAPValueResult())
1216 AddChild("value",
1217 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1218}
1219
1221 if (Node->usesADL())
1222 OS << " adl";
1223 if (Node->hasStoredFPFeatures())
1224 printFPOptions(Node->getFPFeatures());
1225}
1226
1228 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1229 if (OperatorSpelling)
1230 OS << " '" << OperatorSpelling << "'";
1231
1233}
1234
1236 OS << " <";
1237 {
1238 ColorScope Color(OS, ShowColors, CastColor);
1239 OS << Node->getCastKindName();
1240 }
1241 dumpBasePath(OS, Node);
1242 OS << ">";
1243 if (Node->hasStoredFPFeatures())
1244 printFPOptions(Node->getFPFeatures());
1245}
1246
1249 if (Node->isPartOfExplicitCast())
1250 OS << " part_of_explicit_cast";
1251}
1252
1254 OS << " ";
1255 dumpBareDeclRef(Node->getDecl());
1256 dumpNestedNameSpecifier(Node->getQualifier());
1257 if (Node->getDecl() != Node->getFoundDecl()) {
1258 OS << " (";
1259 dumpBareDeclRef(Node->getFoundDecl());
1260 OS << ")";
1261 }
1262 switch (Node->isNonOdrUse()) {
1263 case NOUR_None: break;
1264 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1265 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1266 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1267 }
1268 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1269 OS << " dependent_capture";
1270 else if (Node->refersToEnclosingVariableOrCapture())
1271 OS << " refers_to_enclosing_variable_or_capture";
1272
1273 if (Node->isImmediateEscalating())
1274 OS << " immediate-escalating";
1275}
1276
1279
1280 dumpNestedNameSpecifier(Node->getQualifier());
1281}
1282
1284 const UnresolvedLookupExpr *Node) {
1285 OS << " (";
1286 if (!Node->requiresADL())
1287 OS << "no ";
1288 OS << "ADL) = '" << Node->getName() << '\'';
1289
1290 UnresolvedLookupExpr::decls_iterator I = Node->decls_begin(),
1291 E = Node->decls_end();
1292 if (I == E)
1293 OS << " empty";
1294 for (; I != E; ++I)
1295 dumpPointer(*I);
1296}
1297
1299 {
1300 ColorScope Color(OS, ShowColors, DeclKindNameColor);
1301 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1302 }
1303 OS << "='" << *Node->getDecl() << "'";
1304 dumpPointer(Node->getDecl());
1305 if (Node->isFreeIvar())
1306 OS << " isFreeIvar";
1307}
1308
1311 dumpType(Node->getTypeSourceInfo()->getType());
1312}
1313
1315 OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
1316}
1317
1319 ColorScope Color(OS, ShowColors, ValueColor);
1320 OS << " " << Node->getValue();
1321}
1322
1324 bool isSigned = Node->getType()->isSignedIntegerType();
1325 ColorScope Color(OS, ShowColors, ValueColor);
1326 OS << " " << toString(Node->getValue(), 10, isSigned);
1327}
1328
1330 ColorScope Color(OS, ShowColors, ValueColor);
1331 OS << " " << Node->getValueAsString(/*Radix=*/10);
1332}
1333
1335 ColorScope Color(OS, ShowColors, ValueColor);
1336 OS << " " << Node->getValueAsApproximateDouble();
1337}
1338
1340 ColorScope Color(OS, ShowColors, ValueColor);
1341 OS << " ";
1342 Str->outputString(OS);
1343}
1344
1346 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1347 OS << " field ";
1348 dumpBareDeclRef(Field);
1349 }
1350}
1351
1353 if (E->isResultDependent())
1354 OS << " result_dependent";
1355}
1356
1358 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1359 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1360 if (!Node->canOverflow())
1361 OS << " cannot overflow";
1362 if (Node->hasStoredFPFeatures())
1363 printFPOptions(Node->getStoredFPFeatures());
1364}
1365
1368 OS << " " << getTraitSpelling(Node->getKind());
1369
1370 if (Node->isArgumentType())
1371 dumpType(Node->getArgumentType());
1372}
1373
1375 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1376 dumpPointer(Node->getMemberDecl());
1377 dumpNestedNameSpecifier(Node->getQualifier());
1378 switch (Node->isNonOdrUse()) {
1379 case NOUR_None: break;
1380 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1381 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1382 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1383 }
1384}
1385
1387 const ExtVectorElementExpr *Node) {
1388 OS << " " << Node->getAccessor().getNameStart();
1389}
1390
1392 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1393 if (Node->hasStoredFPFeatures())
1394 printFPOptions(Node->getStoredFPFeatures());
1395}
1396
1399 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1400 << "' ComputeLHSTy=";
1401 dumpBareType(Node->getComputationLHSType());
1402 OS << " ComputeResultTy=";
1403 dumpBareType(Node->getComputationResultType());
1404 if (Node->hasStoredFPFeatures())
1405 printFPOptions(Node->getStoredFPFeatures());
1406}
1407
1409 OS << " " << Node->getLabel()->getName();
1410 dumpPointer(Node->getLabel());
1411}
1412
1414 OS << " " << Node->getCastName() << "<"
1415 << Node->getTypeAsWritten().getAsString() << ">"
1416 << " <" << Node->getCastKindName();
1417 dumpBasePath(OS, Node);
1418 OS << ">";
1419}
1420
1422 OS << " " << (Node->getValue() ? "true" : "false");
1423}
1424
1426 if (Node->isImplicit())
1427 OS << " implicit";
1428 if (Node->isCapturedByCopyInLambdaWithExplicitObjectParameter())
1429 OS << " dependent_capture";
1430 OS << " this";
1431}
1432
1434 const CXXFunctionalCastExpr *Node) {
1435 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1436 << Node->getCastKindName() << ">";
1437 if (Node->hasStoredFPFeatures())
1438 printFPOptions(Node->getFPFeatures());
1439}
1440
1443 if (Node->hasStoredFPFeatures())
1444 printFPOptions(Node->getFPFeatures());
1445}
1446
1449 dumpType(Node->getTypeAsWritten());
1450 if (Node->isListInitialization())
1451 OS << " list";
1452}
1453
1455 CXXConstructorDecl *Ctor = Node->getConstructor();
1456 dumpType(Ctor->getType());
1457 if (Node->isElidable())
1458 OS << " elidable";
1459 if (Node->isListInitialization())
1460 OS << " list";
1461 if (Node->isStdInitListInitialization())
1462 OS << " std::initializer_list";
1463 if (Node->requiresZeroInitialization())
1464 OS << " zeroing";
1465 if (Node->isImmediateEscalating())
1466 OS << " immediate-escalating";
1467}
1468
1470 const CXXBindTemporaryExpr *Node) {
1471 OS << " (CXXTemporary";
1473 OS << ")";
1474}
1475
1477 if (Node->isGlobalNew())
1478 OS << " global";
1479 if (Node->isArray())
1480 OS << " array";
1481 if (Node->getOperatorNew()) {
1482 OS << ' ';
1483 dumpBareDeclRef(Node->getOperatorNew());
1484 }
1485 // We could dump the deallocation function used in case of error, but it's
1486 // usually not that interesting.
1487}
1488
1490 if (Node->isGlobalDelete())
1491 OS << " global";
1492 if (Node->isArrayForm())
1493 OS << " array";
1494 if (Node->getOperatorDelete()) {
1495 OS << ' ';
1496 dumpBareDeclRef(Node->getOperatorDelete());
1497 }
1498}
1499
1501 OS << " " << getTraitSpelling(Node->getTrait());
1502}
1503
1505 OS << " " << getTraitSpelling(Node->getTrait());
1506}
1507
1509 OS << " " << getTraitSpelling(Node->getTrait());
1510}
1511
1513 if (Node->hasRewrittenInit())
1514 OS << " has rewritten init";
1515}
1516
1518 if (Node->hasRewrittenInit())
1519 OS << " has rewritten init";
1520}
1521
1524 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1525 OS << " extended by ";
1526 dumpBareDeclRef(VD);
1527 }
1528}
1529
1531 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1532 dumpCleanupObject(Node->getObject(i));
1533}
1534
1536 dumpPointer(Node->getPack());
1537 dumpName(Node->getPack());
1538}
1539
1542 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1543}
1544
1546 OS << " selector=";
1547 Node->getSelector().print(OS);
1548 switch (Node->getReceiverKind()) {
1550 break;
1551
1553 OS << " class=";
1554 dumpBareType(Node->getClassReceiver());
1555 break;
1556
1558 OS << " super (instance)";
1559 break;
1560
1562 OS << " super (class)";
1563 break;
1564 }
1565}
1566
1568 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1569 OS << " selector=";
1570 BoxingMethod->getSelector().print(OS);
1571 }
1572}
1573
1575 if (!Node->getCatchParamDecl())
1576 OS << " catch all";
1577}
1578
1580 dumpType(Node->getEncodedType());
1581}
1582
1584 OS << " ";
1585 Node->getSelector().print(OS);
1586}
1587
1589 OS << ' ' << *Node->getProtocol();
1590}
1591
1593 if (Node->isImplicitProperty()) {
1594 OS << " Kind=MethodRef Getter=\"";
1595 if (Node->getImplicitPropertyGetter())
1596 Node->getImplicitPropertyGetter()->getSelector().print(OS);
1597 else
1598 OS << "(null)";
1599
1600 OS << "\" Setter=\"";
1601 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1602 Setter->getSelector().print(OS);
1603 else
1604 OS << "(null)";
1605 OS << "\"";
1606 } else {
1607 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1608 << '"';
1609 }
1610
1611 if (Node->isSuperReceiver())
1612 OS << " super";
1613
1614 OS << " Messaging=";
1615 if (Node->isMessagingGetter() && Node->isMessagingSetter())
1616 OS << "Getter&Setter";
1617 else if (Node->isMessagingGetter())
1618 OS << "Getter";
1619 else if (Node->isMessagingSetter())
1620 OS << "Setter";
1621}
1622
1624 const ObjCSubscriptRefExpr *Node) {
1625 if (Node->isArraySubscriptRefExpr())
1626 OS << " Kind=ArraySubscript GetterForArray=\"";
1627 else
1628 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1629 if (Node->getAtIndexMethodDecl())
1630 Node->getAtIndexMethodDecl()->getSelector().print(OS);
1631 else
1632 OS << "(null)";
1633
1634 if (Node->isArraySubscriptRefExpr())
1635 OS << "\" SetterForArray=\"";
1636 else
1637 OS << "\" SetterForDictionary=\"";
1638 if (Node->setAtIndexMethodDecl())
1639 Node->setAtIndexMethodDecl()->getSelector().print(OS);
1640 else
1641 OS << "(null)";
1642}
1643
1645 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1646}
1647
1649 OS << " ";
1650 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
1651 Visit(Node->getIteratorDecl(I));
1652 OS << " = ";
1653 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
1654 OS << " begin ";
1655 Visit(Range.Begin);
1656 OS << " end ";
1657 Visit(Range.End);
1658 if (Range.Step) {
1659 OS << " step ";
1660 Visit(Range.Step);
1661 }
1662 }
1663}
1664
1667 OS << " ";
1668 dumpBareDeclRef(Node->getFoundDecl());
1669}
1670
1672 const RequiresExpr *Node) {
1673 if (!Node->isValueDependent())
1674 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
1675}
1676
1678 if (T->isSpelledAsLValue())
1679 OS << " written as lvalue reference";
1680}
1681
1683 switch (T->getSizeModifier()) {
1685 break;
1687 OS << " static";
1688 break;
1690 OS << " *";
1691 break;
1692 }
1693 OS << " " << T->getIndexTypeQualifiers().getAsString();
1694}
1695
1697 OS << " " << T->getSize();
1699}
1700
1702 OS << " ";
1703 dumpSourceRange(T->getBracketsRange());
1705}
1706
1708 const DependentSizedArrayType *T) {
1710 OS << " ";
1711 dumpSourceRange(T->getBracketsRange());
1712}
1713
1716 OS << " ";
1717 dumpLocation(T->getAttributeLoc());
1718}
1719
1721 switch (T->getVectorKind()) {
1723 break;
1725 OS << " altivec";
1726 break;
1728 OS << " altivec pixel";
1729 break;
1731 OS << " altivec bool";
1732 break;
1733 case VectorKind::Neon:
1734 OS << " neon";
1735 break;
1737 OS << " neon poly";
1738 break;
1740 OS << " fixed-length sve data vector";
1741 break;
1743 OS << " fixed-length sve predicate vector";
1744 break;
1746 OS << " fixed-length rvv data vector";
1747 break;
1749 OS << " fixed-length rvv mask vector";
1750 break;
1751 }
1752 OS << " " << T->getNumElements();
1753}
1754
1756 auto EI = T->getExtInfo();
1757 if (EI.getNoReturn())
1758 OS << " noreturn";
1759 if (EI.getProducesResult())
1760 OS << " produces_result";
1761 if (EI.getHasRegParm())
1762 OS << " regparm " << EI.getRegParm();
1763 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1764}
1765
1767 auto EPI = T->getExtProtoInfo();
1768 if (EPI.HasTrailingReturn)
1769 OS << " trailing_return";
1770 if (T->isConst())
1771 OS << " const";
1772 if (T->isVolatile())
1773 OS << " volatile";
1774 if (T->isRestrict())
1775 OS << " restrict";
1776 if (T->getExtProtoInfo().Variadic)
1777 OS << " variadic";
1778 switch (EPI.RefQualifier) {
1779 case RQ_None:
1780 break;
1781 case RQ_LValue:
1782 OS << " &";
1783 break;
1784 case RQ_RValue:
1785 OS << " &&";
1786 break;
1787 }
1788
1789 switch (EPI.ExceptionSpec.Type) {
1790 case EST_None:
1791 break;
1792 case EST_DynamicNone:
1793 OS << " exceptionspec_dynamic_none";
1794 break;
1795 case EST_Dynamic:
1796 OS << " exceptionspec_dynamic";
1797 break;
1798 case EST_MSAny:
1799 OS << " exceptionspec_ms_any";
1800 break;
1801 case EST_NoThrow:
1802 OS << " exceptionspec_nothrow";
1803 break;
1804 case EST_BasicNoexcept:
1805 OS << " exceptionspec_basic_noexcept";
1806 break;
1808 OS << " exceptionspec_dependent_noexcept";
1809 break;
1810 case EST_NoexceptFalse:
1811 OS << " exceptionspec_noexcept_false";
1812 break;
1813 case EST_NoexceptTrue:
1814 OS << " exceptionspec_noexcept_true";
1815 break;
1816 case EST_Unevaluated:
1817 OS << " exceptionspec_unevaluated";
1818 break;
1819 case EST_Uninstantiated:
1820 OS << " exceptionspec_uninstantiated";
1821 break;
1822 case EST_Unparsed:
1823 OS << " exceptionspec_unparsed";
1824 break;
1825 }
1826 if (!EPI.ExceptionSpec.Exceptions.empty()) {
1827 AddChild([=] {
1828 OS << "Exceptions:";
1829 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
1830 ++I) {
1831 if (I)
1832 OS << ",";
1833 dumpType(EPI.ExceptionSpec.Exceptions[I]);
1834 }
1835 });
1836 }
1837 if (EPI.ExceptionSpec.NoexceptExpr) {
1838 AddChild([=] {
1839 OS << "NoexceptExpr: ";
1840 Visit(EPI.ExceptionSpec.NoexceptExpr);
1841 });
1842 }
1843 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
1844 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
1845
1846 // FIXME: Consumed parameters.
1848}
1849
1851 dumpDeclRef(T->getDecl());
1852}
1853
1855 dumpDeclRef(T->getFoundDecl());
1856 if (!T->typeMatchesDecl())
1857 OS << " divergent";
1858}
1859
1861 dumpDeclRef(T->getDecl());
1862 if (!T->typeMatchesDecl())
1863 OS << " divergent";
1864}
1865
1867 switch (T->getUTTKind()) {
1868#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
1869 case UnaryTransformType::Enum: \
1870 OS << " " #Trait; \
1871 break;
1872#include "clang/Basic/TransformTypeTraits.def"
1873 }
1874}
1875
1877 dumpDeclRef(T->getDecl());
1878}
1879
1881 OS << " depth " << T->getDepth() << " index " << T->getIndex();
1882 if (T->isParameterPack())
1883 OS << " pack";
1884 dumpDeclRef(T->getDecl());
1885}
1886
1889 dumpDeclRef(T->getAssociatedDecl());
1890 VisitTemplateTypeParmDecl(T->getReplacedParameter());
1891 if (auto PackIndex = T->getPackIndex())
1892 OS << " pack_index " << *PackIndex;
1893}
1894
1897 dumpDeclRef(T->getAssociatedDecl());
1898 VisitTemplateTypeParmDecl(T->getReplacedParameter());
1899}
1900
1902 if (T->isDecltypeAuto())
1903 OS << " decltype(auto)";
1904 if (!T->isDeduced())
1905 OS << " undeduced";
1906 if (T->isConstrained())
1907 dumpDeclRef(T->getTypeConstraintConcept());
1908}
1909
1912 if (T->getTemplateName().getKind() == TemplateName::UsingTemplate)
1913 OS << " using";
1914}
1915
1918 if (T->isTypeAlias())
1919 OS << " alias";
1920 if (T->getTemplateName().getKind() == TemplateName::UsingTemplate)
1921 OS << " using";
1922 OS << " ";
1923 T->getTemplateName().dump(OS);
1924}
1925
1927 const InjectedClassNameType *T) {
1928 dumpDeclRef(T->getDecl());
1929}
1930
1932 dumpDeclRef(T->getDecl());
1933}
1934
1936 if (auto N = T->getNumExpansions())
1937 OS << " expansions " << *N;
1938}
1939
1941 // By default, add extra Type details with no extra loc info.
1943}
1944// FIXME: override behavior for TypeLocs that have interesting location
1945// information, such as the qualifier in ElaboratedTypeLoc.
1946
1948
1950 dumpName(D);
1952 if (D->isModulePrivate())
1953 OS << " __module_private__";
1954}
1955
1957 if (D->isScoped()) {
1958 if (D->isScopedUsingClassTag())
1959 OS << " class";
1960 else
1961 OS << " struct";
1962 }
1963 dumpName(D);
1964 if (D->isModulePrivate())
1965 OS << " __module_private__";
1966 if (D->isFixed())
1968}
1969
1971 OS << ' ' << D->getKindName();
1972 dumpName(D);
1973 if (D->isModulePrivate())
1974 OS << " __module_private__";
1975 if (D->isCompleteDefinition())
1976 OS << " definition";
1977}
1978
1980 dumpName(D);
1981 dumpType(D->getType());
1982}
1983
1985 dumpName(D);
1986 dumpType(D->getType());
1987
1988 for (const auto *Child : D->chain())
1989 dumpDeclRef(Child);
1990}
1991
1993 dumpName(D);
1994 dumpType(D->getType());
1996
1997 StorageClass SC = D->getStorageClass();
1998 if (SC != SC_None)
2000 if (D->isInlineSpecified())
2001 OS << " inline";
2002 if (D->isVirtualAsWritten())
2003 OS << " virtual";
2004 if (D->isModulePrivate())
2005 OS << " __module_private__";
2006
2007 if (D->isPureVirtual())
2008 OS << " pure";
2009 if (D->isDefaulted()) {
2010 OS << " default";
2011 if (D->isDeleted())
2012 OS << "_delete";
2013 }
2014 if (D->isDeletedAsWritten())
2015 OS << " delete";
2016 if (D->isTrivial())
2017 OS << " trivial";
2018
2019 if (const StringLiteral *M = D->getDeletedMessage())
2020 AddChild("delete message", [=] { Visit(M); });
2021
2023 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
2024
2025 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
2026 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
2027 switch (EPI.ExceptionSpec.Type) {
2028 default:
2029 break;
2030 case EST_Unevaluated:
2031 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
2032 break;
2033 case EST_Uninstantiated:
2034 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
2035 break;
2036 }
2037 }
2038
2039 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
2040 if (MD->size_overridden_methods() != 0) {
2041 auto dumpOverride = [=](const CXXMethodDecl *D) {
2042 SplitQualType T_split = D->getType().split();
2043 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
2044 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
2045 };
2046
2047 AddChild([=] {
2048 auto Overrides = MD->overridden_methods();
2049 OS << "Overrides: [ ";
2050 dumpOverride(*Overrides.begin());
2051 for (const auto *Override : llvm::drop_begin(Overrides)) {
2052 OS << ", ";
2053 dumpOverride(Override);
2054 }
2055 OS << " ]";
2056 });
2057 }
2058 }
2059
2060 if (!D->isInlineSpecified() && D->isInlined()) {
2061 OS << " implicit-inline";
2062 }
2063 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
2064 // the Params are set later, it is possible for a dump during debugging to
2065 // encounter a FunctionDecl that has been created but hasn't been assigned
2066 // ParmVarDecls yet.
2067 if (!D->param_empty() && !D->param_begin())
2068 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
2069
2070 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
2071 OS << " instantiated_from";
2072 dumpPointer(Instance);
2073 }
2074}
2075
2077 const CXXDeductionGuideDecl *D) {
2079 switch (D->getDeductionCandidateKind()) {
2082 return;
2084 OS << " aggregate ";
2085 break;
2086 }
2087}
2088
2091 OS << " extended by ";
2093 OS << " mangling ";
2094 {
2095 ColorScope Color(OS, ShowColors, ValueColor);
2096 OS << D->getManglingNumber();
2097 }
2098}
2099
2101 dumpName(D);
2102 dumpType(D->getType());
2103 if (D->isMutable())
2104 OS << " mutable";
2105 if (D->isModulePrivate())
2106 OS << " __module_private__";
2107}
2108
2111 dumpName(D);
2112 if (const auto *P = dyn_cast<ParmVarDecl>(D);
2113 P && P->isExplicitObjectParameter())
2114 OS << " this";
2115
2116 dumpType(D->getType());
2118 StorageClass SC = D->getStorageClass();
2119 if (SC != SC_None)
2121 switch (D->getTLSKind()) {
2122 case VarDecl::TLS_None:
2123 break;
2125 OS << " tls";
2126 break;
2128 OS << " tls_dynamic";
2129 break;
2130 }
2131 if (D->isModulePrivate())
2132 OS << " __module_private__";
2133 if (D->isNRVOVariable())
2134 OS << " nrvo";
2135 if (D->isInline())
2136 OS << " inline";
2137 if (D->isConstexpr())
2138 OS << " constexpr";
2139 if (D->hasInit()) {
2140 switch (D->getInitStyle()) {
2141 case VarDecl::CInit:
2142 OS << " cinit";
2143 break;
2144 case VarDecl::CallInit:
2145 OS << " callinit";
2146 break;
2147 case VarDecl::ListInit:
2148 OS << " listinit";
2149 break;
2151 OS << " parenlistinit";
2152 }
2153 }
2154 if (D->needsDestruction(D->getASTContext()))
2155 OS << " destroyed";
2156 if (D->isParameterPack())
2157 OS << " pack";
2158
2159 if (D->hasInit()) {
2160 const Expr *E = D->getInit();
2161 // Only dump the value of constexpr VarDecls for now.
2162 if (E && !E->isValueDependent() && D->isConstexpr() &&
2163 !D->getType()->isDependentType()) {
2164 const APValue *Value = D->evaluateValue();
2165 if (Value)
2166 AddChild("value", [=] { Visit(*Value, E->getType()); });
2167 }
2168 }
2169}
2170
2172 dumpName(D);
2173 dumpType(D->getType());
2174}
2175
2177 if (D->isNothrow())
2178 OS << " nothrow";
2179}
2180
2182 OS << ' ' << D->getImportedModule()->getFullModuleName();
2183
2184 for (Decl *InitD :
2186 dumpDeclRef(InitD, "initializer");
2187}
2188
2190 OS << ' ';
2191 switch (D->getCommentKind()) {
2192 case PCK_Unknown:
2193 llvm_unreachable("unexpected pragma comment kind");
2194 case PCK_Compiler:
2195 OS << "compiler";
2196 break;
2197 case PCK_ExeStr:
2198 OS << "exestr";
2199 break;
2200 case PCK_Lib:
2201 OS << "lib";
2202 break;
2203 case PCK_Linker:
2204 OS << "linker";
2205 break;
2206 case PCK_User:
2207 OS << "user";
2208 break;
2209 }
2210 StringRef Arg = D->getArg();
2211 if (!Arg.empty())
2212 OS << " \"" << Arg << "\"";
2213}
2214
2216 const PragmaDetectMismatchDecl *D) {
2217 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2218}
2219
2221 const OMPExecutableDirective *D) {
2222 if (D->isStandaloneDirective())
2223 OS << " openmp_standalone_directive";
2224}
2225
2227 const OMPDeclareReductionDecl *D) {
2228 dumpName(D);
2229 dumpType(D->getType());
2230 OS << " combiner";
2232 if (const auto *Initializer = D->getInitializer()) {
2233 OS << " initializer";
2235 switch (D->getInitializerKind()) {
2237 OS << " omp_priv = ";
2238 break;
2240 OS << " omp_priv ()";
2241 break;
2243 break;
2244 }
2245 }
2246}
2247
2249 for (const auto *C : D->clauselists()) {
2250 AddChild([=] {
2251 if (!C) {
2252 ColorScope Color(OS, ShowColors, NullColor);
2253 OS << "<<<NULL>>> OMPClause";
2254 return;
2255 }
2256 {
2257 ColorScope Color(OS, ShowColors, AttrColor);
2258 StringRef ClauseName(
2259 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2260 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2261 << ClauseName.drop_front() << "Clause";
2262 }
2263 dumpPointer(C);
2264 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2265 });
2266 }
2267}
2268
2270 dumpName(D);
2271 dumpType(D->getType());
2272}
2273
2275 dumpName(D);
2276 if (D->isInline())
2277 OS << " inline";
2278 if (D->isNested())
2279 OS << " nested";
2280 if (!D->isOriginalNamespace())
2281 dumpDeclRef(D->getOriginalNamespace(), "original");
2282}
2283
2285 OS << ' ';
2287}
2288
2290 dumpName(D);
2292}
2293
2295 dumpName(D);
2297}
2298
2300 const TypeAliasTemplateDecl *D) {
2301 dumpName(D);
2302}
2303
2305 VisitRecordDecl(D);
2306 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2307 OS << " instantiated_from";
2308 dumpPointer(Instance);
2309 }
2310 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
2311 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2312
2314
2315 if (!D->isCompleteDefinition())
2316 return;
2317
2318 AddChild([=] {
2319 {
2320 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2321 OS << "DefinitionData";
2322 }
2323#define FLAG(fn, name) \
2324 if (D->fn()) \
2325 OS << " " #name;
2326 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2327
2328 FLAG(isGenericLambda, generic);
2329 FLAG(isLambda, lambda);
2330
2331 FLAG(isAnonymousStructOrUnion, is_anonymous);
2332 FLAG(canPassInRegisters, pass_in_registers);
2333 FLAG(isEmpty, empty);
2334 FLAG(isAggregate, aggregate);
2335 FLAG(isStandardLayout, standard_layout);
2336 FLAG(isTriviallyCopyable, trivially_copyable);
2337 FLAG(isPOD, pod);
2338 FLAG(isTrivial, trivial);
2339 FLAG(isPolymorphic, polymorphic);
2340 FLAG(isAbstract, abstract);
2341 FLAG(isLiteral, literal);
2342
2343 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2344 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2345 FLAG(hasMutableFields, has_mutable_fields);
2346 FLAG(hasVariantMembers, has_variant_members);
2347 FLAG(allowConstDefaultInit, can_const_default_init);
2348
2349 AddChild([=] {
2350 {
2351 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2352 OS << "DefaultConstructor";
2353 }
2354 FLAG(hasDefaultConstructor, exists);
2355 FLAG(hasTrivialDefaultConstructor, trivial);
2356 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2357 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2358 FLAG(hasConstexprDefaultConstructor, constexpr);
2359 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2360 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2361 });
2362
2363 AddChild([=] {
2364 {
2365 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2366 OS << "CopyConstructor";
2367 }
2368 FLAG(hasSimpleCopyConstructor, simple);
2369 FLAG(hasTrivialCopyConstructor, trivial);
2370 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2371 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2372 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2373 FLAG(needsImplicitCopyConstructor, needs_implicit);
2374 FLAG(needsOverloadResolutionForCopyConstructor,
2375 needs_overload_resolution);
2377 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2378 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2379 });
2380
2381 AddChild([=] {
2382 {
2383 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2384 OS << "MoveConstructor";
2385 }
2386 FLAG(hasMoveConstructor, exists);
2387 FLAG(hasSimpleMoveConstructor, simple);
2388 FLAG(hasTrivialMoveConstructor, trivial);
2389 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2390 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2391 FLAG(needsImplicitMoveConstructor, needs_implicit);
2392 FLAG(needsOverloadResolutionForMoveConstructor,
2393 needs_overload_resolution);
2395 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2396 });
2397
2398 AddChild([=] {
2399 {
2400 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2401 OS << "CopyAssignment";
2402 }
2403 FLAG(hasSimpleCopyAssignment, simple);
2404 FLAG(hasTrivialCopyAssignment, trivial);
2405 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2406 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2407 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2408 FLAG(needsImplicitCopyAssignment, needs_implicit);
2409 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2410 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2411 });
2412
2413 AddChild([=] {
2414 {
2415 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2416 OS << "MoveAssignment";
2417 }
2418 FLAG(hasMoveAssignment, exists);
2419 FLAG(hasSimpleMoveAssignment, simple);
2420 FLAG(hasTrivialMoveAssignment, trivial);
2421 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2422 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2423 FLAG(needsImplicitMoveAssignment, needs_implicit);
2424 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2425 });
2426
2427 AddChild([=] {
2428 {
2429 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2430 OS << "Destructor";
2431 }
2432 FLAG(hasSimpleDestructor, simple);
2433 FLAG(hasIrrelevantDestructor, irrelevant);
2434 FLAG(hasTrivialDestructor, trivial);
2435 FLAG(hasNonTrivialDestructor, non_trivial);
2436 FLAG(hasUserDeclaredDestructor, user_declared);
2437 FLAG(hasConstexprDestructor, constexpr);
2438 FLAG(needsImplicitDestructor, needs_implicit);
2439 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2441 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2442 });
2443 });
2444
2445 for (const auto &I : D->bases()) {
2446 AddChild([=] {
2447 if (I.isVirtual())
2448 OS << "virtual ";
2449 dumpAccessSpecifier(I.getAccessSpecifier());
2450 dumpType(I.getType());
2451 if (I.isPackExpansion())
2452 OS << "...";
2453 });
2454 }
2455}
2456
2458 dumpName(D);
2459}
2460
2462 dumpName(D);
2463}
2464
2466 dumpName(D);
2467}
2468
2470 dumpName(D);
2471}
2472
2474 if (const auto *TC = D->getTypeConstraint()) {
2475 OS << " ";
2476 dumpBareDeclRef(TC->getNamedConcept());
2477 if (TC->getNamedConcept() != TC->getFoundDecl()) {
2478 OS << " (";
2479 dumpBareDeclRef(TC->getFoundDecl());
2480 OS << ")";
2481 }
2482 } else if (D->wasDeclaredWithTypename())
2483 OS << " typename";
2484 else
2485 OS << " class";
2486 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2487 if (D->isParameterPack())
2488 OS << " ...";
2489 dumpName(D);
2490}
2491
2493 const NonTypeTemplateParmDecl *D) {
2494 dumpType(D->getType());
2495 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2496 if (D->isParameterPack())
2497 OS << " ...";
2498 dumpName(D);
2499}
2500
2502 const TemplateTemplateParmDecl *D) {
2503 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2504 if (D->isParameterPack())
2505 OS << " ...";
2506 dumpName(D);
2507}
2508
2510 OS << ' ';
2511 if (D->getQualifier())
2513 OS << D->getDeclName();
2515}
2516
2518 OS << ' ';
2520}
2521
2523 const UnresolvedUsingTypenameDecl *D) {
2524 OS << ' ';
2525 if (D->getQualifier())
2527 OS << D->getDeclName();
2528}
2529
2531 const UnresolvedUsingValueDecl *D) {
2532 OS << ' ';
2533 if (D->getQualifier())
2535 OS << D->getDeclName();
2536 dumpType(D->getType());
2537}
2538
2540 OS << ' ';
2542}
2543
2545 const ConstructorUsingShadowDecl *D) {
2546 if (D->constructsVirtualBase())
2547 OS << " virtual";
2548
2549 AddChild([=] {
2550 OS << "target ";
2552 });
2553
2554 AddChild([=] {
2555 OS << "nominated ";
2557 OS << ' ';
2559 });
2560
2561 AddChild([=] {
2562 OS << "constructed ";
2564 OS << ' ';
2566 });
2567}
2568
2570 switch (D->getLanguage()) {
2572 OS << " C";
2573 break;
2575 OS << " C++";
2576 break;
2577 }
2578}
2579
2581 OS << ' ';
2583}
2584
2586 if (TypeSourceInfo *T = D->getFriendType())
2587 dumpType(T->getType());
2588}
2589
2591 dumpName(D);
2592 dumpType(D->getType());
2593 if (D->getSynthesize())
2594 OS << " synthesize";
2595
2596 switch (D->getAccessControl()) {
2597 case ObjCIvarDecl::None:
2598 OS << " none";
2599 break;
2601 OS << " private";
2602 break;
2604 OS << " protected";
2605 break;
2607 OS << " public";
2608 break;
2610 OS << " package";
2611 break;
2612 }
2613}
2614
2616 if (D->isInstanceMethod())
2617 OS << " -";
2618 else
2619 OS << " +";
2620 dumpName(D);
2621 dumpType(D->getReturnType());
2622
2623 if (D->isVariadic())
2624 OS << " variadic";
2625}
2626
2628 dumpName(D);
2629 switch (D->getVariance()) {
2631 break;
2632
2634 OS << " covariant";
2635 break;
2636
2638 OS << " contravariant";
2639 break;
2640 }
2641
2642 if (D->hasExplicitBound())
2643 OS << " bounded";
2645}
2646
2648 dumpName(D);
2651 for (const auto *P : D->protocols())
2652 dumpDeclRef(P);
2653}
2654
2656 dumpName(D);
2659}
2660
2662 dumpName(D);
2663
2664 for (const auto *Child : D->protocols())
2665 dumpDeclRef(Child);
2666}
2667
2669 dumpName(D);
2670 dumpDeclRef(D->getSuperClass(), "super");
2671
2673 for (const auto *Child : D->protocols())
2674 dumpDeclRef(Child);
2675}
2676
2678 const ObjCImplementationDecl *D) {
2679 dumpName(D);
2680 dumpDeclRef(D->getSuperClass(), "super");
2682}
2683
2685 const ObjCCompatibleAliasDecl *D) {
2686 dumpName(D);
2688}
2689
2691 dumpName(D);
2692 dumpType(D->getType());
2693
2695 OS << " required";
2697 OS << " optional";
2698
2702 OS << " readonly";
2704 OS << " assign";
2706 OS << " readwrite";
2708 OS << " retain";
2710 OS << " copy";
2712 OS << " nonatomic";
2714 OS << " atomic";
2716 OS << " weak";
2718 OS << " strong";
2720 OS << " unsafe_unretained";
2722 OS << " class";
2724 OS << " direct";
2726 dumpDeclRef(D->getGetterMethodDecl(), "getter");
2728 dumpDeclRef(D->getSetterMethodDecl(), "setter");
2729 }
2730}
2731
2735 OS << " synthesize";
2736 else
2737 OS << " dynamic";
2740}
2741
2743 if (D->isVariadic())
2744 OS << " variadic";
2745
2746 if (D->capturesCXXThis())
2747 OS << " captures_this";
2748}
2749
2751 dumpName(D);
2752}
2753
2755 VisitStmt(S);
2756 if (S->hasStoredFPFeatures())
2757 printFPOptions(S->getStoredFPFeatures());
2758}
2759
2761 if (D->isCBuffer())
2762 OS << " cbuffer";
2763 else
2764 OS << " tbuffer";
2765 dumpName(D);
2766}
2767
2769 OS << " " << S->getDirectiveKind();
2770}
static double GetApproxValue(const llvm::APFloat &F)
Definition: APValue.cpp:622
#define V(N, I)
Definition: ASTContext.h:3285
DynTypedNode Node
#define SM(sm)
Definition: Cuda.cpp:83
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
#define X(type, name)
Definition: Value.h:143
bool ShowColors
Definition: Logger.cpp:29
Defines the clang::Module class, which describes a module in the source code.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class....
SourceRange Range
Definition: SemaObjC.cpp:754
SourceLocation Loc
Definition: SemaObjC.cpp:755
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:2848
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3518
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:5981
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:4107
A class which contains all the information about a particular captured value.
Definition: Decl.h:4500
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4494
bool capturesCXXThis() const
Definition: Decl.h:4626
bool isVariadic() const
Definition: Decl.h:4569
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:1487
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1542
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2535
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2300
Represents a C++ deduction guide declaration.
Definition: DeclCXX.h:1952
DeductionCandidate getDeductionCandidateKind() const
Definition: DeclCXX.h:2006
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:2493
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3676
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1813
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2060
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:2236
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:1876
base_class_range bases()
Definition: DeclCXX.h:619
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:906
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1017
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:816
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:3550
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:4686
bool isNothrow() const
Definition: Decl.cpp:5443
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:5175
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:3556
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:3598
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3689
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Definition: DeclCXX.h:3698
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
Definition: DeclCXX.h:3679
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition: DeclCXX.h:3673
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:3136
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:2066
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:86
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition: DeclBase.h:1216
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:599
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition: DeclBase.h:1209
@ FOK_None
Not a friend object.
Definition: DeclBase.h:1207
@ FOK_Declared
A friend of a previously-declared entity.
Definition: DeclBase.h:1208
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:833
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:776
bool isInvalidDecl() const
Definition: DeclBase.h:594
SourceLocation getLocation() const
Definition: DeclBase.h:445
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:627
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:454
AccessSpecifier getAccess() const
Definition: DeclBase.h:513
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:908
Kind getKind() const
Definition: DeclBase.h:448
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:433
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:6029
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3316
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3801
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3899
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:3297
Represents an enum.
Definition: Decl.h:3867
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4072
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4075
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4081
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:4027
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3467
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3473
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:2919
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:915
Represents a member of a struct/union/class.
Definition: Decl.h:3057
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3145
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:2667
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition: Decl.h:2830
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2339
param_iterator param_begin()
Definition: Decl.h:2695
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2502
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2797
bool isDeletedAsWritten() const
Definition: Decl.h:2506
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2322
bool param_empty() const
Definition: Decl.h:2694
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2347
bool isIneligibleOrNotSelected() const
Definition: Decl.h:2380
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
Definition: Decl.cpp:4266
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2313
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:2808
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4656
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4900
Declaration of a template function.
Definition: DeclTemplate.h:957
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:4256
ExtInfo getExtInfo() const
Definition: Type.h:4585
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3493
bool isConst() const
Definition: Type.h:4591
bool isRestrict() const
Definition: Type.h:4593
bool isVolatile() const
Definition: Type.h:4592
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:4940
bool isCBuffer() const
Definition: Decl.h:4968
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:4799
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4857
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3341
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:3363
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:6221
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:3229
unsigned getManglingNumber() const
Definition: DeclCXX.h:3278
Represents a linkage specification.
Definition: DeclCXX.h:2934
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2957
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4710
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:648
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:3120
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3215
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:3010
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:2996
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:151
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:417
clauselist_range clauselists()
Definition: DeclOpenMP.h:442
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:2326
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2158
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2369
protocol_range protocols() const
Definition: DeclObjC.h:2400
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2542
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2199
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2772
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2790
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2483
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2594
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2732
Represents an ObjC class declaration.
Definition: DeclObjC.h:1153
protocol_range protocols() const
Definition: DeclObjC.h:1358
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1629
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:352
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6952
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1950
AccessControl getAccessControl() const
Definition: DeclObjC.h:1998
bool getSynthesize() const
Definition: DeclObjC.h:2005
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:730
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:900
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:903
QualType getType() const
Definition: DeclObjC.h:803
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:814
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:911
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2802
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2876
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2872
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2867
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2082
protocol_range protocols() const
Definition: DeclObjC.h:2158
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:640
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:623
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:24
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:25
Represents a pack expansion of types.
Definition: Type.h:6569
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:940
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:7380
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4168
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5549
RecordDecl * getDecl() const
Definition: Type.h:5559
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:3380
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:4251
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:5889
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5819
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:3821
StringRef getKindName() const
Definition: Decl.h:3775
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3687
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:6089
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:3555
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:7330
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:7341
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2763
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:1813
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:476
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2661
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2653
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2320
const char * getTypeClassName() const
Definition: Type.cpp:3282
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2647
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:2671
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2303
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:8126
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3534
QualType getUnderlyingType() const
Definition: Decl.h:3487
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:5466
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3197
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:5144
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3959
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3996
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3862
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3906
Represents a C++ using-declaration.
Definition: DeclCXX.h:3512
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3549
Represents C++ using-directive.
Definition: DeclCXX.h:3015
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2958
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3713
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3757
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3320
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3384
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:3747
Represents a GCC generic vector type.
Definition: Type.h:3969
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
@ Wait
'wait' clause, allowed on Compute, Data, 'update', and Combined constructs.
@ DevicePtr
'deviceptr' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ PCopyOut
'copyout' clause alias 'pcopyout'. Preserved for diagnostic purposes.
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ Async
'async' clause, allowed on Compute, Data, 'update', 'wait', and Combined constructs.
@ PresentOrCreate
'create' clause alias 'present_or_create'.
@ PresentOrCopy
'copy' clause alias 'present_or_copy'. Preserved for diagnostic purposes.
@ Private
'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...
@ Copy
'copy' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ DeviceType
'device_type' clause, allowed on Compute, 'data', 'init', 'shutdown', 'set', update',...
@ Attach
'attach' clause, allowed on Compute and Combined constructs, plus 'data' and 'enter data'.
@ NumGangs
'num_gangs' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
@ Default
'default' clause, allowed on parallel, serial, kernel (and compound) constructs.
@ NoCreate
'no_create' clause, allowed on allowed on Compute and Combined constructs, plus 'data'.
@ PresentOrCopyOut
'copyout' clause alias 'present_or_copyout'.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ CopyOut
'copyout' clause, allowed on Compute and Combined constructs, plus 'data', 'exit data',...
@ FirstPrivate
'firstprivate' clause, allowed on 'parallel', 'serial', 'parallel loop', and 'serial loop' constructs...
@ PCopy
'copy' clause alias 'pcopy'. Preserved for diagnostic purposes.
@ PCopyIn
'copyin' clause alias 'pcopyin'. Preserved for diagnostic purposes.
@ PCreate
'create' clause alias 'pcreate'. Preserved for diagnostic purposes.
@ Present
'present' clause, allowed on Compute and Combined constructs, plus 'data' and 'declare'.
@ DType
'dtype' clause, an alias for 'device_type', stored separately for diagnostic purposes.
@ CopyIn
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
@ PresentOrCopyIn
'copyin' clause alias 'present_or_copyin'.
static const TerminalColor CommentColor
static const TerminalColor DeclNameColor
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h: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:1762
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1765
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1768
@ 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
std::pair< IdentifierInfo *, SourceLocation > DeviceTypeArgument
Definition: OpenACCClause.h:80
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:4719
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:4723
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4709
Extra information about a function prototype.
Definition: Type.h:4735
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4742
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:154
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:873
Information about a single command.