clang 18.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"
21#include "clang/Basic/Module.h"
25#include "llvm/ADT/StringExtras.h"
26
27#include <algorithm>
28#include <utility>
29
30using namespace clang;
31
32static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
33
34template <typename T>
35static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
36 const T *First = D->getFirstDecl();
37 if (First != D)
38 OS << " first " << First;
39}
40
41template <typename T>
42static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
43 const T *Prev = D->getPreviousDecl();
44 if (Prev)
45 OS << " prev " << Prev;
46}
47
48/// Dump the previous declaration in the redeclaration chain for a declaration,
49/// if any.
50static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
51 switch (D->getKind()) {
52#define DECL(DERIVED, BASE) \
53 case Decl::DERIVED: \
54 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
55#define ABSTRACT_DECL(DECL)
56#include "clang/AST/DeclNodes.inc"
57 }
58 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
59}
60
61TextNodeDumper::TextNodeDumper(raw_ostream &OS, const ASTContext &Context,
62 bool ShowColors)
64 Context(&Context), SM(&Context.getSourceManager()),
65 PrintPolicy(Context.getPrintingPolicy()),
66 Traits(&Context.getCommentCommandTraits()) {}
67
70
72 const comments::FullComment *FC) {
73 if (!C) {
74 ColorScope Color(OS, ShowColors, NullColor);
75 OS << "<<<NULL>>>";
76 return;
77 }
78
79 {
80 ColorScope Color(OS, ShowColors, CommentColor);
81 OS << C->getCommentKindName();
82 }
84 dumpSourceRange(C->getSourceRange());
85
86 ConstCommentVisitor<TextNodeDumper, void,
87 const comments::FullComment *>::visit(C, FC);
88}
89
91 {
92 ColorScope Color(OS, ShowColors, AttrColor);
93
94 switch (A->getKind()) {
95#define ATTR(X) \
96 case attr::X: \
97 OS << #X; \
98 break;
99#include "clang/Basic/AttrList.inc"
100 }
101 OS << "Attr";
102 }
103 dumpPointer(A);
105 if (A->isInherited())
106 OS << " Inherited";
107 if (A->isImplicit())
108 OS << " Implicit";
109
111}
112
114 const Decl *From, StringRef Label) {
115 OS << "TemplateArgument";
116 if (R.isValid())
118
119 if (From)
120 dumpDeclRef(From, Label);
121
123}
124
126 if (!Node) {
127 ColorScope Color(OS, ShowColors, NullColor);
128 OS << "<<<NULL>>>";
129 return;
130 }
131 {
132 ColorScope Color(OS, ShowColors, StmtColor);
133 OS << Node->getStmtClassName();
134 }
137
138 if (const auto *E = dyn_cast<Expr>(Node)) {
139 dumpType(E->getType());
140
141 if (E->containsErrors()) {
142 ColorScope Color(OS, ShowColors, ErrorsColor);
143 OS << " contains-errors";
144 }
145
146 {
147 ColorScope Color(OS, ShowColors, ValueKindColor);
148 switch (E->getValueKind()) {
149 case VK_PRValue:
150 break;
151 case VK_LValue:
152 OS << " lvalue";
153 break;
154 case VK_XValue:
155 OS << " xvalue";
156 break;
157 }
158 }
159
160 {
161 ColorScope Color(OS, ShowColors, ObjectKindColor);
162 switch (E->getObjectKind()) {
163 case OK_Ordinary:
164 break;
165 case OK_BitField:
166 OS << " bitfield";
167 break;
168 case OK_ObjCProperty:
169 OS << " objcproperty";
170 break;
171 case OK_ObjCSubscript:
172 OS << " objcsubscript";
173 break;
175 OS << " vectorcomponent";
176 break;
178 OS << " matrixcomponent";
179 break;
180 }
181 }
182 }
183
185}
186
188 if (!T) {
189 ColorScope Color(OS, ShowColors, NullColor);
190 OS << "<<<NULL>>>";
191 return;
192 }
193 if (isa<LocInfoType>(T)) {
194 {
195 ColorScope Color(OS, ShowColors, TypeColor);
196 OS << "LocInfo Type";
197 }
198 dumpPointer(T);
199 return;
200 }
201
202 {
203 ColorScope Color(OS, ShowColors, TypeColor);
204 OS << T->getTypeClassName() << "Type";
205 }
206 dumpPointer(T);
207 OS << " ";
208 dumpBareType(QualType(T, 0), false);
209
210 QualType SingleStepDesugar =
212 if (SingleStepDesugar != QualType(T, 0))
213 OS << " sugar";
214
215 if (T->containsErrors()) {
216 ColorScope Color(OS, ShowColors, ErrorsColor);
217 OS << " contains-errors";
218 }
219
220 if (T->isDependentType())
221 OS << " dependent";
222 else if (T->isInstantiationDependentType())
223 OS << " instantiation_dependent";
224
225 if (T->isVariablyModifiedType())
226 OS << " variably_modified";
228 OS << " contains_unexpanded_pack";
229 if (T->isFromAST())
230 OS << " imported";
231
233}
234
236 OS << "QualType";
238 OS << " ";
239 dumpBareType(T, false);
240 OS << " " << T.split().Quals.getAsString();
241}
242
244 if (!D) {
245 ColorScope Color(OS, ShowColors, NullColor);
246 OS << "<<<NULL>>>";
247 return;
248 }
249
250 {
251 ColorScope Color(OS, ShowColors, DeclKindNameColor);
252 OS << D->getDeclKindName() << "Decl";
253 }
254 dumpPointer(D);
255 if (D->getLexicalDeclContext() != D->getDeclContext())
256 OS << " parent " << cast<Decl>(D->getDeclContext());
257 dumpPreviousDecl(OS, D);
259 OS << ' ';
261 if (D->isFromASTFile())
262 OS << " imported";
263 if (Module *M = D->getOwningModule())
264 OS << " in " << M->getFullModuleName();
265 if (auto *ND = dyn_cast<NamedDecl>(D))
267 const_cast<NamedDecl *>(ND)))
268 AddChild([=] { OS << "also in " << M->getFullModuleName(); });
269 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
270 if (!ND->isUnconditionallyVisible())
271 OS << " hidden";
272 if (D->isImplicit())
273 OS << " implicit";
274
275 if (D->isUsed())
276 OS << " used";
277 else if (D->isThisDeclarationReferenced())
278 OS << " referenced";
279
280 if (D->isInvalidDecl())
281 OS << " invalid";
282 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
283 if (FD->isConstexprSpecified())
284 OS << " constexpr";
285 if (FD->isConsteval())
286 OS << " consteval";
287 else if (FD->isImmediateFunction())
288 OS << " immediate";
289 if (FD->isMultiVersion())
290 OS << " multiversion";
291 }
292
293 if (!isa<FunctionDecl>(*D)) {
294 const auto *MD = dyn_cast<ObjCMethodDecl>(D);
295 if (!MD || !MD->isThisDeclarationADefinition()) {
296 const auto *DC = dyn_cast<DeclContext>(D);
297 if (DC && DC->hasExternalLexicalStorage()) {
298 ColorScope Color(OS, ShowColors, UndeserializedColor);
299 OS << " <undeserialized declarations>";
300 }
301 }
302 }
303
304 switch (D->getFriendObjectKind()) {
305 case Decl::FOK_None:
306 break;
308 OS << " friend";
309 break;
311 OS << " friend_undeclared";
312 break;
313 }
314
316}
317
319 OS << "CXXCtorInitializer";
320 if (Init->isAnyMemberInitializer()) {
321 OS << ' ';
322 dumpBareDeclRef(Init->getAnyMember());
323 } else if (Init->isBaseInitializer()) {
324 dumpType(QualType(Init->getBaseClass(), 0));
325 } else if (Init->isDelegatingInitializer()) {
326 dumpType(Init->getTypeSourceInfo()->getType());
327 } else {
328 llvm_unreachable("Unknown initializer type");
329 }
330}
331
333 OS << "capture";
334 if (C.isByRef())
335 OS << " byref";
336 if (C.isNested())
337 OS << " nested";
338 if (C.getVariable()) {
339 OS << ' ';
340 dumpBareDeclRef(C.getVariable());
341 }
342}
343
345 if (!C) {
346 ColorScope Color(OS, ShowColors, NullColor);
347 OS << "<<<NULL>>> OMPClause";
348 return;
349 }
350 {
351 ColorScope Color(OS, ShowColors, AttrColor);
352 StringRef ClauseName(llvm::omp::getOpenMPClauseName(C->getClauseKind()));
353 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
354 << ClauseName.drop_front() << "Clause";
355 }
356 dumpPointer(C);
357 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
358 if (C->isImplicit())
359 OS << " <implicit>";
360}
361
363 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
364 if (TSI) {
365 OS << "case ";
366 dumpType(TSI->getType());
367 } else {
368 OS << "default";
369 }
370
371 if (A.isSelected())
372 OS << " selected";
373}
374
376 if (!R) {
377 ColorScope Color(OS, ShowColors, NullColor);
378 OS << "<<<NULL>>> ConceptReference";
379 return;
380 }
381
382 OS << "ConceptReference";
383 dumpPointer(R);
385 OS << ' ';
387}
388
390 if (!R) {
391 ColorScope Color(OS, ShowColors, NullColor);
392 OS << "<<<NULL>>> Requirement";
393 return;
394 }
395
396 {
397 ColorScope Color(OS, ShowColors, StmtColor);
398 switch (R->getKind()) {
400 OS << "TypeRequirement";
401 break;
403 OS << "SimpleRequirement";
404 break;
406 OS << "CompoundRequirement";
407 break;
409 OS << "NestedRequirement";
410 break;
411 }
412 }
413
414 dumpPointer(R);
415
416 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
417 if (ER->hasNoexceptRequirement())
418 OS << " noexcept";
419 }
420
421 if (R->isDependent())
422 OS << " dependent";
423 else
424 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
426 OS << " contains_unexpanded_pack";
427}
428
429static double GetApproxValue(const llvm::APFloat &F) {
430 llvm::APFloat V = F;
431 bool ignored;
432 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
433 &ignored);
434 return V.convertToDouble();
435}
436
437/// True if the \p APValue \p Value can be folded onto the current line.
438static bool isSimpleAPValue(const APValue &Value) {
439 switch (Value.getKind()) {
440 case APValue::None:
442 case APValue::Int:
443 case APValue::Float:
447 case APValue::LValue:
450 return true;
451 case APValue::Vector:
452 case APValue::Array:
453 case APValue::Struct:
454 return false;
455 case APValue::Union:
456 return isSimpleAPValue(Value.getUnionValue());
457 }
458 llvm_unreachable("unexpected APValue kind!");
459}
460
461/// Dump the children of the \p APValue \p Value.
462///
463/// \param[in] Value The \p APValue to visit
464/// \param[in] Ty The \p QualType passed to \p Visit
465///
466/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
467/// to one of the child of the \p APValue
468///
469/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
470/// the indices in the range \p [0,NumChildren(
471///
472/// \param[in] LabelSingular The label to use on a line with a single child
473/// \param[in] LabelPlurial The label to use on a line with multiple children
474void TextNodeDumper::dumpAPValueChildren(
475 const APValue &Value, QualType Ty,
476 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
477 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
478 // To save some vertical space we print up to MaxChildrenPerLine APValues
479 // considered to be simple (by isSimpleAPValue) on a single line.
480 constexpr unsigned MaxChildrenPerLine = 4;
481 unsigned I = 0;
482 while (I < NumChildren) {
483 unsigned J = I;
484 while (J < NumChildren) {
485 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
486 (J - I < MaxChildrenPerLine)) {
487 ++J;
488 continue;
489 }
490 break;
491 }
492
493 J = std::max(I + 1, J);
494
495 // Print [I,J) on a single line.
496 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
497 for (unsigned X = I; X < J; ++X) {
498 Visit(IdxToChildFun(Value, X), Ty);
499 if (X + 1 != J)
500 OS << ", ";
501 }
502 });
503 I = J;
504 }
505}
506
508 ColorScope Color(OS, ShowColors, ValueKindColor);
509 switch (Value.getKind()) {
510 case APValue::None:
511 OS << "None";
512 return;
514 OS << "Indeterminate";
515 return;
516 case APValue::Int:
517 OS << "Int ";
518 {
519 ColorScope Color(OS, ShowColors, ValueColor);
520 OS << Value.getInt();
521 }
522 return;
523 case APValue::Float:
524 OS << "Float ";
525 {
526 ColorScope Color(OS, ShowColors, ValueColor);
527 OS << GetApproxValue(Value.getFloat());
528 }
529 return;
531 OS << "FixedPoint ";
532 {
533 ColorScope Color(OS, ShowColors, ValueColor);
534 OS << Value.getFixedPoint();
535 }
536 return;
537 case APValue::Vector: {
538 unsigned VectorLength = Value.getVectorLength();
539 OS << "Vector length=" << VectorLength;
540
541 dumpAPValueChildren(
542 Value, Ty,
543 [](const APValue &Value, unsigned Index) -> const APValue & {
544 return Value.getVectorElt(Index);
545 },
546 VectorLength, "element", "elements");
547 return;
548 }
550 OS << "ComplexInt ";
551 {
552 ColorScope Color(OS, ShowColors, ValueColor);
553 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
554 << 'i';
555 }
556 return;
558 OS << "ComplexFloat ";
559 {
560 ColorScope Color(OS, ShowColors, ValueColor);
561 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
562 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
563 }
564 return;
565 case APValue::LValue:
566 (void)Context;
567 OS << "LValue <todo>";
568 return;
569 case APValue::Array: {
570 unsigned ArraySize = Value.getArraySize();
571 unsigned NumInitializedElements = Value.getArrayInitializedElts();
572 OS << "Array size=" << ArraySize;
573
574 dumpAPValueChildren(
575 Value, Ty,
576 [](const APValue &Value, unsigned Index) -> const APValue & {
577 return Value.getArrayInitializedElt(Index);
578 },
579 NumInitializedElements, "element", "elements");
580
581 if (Value.hasArrayFiller()) {
582 AddChild("filler", [=] {
583 {
584 ColorScope Color(OS, ShowColors, ValueColor);
585 OS << ArraySize - NumInitializedElements << " x ";
586 }
587 Visit(Value.getArrayFiller(), Ty);
588 });
589 }
590
591 return;
592 }
593 case APValue::Struct: {
594 OS << "Struct";
595
596 dumpAPValueChildren(
597 Value, Ty,
598 [](const APValue &Value, unsigned Index) -> const APValue & {
599 return Value.getStructBase(Index);
600 },
601 Value.getStructNumBases(), "base", "bases");
602
603 dumpAPValueChildren(
604 Value, Ty,
605 [](const APValue &Value, unsigned Index) -> const APValue & {
606 return Value.getStructField(Index);
607 },
608 Value.getStructNumFields(), "field", "fields");
609
610 return;
611 }
612 case APValue::Union: {
613 OS << "Union";
614 {
615 ColorScope Color(OS, ShowColors, ValueColor);
616 if (const FieldDecl *FD = Value.getUnionField())
617 OS << " ." << *cast<NamedDecl>(FD);
618 }
619 // If the union value is considered to be simple, fold it into the
620 // current line to save some vertical space.
621 const APValue &UnionValue = Value.getUnionValue();
622 if (isSimpleAPValue(UnionValue)) {
623 OS << ' ';
624 Visit(UnionValue, Ty);
625 } else {
626 AddChild([=] { Visit(UnionValue, Ty); });
627 }
628
629 return;
630 }
632 OS << "MemberPointer <todo>";
633 return;
635 OS << "AddrLabelDiff <todo>";
636 return;
637 }
638 llvm_unreachable("Unknown APValue kind!");
639}
640
641void TextNodeDumper::dumpPointer(const void *Ptr) {
642 ColorScope Color(OS, ShowColors, AddressColor);
643 OS << ' ' << Ptr;
644}
645
647 if (!SM)
648 return;
649
650 ColorScope Color(OS, ShowColors, LocationColor);
651 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
652
653 // The general format we print out is filename:line:col, but we drop pieces
654 // that haven't changed since the last loc printed.
655 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
656
657 if (PLoc.isInvalid()) {
658 OS << "<invalid sloc>";
659 return;
660 }
661
662 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
663 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
664 << PLoc.getColumn();
665 LastLocFilename = PLoc.getFilename();
666 LastLocLine = PLoc.getLine();
667 } else if (PLoc.getLine() != LastLocLine) {
668 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
669 LastLocLine = PLoc.getLine();
670 } else {
671 OS << "col" << ':' << PLoc.getColumn();
672 }
673}
674
676 // Can't translate locations if a SourceManager isn't available.
677 if (!SM)
678 return;
679
680 OS << " <";
682 if (R.getBegin() != R.getEnd()) {
683 OS << ", ";
684 dumpLocation(R.getEnd());
685 }
686 OS << ">";
687
688 // <t2.c:123:421[blah], t2.c:412:321>
689}
690
692 ColorScope Color(OS, ShowColors, TypeColor);
693
694 SplitQualType T_split = T.split();
695 OS << "'" << QualType::getAsString(T_split, PrintPolicy) << "'";
696
697 if (Desugar && !T.isNull()) {
698 // If the type is sugared, also dump a (shallow) desugared type.
700 if (T_split != D_split)
701 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
702 }
703}
704
706 OS << ' ';
707 dumpBareType(T);
708}
709
711 if (!D) {
712 ColorScope Color(OS, ShowColors, NullColor);
713 OS << "<<<NULL>>>";
714 return;
715 }
716
717 {
718 ColorScope Color(OS, ShowColors, DeclKindNameColor);
719 OS << D->getDeclKindName();
720 }
721 dumpPointer(D);
722
723 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
724 ColorScope Color(OS, ShowColors, DeclNameColor);
725 OS << " '" << ND->getDeclName() << '\'';
726 }
727
728 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
729 dumpType(VD->getType());
730}
731
733 if (ND->getDeclName()) {
734 ColorScope Color(OS, ShowColors, DeclNameColor);
735 OS << ' ' << ND->getDeclName();
736 }
737}
738
740 const auto AccessSpelling = getAccessSpelling(AS);
741 if (AccessSpelling.empty())
742 return;
743 OS << AccessSpelling;
744}
745
748 if (auto *BD = C.dyn_cast<BlockDecl *>())
749 dumpDeclRef(BD, "cleanup");
750 else if (auto *CLE = C.dyn_cast<CompoundLiteralExpr *>())
751 AddChild([=] {
752 OS << "cleanup ";
753 {
754 ColorScope Color(OS, ShowColors, StmtColor);
755 OS << CLE->getStmtClassName();
756 }
757 dumpPointer(CLE);
758 });
759 else
760 llvm_unreachable("unexpected cleanup type");
761}
762
765 switch (TSK) {
766 case TSK_Undeclared:
767 break;
769 OS << " implicit_instantiation";
770 break;
772 OS << " explicit_specialization";
773 break;
775 OS << " explicit_instantiation_declaration";
776 break;
778 OS << " explicit_instantiation_definition";
779 break;
780 }
781}
782
784 if (!NNS)
785 return;
786
787 AddChild([=] {
788 OS << "NestedNameSpecifier";
789
790 switch (NNS->getKind()) {
791 case NestedNameSpecifier::Identifier:
792 OS << " Identifier";
793 OS << " '" << NNS->getAsIdentifier()->getName() << "'";
794 break;
795 case NestedNameSpecifier::Namespace:
796 OS << " "; // "Namespace" is printed as the decl kind.
797 dumpBareDeclRef(NNS->getAsNamespace());
798 break;
799 case NestedNameSpecifier::NamespaceAlias:
800 OS << " "; // "NamespaceAlias" is printed as the decl kind.
801 dumpBareDeclRef(NNS->getAsNamespaceAlias());
802 break;
803 case NestedNameSpecifier::TypeSpec:
804 OS << " TypeSpec";
805 dumpType(QualType(NNS->getAsType(), 0));
806 break;
807 case NestedNameSpecifier::TypeSpecWithTemplate:
808 OS << " TypeSpecWithTemplate";
809 dumpType(QualType(NNS->getAsType(), 0));
810 break;
811 case NestedNameSpecifier::Global:
812 OS << " Global";
813 break;
814 case NestedNameSpecifier::Super:
815 OS << " Super";
816 break;
817 }
818
819 dumpNestedNameSpecifier(NNS->getPrefix());
820 });
821}
822
823void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
824 if (!D)
825 return;
826
827 AddChild([=] {
828 if (!Label.empty())
829 OS << Label << ' ';
831 });
832}
833
834const char *TextNodeDumper::getCommandName(unsigned CommandID) {
835 if (Traits)
836 return Traits->getCommandInfo(CommandID)->Name;
837 const comments::CommandInfo *Info =
839 if (Info)
840 return Info->Name;
841 return "<not a builtin command>";
842}
843
844void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
845#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
846 if (FPO.has##NAME##Override()) \
847 OS << " " #NAME "=" << FPO.get##NAME##Override();
848#include "clang/Basic/FPOptions.def"
849}
850
852 const comments::FullComment *) {
853 OS << " Text=\"" << C->getText() << "\"";
854}
855
858 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
859 switch (C->getRenderKind()) {
861 OS << " RenderNormal";
862 break;
864 OS << " RenderBold";
865 break;
867 OS << " RenderMonospaced";
868 break;
870 OS << " RenderEmphasized";
871 break;
873 OS << " RenderAnchor";
874 break;
875 }
876
877 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
878 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
879}
880
883 OS << " Name=\"" << C->getTagName() << "\"";
884 if (C->getNumAttrs() != 0) {
885 OS << " Attrs: ";
886 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
888 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
889 }
890 }
891 if (C->isSelfClosing())
892 OS << " SelfClosing";
893}
894
897 OS << " Name=\"" << C->getTagName() << "\"";
898}
899
902 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
903 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
904 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
905}
906
909 OS << " "
911
912 if (C->isDirectionExplicit())
913 OS << " explicitly";
914 else
915 OS << " implicitly";
916
917 if (C->hasParamName()) {
918 if (C->isParamIndexValid())
919 OS << " Param=\"" << C->getParamName(FC) << "\"";
920 else
921 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
922 }
923
924 if (C->isParamIndexValid() && !C->isVarArgParam())
925 OS << " ParamIndex=" << C->getParamIndex();
926}
927
930 if (C->hasParamName()) {
931 if (C->isPositionValid())
932 OS << " Param=\"" << C->getParamName(FC) << "\"";
933 else
934 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
935 }
936
937 if (C->isPositionValid()) {
938 OS << " Position=<";
939 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
940 OS << C->getIndex(i);
941 if (i != e - 1)
942 OS << ", ";
943 }
944 OS << ">";
945 }
946}
947
950 OS << " Name=\"" << getCommandName(C->getCommandID())
951 << "\""
952 " CloseName=\""
953 << C->getCloseName() << "\"";
954}
955
958 const comments::FullComment *) {
959 OS << " Text=\"" << C->getText() << "\"";
960}
961
964 OS << " Text=\"" << C->getText() << "\"";
965}
966
968 OS << " null";
969}
970
972 OS << " type";
973 dumpType(TA.getAsType());
974}
975
977 const TemplateArgument &TA) {
978 OS << " decl";
980}
981
983 OS << " nullptr";
984}
985
987 OS << " integral " << TA.getAsIntegral();
988}
989
992 OS << " using";
993 OS << " template ";
994 TA.getAsTemplate().dump(OS);
995}
996
998 const TemplateArgument &TA) {
1001 OS << " using";
1002 OS << " template expansion ";
1004}
1005
1007 OS << " expr";
1008}
1009
1011 OS << " pack";
1012}
1013
1014static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1015 if (Node->path_empty())
1016 return;
1017
1018 OS << " (";
1019 bool First = true;
1020 for (CastExpr::path_const_iterator I = Node->path_begin(),
1021 E = Node->path_end();
1022 I != E; ++I) {
1023 const CXXBaseSpecifier *Base = *I;
1024 if (!First)
1025 OS << " -> ";
1026
1027 const auto *RD =
1028 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
1029
1030 if (Base->isVirtual())
1031 OS << "virtual ";
1032 OS << RD->getName();
1033 First = false;
1034 }
1035
1036 OS << ')';
1037}
1038
1040 if (Node->hasInitStorage())
1041 OS << " has_init";
1042 if (Node->hasVarStorage())
1043 OS << " has_var";
1044 if (Node->hasElseStorage())
1045 OS << " has_else";
1046 if (Node->isConstexpr())
1047 OS << " constexpr";
1048 if (Node->isConsteval()) {
1049 OS << " ";
1050 if (Node->isNegatedConsteval())
1051 OS << "!";
1052 OS << "consteval";
1053 }
1054}
1055
1057 if (Node->hasInitStorage())
1058 OS << " has_init";
1059 if (Node->hasVarStorage())
1060 OS << " has_var";
1061}
1062
1064 if (Node->hasVarStorage())
1065 OS << " has_var";
1066}
1067
1069 OS << " '" << Node->getName() << "'";
1070 if (Node->isSideEntry())
1071 OS << " side_entry";
1072}
1073
1075 OS << " '" << Node->getLabel()->getName() << "'";
1076 dumpPointer(Node->getLabel());
1077}
1078
1080 if (Node->caseStmtIsGNURange())
1081 OS << " gnu_range";
1082}
1083
1085 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1086 OS << " nrvo_candidate(";
1087 dumpBareDeclRef(Cand);
1088 OS << ")";
1089 }
1090}
1091
1093 if (Node->hasAPValueResult())
1094 AddChild("value",
1095 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1096}
1097
1099 if (Node->usesADL())
1100 OS << " adl";
1101 if (Node->hasStoredFPFeatures())
1102 printFPOptions(Node->getFPFeatures());
1103}
1104
1106 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1107 if (OperatorSpelling)
1108 OS << " '" << OperatorSpelling << "'";
1109
1111}
1112
1114 OS << " <";
1115 {
1116 ColorScope Color(OS, ShowColors, CastColor);
1117 OS << Node->getCastKindName();
1118 }
1119 dumpBasePath(OS, Node);
1120 OS << ">";
1121 if (Node->hasStoredFPFeatures())
1122 printFPOptions(Node->getFPFeatures());
1123}
1124
1127 if (Node->isPartOfExplicitCast())
1128 OS << " part_of_explicit_cast";
1129}
1130
1132 OS << " ";
1133 dumpBareDeclRef(Node->getDecl());
1134 dumpNestedNameSpecifier(Node->getQualifier());
1135 if (Node->getDecl() != Node->getFoundDecl()) {
1136 OS << " (";
1137 dumpBareDeclRef(Node->getFoundDecl());
1138 OS << ")";
1139 }
1140 switch (Node->isNonOdrUse()) {
1141 case NOUR_None: break;
1142 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1143 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1144 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1145 }
1146 if (Node->refersToEnclosingVariableOrCapture())
1147 OS << " refers_to_enclosing_variable_or_capture";
1148 if (Node->isImmediateEscalating())
1149 OS << " immediate-escalating";
1150}
1151
1154
1155 dumpNestedNameSpecifier(Node->getQualifier());
1156}
1157
1159 const UnresolvedLookupExpr *Node) {
1160 OS << " (";
1161 if (!Node->requiresADL())
1162 OS << "no ";
1163 OS << "ADL) = '" << Node->getName() << '\'';
1164
1165 UnresolvedLookupExpr::decls_iterator I = Node->decls_begin(),
1166 E = Node->decls_end();
1167 if (I == E)
1168 OS << " empty";
1169 for (; I != E; ++I)
1170 dumpPointer(*I);
1171}
1172
1174 {
1175 ColorScope Color(OS, ShowColors, DeclKindNameColor);
1176 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1177 }
1178 OS << "='" << *Node->getDecl() << "'";
1179 dumpPointer(Node->getDecl());
1180 if (Node->isFreeIvar())
1181 OS << " isFreeIvar";
1182}
1183
1186 dumpType(Node->getTypeSourceInfo()->getType());
1187}
1188
1190 OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
1191}
1192
1194 ColorScope Color(OS, ShowColors, ValueColor);
1195 OS << " " << Node->getValue();
1196}
1197
1199 bool isSigned = Node->getType()->isSignedIntegerType();
1200 ColorScope Color(OS, ShowColors, ValueColor);
1201 OS << " " << toString(Node->getValue(), 10, isSigned);
1202}
1203
1205 ColorScope Color(OS, ShowColors, ValueColor);
1206 OS << " " << Node->getValueAsString(/*Radix=*/10);
1207}
1208
1210 ColorScope Color(OS, ShowColors, ValueColor);
1211 OS << " " << Node->getValueAsApproximateDouble();
1212}
1213
1215 ColorScope Color(OS, ShowColors, ValueColor);
1216 OS << " ";
1217 Str->outputString(OS);
1218}
1219
1221 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1222 OS << " field ";
1223 dumpBareDeclRef(Field);
1224 }
1225}
1226
1228 if (E->isResultDependent())
1229 OS << " result_dependent";
1230}
1231
1233 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1234 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1235 if (!Node->canOverflow())
1236 OS << " cannot overflow";
1237 if (Node->hasStoredFPFeatures())
1238 printFPOptions(Node->getStoredFPFeatures());
1239}
1240
1243 OS << " " << getTraitSpelling(Node->getKind());
1244
1245 if (Node->isArgumentType())
1246 dumpType(Node->getArgumentType());
1247}
1248
1250 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1251 dumpPointer(Node->getMemberDecl());
1252 dumpNestedNameSpecifier(Node->getQualifier());
1253 switch (Node->isNonOdrUse()) {
1254 case NOUR_None: break;
1255 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1256 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1257 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1258 }
1259}
1260
1262 const ExtVectorElementExpr *Node) {
1263 OS << " " << Node->getAccessor().getNameStart();
1264}
1265
1267 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1268 if (Node->hasStoredFPFeatures())
1269 printFPOptions(Node->getStoredFPFeatures());
1270}
1271
1274 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1275 << "' ComputeLHSTy=";
1276 dumpBareType(Node->getComputationLHSType());
1277 OS << " ComputeResultTy=";
1278 dumpBareType(Node->getComputationResultType());
1279 if (Node->hasStoredFPFeatures())
1280 printFPOptions(Node->getStoredFPFeatures());
1281}
1282
1284 OS << " " << Node->getLabel()->getName();
1285 dumpPointer(Node->getLabel());
1286}
1287
1289 OS << " " << Node->getCastName() << "<"
1290 << Node->getTypeAsWritten().getAsString() << ">"
1291 << " <" << Node->getCastKindName();
1292 dumpBasePath(OS, Node);
1293 OS << ">";
1294}
1295
1297 OS << " " << (Node->getValue() ? "true" : "false");
1298}
1299
1301 if (Node->isImplicit())
1302 OS << " implicit";
1303 OS << " this";
1304}
1305
1307 const CXXFunctionalCastExpr *Node) {
1308 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1309 << Node->getCastKindName() << ">";
1310 if (Node->hasStoredFPFeatures())
1311 printFPOptions(Node->getFPFeatures());
1312}
1313
1316 if (Node->hasStoredFPFeatures())
1317 printFPOptions(Node->getFPFeatures());
1318}
1319
1322 dumpType(Node->getTypeAsWritten());
1323 if (Node->isListInitialization())
1324 OS << " list";
1325}
1326
1328 CXXConstructorDecl *Ctor = Node->getConstructor();
1329 dumpType(Ctor->getType());
1330 if (Node->isElidable())
1331 OS << " elidable";
1332 if (Node->isListInitialization())
1333 OS << " list";
1334 if (Node->isStdInitListInitialization())
1335 OS << " std::initializer_list";
1336 if (Node->requiresZeroInitialization())
1337 OS << " zeroing";
1338 if (Node->isImmediateEscalating())
1339 OS << " immediate-escalating";
1340}
1341
1343 const CXXBindTemporaryExpr *Node) {
1344 OS << " (CXXTemporary";
1346 OS << ")";
1347}
1348
1350 if (Node->isGlobalNew())
1351 OS << " global";
1352 if (Node->isArray())
1353 OS << " array";
1354 if (Node->getOperatorNew()) {
1355 OS << ' ';
1356 dumpBareDeclRef(Node->getOperatorNew());
1357 }
1358 // We could dump the deallocation function used in case of error, but it's
1359 // usually not that interesting.
1360}
1361
1363 if (Node->isGlobalDelete())
1364 OS << " global";
1365 if (Node->isArrayForm())
1366 OS << " array";
1367 if (Node->getOperatorDelete()) {
1368 OS << ' ';
1369 dumpBareDeclRef(Node->getOperatorDelete());
1370 }
1371}
1372
1374 OS << " " << getTraitSpelling(Node->getTrait());
1375}
1376
1378 OS << " " << getTraitSpelling(Node->getTrait());
1379}
1380
1382 OS << " " << getTraitSpelling(Node->getTrait());
1383}
1384
1387 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1388 OS << " extended by ";
1389 dumpBareDeclRef(VD);
1390 }
1391}
1392
1394 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1395 dumpCleanupObject(Node->getObject(i));
1396}
1397
1399 dumpPointer(Node->getPack());
1400 dumpName(Node->getPack());
1401}
1402
1405 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1406}
1407
1409 OS << " selector=";
1410 Node->getSelector().print(OS);
1411 switch (Node->getReceiverKind()) {
1413 break;
1414
1416 OS << " class=";
1417 dumpBareType(Node->getClassReceiver());
1418 break;
1419
1421 OS << " super (instance)";
1422 break;
1423
1425 OS << " super (class)";
1426 break;
1427 }
1428}
1429
1431 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1432 OS << " selector=";
1433 BoxingMethod->getSelector().print(OS);
1434 }
1435}
1436
1438 if (!Node->getCatchParamDecl())
1439 OS << " catch all";
1440}
1441
1443 dumpType(Node->getEncodedType());
1444}
1445
1447 OS << " ";
1448 Node->getSelector().print(OS);
1449}
1450
1452 OS << ' ' << *Node->getProtocol();
1453}
1454
1456 if (Node->isImplicitProperty()) {
1457 OS << " Kind=MethodRef Getter=\"";
1458 if (Node->getImplicitPropertyGetter())
1459 Node->getImplicitPropertyGetter()->getSelector().print(OS);
1460 else
1461 OS << "(null)";
1462
1463 OS << "\" Setter=\"";
1464 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1465 Setter->getSelector().print(OS);
1466 else
1467 OS << "(null)";
1468 OS << "\"";
1469 } else {
1470 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1471 << '"';
1472 }
1473
1474 if (Node->isSuperReceiver())
1475 OS << " super";
1476
1477 OS << " Messaging=";
1478 if (Node->isMessagingGetter() && Node->isMessagingSetter())
1479 OS << "Getter&Setter";
1480 else if (Node->isMessagingGetter())
1481 OS << "Getter";
1482 else if (Node->isMessagingSetter())
1483 OS << "Setter";
1484}
1485
1487 const ObjCSubscriptRefExpr *Node) {
1488 if (Node->isArraySubscriptRefExpr())
1489 OS << " Kind=ArraySubscript GetterForArray=\"";
1490 else
1491 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1492 if (Node->getAtIndexMethodDecl())
1493 Node->getAtIndexMethodDecl()->getSelector().print(OS);
1494 else
1495 OS << "(null)";
1496
1497 if (Node->isArraySubscriptRefExpr())
1498 OS << "\" SetterForArray=\"";
1499 else
1500 OS << "\" SetterForDictionary=\"";
1501 if (Node->setAtIndexMethodDecl())
1502 Node->setAtIndexMethodDecl()->getSelector().print(OS);
1503 else
1504 OS << "(null)";
1505}
1506
1508 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1509}
1510
1512 OS << " ";
1513 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
1514 Visit(Node->getIteratorDecl(I));
1515 OS << " = ";
1516 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
1517 OS << " begin ";
1518 Visit(Range.Begin);
1519 OS << " end ";
1520 Visit(Range.End);
1521 if (Range.Step) {
1522 OS << " step ";
1523 Visit(Range.Step);
1524 }
1525 }
1526}
1527
1530 OS << " ";
1531 dumpBareDeclRef(Node->getFoundDecl());
1532}
1533
1535 const RequiresExpr *Node) {
1536 if (!Node->isValueDependent())
1537 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
1538}
1539
1541 if (T->isSpelledAsLValue())
1542 OS << " written as lvalue reference";
1543}
1544
1546 switch (T->getSizeModifier()) {
1547 case ArrayType::Normal:
1548 break;
1549 case ArrayType::Static:
1550 OS << " static";
1551 break;
1552 case ArrayType::Star:
1553 OS << " *";
1554 break;
1555 }
1556 OS << " " << T->getIndexTypeQualifiers().getAsString();
1557}
1558
1560 OS << " " << T->getSize();
1561 VisitArrayType(T);
1562}
1563
1565 OS << " ";
1567 VisitArrayType(T);
1568}
1569
1571 const DependentSizedArrayType *T) {
1572 VisitArrayType(T);
1573 OS << " ";
1575}
1576
1578 const DependentSizedExtVectorType *T) {
1579 OS << " ";
1581}
1582
1584 switch (T->getVectorKind()) {
1586 break;
1588 OS << " altivec";
1589 break;
1591 OS << " altivec pixel";
1592 break;
1594 OS << " altivec bool";
1595 break;
1597 OS << " neon";
1598 break;
1600 OS << " neon poly";
1601 break;
1603 OS << " fixed-length sve data vector";
1604 break;
1606 OS << " fixed-length sve predicate vector";
1607 break;
1609 OS << " fixed-length rvv data vector";
1610 break;
1611 }
1612 OS << " " << T->getNumElements();
1613}
1614
1616 auto EI = T->getExtInfo();
1617 if (EI.getNoReturn())
1618 OS << " noreturn";
1619 if (EI.getProducesResult())
1620 OS << " produces_result";
1621 if (EI.getHasRegParm())
1622 OS << " regparm " << EI.getRegParm();
1623 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1624}
1625
1627 auto EPI = T->getExtProtoInfo();
1628 if (EPI.HasTrailingReturn)
1629 OS << " trailing_return";
1630 if (T->isConst())
1631 OS << " const";
1632 if (T->isVolatile())
1633 OS << " volatile";
1634 if (T->isRestrict())
1635 OS << " restrict";
1636 if (T->getExtProtoInfo().Variadic)
1637 OS << " variadic";
1638 switch (EPI.RefQualifier) {
1639 case RQ_None:
1640 break;
1641 case RQ_LValue:
1642 OS << " &";
1643 break;
1644 case RQ_RValue:
1645 OS << " &&";
1646 break;
1647 }
1648
1649 switch (EPI.ExceptionSpec.Type) {
1650 case EST_None:
1651 break;
1652 case EST_DynamicNone:
1653 OS << " exceptionspec_dynamic_none";
1654 break;
1655 case EST_Dynamic:
1656 OS << " exceptionspec_dynamic";
1657 break;
1658 case EST_MSAny:
1659 OS << " exceptionspec_ms_any";
1660 break;
1661 case EST_NoThrow:
1662 OS << " exceptionspec_nothrow";
1663 break;
1664 case EST_BasicNoexcept:
1665 OS << " exceptionspec_basic_noexcept";
1666 break;
1668 OS << " exceptionspec_dependent_noexcept";
1669 break;
1670 case EST_NoexceptFalse:
1671 OS << " exceptionspec_noexcept_false";
1672 break;
1673 case EST_NoexceptTrue:
1674 OS << " exceptionspec_noexcept_true";
1675 break;
1676 case EST_Unevaluated:
1677 OS << " exceptionspec_unevaluated";
1678 break;
1679 case EST_Uninstantiated:
1680 OS << " exceptionspec_uninstantiated";
1681 break;
1682 case EST_Unparsed:
1683 OS << " exceptionspec_unparsed";
1684 break;
1685 }
1686 if (!EPI.ExceptionSpec.Exceptions.empty()) {
1687 AddChild([=] {
1688 OS << "Exceptions:";
1689 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
1690 ++I) {
1691 if (I)
1692 OS << ",";
1693 dumpType(EPI.ExceptionSpec.Exceptions[I]);
1694 }
1695 });
1696 }
1697 if (EPI.ExceptionSpec.NoexceptExpr) {
1698 AddChild([=] {
1699 OS << "NoexceptExpr: ";
1700 Visit(EPI.ExceptionSpec.NoexceptExpr);
1701 });
1702 }
1703 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
1704 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
1705
1706 // FIXME: Consumed parameters.
1708}
1709
1711 dumpDeclRef(T->getDecl());
1712}
1713
1716 if (!T->typeMatchesDecl())
1717 OS << " divergent";
1718}
1719
1721 dumpDeclRef(T->getDecl());
1722 if (!T->typeMatchesDecl())
1723 OS << " divergent";
1724}
1725
1727 switch (T->getUTTKind()) {
1728#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
1729 case UnaryTransformType::Enum: \
1730 OS << " " #Trait; \
1731 break;
1732#include "clang/Basic/TransformTypeTraits.def"
1733 }
1734}
1735
1737 dumpDeclRef(T->getDecl());
1738}
1739
1741 OS << " depth " << T->getDepth() << " index " << T->getIndex();
1742 if (T->isParameterPack())
1743 OS << " pack";
1744 dumpDeclRef(T->getDecl());
1745}
1746
1748 const SubstTemplateTypeParmType *T) {
1751 if (auto PackIndex = T->getPackIndex())
1752 OS << " pack_index " << *PackIndex;
1753}
1754
1759}
1760
1762 if (T->isDecltypeAuto())
1763 OS << " decltype(auto)";
1764 if (!T->isDeduced())
1765 OS << " undeduced";
1766 if (T->isConstrained()) {
1768 for (const auto &Arg : T->getTypeConstraintArguments())
1770 }
1771}
1772
1776 OS << " using";
1777}
1778
1780 const TemplateSpecializationType *T) {
1781 if (T->isTypeAlias())
1782 OS << " alias";
1784 OS << " using";
1785 OS << " ";
1786 T->getTemplateName().dump(OS);
1787}
1788
1790 const InjectedClassNameType *T) {
1791 dumpDeclRef(T->getDecl());
1792}
1793
1795 dumpDeclRef(T->getDecl());
1796}
1797
1799 if (auto N = T->getNumExpansions())
1800 OS << " expansions " << *N;
1801}
1802
1804
1806 dumpName(D);
1808 if (D->isModulePrivate())
1809 OS << " __module_private__";
1810}
1811
1813 if (D->isScoped()) {
1814 if (D->isScopedUsingClassTag())
1815 OS << " class";
1816 else
1817 OS << " struct";
1818 }
1819 dumpName(D);
1820 if (D->isModulePrivate())
1821 OS << " __module_private__";
1822 if (D->isFixed())
1824}
1825
1827 OS << ' ' << D->getKindName();
1828 dumpName(D);
1829 if (D->isModulePrivate())
1830 OS << " __module_private__";
1831 if (D->isCompleteDefinition())
1832 OS << " definition";
1833}
1834
1836 dumpName(D);
1837 dumpType(D->getType());
1838}
1839
1841 dumpName(D);
1842 dumpType(D->getType());
1843
1844 for (const auto *Child : D->chain())
1845 dumpDeclRef(Child);
1846}
1847
1849 dumpName(D);
1850 dumpType(D->getType());
1852
1853 StorageClass SC = D->getStorageClass();
1854 if (SC != SC_None)
1856 if (D->isInlineSpecified())
1857 OS << " inline";
1858 if (D->isVirtualAsWritten())
1859 OS << " virtual";
1860 if (D->isModulePrivate())
1861 OS << " __module_private__";
1862
1863 if (D->isPure())
1864 OS << " pure";
1865 if (D->isDefaulted()) {
1866 OS << " default";
1867 if (D->isDeleted())
1868 OS << "_delete";
1869 }
1870 if (D->isDeletedAsWritten())
1871 OS << " delete";
1872 if (D->isTrivial())
1873 OS << " trivial";
1874
1876 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
1877
1878 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1879 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1880 switch (EPI.ExceptionSpec.Type) {
1881 default:
1882 break;
1883 case EST_Unevaluated:
1884 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1885 break;
1886 case EST_Uninstantiated:
1887 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1888 break;
1889 }
1890 }
1891
1892 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1893 if (MD->size_overridden_methods() != 0) {
1894 auto dumpOverride = [=](const CXXMethodDecl *D) {
1895 SplitQualType T_split = D->getType().split();
1896 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
1897 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
1898 };
1899
1900 AddChild([=] {
1901 auto Overrides = MD->overridden_methods();
1902 OS << "Overrides: [ ";
1903 dumpOverride(*Overrides.begin());
1904 for (const auto *Override : llvm::drop_begin(Overrides)) {
1905 OS << ", ";
1906 dumpOverride(Override);
1907 }
1908 OS << " ]";
1909 });
1910 }
1911 }
1912
1913 if (!D->isInlineSpecified() && D->isInlined()) {
1914 OS << " implicit-inline";
1915 }
1916 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
1917 // the Params are set later, it is possible for a dump during debugging to
1918 // encounter a FunctionDecl that has been created but hasn't been assigned
1919 // ParmVarDecls yet.
1920 if (!D->param_empty() && !D->param_begin())
1921 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1922
1923 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
1924 OS << " instantiated_from";
1925 dumpPointer(Instance);
1926 }
1927}
1928
1931 OS << " extended by ";
1933 OS << " mangling ";
1934 {
1935 ColorScope Color(OS, ShowColors, ValueColor);
1936 OS << D->getManglingNumber();
1937 }
1938}
1939
1941 dumpName(D);
1942 dumpType(D->getType());
1943 if (D->isMutable())
1944 OS << " mutable";
1945 if (D->isModulePrivate())
1946 OS << " __module_private__";
1947}
1948
1951 dumpName(D);
1952 dumpType(D->getType());
1954 StorageClass SC = D->getStorageClass();
1955 if (SC != SC_None)
1957 switch (D->getTLSKind()) {
1958 case VarDecl::TLS_None:
1959 break;
1961 OS << " tls";
1962 break;
1964 OS << " tls_dynamic";
1965 break;
1966 }
1967 if (D->isModulePrivate())
1968 OS << " __module_private__";
1969 if (D->isNRVOVariable())
1970 OS << " nrvo";
1971 if (D->isInline())
1972 OS << " inline";
1973 if (D->isConstexpr())
1974 OS << " constexpr";
1975 if (D->hasInit()) {
1976 switch (D->getInitStyle()) {
1977 case VarDecl::CInit:
1978 OS << " cinit";
1979 break;
1980 case VarDecl::CallInit:
1981 OS << " callinit";
1982 break;
1983 case VarDecl::ListInit:
1984 OS << " listinit";
1985 break;
1987 OS << " parenlistinit";
1988 }
1989 }
1990 if (D->needsDestruction(D->getASTContext()))
1991 OS << " destroyed";
1992 if (D->isParameterPack())
1993 OS << " pack";
1994
1995 if (D->hasInit()) {
1996 const Expr *E = D->getInit();
1997 // Only dump the value of constexpr VarDecls for now.
1998 if (E && !E->isValueDependent() && D->isConstexpr() &&
1999 !D->getType()->isDependentType()) {
2000 const APValue *Value = D->evaluateValue();
2001 if (Value)
2002 AddChild("value", [=] { Visit(*Value, E->getType()); });
2003 }
2004 }
2005}
2006
2008 dumpName(D);
2009 dumpType(D->getType());
2010}
2011
2013 if (D->isNothrow())
2014 OS << " nothrow";
2015}
2016
2018 OS << ' ' << D->getImportedModule()->getFullModuleName();
2019
2020 for (Decl *InitD :
2022 dumpDeclRef(InitD, "initializer");
2023}
2024
2026 OS << ' ';
2027 switch (D->getCommentKind()) {
2028 case PCK_Unknown:
2029 llvm_unreachable("unexpected pragma comment kind");
2030 case PCK_Compiler:
2031 OS << "compiler";
2032 break;
2033 case PCK_ExeStr:
2034 OS << "exestr";
2035 break;
2036 case PCK_Lib:
2037 OS << "lib";
2038 break;
2039 case PCK_Linker:
2040 OS << "linker";
2041 break;
2042 case PCK_User:
2043 OS << "user";
2044 break;
2045 }
2046 StringRef Arg = D->getArg();
2047 if (!Arg.empty())
2048 OS << " \"" << Arg << "\"";
2049}
2050
2052 const PragmaDetectMismatchDecl *D) {
2053 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2054}
2055
2057 const OMPExecutableDirective *D) {
2058 if (D->isStandaloneDirective())
2059 OS << " openmp_standalone_directive";
2060}
2061
2063 const OMPDeclareReductionDecl *D) {
2064 dumpName(D);
2065 dumpType(D->getType());
2066 OS << " combiner";
2068 if (const auto *Initializer = D->getInitializer()) {
2069 OS << " initializer";
2071 switch (D->getInitializerKind()) {
2073 OS << " omp_priv = ";
2074 break;
2076 OS << " omp_priv ()";
2077 break;
2079 break;
2080 }
2081 }
2082}
2083
2085 for (const auto *C : D->clauselists()) {
2086 AddChild([=] {
2087 if (!C) {
2088 ColorScope Color(OS, ShowColors, NullColor);
2089 OS << "<<<NULL>>> OMPClause";
2090 return;
2091 }
2092 {
2093 ColorScope Color(OS, ShowColors, AttrColor);
2094 StringRef ClauseName(
2095 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2096 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2097 << ClauseName.drop_front() << "Clause";
2098 }
2099 dumpPointer(C);
2100 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2101 });
2102 }
2103}
2104
2106 dumpName(D);
2107 dumpType(D->getType());
2108}
2109
2111 dumpName(D);
2112 if (D->isInline())
2113 OS << " inline";
2114 if (D->isNested())
2115 OS << " nested";
2116 if (!D->isOriginalNamespace())
2117 dumpDeclRef(D->getOriginalNamespace(), "original");
2118}
2119
2121 OS << ' ';
2123}
2124
2126 dumpName(D);
2128}
2129
2131 dumpName(D);
2133}
2134
2136 const TypeAliasTemplateDecl *D) {
2137 dumpName(D);
2138}
2139
2141 VisitRecordDecl(D);
2142 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2143 OS << " instantiated_from";
2144 dumpPointer(Instance);
2145 }
2146 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
2147 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2148
2150
2151 if (!D->isCompleteDefinition())
2152 return;
2153
2154 AddChild([=] {
2155 {
2156 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2157 OS << "DefinitionData";
2158 }
2159#define FLAG(fn, name) \
2160 if (D->fn()) \
2161 OS << " " #name;
2162 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2163
2164 FLAG(isGenericLambda, generic);
2165 FLAG(isLambda, lambda);
2166
2167 FLAG(isAnonymousStructOrUnion, is_anonymous);
2168 FLAG(canPassInRegisters, pass_in_registers);
2169 FLAG(isEmpty, empty);
2170 FLAG(isAggregate, aggregate);
2171 FLAG(isStandardLayout, standard_layout);
2172 FLAG(isTriviallyCopyable, trivially_copyable);
2173 FLAG(isPOD, pod);
2174 FLAG(isTrivial, trivial);
2175 FLAG(isPolymorphic, polymorphic);
2176 FLAG(isAbstract, abstract);
2177 FLAG(isLiteral, literal);
2178
2179 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2180 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2181 FLAG(hasMutableFields, has_mutable_fields);
2182 FLAG(hasVariantMembers, has_variant_members);
2183 FLAG(allowConstDefaultInit, can_const_default_init);
2184
2185 AddChild([=] {
2186 {
2187 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2188 OS << "DefaultConstructor";
2189 }
2190 FLAG(hasDefaultConstructor, exists);
2191 FLAG(hasTrivialDefaultConstructor, trivial);
2192 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2193 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2194 FLAG(hasConstexprDefaultConstructor, constexpr);
2195 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2196 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2197 });
2198
2199 AddChild([=] {
2200 {
2201 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2202 OS << "CopyConstructor";
2203 }
2204 FLAG(hasSimpleCopyConstructor, simple);
2205 FLAG(hasTrivialCopyConstructor, trivial);
2206 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2207 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2208 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2209 FLAG(needsImplicitCopyConstructor, needs_implicit);
2210 FLAG(needsOverloadResolutionForCopyConstructor,
2211 needs_overload_resolution);
2213 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2214 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2215 });
2216
2217 AddChild([=] {
2218 {
2219 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2220 OS << "MoveConstructor";
2221 }
2222 FLAG(hasMoveConstructor, exists);
2223 FLAG(hasSimpleMoveConstructor, simple);
2224 FLAG(hasTrivialMoveConstructor, trivial);
2225 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2226 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2227 FLAG(needsImplicitMoveConstructor, needs_implicit);
2228 FLAG(needsOverloadResolutionForMoveConstructor,
2229 needs_overload_resolution);
2231 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2232 });
2233
2234 AddChild([=] {
2235 {
2236 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2237 OS << "CopyAssignment";
2238 }
2239 FLAG(hasSimpleCopyAssignment, simple);
2240 FLAG(hasTrivialCopyAssignment, trivial);
2241 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2242 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2243 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2244 FLAG(needsImplicitCopyAssignment, needs_implicit);
2245 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2246 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2247 });
2248
2249 AddChild([=] {
2250 {
2251 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2252 OS << "MoveAssignment";
2253 }
2254 FLAG(hasMoveAssignment, exists);
2255 FLAG(hasSimpleMoveAssignment, simple);
2256 FLAG(hasTrivialMoveAssignment, trivial);
2257 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2258 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2259 FLAG(needsImplicitMoveAssignment, needs_implicit);
2260 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2261 });
2262
2263 AddChild([=] {
2264 {
2265 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2266 OS << "Destructor";
2267 }
2268 FLAG(hasSimpleDestructor, simple);
2269 FLAG(hasIrrelevantDestructor, irrelevant);
2270 FLAG(hasTrivialDestructor, trivial);
2271 FLAG(hasNonTrivialDestructor, non_trivial);
2272 FLAG(hasUserDeclaredDestructor, user_declared);
2273 FLAG(hasConstexprDestructor, constexpr);
2274 FLAG(needsImplicitDestructor, needs_implicit);
2275 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2277 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2278 });
2279 });
2280
2281 for (const auto &I : D->bases()) {
2282 AddChild([=] {
2283 if (I.isVirtual())
2284 OS << "virtual ";
2285 dumpAccessSpecifier(I.getAccessSpecifier());
2286 dumpType(I.getType());
2287 if (I.isPackExpansion())
2288 OS << "...";
2289 });
2290 }
2291}
2292
2294 dumpName(D);
2295}
2296
2298 dumpName(D);
2299}
2300
2302 dumpName(D);
2303}
2304
2306 dumpName(D);
2307}
2308
2310 if (const auto *TC = D->getTypeConstraint()) {
2311 OS << " ";
2312 dumpBareDeclRef(TC->getNamedConcept());
2313 if (TC->getNamedConcept() != TC->getFoundDecl()) {
2314 OS << " (";
2315 dumpBareDeclRef(TC->getFoundDecl());
2316 OS << ")";
2317 }
2318 } else if (D->wasDeclaredWithTypename())
2319 OS << " typename";
2320 else
2321 OS << " class";
2322 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2323 if (D->isParameterPack())
2324 OS << " ...";
2325 dumpName(D);
2326}
2327
2329 const NonTypeTemplateParmDecl *D) {
2330 dumpType(D->getType());
2331 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2332 if (D->isParameterPack())
2333 OS << " ...";
2334 dumpName(D);
2335}
2336
2338 const TemplateTemplateParmDecl *D) {
2339 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2340 if (D->isParameterPack())
2341 OS << " ...";
2342 dumpName(D);
2343}
2344
2346 OS << ' ';
2347 if (D->getQualifier())
2349 OS << D->getDeclName();
2351}
2352
2354 OS << ' ';
2356}
2357
2359 const UnresolvedUsingTypenameDecl *D) {
2360 OS << ' ';
2361 if (D->getQualifier())
2363 OS << D->getDeclName();
2364}
2365
2367 const UnresolvedUsingValueDecl *D) {
2368 OS << ' ';
2369 if (D->getQualifier())
2371 OS << D->getDeclName();
2372 dumpType(D->getType());
2373}
2374
2376 OS << ' ';
2378}
2379
2381 const ConstructorUsingShadowDecl *D) {
2382 if (D->constructsVirtualBase())
2383 OS << " virtual";
2384
2385 AddChild([=] {
2386 OS << "target ";
2388 });
2389
2390 AddChild([=] {
2391 OS << "nominated ";
2393 OS << ' ';
2395 });
2396
2397 AddChild([=] {
2398 OS << "constructed ";
2400 OS << ' ';
2402 });
2403}
2404
2406 switch (D->getLanguage()) {
2408 OS << " C";
2409 break;
2411 OS << " C++";
2412 break;
2413 }
2414}
2415
2417 OS << ' ';
2419}
2420
2422 if (TypeSourceInfo *T = D->getFriendType())
2423 dumpType(T->getType());
2424}
2425
2427 dumpName(D);
2428 dumpType(D->getType());
2429 if (D->getSynthesize())
2430 OS << " synthesize";
2431
2432 switch (D->getAccessControl()) {
2433 case ObjCIvarDecl::None:
2434 OS << " none";
2435 break;
2437 OS << " private";
2438 break;
2440 OS << " protected";
2441 break;
2443 OS << " public";
2444 break;
2446 OS << " package";
2447 break;
2448 }
2449}
2450
2452 if (D->isInstanceMethod())
2453 OS << " -";
2454 else
2455 OS << " +";
2456 dumpName(D);
2457 dumpType(D->getReturnType());
2458
2459 if (D->isVariadic())
2460 OS << " variadic";
2461}
2462
2464 dumpName(D);
2465 switch (D->getVariance()) {
2467 break;
2468
2470 OS << " covariant";
2471 break;
2472
2474 OS << " contravariant";
2475 break;
2476 }
2477
2478 if (D->hasExplicitBound())
2479 OS << " bounded";
2481}
2482
2484 dumpName(D);
2487 for (const auto *P : D->protocols())
2488 dumpDeclRef(P);
2489}
2490
2492 dumpName(D);
2495}
2496
2498 dumpName(D);
2499
2500 for (const auto *Child : D->protocols())
2501 dumpDeclRef(Child);
2502}
2503
2505 dumpName(D);
2506 dumpDeclRef(D->getSuperClass(), "super");
2507
2509 for (const auto *Child : D->protocols())
2510 dumpDeclRef(Child);
2511}
2512
2514 const ObjCImplementationDecl *D) {
2515 dumpName(D);
2516 dumpDeclRef(D->getSuperClass(), "super");
2518}
2519
2521 const ObjCCompatibleAliasDecl *D) {
2522 dumpName(D);
2524}
2525
2527 dumpName(D);
2528 dumpType(D->getType());
2529
2531 OS << " required";
2533 OS << " optional";
2534
2538 OS << " readonly";
2540 OS << " assign";
2542 OS << " readwrite";
2544 OS << " retain";
2546 OS << " copy";
2548 OS << " nonatomic";
2550 OS << " atomic";
2552 OS << " weak";
2554 OS << " strong";
2556 OS << " unsafe_unretained";
2558 OS << " class";
2560 OS << " direct";
2562 dumpDeclRef(D->getGetterMethodDecl(), "getter");
2564 dumpDeclRef(D->getSetterMethodDecl(), "setter");
2565 }
2566}
2567
2571 OS << " synthesize";
2572 else
2573 OS << " dynamic";
2576}
2577
2579 if (D->isVariadic())
2580 OS << " variadic";
2581
2582 if (D->capturesCXXThis())
2583 OS << " captures_this";
2584}
2585
2587 dumpName(D);
2588}
2589
2591 VisitStmt(S);
2592 if (S->hasStoredFPFeatures())
2593 printFPOptions(S->getStoredFPFeatures());
2594}
2595
2597 if (D->isCBuffer())
2598 OS << " cbuffer";
2599 else
2600 OS << " tbuffer";
2601 dumpName(D);
2602}
static double GetApproxValue(const llvm::APFloat &F)
Definition: APValue.cpp:622
#define V(N, I)
Definition: ASTContext.h:3233
DynTypedNode Node
#define SM(sm)
Definition: Cuda.cpp:80
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:142
bool ShowColors
Definition: Logger.cpp:29
Defines the clang::Module class, which describes a module in the source code.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class....
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
static bool isSimpleAPValue(const APValue &Value)
True if the APValue Value can be folded onto the current line.
#define FLAG(fn, name)
static void dumpBasePath(raw_ostream &OS, const CastExpr *Node)
static void dumpPreviousDeclImpl(raw_ostream &OS,...)
static void dumpPreviousDecl(raw_ostream &OS, const Decl *D)
Dump the previous declaration in the redeclaration chain for a declaration, if any.
Defines enumerations for the type traits support.
C Language Family Type Representation.
std::string Label
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
@ Indeterminate
This object has an indeterminate value (C++ [basic.indet]).
Definition: APValue.h:131
@ None
There is no such object (it's outside its lifetime).
Definition: APValue.h:129
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition: ASTContext.h:182
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:683
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:4345
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2840
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3083
ArraySizeModifier getSizeModifier() const
Definition: Type.h:3106
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:3110
Attr - This represents one attribute.
Definition: Attr.h:40
attr::Kind getKind() const
Definition: Attr.h:80
bool isInherited() const
Definition: Attr.h:89
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:93
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5365
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
Definition: Type.h:5375
bool isDecltypeAuto() const
Definition: Type.h:5388
ConceptDecl * getTypeConstraintConcept() const
Definition: Type.h:5380
bool isConstrained() const
Definition: Type.h:5384
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3847
StringRef getOpcodeStr() const
Definition: Expr.h:3912
A binding in a decomposition declaration.
Definition: DeclCXX.h:4060
A class which contains all the information about a particular captured value.
Definition: Decl.h:4385
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4379
bool capturesCXXThis() const
Definition: Decl.h:4511
bool isVariadic() const
Definition: Decl.h:4454
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:1475
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1523
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2491
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2259
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2486
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3642
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1800
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2035
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:2212
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
Represents a C++ struct/union/class.
Definition: DeclCXX.h:254
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:1834
base_class_range bases()
Definition: DeclCXX.h:606
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:893
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1004
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:803
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:3516
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2832
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4571
bool isNothrow() const
Definition: Decl.cpp:5315
CaseStmt - Represent a case statement.
Definition: Stmt.h:1622
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3502
const CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3569
Declaration of a class template.
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4095
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3432
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1429
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:3131
const llvm::APInt & getSize() const
Definition: Type.h:3152
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1049
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3552
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3642
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Definition: DeclCXX.h:3651
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
Definition: DeclCXX.h:3632
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition: DeclCXX.h:3626
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:3069
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:1951
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1242
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:83
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition: DeclBase.h:1194
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:429
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:576
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition: DeclBase.h:1187
@ FOK_None
Not a friend object.
Definition: DeclBase.h:1185
@ FOK_Declared
A friend of a previously-declared entity.
Definition: DeclBase.h:1186
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:811
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:754
bool isInvalidDecl() const
Definition: DeclBase.h:571
SourceLocation getLocation() const
Definition: DeclBase.h:432
const char * getDeclKindName() const
Definition: DeclBase.cpp:124
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:604
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:458
DeclContext * getDeclContext()
Definition: DeclBase.h:441
AccessSpecifier getAccess() const
Definition: DeclBase.h:491
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:886
Kind getKind() const
Definition: DeclBase.h:435
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:420
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:825
Represents a C++17 deduced template specialization type.
Definition: Type.h:5413
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
Definition: Type.h:5433
bool isDeduced() const
Definition: Type.h:5353
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3282
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3289
SourceRange getBracketsRange() const
Definition: Type.h:3317
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3391
SourceLocation getAttributeLoc() const
Definition: Type.h:3408
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:3197
Represents an enum.
Definition: Decl.h:3758
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3963
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:3966
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:3972
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3918
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3433
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3439
This represents one expression.
Definition: Expr.h:110
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:169
QualType getType() const
Definition: Expr.h:142
An expression trait intrinsic.
Definition: ExprCXX.h:2910
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6107
Represents difference between two FPOptions values.
Definition: LangOptions.h:820
Represents a member of a struct/union/class.
Definition: Decl.h:2962
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3047
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:121
Represents a function declaration or definition.
Definition: Decl.h:1919
bool isPure() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2257
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition: Decl.h:2733
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2274
param_iterator param_begin()
Definition: Decl.h:2615
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2437
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2700
bool isDeletedAsWritten() const
Definition: Decl.h:2441
bool param_empty() const
Definition: Decl.h:2614
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2282
bool isIneligibleOrNotSelected() const
Definition: Decl.h:2315
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
Definition: Decl.cpp:4169
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2248
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization,...
Definition: Decl.cpp:3924
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Definition: Decl.cpp:3616
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2711
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4117
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4345
Declaration of a template function.
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3751
ExtInfo getExtInfo() const
Definition: Type.h:4047
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3354
bool isConst() const
Definition: Type.h:4053
bool isRestrict() const
Definition: Type.h:4055
bool isVolatile() const
Definition: Type.h:4054
Represents a C11 generic selection.
Definition: Expr.h:5720
AssociationTy< true > ConstAssociation
Definition: Expr.h:5951
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5971
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2683
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4825
bool isCBuffer() const
Definition: Decl.h:4853
IfStmt - This represents an if/then/else.
Definition: Stmt.h:1959
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3662
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4684
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4742
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3237
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:3258
Describes an C or C++ initializer list.
Definition: Expr.h:4843
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4962
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5607
CXXRecordDecl * getDecl() const
Definition: Type.cpp:3861
Represents the declaration of a label.
Definition: Decl.h:496
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:1852
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3183
unsigned getManglingNumber() const
Definition: DeclCXX.h:3232
Represents a linkage specification.
Definition: DeclCXX.h:2884
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2913
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4577
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3195
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:104
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:242
This represents a decl that may have a name.
Definition: Decl.h:247
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:625
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:313
Represents a C++ namespace alias.
Definition: DeclCXX.h:3074
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3169
Represent a C++ namespace.
Definition: Decl.h:544
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2943
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:607
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2929
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:624
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:171
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:239
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:221
InitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:242
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:275
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:416
clauselist_range clauselists()
Definition: DeclOpenMP.h:441
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2312
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2169
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2357
protocol_range protocols() const
Definition: DeclObjC.h:2388
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2531
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2213
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2759
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2777
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2472
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2584
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2719
Represents an ObjC class declaration.
Definition: DeclObjC.h:1147
protocol_range protocols() const
Definition: DeclObjC.h:1347
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1635
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:351
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6339
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:853
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1939
AccessControl getAccessControl() const
Definition: DeclObjC.h:1988
bool getSynthesize() const
Definition: DeclObjC.h:1995
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:942
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:1097
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:1091
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:1094
@ Class
The receiver is a class.
Definition: ExprObjC.h:1088
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:138
bool isVariadic() const
Definition: DeclObjC.h:433
bool isInstanceMethod() const
Definition: DeclObjC.h:428
QualType getReturnType() const
Definition: DeclObjC.h:331
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:894
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:897
QualType getType() const
Definition: DeclObjC.h:797
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:808
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:905
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2789
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2862
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2858
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2853
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:614
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2069
protocol_range protocols() const
Definition: DeclObjC.h:2144
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:841
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:579
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:639
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
Represents a pack expansion of types.
Definition: Type.h:5956
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: Type.h:5981
Represents a #pragma comment line.
Definition: Decl.h:140
StringRef getArg() const
Definition: Decl.h:163
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:161
Represents a #pragma detect_mismatch line.
Definition: Decl.h:174
StringRef getName() const
Definition: Decl.h:195
StringRef getValue() const
Definition: Decl.h:196
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1985
StringRef getIdentKindName() const
Definition: Expr.h:2057
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:736
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:803
SplitQualType getSplitDesugaredType() const
Definition: Type.h:1088
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6768
std::string getAsString() const
void * getAsOpaquePtr() const
Definition: Type.h:783
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4036
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:4933
RecordDecl * getDecl() const
Definition: Type.h:4943
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:2951
bool isSpelledAsLValue() const
Definition: Type.h:2964
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:507
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:2840
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4217
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:43
Stmt - This represents one statement.
Definition: Stmt.h:72
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1793
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1236
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5273
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.cpp:3911
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Definition: Type.cpp:3920
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5203
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.h:5224
std::optional< unsigned > getPackIndex() const
Definition: Type.h:5233
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Definition: Type.cpp:3894
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2209
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:3712
StringRef getKindName() const
Definition: Decl.h:3668
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3580
TagDecl * getDecl() const
Definition: Type.cpp:3763
Represents a template argument.
Definition: TemplateBase.h:60
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:287
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:331
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Definition: TemplateBase.h:311
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:294
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:318
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:5475
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5541
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:5534
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.
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:5166
bool isParameterPack() const
Definition: Type.h:5164
unsigned getIndex() const
Definition: Type.h:5163
unsigned getDepth() const
Definition: Type.h:5162
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 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)
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 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 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 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 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 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:3449
Declaration of an alias template.
A container of type source information.
Definition: Type.h:6718
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6729
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2755
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:1597
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:448
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2373
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2365
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2037
const char * getTypeClassName() const
Definition: Type.cpp:3145
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2359
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2383
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2020
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7523
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3429
QualType getUnderlyingType() const
Definition: Decl.h:3382
TypedefNameDecl * getDecl() const
Definition: Type.h:4663
bool typeMatchesDecl() const
Definition: Type.h:4671
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2580
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2195
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1420
A unary type transform, which is a type constructed from another.
Definition: Type.h:4850
UTTKind getUTTKind() const
Definition: Type.h:4879
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3164
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4589
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4600
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3912
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3949
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3815
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3859
Represents a C++ using-declaration.
Definition: DeclCXX.h:3466
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3503
Represents C++ using-directive.
Definition: DeclCXX.h:2969
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2892
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3666
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3710
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3274
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3338
UsingShadowDecl * getFoundDecl() const
Definition: Type.h:4629
bool typeMatchesDecl() const
Definition: Type.h:4638
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:703
QualType getType() const
Definition: Decl.h:714
Kind getKind() const
Definition: Value.h:135
Represents a variable declaration or definition.
Definition: Decl.h:915
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1521
TLSKind getTLSKind() const
Definition: Decl.cpp:2147
bool hasInit() const
Definition: Decl.cpp:2378
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1418
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2100
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:926
@ CInit
C-style initialization with assignment.
Definition: Decl.h:920
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:929
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:923
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
Definition: Decl.cpp:2529
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1464
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Would the destruction of this variable have any effect, and if so, what kind?
Definition: Decl.cpp:2793
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1503
const Expr * getInit() const
Definition: Decl.h:1327
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:938
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:941
@ TLS_None
Not a TLS variable.
Definition: Decl.h:935
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1127
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:2729
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
Definition: Decl.cpp:2636
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3235
SourceRange getBracketsRange() const
Definition: Type.h:3260
Represents a GCC generic vector type.
Definition: Type.h:3431
unsigned getNumElements() const
Definition: Type.h:3476
@ AltiVecBool
is AltiVec 'vector bool ...'
Definition: Type.h:3444
@ RVVFixedLengthDataVector
is RISC-V RVV fixed-length data vector
Definition: Type.h:3459
@ SveFixedLengthPredicateVector
is AArch64 SVE fixed-length predicate vector
Definition: Type.h:3456
@ NeonPolyVector
is ARM Neon polynomial vector
Definition: Type.h:3450
@ GenericVector
not a target-specific vector type
Definition: Type.h:3435
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition: Type.h:3441
@ SveFixedLengthDataVector
is AArch64 SVE fixed-length data vector
Definition: Type.h:3453
@ AltiVecVector
is AltiVec vector
Definition: Type.h:3438
@ NeonVector
is ARM Neon vector
Definition: Type.h:3447
VectorKind getVectorKind() const
Definition: Type.h:3481
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2405
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:588
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:52
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1077
An opening HTML tag with attributes.
Definition: Comment.h:411
A command with word-like arguments that is considered inline content.
Definition: Comment.h:302
Doxygen \param command.
Definition: Comment.h:694
static const char * getDirectionAsString(PassDirection D)
Definition: Comment.cpp:187
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:782
A verbatim block command (e.
Definition: Comment.h:874
A line of text contained in a verbatim block.
Definition: Comment.h:846
A verbatim line command.
Definition: Comment.h:926
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:195
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:215
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
RetTy VisitTemplateArgument(REF(TemplateArgument), ParamTys...)
static const TerminalColor NullColor
static const TerminalColor ErrorsColor
static const TerminalColor CommentColor
static const TerminalColor DeclNameColor
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:388
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:1550
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1553
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1556
@ OK_VectorComponent
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:148
@ 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:152
@ OK_ObjCSubscript
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition: Specifiers.h:157
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:142
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:145
@ OK_MatrixComponent
A matrix component is a single element of a matrix.
Definition: Specifiers.h:160
static const TerminalColor StmtColor
static const TerminalColor UndeserializedColor
StorageClass
Storage classes.
Definition: Specifiers.h:239
@ SC_None
Definition: Specifiers.h:241
static const TerminalColor DeclKindNameColor
@ C
Languages that the frontend can parse and compile.
static const TerminalColor LocationColor
static const TerminalColor ValueKindColor
static const TerminalColor CastColor
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:126
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:135
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:130
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
static const TerminalColor AttrColor
static const TerminalColor TypeColor
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
Definition: Specifiers.h:179
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:197
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:193
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition: Specifiers.h:189
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition: Specifiers.h:185
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition: Specifiers.h:182
@ 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.
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:114
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:174
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:168
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:166
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:171
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition: Type.h:4180
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:4184
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4170
Extra information about a function prototype.
Definition: Type.h:4194
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4201
Iterator range representation begin:end[:step].
Definition: ExprOpenMP.h:278
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:669
Qualifiers Quals
The local qualifiers.
Definition: Type.h:674
Information about a single command.