clang 19.0.0git
TextNodeDumper.cpp
Go to the documentation of this file.
1//===--- TextNodeDumper.cpp - Printing of AST nodes -----------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements AST dumping of components of individual AST nodes.
10//
11//===----------------------------------------------------------------------===//
12
14#include "clang/AST/APValue.h"
20#include "clang/AST/Type.h"
22#include "clang/Basic/Module.h"
26#include "llvm/ADT/StringExtras.h"
27
28#include <algorithm>
29#include <utility>
30
31using namespace clang;
32
33static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
34
35template <typename T>
36static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
37 const T *First = D->getFirstDecl();
38 if (First != D)
39 OS << " first " << First;
40}
41
42template <typename T>
43static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
44 const T *Prev = D->getPreviousDecl();
45 if (Prev)
46 OS << " prev " << Prev;
47}
48
49/// Dump the previous declaration in the redeclaration chain for a declaration,
50/// if any.
51static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
52 switch (D->getKind()) {
53#define DECL(DERIVED, BASE) \
54 case Decl::DERIVED: \
55 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
56#define ABSTRACT_DECL(DECL)
57#include "clang/AST/DeclNodes.inc"
58 }
59 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
60}
61
62TextNodeDumper::TextNodeDumper(raw_ostream &OS, const ASTContext &Context,
63 bool ShowColors)
65 Context(&Context), SM(&Context.getSourceManager()),
66 PrintPolicy(Context.getPrintingPolicy()),
67 Traits(&Context.getCommentCommandTraits()) {}
68
71
73 const comments::FullComment *FC) {
74 if (!C) {
75 ColorScope Color(OS, ShowColors, NullColor);
76 OS << "<<<NULL>>>";
77 return;
78 }
79
80 {
81 ColorScope Color(OS, ShowColors, CommentColor);
82 OS << C->getCommentKindName();
83 }
85 dumpSourceRange(C->getSourceRange());
86
87 ConstCommentVisitor<TextNodeDumper, void,
88 const comments::FullComment *>::visit(C, FC);
89}
90
92 {
93 ColorScope Color(OS, ShowColors, AttrColor);
94
95 switch (A->getKind()) {
96#define ATTR(X) \
97 case attr::X: \
98 OS << #X; \
99 break;
100#include "clang/Basic/AttrList.inc"
101 }
102 OS << "Attr";
103 }
104 dumpPointer(A);
106 if (A->isInherited())
107 OS << " Inherited";
108 if (A->isImplicit())
109 OS << " Implicit";
110
112}
113
115 const Decl *From, StringRef Label) {
116 OS << "TemplateArgument";
117 if (R.isValid())
119
120 if (From)
121 dumpDeclRef(From, Label);
122
124}
125
127 if (!Node) {
128 ColorScope Color(OS, ShowColors, NullColor);
129 OS << "<<<NULL>>>";
130 return;
131 }
132 {
133 ColorScope Color(OS, ShowColors, StmtColor);
134 OS << Node->getStmtClassName();
135 }
138
139 if (const auto *E = dyn_cast<Expr>(Node)) {
140 dumpType(E->getType());
141
142 if (E->containsErrors()) {
143 ColorScope Color(OS, ShowColors, ErrorsColor);
144 OS << " contains-errors";
145 }
146
147 {
148 ColorScope Color(OS, ShowColors, ValueKindColor);
149 switch (E->getValueKind()) {
150 case VK_PRValue:
151 break;
152 case VK_LValue:
153 OS << " lvalue";
154 break;
155 case VK_XValue:
156 OS << " xvalue";
157 break;
158 }
159 }
160
161 {
162 ColorScope Color(OS, ShowColors, ObjectKindColor);
163 switch (E->getObjectKind()) {
164 case OK_Ordinary:
165 break;
166 case OK_BitField:
167 OS << " bitfield";
168 break;
169 case OK_ObjCProperty:
170 OS << " objcproperty";
171 break;
172 case OK_ObjCSubscript:
173 OS << " objcsubscript";
174 break;
176 OS << " vectorcomponent";
177 break;
179 OS << " matrixcomponent";
180 break;
181 }
182 }
183 }
184
186}
187
189 if (!T) {
190 ColorScope Color(OS, ShowColors, NullColor);
191 OS << "<<<NULL>>>";
192 return;
193 }
194 if (isa<LocInfoType>(T)) {
195 {
196 ColorScope Color(OS, ShowColors, TypeColor);
197 OS << "LocInfo Type";
198 }
199 dumpPointer(T);
200 return;
201 }
202
203 {
204 ColorScope Color(OS, ShowColors, TypeColor);
205 OS << T->getTypeClassName() << "Type";
206 }
207 dumpPointer(T);
208 OS << " ";
209 dumpBareType(QualType(T, 0), false);
210
211 QualType SingleStepDesugar =
213 if (SingleStepDesugar != QualType(T, 0))
214 OS << " sugar";
215
216 if (T->containsErrors()) {
217 ColorScope Color(OS, ShowColors, ErrorsColor);
218 OS << " contains-errors";
219 }
220
221 if (T->isDependentType())
222 OS << " dependent";
223 else if (T->isInstantiationDependentType())
224 OS << " instantiation_dependent";
225
226 if (T->isVariablyModifiedType())
227 OS << " variably_modified";
229 OS << " contains_unexpanded_pack";
230 if (T->isFromAST())
231 OS << " imported";
232
234}
235
237 OS << "QualType";
239 OS << " ";
240 dumpBareType(T, false);
241 OS << " " << T.split().Quals.getAsString();
242}
243
245 if (!TL) {
246 ColorScope Color(OS, ShowColors, NullColor);
247 OS << "<<<NULL>>>";
248 return;
249 }
250
251 {
252 ColorScope Color(OS, ShowColors, TypeColor);
254 ? "Qualified"
255 : TL.getType()->getTypeClassName())
256 << "TypeLoc";
257 }
259 OS << ' ';
260 dumpBareType(TL.getType(), /*Desugar=*/false);
261
263}
264
266 if (!D) {
267 ColorScope Color(OS, ShowColors, NullColor);
268 OS << "<<<NULL>>>";
269 return;
270 }
271
272 {
273 ColorScope Color(OS, ShowColors, DeclKindNameColor);
274 OS << D->getDeclKindName() << "Decl";
275 }
276 dumpPointer(D);
277 if (D->getLexicalDeclContext() != D->getDeclContext())
278 OS << " parent " << cast<Decl>(D->getDeclContext());
279 dumpPreviousDecl(OS, D);
281 OS << ' ';
283 if (D->isFromASTFile())
284 OS << " imported";
285 if (Module *M = D->getOwningModule())
286 OS << " in " << M->getFullModuleName();
287 if (auto *ND = dyn_cast<NamedDecl>(D))
289 const_cast<NamedDecl *>(ND)))
290 AddChild([=] { OS << "also in " << M->getFullModuleName(); });
291 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
292 if (!ND->isUnconditionallyVisible())
293 OS << " hidden";
294 if (D->isImplicit())
295 OS << " implicit";
296
297 if (D->isUsed())
298 OS << " used";
299 else if (D->isThisDeclarationReferenced())
300 OS << " referenced";
301
302 if (D->isInvalidDecl())
303 OS << " invalid";
304 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
305 if (FD->isConstexprSpecified())
306 OS << " constexpr";
307 if (FD->isConsteval())
308 OS << " consteval";
309 else if (FD->isImmediateFunction())
310 OS << " immediate";
311 if (FD->isMultiVersion())
312 OS << " multiversion";
313 }
314
315 if (!isa<FunctionDecl>(*D)) {
316 const auto *MD = dyn_cast<ObjCMethodDecl>(D);
317 if (!MD || !MD->isThisDeclarationADefinition()) {
318 const auto *DC = dyn_cast<DeclContext>(D);
319 if (DC && DC->hasExternalLexicalStorage()) {
320 ColorScope Color(OS, ShowColors, UndeserializedColor);
321 OS << " <undeserialized declarations>";
322 }
323 }
324 }
325
326 switch (D->getFriendObjectKind()) {
327 case Decl::FOK_None:
328 break;
330 OS << " friend";
331 break;
333 OS << " friend_undeclared";
334 break;
335 }
336
338}
339
341 OS << "CXXCtorInitializer";
342 if (Init->isAnyMemberInitializer()) {
343 OS << ' ';
344 dumpBareDeclRef(Init->getAnyMember());
345 } else if (Init->isBaseInitializer()) {
346 dumpType(QualType(Init->getBaseClass(), 0));
347 } else if (Init->isDelegatingInitializer()) {
348 dumpType(Init->getTypeSourceInfo()->getType());
349 } else {
350 llvm_unreachable("Unknown initializer type");
351 }
352}
353
355 OS << "capture";
356 if (C.isByRef())
357 OS << " byref";
358 if (C.isNested())
359 OS << " nested";
360 if (C.getVariable()) {
361 OS << ' ';
362 dumpBareDeclRef(C.getVariable());
363 }
364}
365
367 if (!C) {
368 ColorScope Color(OS, ShowColors, NullColor);
369 OS << "<<<NULL>>> OMPClause";
370 return;
371 }
372 {
373 ColorScope Color(OS, ShowColors, AttrColor);
374 StringRef ClauseName(llvm::omp::getOpenMPClauseName(C->getClauseKind()));
375 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
376 << ClauseName.drop_front() << "Clause";
377 }
378 dumpPointer(C);
379 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
380 if (C->isImplicit())
381 OS << " <implicit>";
382}
383
385 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
386 if (TSI) {
387 OS << "case ";
388 dumpType(TSI->getType());
389 } else {
390 OS << "default";
391 }
392
393 if (A.isSelected())
394 OS << " selected";
395}
396
398 if (!R) {
399 ColorScope Color(OS, ShowColors, NullColor);
400 OS << "<<<NULL>>> ConceptReference";
401 return;
402 }
403
404 OS << "ConceptReference";
405 dumpPointer(R);
407 OS << ' ';
409}
410
412 if (!R) {
413 ColorScope Color(OS, ShowColors, NullColor);
414 OS << "<<<NULL>>> Requirement";
415 return;
416 }
417
418 {
419 ColorScope Color(OS, ShowColors, StmtColor);
420 switch (R->getKind()) {
422 OS << "TypeRequirement";
423 break;
425 OS << "SimpleRequirement";
426 break;
428 OS << "CompoundRequirement";
429 break;
431 OS << "NestedRequirement";
432 break;
433 }
434 }
435
436 dumpPointer(R);
437
438 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
439 if (ER->hasNoexceptRequirement())
440 OS << " noexcept";
441 }
442
443 if (R->isDependent())
444 OS << " dependent";
445 else
446 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
448 OS << " contains_unexpanded_pack";
449}
450
451static double GetApproxValue(const llvm::APFloat &F) {
452 llvm::APFloat V = F;
453 bool ignored;
454 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
455 &ignored);
456 return V.convertToDouble();
457}
458
459/// True if the \p APValue \p Value can be folded onto the current line.
460static bool isSimpleAPValue(const APValue &Value) {
461 switch (Value.getKind()) {
462 case APValue::None:
464 case APValue::Int:
465 case APValue::Float:
469 case APValue::LValue:
472 return true;
473 case APValue::Vector:
474 case APValue::Array:
475 case APValue::Struct:
476 return false;
477 case APValue::Union:
478 return isSimpleAPValue(Value.getUnionValue());
479 }
480 llvm_unreachable("unexpected APValue kind!");
481}
482
483/// Dump the children of the \p APValue \p Value.
484///
485/// \param[in] Value The \p APValue to visit
486/// \param[in] Ty The \p QualType passed to \p Visit
487///
488/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
489/// to one of the child of the \p APValue
490///
491/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
492/// the indices in the range \p [0,NumChildren(
493///
494/// \param[in] LabelSingular The label to use on a line with a single child
495/// \param[in] LabelPlurial The label to use on a line with multiple children
496void TextNodeDumper::dumpAPValueChildren(
497 const APValue &Value, QualType Ty,
498 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
499 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
500 // To save some vertical space we print up to MaxChildrenPerLine APValues
501 // considered to be simple (by isSimpleAPValue) on a single line.
502 constexpr unsigned MaxChildrenPerLine = 4;
503 unsigned I = 0;
504 while (I < NumChildren) {
505 unsigned J = I;
506 while (J < NumChildren) {
507 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
508 (J - I < MaxChildrenPerLine)) {
509 ++J;
510 continue;
511 }
512 break;
513 }
514
515 J = std::max(I + 1, J);
516
517 // Print [I,J) on a single line.
518 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
519 for (unsigned X = I; X < J; ++X) {
520 Visit(IdxToChildFun(Value, X), Ty);
521 if (X + 1 != J)
522 OS << ", ";
523 }
524 });
525 I = J;
526 }
527}
528
530 ColorScope Color(OS, ShowColors, ValueKindColor);
531 switch (Value.getKind()) {
532 case APValue::None:
533 OS << "None";
534 return;
536 OS << "Indeterminate";
537 return;
538 case APValue::Int:
539 OS << "Int ";
540 {
541 ColorScope Color(OS, ShowColors, ValueColor);
542 OS << Value.getInt();
543 }
544 return;
545 case APValue::Float:
546 OS << "Float ";
547 {
548 ColorScope Color(OS, ShowColors, ValueColor);
549 OS << GetApproxValue(Value.getFloat());
550 }
551 return;
553 OS << "FixedPoint ";
554 {
555 ColorScope Color(OS, ShowColors, ValueColor);
556 OS << Value.getFixedPoint();
557 }
558 return;
559 case APValue::Vector: {
560 unsigned VectorLength = Value.getVectorLength();
561 OS << "Vector length=" << VectorLength;
562
563 dumpAPValueChildren(
564 Value, Ty,
565 [](const APValue &Value, unsigned Index) -> const APValue & {
566 return Value.getVectorElt(Index);
567 },
568 VectorLength, "element", "elements");
569 return;
570 }
572 OS << "ComplexInt ";
573 {
574 ColorScope Color(OS, ShowColors, ValueColor);
575 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
576 << 'i';
577 }
578 return;
580 OS << "ComplexFloat ";
581 {
582 ColorScope Color(OS, ShowColors, ValueColor);
583 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
584 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
585 }
586 return;
587 case APValue::LValue:
588 (void)Context;
589 OS << "LValue <todo>";
590 return;
591 case APValue::Array: {
592 unsigned ArraySize = Value.getArraySize();
593 unsigned NumInitializedElements = Value.getArrayInitializedElts();
594 OS << "Array size=" << ArraySize;
595
596 dumpAPValueChildren(
597 Value, Ty,
598 [](const APValue &Value, unsigned Index) -> const APValue & {
599 return Value.getArrayInitializedElt(Index);
600 },
601 NumInitializedElements, "element", "elements");
602
603 if (Value.hasArrayFiller()) {
604 AddChild("filler", [=] {
605 {
606 ColorScope Color(OS, ShowColors, ValueColor);
607 OS << ArraySize - NumInitializedElements << " x ";
608 }
609 Visit(Value.getArrayFiller(), Ty);
610 });
611 }
612
613 return;
614 }
615 case APValue::Struct: {
616 OS << "Struct";
617
618 dumpAPValueChildren(
619 Value, Ty,
620 [](const APValue &Value, unsigned Index) -> const APValue & {
621 return Value.getStructBase(Index);
622 },
623 Value.getStructNumBases(), "base", "bases");
624
625 dumpAPValueChildren(
626 Value, Ty,
627 [](const APValue &Value, unsigned Index) -> const APValue & {
628 return Value.getStructField(Index);
629 },
630 Value.getStructNumFields(), "field", "fields");
631
632 return;
633 }
634 case APValue::Union: {
635 OS << "Union";
636 {
637 ColorScope Color(OS, ShowColors, ValueColor);
638 if (const FieldDecl *FD = Value.getUnionField())
639 OS << " ." << *cast<NamedDecl>(FD);
640 }
641 // If the union value is considered to be simple, fold it into the
642 // current line to save some vertical space.
643 const APValue &UnionValue = Value.getUnionValue();
644 if (isSimpleAPValue(UnionValue)) {
645 OS << ' ';
646 Visit(UnionValue, Ty);
647 } else {
648 AddChild([=] { Visit(UnionValue, Ty); });
649 }
650
651 return;
652 }
654 OS << "MemberPointer <todo>";
655 return;
657 OS << "AddrLabelDiff <todo>";
658 return;
659 }
660 llvm_unreachable("Unknown APValue kind!");
661}
662
663void TextNodeDumper::dumpPointer(const void *Ptr) {
664 ColorScope Color(OS, ShowColors, AddressColor);
665 OS << ' ' << Ptr;
666}
667
669 if (!SM)
670 return;
671
672 ColorScope Color(OS, ShowColors, LocationColor);
673 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
674
675 // The general format we print out is filename:line:col, but we drop pieces
676 // that haven't changed since the last loc printed.
677 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
678
679 if (PLoc.isInvalid()) {
680 OS << "<invalid sloc>";
681 return;
682 }
683
684 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
685 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
686 << PLoc.getColumn();
687 LastLocFilename = PLoc.getFilename();
688 LastLocLine = PLoc.getLine();
689 } else if (PLoc.getLine() != LastLocLine) {
690 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
691 LastLocLine = PLoc.getLine();
692 } else {
693 OS << "col" << ':' << PLoc.getColumn();
694 }
695}
696
698 // Can't translate locations if a SourceManager isn't available.
699 if (!SM)
700 return;
701
702 OS << " <";
704 if (R.getBegin() != R.getEnd()) {
705 OS << ", ";
706 dumpLocation(R.getEnd());
707 }
708 OS << ">";
709
710 // <t2.c:123:421[blah], t2.c:412:321>
711}
712
714 ColorScope Color(OS, ShowColors, TypeColor);
715
716 SplitQualType T_split = T.split();
717 std::string T_str = QualType::getAsString(T_split, PrintPolicy);
718 OS << "'" << T_str << "'";
719
720 if (Desugar && !T.isNull()) {
721 // If the type is sugared, also dump a (shallow) desugared type when
722 // it is visibly different.
724 if (T_split != D_split) {
725 std::string D_str = QualType::getAsString(D_split, PrintPolicy);
726 if (T_str != D_str)
727 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
728 }
729 }
730}
731
733 OS << ' ';
734 dumpBareType(T);
735}
736
738 if (!D) {
739 ColorScope Color(OS, ShowColors, NullColor);
740 OS << "<<<NULL>>>";
741 return;
742 }
743
744 {
745 ColorScope Color(OS, ShowColors, DeclKindNameColor);
746 OS << D->getDeclKindName();
747 }
748 dumpPointer(D);
749
750 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
751 ColorScope Color(OS, ShowColors, DeclNameColor);
752 OS << " '" << ND->getDeclName() << '\'';
753 }
754
755 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
756 dumpType(VD->getType());
757}
758
760 if (ND->getDeclName()) {
761 ColorScope Color(OS, ShowColors, DeclNameColor);
762 OS << ' ' << ND->getDeclName();
763 }
764}
765
767 const auto AccessSpelling = getAccessSpelling(AS);
768 if (AccessSpelling.empty())
769 return;
770 OS << AccessSpelling;
771}
772
775 if (auto *BD = C.dyn_cast<BlockDecl *>())
776 dumpDeclRef(BD, "cleanup");
777 else if (auto *CLE = C.dyn_cast<CompoundLiteralExpr *>())
778 AddChild([=] {
779 OS << "cleanup ";
780 {
781 ColorScope Color(OS, ShowColors, StmtColor);
782 OS << CLE->getStmtClassName();
783 }
784 dumpPointer(CLE);
785 });
786 else
787 llvm_unreachable("unexpected cleanup type");
788}
789
792 switch (TSK) {
793 case TSK_Undeclared:
794 break;
796 OS << " implicit_instantiation";
797 break;
799 OS << " explicit_specialization";
800 break;
802 OS << " explicit_instantiation_declaration";
803 break;
805 OS << " explicit_instantiation_definition";
806 break;
807 }
808}
809
811 if (!NNS)
812 return;
813
814 AddChild([=] {
815 OS << "NestedNameSpecifier";
816
817 switch (NNS->getKind()) {
818 case NestedNameSpecifier::Identifier:
819 OS << " Identifier";
820 OS << " '" << NNS->getAsIdentifier()->getName() << "'";
821 break;
822 case NestedNameSpecifier::Namespace:
823 OS << " "; // "Namespace" is printed as the decl kind.
824 dumpBareDeclRef(NNS->getAsNamespace());
825 break;
826 case NestedNameSpecifier::NamespaceAlias:
827 OS << " "; // "NamespaceAlias" is printed as the decl kind.
828 dumpBareDeclRef(NNS->getAsNamespaceAlias());
829 break;
830 case NestedNameSpecifier::TypeSpec:
831 OS << " TypeSpec";
832 dumpType(QualType(NNS->getAsType(), 0));
833 break;
834 case NestedNameSpecifier::TypeSpecWithTemplate:
835 OS << " TypeSpecWithTemplate";
836 dumpType(QualType(NNS->getAsType(), 0));
837 break;
838 case NestedNameSpecifier::Global:
839 OS << " Global";
840 break;
841 case NestedNameSpecifier::Super:
842 OS << " Super";
843 break;
844 }
845
846 dumpNestedNameSpecifier(NNS->getPrefix());
847 });
848}
849
850void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
851 if (!D)
852 return;
853
854 AddChild([=] {
855 if (!Label.empty())
856 OS << Label << ' ';
858 });
859}
860
861const char *TextNodeDumper::getCommandName(unsigned CommandID) {
862 if (Traits)
863 return Traits->getCommandInfo(CommandID)->Name;
864 const comments::CommandInfo *Info =
866 if (Info)
867 return Info->Name;
868 return "<not a builtin command>";
869}
870
871void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
872#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
873 if (FPO.has##NAME##Override()) \
874 OS << " " #NAME "=" << FPO.get##NAME##Override();
875#include "clang/Basic/FPOptions.def"
876}
877
879 const comments::FullComment *) {
880 OS << " Text=\"" << C->getText() << "\"";
881}
882
885 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
886 switch (C->getRenderKind()) {
888 OS << " RenderNormal";
889 break;
891 OS << " RenderBold";
892 break;
894 OS << " RenderMonospaced";
895 break;
897 OS << " RenderEmphasized";
898 break;
900 OS << " RenderAnchor";
901 break;
902 }
903
904 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
905 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
906}
907
910 OS << " Name=\"" << C->getTagName() << "\"";
911 if (C->getNumAttrs() != 0) {
912 OS << " Attrs: ";
913 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
915 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
916 }
917 }
918 if (C->isSelfClosing())
919 OS << " SelfClosing";
920}
921
924 OS << " Name=\"" << C->getTagName() << "\"";
925}
926
929 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
930 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
931 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
932}
933
936 OS << " "
938
939 if (C->isDirectionExplicit())
940 OS << " explicitly";
941 else
942 OS << " implicitly";
943
944 if (C->hasParamName()) {
945 if (C->isParamIndexValid())
946 OS << " Param=\"" << C->getParamName(FC) << "\"";
947 else
948 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
949 }
950
951 if (C->isParamIndexValid() && !C->isVarArgParam())
952 OS << " ParamIndex=" << C->getParamIndex();
953}
954
957 if (C->hasParamName()) {
958 if (C->isPositionValid())
959 OS << " Param=\"" << C->getParamName(FC) << "\"";
960 else
961 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
962 }
963
964 if (C->isPositionValid()) {
965 OS << " Position=<";
966 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
967 OS << C->getIndex(i);
968 if (i != e - 1)
969 OS << ", ";
970 }
971 OS << ">";
972 }
973}
974
977 OS << " Name=\"" << getCommandName(C->getCommandID())
978 << "\""
979 " CloseName=\""
980 << C->getCloseName() << "\"";
981}
982
985 const comments::FullComment *) {
986 OS << " Text=\"" << C->getText() << "\"";
987}
988
991 OS << " Text=\"" << C->getText() << "\"";
992}
993
995 OS << " null";
996}
997
999 OS << " type";
1000 dumpType(TA.getAsType());
1001}
1002
1004 const TemplateArgument &TA) {
1005 OS << " decl";
1006 dumpDeclRef(TA.getAsDecl());
1007}
1008
1010 OS << " nullptr";
1011}
1012
1014 OS << " integral " << TA.getAsIntegral();
1015}
1016
1019 OS << " using";
1020 OS << " template ";
1021 TA.getAsTemplate().dump(OS);
1022}
1023
1025 const TemplateArgument &TA) {
1028 OS << " using";
1029 OS << " template expansion ";
1031}
1032
1034 OS << " expr";
1035}
1036
1038 OS << " pack";
1039}
1040
1041static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1042 if (Node->path_empty())
1043 return;
1044
1045 OS << " (";
1046 bool First = true;
1047 for (CastExpr::path_const_iterator I = Node->path_begin(),
1048 E = Node->path_end();
1049 I != E; ++I) {
1050 const CXXBaseSpecifier *Base = *I;
1051 if (!First)
1052 OS << " -> ";
1053
1054 const auto *RD =
1055 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
1056
1057 if (Base->isVirtual())
1058 OS << "virtual ";
1059 OS << RD->getName();
1060 First = false;
1061 }
1062
1063 OS << ')';
1064}
1065
1067 if (Node->hasInitStorage())
1068 OS << " has_init";
1069 if (Node->hasVarStorage())
1070 OS << " has_var";
1071 if (Node->hasElseStorage())
1072 OS << " has_else";
1073 if (Node->isConstexpr())
1074 OS << " constexpr";
1075 if (Node->isConsteval()) {
1076 OS << " ";
1077 if (Node->isNegatedConsteval())
1078 OS << "!";
1079 OS << "consteval";
1080 }
1081}
1082
1084 if (Node->hasInitStorage())
1085 OS << " has_init";
1086 if (Node->hasVarStorage())
1087 OS << " has_var";
1088}
1089
1091 if (Node->hasVarStorage())
1092 OS << " has_var";
1093}
1094
1096 OS << " '" << Node->getName() << "'";
1097 if (Node->isSideEntry())
1098 OS << " side_entry";
1099}
1100
1102 OS << " '" << Node->getLabel()->getName() << "'";
1103 dumpPointer(Node->getLabel());
1104}
1105
1107 if (Node->caseStmtIsGNURange())
1108 OS << " gnu_range";
1109}
1110
1112 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1113 OS << " nrvo_candidate(";
1114 dumpBareDeclRef(Cand);
1115 OS << ")";
1116 }
1117}
1118
1120 if (Node->isImplicit())
1121 OS << " implicit";
1122}
1123
1125 if (Node->isImplicit())
1126 OS << " implicit";
1127}
1128
1130 if (Node->hasAPValueResult())
1131 AddChild("value",
1132 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1133}
1134
1136 if (Node->usesADL())
1137 OS << " adl";
1138 if (Node->hasStoredFPFeatures())
1139 printFPOptions(Node->getFPFeatures());
1140}
1141
1143 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1144 if (OperatorSpelling)
1145 OS << " '" << OperatorSpelling << "'";
1146
1148}
1149
1151 OS << " <";
1152 {
1153 ColorScope Color(OS, ShowColors, CastColor);
1154 OS << Node->getCastKindName();
1155 }
1156 dumpBasePath(OS, Node);
1157 OS << ">";
1158 if (Node->hasStoredFPFeatures())
1159 printFPOptions(Node->getFPFeatures());
1160}
1161
1164 if (Node->isPartOfExplicitCast())
1165 OS << " part_of_explicit_cast";
1166}
1167
1169 OS << " ";
1170 dumpBareDeclRef(Node->getDecl());
1171 dumpNestedNameSpecifier(Node->getQualifier());
1172 if (Node->getDecl() != Node->getFoundDecl()) {
1173 OS << " (";
1174 dumpBareDeclRef(Node->getFoundDecl());
1175 OS << ")";
1176 }
1177 switch (Node->isNonOdrUse()) {
1178 case NOUR_None: break;
1179 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1180 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1181 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1182 }
1183 if (Node->refersToEnclosingVariableOrCapture())
1184 OS << " refers_to_enclosing_variable_or_capture";
1185 if (Node->isImmediateEscalating())
1186 OS << " immediate-escalating";
1187}
1188
1191
1192 dumpNestedNameSpecifier(Node->getQualifier());
1193}
1194
1196 const UnresolvedLookupExpr *Node) {
1197 OS << " (";
1198 if (!Node->requiresADL())
1199 OS << "no ";
1200 OS << "ADL) = '" << Node->getName() << '\'';
1201
1202 UnresolvedLookupExpr::decls_iterator I = Node->decls_begin(),
1203 E = Node->decls_end();
1204 if (I == E)
1205 OS << " empty";
1206 for (; I != E; ++I)
1207 dumpPointer(*I);
1208}
1209
1211 {
1212 ColorScope Color(OS, ShowColors, DeclKindNameColor);
1213 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1214 }
1215 OS << "='" << *Node->getDecl() << "'";
1216 dumpPointer(Node->getDecl());
1217 if (Node->isFreeIvar())
1218 OS << " isFreeIvar";
1219}
1220
1223 dumpType(Node->getTypeSourceInfo()->getType());
1224}
1225
1227 OS << " " << PredefinedExpr::getIdentKindName(Node->getIdentKind());
1228}
1229
1231 ColorScope Color(OS, ShowColors, ValueColor);
1232 OS << " " << Node->getValue();
1233}
1234
1236 bool isSigned = Node->getType()->isSignedIntegerType();
1237 ColorScope Color(OS, ShowColors, ValueColor);
1238 OS << " " << toString(Node->getValue(), 10, isSigned);
1239}
1240
1242 ColorScope Color(OS, ShowColors, ValueColor);
1243 OS << " " << Node->getValueAsString(/*Radix=*/10);
1244}
1245
1247 ColorScope Color(OS, ShowColors, ValueColor);
1248 OS << " " << Node->getValueAsApproximateDouble();
1249}
1250
1252 ColorScope Color(OS, ShowColors, ValueColor);
1253 OS << " ";
1254 Str->outputString(OS);
1255}
1256
1258 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1259 OS << " field ";
1260 dumpBareDeclRef(Field);
1261 }
1262}
1263
1265 if (E->isResultDependent())
1266 OS << " result_dependent";
1267}
1268
1270 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1271 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1272 if (!Node->canOverflow())
1273 OS << " cannot overflow";
1274 if (Node->hasStoredFPFeatures())
1275 printFPOptions(Node->getStoredFPFeatures());
1276}
1277
1280 OS << " " << getTraitSpelling(Node->getKind());
1281
1282 if (Node->isArgumentType())
1283 dumpType(Node->getArgumentType());
1284}
1285
1287 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1288 dumpPointer(Node->getMemberDecl());
1289 dumpNestedNameSpecifier(Node->getQualifier());
1290 switch (Node->isNonOdrUse()) {
1291 case NOUR_None: break;
1292 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1293 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1294 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1295 }
1296}
1297
1299 const ExtVectorElementExpr *Node) {
1300 OS << " " << Node->getAccessor().getNameStart();
1301}
1302
1304 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1305 if (Node->hasStoredFPFeatures())
1306 printFPOptions(Node->getStoredFPFeatures());
1307}
1308
1311 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1312 << "' ComputeLHSTy=";
1313 dumpBareType(Node->getComputationLHSType());
1314 OS << " ComputeResultTy=";
1315 dumpBareType(Node->getComputationResultType());
1316 if (Node->hasStoredFPFeatures())
1317 printFPOptions(Node->getStoredFPFeatures());
1318}
1319
1321 OS << " " << Node->getLabel()->getName();
1322 dumpPointer(Node->getLabel());
1323}
1324
1326 OS << " " << Node->getCastName() << "<"
1327 << Node->getTypeAsWritten().getAsString() << ">"
1328 << " <" << Node->getCastKindName();
1329 dumpBasePath(OS, Node);
1330 OS << ">";
1331}
1332
1334 OS << " " << (Node->getValue() ? "true" : "false");
1335}
1336
1338 if (Node->isImplicit())
1339 OS << " implicit";
1340 OS << " this";
1341}
1342
1344 const CXXFunctionalCastExpr *Node) {
1345 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1346 << Node->getCastKindName() << ">";
1347 if (Node->hasStoredFPFeatures())
1348 printFPOptions(Node->getFPFeatures());
1349}
1350
1353 if (Node->hasStoredFPFeatures())
1354 printFPOptions(Node->getFPFeatures());
1355}
1356
1359 dumpType(Node->getTypeAsWritten());
1360 if (Node->isListInitialization())
1361 OS << " list";
1362}
1363
1365 CXXConstructorDecl *Ctor = Node->getConstructor();
1366 dumpType(Ctor->getType());
1367 if (Node->isElidable())
1368 OS << " elidable";
1369 if (Node->isListInitialization())
1370 OS << " list";
1371 if (Node->isStdInitListInitialization())
1372 OS << " std::initializer_list";
1373 if (Node->requiresZeroInitialization())
1374 OS << " zeroing";
1375 if (Node->isImmediateEscalating())
1376 OS << " immediate-escalating";
1377}
1378
1380 const CXXBindTemporaryExpr *Node) {
1381 OS << " (CXXTemporary";
1383 OS << ")";
1384}
1385
1387 if (Node->isGlobalNew())
1388 OS << " global";
1389 if (Node->isArray())
1390 OS << " array";
1391 if (Node->getOperatorNew()) {
1392 OS << ' ';
1393 dumpBareDeclRef(Node->getOperatorNew());
1394 }
1395 // We could dump the deallocation function used in case of error, but it's
1396 // usually not that interesting.
1397}
1398
1400 if (Node->isGlobalDelete())
1401 OS << " global";
1402 if (Node->isArrayForm())
1403 OS << " array";
1404 if (Node->getOperatorDelete()) {
1405 OS << ' ';
1406 dumpBareDeclRef(Node->getOperatorDelete());
1407 }
1408}
1409
1411 OS << " " << getTraitSpelling(Node->getTrait());
1412}
1413
1415 OS << " " << getTraitSpelling(Node->getTrait());
1416}
1417
1419 OS << " " << getTraitSpelling(Node->getTrait());
1420}
1421
1423 if (Node->hasRewrittenInit()) {
1424 OS << " has rewritten init";
1425 AddChild([=] {
1426 ColorScope Color(OS, ShowColors, StmtColor);
1427 Visit(Node->getExpr());
1428 });
1429 }
1430}
1431
1433 if (Node->hasRewrittenInit()) {
1434 OS << " has rewritten init";
1435 AddChild([=] {
1436 ColorScope Color(OS, ShowColors, StmtColor);
1437 Visit(Node->getExpr());
1438 });
1439 }
1440}
1441
1444 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1445 OS << " extended by ";
1446 dumpBareDeclRef(VD);
1447 }
1448}
1449
1451 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1452 dumpCleanupObject(Node->getObject(i));
1453}
1454
1456 dumpPointer(Node->getPack());
1457 dumpName(Node->getPack());
1458}
1459
1462 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1463}
1464
1466 OS << " selector=";
1467 Node->getSelector().print(OS);
1468 switch (Node->getReceiverKind()) {
1470 break;
1471
1473 OS << " class=";
1474 dumpBareType(Node->getClassReceiver());
1475 break;
1476
1478 OS << " super (instance)";
1479 break;
1480
1482 OS << " super (class)";
1483 break;
1484 }
1485}
1486
1488 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1489 OS << " selector=";
1490 BoxingMethod->getSelector().print(OS);
1491 }
1492}
1493
1495 if (!Node->getCatchParamDecl())
1496 OS << " catch all";
1497}
1498
1500 dumpType(Node->getEncodedType());
1501}
1502
1504 OS << " ";
1505 Node->getSelector().print(OS);
1506}
1507
1509 OS << ' ' << *Node->getProtocol();
1510}
1511
1513 if (Node->isImplicitProperty()) {
1514 OS << " Kind=MethodRef Getter=\"";
1515 if (Node->getImplicitPropertyGetter())
1516 Node->getImplicitPropertyGetter()->getSelector().print(OS);
1517 else
1518 OS << "(null)";
1519
1520 OS << "\" Setter=\"";
1521 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
1522 Setter->getSelector().print(OS);
1523 else
1524 OS << "(null)";
1525 OS << "\"";
1526 } else {
1527 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
1528 << '"';
1529 }
1530
1531 if (Node->isSuperReceiver())
1532 OS << " super";
1533
1534 OS << " Messaging=";
1535 if (Node->isMessagingGetter() && Node->isMessagingSetter())
1536 OS << "Getter&Setter";
1537 else if (Node->isMessagingGetter())
1538 OS << "Getter";
1539 else if (Node->isMessagingSetter())
1540 OS << "Setter";
1541}
1542
1544 const ObjCSubscriptRefExpr *Node) {
1545 if (Node->isArraySubscriptRefExpr())
1546 OS << " Kind=ArraySubscript GetterForArray=\"";
1547 else
1548 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
1549 if (Node->getAtIndexMethodDecl())
1550 Node->getAtIndexMethodDecl()->getSelector().print(OS);
1551 else
1552 OS << "(null)";
1553
1554 if (Node->isArraySubscriptRefExpr())
1555 OS << "\" SetterForArray=\"";
1556 else
1557 OS << "\" SetterForDictionary=\"";
1558 if (Node->setAtIndexMethodDecl())
1559 Node->setAtIndexMethodDecl()->getSelector().print(OS);
1560 else
1561 OS << "(null)";
1562}
1563
1565 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
1566}
1567
1569 OS << " ";
1570 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
1571 Visit(Node->getIteratorDecl(I));
1572 OS << " = ";
1573 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
1574 OS << " begin ";
1575 Visit(Range.Begin);
1576 OS << " end ";
1577 Visit(Range.End);
1578 if (Range.Step) {
1579 OS << " step ";
1580 Visit(Range.Step);
1581 }
1582 }
1583}
1584
1587 OS << " ";
1588 dumpBareDeclRef(Node->getFoundDecl());
1589}
1590
1592 const RequiresExpr *Node) {
1593 if (!Node->isValueDependent())
1594 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
1595}
1596
1598 if (T->isSpelledAsLValue())
1599 OS << " written as lvalue reference";
1600}
1601
1603 switch (T->getSizeModifier()) {
1605 break;
1607 OS << " static";
1608 break;
1610 OS << " *";
1611 break;
1612 }
1613 OS << " " << T->getIndexTypeQualifiers().getAsString();
1614}
1615
1617 OS << " " << T->getSize();
1618 VisitArrayType(T);
1619}
1620
1622 OS << " ";
1624 VisitArrayType(T);
1625}
1626
1628 const DependentSizedArrayType *T) {
1629 VisitArrayType(T);
1630 OS << " ";
1632}
1633
1635 const DependentSizedExtVectorType *T) {
1636 OS << " ";
1638}
1639
1641 switch (T->getVectorKind()) {
1643 break;
1645 OS << " altivec";
1646 break;
1648 OS << " altivec pixel";
1649 break;
1651 OS << " altivec bool";
1652 break;
1653 case VectorKind::Neon:
1654 OS << " neon";
1655 break;
1657 OS << " neon poly";
1658 break;
1660 OS << " fixed-length sve data vector";
1661 break;
1663 OS << " fixed-length sve predicate vector";
1664 break;
1666 OS << " fixed-length rvv data vector";
1667 break;
1669 OS << " fixed-length rvv mask vector";
1670 break;
1671 }
1672 OS << " " << T->getNumElements();
1673}
1674
1676 auto EI = T->getExtInfo();
1677 if (EI.getNoReturn())
1678 OS << " noreturn";
1679 if (EI.getProducesResult())
1680 OS << " produces_result";
1681 if (EI.getHasRegParm())
1682 OS << " regparm " << EI.getRegParm();
1683 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
1684}
1685
1687 auto EPI = T->getExtProtoInfo();
1688 if (EPI.HasTrailingReturn)
1689 OS << " trailing_return";
1690 if (T->isConst())
1691 OS << " const";
1692 if (T->isVolatile())
1693 OS << " volatile";
1694 if (T->isRestrict())
1695 OS << " restrict";
1696 if (T->getExtProtoInfo().Variadic)
1697 OS << " variadic";
1698 switch (EPI.RefQualifier) {
1699 case RQ_None:
1700 break;
1701 case RQ_LValue:
1702 OS << " &";
1703 break;
1704 case RQ_RValue:
1705 OS << " &&";
1706 break;
1707 }
1708
1709 switch (EPI.ExceptionSpec.Type) {
1710 case EST_None:
1711 break;
1712 case EST_DynamicNone:
1713 OS << " exceptionspec_dynamic_none";
1714 break;
1715 case EST_Dynamic:
1716 OS << " exceptionspec_dynamic";
1717 break;
1718 case EST_MSAny:
1719 OS << " exceptionspec_ms_any";
1720 break;
1721 case EST_NoThrow:
1722 OS << " exceptionspec_nothrow";
1723 break;
1724 case EST_BasicNoexcept:
1725 OS << " exceptionspec_basic_noexcept";
1726 break;
1728 OS << " exceptionspec_dependent_noexcept";
1729 break;
1730 case EST_NoexceptFalse:
1731 OS << " exceptionspec_noexcept_false";
1732 break;
1733 case EST_NoexceptTrue:
1734 OS << " exceptionspec_noexcept_true";
1735 break;
1736 case EST_Unevaluated:
1737 OS << " exceptionspec_unevaluated";
1738 break;
1739 case EST_Uninstantiated:
1740 OS << " exceptionspec_uninstantiated";
1741 break;
1742 case EST_Unparsed:
1743 OS << " exceptionspec_unparsed";
1744 break;
1745 }
1746 if (!EPI.ExceptionSpec.Exceptions.empty()) {
1747 AddChild([=] {
1748 OS << "Exceptions:";
1749 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
1750 ++I) {
1751 if (I)
1752 OS << ",";
1753 dumpType(EPI.ExceptionSpec.Exceptions[I]);
1754 }
1755 });
1756 }
1757 if (EPI.ExceptionSpec.NoexceptExpr) {
1758 AddChild([=] {
1759 OS << "NoexceptExpr: ";
1760 Visit(EPI.ExceptionSpec.NoexceptExpr);
1761 });
1762 }
1763 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
1764 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
1765
1766 // FIXME: Consumed parameters.
1768}
1769
1771 dumpDeclRef(T->getDecl());
1772}
1773
1776 if (!T->typeMatchesDecl())
1777 OS << " divergent";
1778}
1779
1781 dumpDeclRef(T->getDecl());
1782 if (!T->typeMatchesDecl())
1783 OS << " divergent";
1784}
1785
1787 switch (T->getUTTKind()) {
1788#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
1789 case UnaryTransformType::Enum: \
1790 OS << " " #Trait; \
1791 break;
1792#include "clang/Basic/TransformTypeTraits.def"
1793 }
1794}
1795
1797 dumpDeclRef(T->getDecl());
1798}
1799
1801 OS << " depth " << T->getDepth() << " index " << T->getIndex();
1802 if (T->isParameterPack())
1803 OS << " pack";
1804 dumpDeclRef(T->getDecl());
1805}
1806
1808 const SubstTemplateTypeParmType *T) {
1811 if (auto PackIndex = T->getPackIndex())
1812 OS << " pack_index " << *PackIndex;
1813}
1814
1819}
1820
1822 if (T->isDecltypeAuto())
1823 OS << " decltype(auto)";
1824 if (!T->isDeduced())
1825 OS << " undeduced";
1826 if (T->isConstrained())
1828}
1829
1833 OS << " using";
1834}
1835
1837 const TemplateSpecializationType *T) {
1838 if (T->isTypeAlias())
1839 OS << " alias";
1841 OS << " using";
1842 OS << " ";
1843 T->getTemplateName().dump(OS);
1844}
1845
1847 const InjectedClassNameType *T) {
1848 dumpDeclRef(T->getDecl());
1849}
1850
1852 dumpDeclRef(T->getDecl());
1853}
1854
1856 if (auto N = T->getNumExpansions())
1857 OS << " expansions " << *N;
1858}
1859
1861 // By default, add extra Type details with no extra loc info.
1863}
1864// FIXME: override behavior for TypeLocs that have interesting location
1865// information, such as the qualifier in ElaboratedTypeLoc.
1866
1868
1870 dumpName(D);
1872 if (D->isModulePrivate())
1873 OS << " __module_private__";
1874}
1875
1877 if (D->isScoped()) {
1878 if (D->isScopedUsingClassTag())
1879 OS << " class";
1880 else
1881 OS << " struct";
1882 }
1883 dumpName(D);
1884 if (D->isModulePrivate())
1885 OS << " __module_private__";
1886 if (D->isFixed())
1888}
1889
1891 OS << ' ' << D->getKindName();
1892 dumpName(D);
1893 if (D->isModulePrivate())
1894 OS << " __module_private__";
1895 if (D->isCompleteDefinition())
1896 OS << " definition";
1897}
1898
1900 dumpName(D);
1901 dumpType(D->getType());
1902}
1903
1905 dumpName(D);
1906 dumpType(D->getType());
1907
1908 for (const auto *Child : D->chain())
1909 dumpDeclRef(Child);
1910}
1911
1913 dumpName(D);
1914 dumpType(D->getType());
1916
1917 StorageClass SC = D->getStorageClass();
1918 if (SC != SC_None)
1920 if (D->isInlineSpecified())
1921 OS << " inline";
1922 if (D->isVirtualAsWritten())
1923 OS << " virtual";
1924 if (D->isModulePrivate())
1925 OS << " __module_private__";
1926
1927 if (D->isPureVirtual())
1928 OS << " pure";
1929 if (D->isDefaulted()) {
1930 OS << " default";
1931 if (D->isDeleted())
1932 OS << "_delete";
1933 }
1934 if (D->isDeletedAsWritten())
1935 OS << " delete";
1936 if (D->isTrivial())
1937 OS << " trivial";
1938
1940 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
1941
1942 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
1943 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
1944 switch (EPI.ExceptionSpec.Type) {
1945 default:
1946 break;
1947 case EST_Unevaluated:
1948 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
1949 break;
1950 case EST_Uninstantiated:
1951 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
1952 break;
1953 }
1954 }
1955
1956 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
1957 if (MD->size_overridden_methods() != 0) {
1958 auto dumpOverride = [=](const CXXMethodDecl *D) {
1959 SplitQualType T_split = D->getType().split();
1960 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
1961 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
1962 };
1963
1964 AddChild([=] {
1965 auto Overrides = MD->overridden_methods();
1966 OS << "Overrides: [ ";
1967 dumpOverride(*Overrides.begin());
1968 for (const auto *Override : llvm::drop_begin(Overrides)) {
1969 OS << ", ";
1970 dumpOverride(Override);
1971 }
1972 OS << " ]";
1973 });
1974 }
1975 }
1976
1977 if (!D->isInlineSpecified() && D->isInlined()) {
1978 OS << " implicit-inline";
1979 }
1980 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
1981 // the Params are set later, it is possible for a dump during debugging to
1982 // encounter a FunctionDecl that has been created but hasn't been assigned
1983 // ParmVarDecls yet.
1984 if (!D->param_empty() && !D->param_begin())
1985 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
1986
1987 if (const auto *Instance = D->getInstantiatedFromMemberFunction()) {
1988 OS << " instantiated_from";
1989 dumpPointer(Instance);
1990 }
1991}
1992
1995 OS << " extended by ";
1997 OS << " mangling ";
1998 {
1999 ColorScope Color(OS, ShowColors, ValueColor);
2000 OS << D->getManglingNumber();
2001 }
2002}
2003
2005 dumpName(D);
2006 dumpType(D->getType());
2007 if (D->isMutable())
2008 OS << " mutable";
2009 if (D->isModulePrivate())
2010 OS << " __module_private__";
2011}
2012
2015 dumpName(D);
2016 if (const auto *P = dyn_cast<ParmVarDecl>(D);
2017 P && P->isExplicitObjectParameter())
2018 OS << " this";
2019
2020 dumpType(D->getType());
2022 StorageClass SC = D->getStorageClass();
2023 if (SC != SC_None)
2025 switch (D->getTLSKind()) {
2026 case VarDecl::TLS_None:
2027 break;
2029 OS << " tls";
2030 break;
2032 OS << " tls_dynamic";
2033 break;
2034 }
2035 if (D->isModulePrivate())
2036 OS << " __module_private__";
2037 if (D->isNRVOVariable())
2038 OS << " nrvo";
2039 if (D->isInline())
2040 OS << " inline";
2041 if (D->isConstexpr())
2042 OS << " constexpr";
2043 if (D->hasInit()) {
2044 switch (D->getInitStyle()) {
2045 case VarDecl::CInit:
2046 OS << " cinit";
2047 break;
2048 case VarDecl::CallInit:
2049 OS << " callinit";
2050 break;
2051 case VarDecl::ListInit:
2052 OS << " listinit";
2053 break;
2055 OS << " parenlistinit";
2056 }
2057 }
2058 if (D->needsDestruction(D->getASTContext()))
2059 OS << " destroyed";
2060 if (D->isParameterPack())
2061 OS << " pack";
2062
2063 if (D->hasInit()) {
2064 const Expr *E = D->getInit();
2065 // Only dump the value of constexpr VarDecls for now.
2066 if (E && !E->isValueDependent() && D->isConstexpr() &&
2067 !D->getType()->isDependentType()) {
2068 const APValue *Value = D->evaluateValue();
2069 if (Value)
2070 AddChild("value", [=] { Visit(*Value, E->getType()); });
2071 }
2072 }
2073}
2074
2076 dumpName(D);
2077 dumpType(D->getType());
2078}
2079
2081 if (D->isNothrow())
2082 OS << " nothrow";
2083}
2084
2086 OS << ' ' << D->getImportedModule()->getFullModuleName();
2087
2088 for (Decl *InitD :
2090 dumpDeclRef(InitD, "initializer");
2091}
2092
2094 OS << ' ';
2095 switch (D->getCommentKind()) {
2096 case PCK_Unknown:
2097 llvm_unreachable("unexpected pragma comment kind");
2098 case PCK_Compiler:
2099 OS << "compiler";
2100 break;
2101 case PCK_ExeStr:
2102 OS << "exestr";
2103 break;
2104 case PCK_Lib:
2105 OS << "lib";
2106 break;
2107 case PCK_Linker:
2108 OS << "linker";
2109 break;
2110 case PCK_User:
2111 OS << "user";
2112 break;
2113 }
2114 StringRef Arg = D->getArg();
2115 if (!Arg.empty())
2116 OS << " \"" << Arg << "\"";
2117}
2118
2120 const PragmaDetectMismatchDecl *D) {
2121 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2122}
2123
2125 const OMPExecutableDirective *D) {
2126 if (D->isStandaloneDirective())
2127 OS << " openmp_standalone_directive";
2128}
2129
2131 const OMPDeclareReductionDecl *D) {
2132 dumpName(D);
2133 dumpType(D->getType());
2134 OS << " combiner";
2136 if (const auto *Initializer = D->getInitializer()) {
2137 OS << " initializer";
2139 switch (D->getInitializerKind()) {
2141 OS << " omp_priv = ";
2142 break;
2144 OS << " omp_priv ()";
2145 break;
2147 break;
2148 }
2149 }
2150}
2151
2153 for (const auto *C : D->clauselists()) {
2154 AddChild([=] {
2155 if (!C) {
2156 ColorScope Color(OS, ShowColors, NullColor);
2157 OS << "<<<NULL>>> OMPClause";
2158 return;
2159 }
2160 {
2161 ColorScope Color(OS, ShowColors, AttrColor);
2162 StringRef ClauseName(
2163 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2164 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2165 << ClauseName.drop_front() << "Clause";
2166 }
2167 dumpPointer(C);
2168 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2169 });
2170 }
2171}
2172
2174 dumpName(D);
2175 dumpType(D->getType());
2176}
2177
2179 dumpName(D);
2180 if (D->isInline())
2181 OS << " inline";
2182 if (D->isNested())
2183 OS << " nested";
2184 if (!D->isOriginalNamespace())
2185 dumpDeclRef(D->getOriginalNamespace(), "original");
2186}
2187
2189 OS << ' ';
2191}
2192
2194 dumpName(D);
2196}
2197
2199 dumpName(D);
2201}
2202
2204 const TypeAliasTemplateDecl *D) {
2205 dumpName(D);
2206}
2207
2209 VisitRecordDecl(D);
2210 if (const auto *Instance = D->getInstantiatedFromMemberClass()) {
2211 OS << " instantiated_from";
2212 dumpPointer(Instance);
2213 }
2214 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D))
2215 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2216
2218
2219 if (!D->isCompleteDefinition())
2220 return;
2221
2222 AddChild([=] {
2223 {
2224 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2225 OS << "DefinitionData";
2226 }
2227#define FLAG(fn, name) \
2228 if (D->fn()) \
2229 OS << " " #name;
2230 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2231
2232 FLAG(isGenericLambda, generic);
2233 FLAG(isLambda, lambda);
2234
2235 FLAG(isAnonymousStructOrUnion, is_anonymous);
2236 FLAG(canPassInRegisters, pass_in_registers);
2237 FLAG(isEmpty, empty);
2238 FLAG(isAggregate, aggregate);
2239 FLAG(isStandardLayout, standard_layout);
2240 FLAG(isTriviallyCopyable, trivially_copyable);
2241 FLAG(isPOD, pod);
2242 FLAG(isTrivial, trivial);
2243 FLAG(isPolymorphic, polymorphic);
2244 FLAG(isAbstract, abstract);
2245 FLAG(isLiteral, literal);
2246
2247 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2248 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2249 FLAG(hasMutableFields, has_mutable_fields);
2250 FLAG(hasVariantMembers, has_variant_members);
2251 FLAG(allowConstDefaultInit, can_const_default_init);
2252
2253 AddChild([=] {
2254 {
2255 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2256 OS << "DefaultConstructor";
2257 }
2258 FLAG(hasDefaultConstructor, exists);
2259 FLAG(hasTrivialDefaultConstructor, trivial);
2260 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2261 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2262 FLAG(hasConstexprDefaultConstructor, constexpr);
2263 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2264 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2265 });
2266
2267 AddChild([=] {
2268 {
2269 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2270 OS << "CopyConstructor";
2271 }
2272 FLAG(hasSimpleCopyConstructor, simple);
2273 FLAG(hasTrivialCopyConstructor, trivial);
2274 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2275 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2276 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2277 FLAG(needsImplicitCopyConstructor, needs_implicit);
2278 FLAG(needsOverloadResolutionForCopyConstructor,
2279 needs_overload_resolution);
2281 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2282 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2283 });
2284
2285 AddChild([=] {
2286 {
2287 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2288 OS << "MoveConstructor";
2289 }
2290 FLAG(hasMoveConstructor, exists);
2291 FLAG(hasSimpleMoveConstructor, simple);
2292 FLAG(hasTrivialMoveConstructor, trivial);
2293 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2294 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2295 FLAG(needsImplicitMoveConstructor, needs_implicit);
2296 FLAG(needsOverloadResolutionForMoveConstructor,
2297 needs_overload_resolution);
2299 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2300 });
2301
2302 AddChild([=] {
2303 {
2304 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2305 OS << "CopyAssignment";
2306 }
2307 FLAG(hasSimpleCopyAssignment, simple);
2308 FLAG(hasTrivialCopyAssignment, trivial);
2309 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2310 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2311 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2312 FLAG(needsImplicitCopyAssignment, needs_implicit);
2313 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2314 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2315 });
2316
2317 AddChild([=] {
2318 {
2319 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2320 OS << "MoveAssignment";
2321 }
2322 FLAG(hasMoveAssignment, exists);
2323 FLAG(hasSimpleMoveAssignment, simple);
2324 FLAG(hasTrivialMoveAssignment, trivial);
2325 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2326 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2327 FLAG(needsImplicitMoveAssignment, needs_implicit);
2328 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2329 });
2330
2331 AddChild([=] {
2332 {
2333 ColorScope Color(OS, ShowColors, DeclKindNameColor);
2334 OS << "Destructor";
2335 }
2336 FLAG(hasSimpleDestructor, simple);
2337 FLAG(hasIrrelevantDestructor, irrelevant);
2338 FLAG(hasTrivialDestructor, trivial);
2339 FLAG(hasNonTrivialDestructor, non_trivial);
2340 FLAG(hasUserDeclaredDestructor, user_declared);
2341 FLAG(hasConstexprDestructor, constexpr);
2342 FLAG(needsImplicitDestructor, needs_implicit);
2343 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2345 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2346 });
2347 });
2348
2349 for (const auto &I : D->bases()) {
2350 AddChild([=] {
2351 if (I.isVirtual())
2352 OS << "virtual ";
2353 dumpAccessSpecifier(I.getAccessSpecifier());
2354 dumpType(I.getType());
2355 if (I.isPackExpansion())
2356 OS << "...";
2357 });
2358 }
2359}
2360
2362 dumpName(D);
2363}
2364
2366 dumpName(D);
2367}
2368
2370 dumpName(D);
2371}
2372
2374 dumpName(D);
2375}
2376
2378 if (const auto *TC = D->getTypeConstraint()) {
2379 OS << " ";
2380 dumpBareDeclRef(TC->getNamedConcept());
2381 if (TC->getNamedConcept() != TC->getFoundDecl()) {
2382 OS << " (";
2383 dumpBareDeclRef(TC->getFoundDecl());
2384 OS << ")";
2385 }
2386 } else if (D->wasDeclaredWithTypename())
2387 OS << " typename";
2388 else
2389 OS << " class";
2390 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2391 if (D->isParameterPack())
2392 OS << " ...";
2393 dumpName(D);
2394}
2395
2397 const NonTypeTemplateParmDecl *D) {
2398 dumpType(D->getType());
2399 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2400 if (D->isParameterPack())
2401 OS << " ...";
2402 dumpName(D);
2403}
2404
2406 const TemplateTemplateParmDecl *D) {
2407 OS << " depth " << D->getDepth() << " index " << D->getIndex();
2408 if (D->isParameterPack())
2409 OS << " ...";
2410 dumpName(D);
2411}
2412
2414 OS << ' ';
2415 if (D->getQualifier())
2417 OS << D->getDeclName();
2419}
2420
2422 OS << ' ';
2424}
2425
2427 const UnresolvedUsingTypenameDecl *D) {
2428 OS << ' ';
2429 if (D->getQualifier())
2431 OS << D->getDeclName();
2432}
2433
2435 const UnresolvedUsingValueDecl *D) {
2436 OS << ' ';
2437 if (D->getQualifier())
2439 OS << D->getDeclName();
2440 dumpType(D->getType());
2441}
2442
2444 OS << ' ';
2446}
2447
2449 const ConstructorUsingShadowDecl *D) {
2450 if (D->constructsVirtualBase())
2451 OS << " virtual";
2452
2453 AddChild([=] {
2454 OS << "target ";
2456 });
2457
2458 AddChild([=] {
2459 OS << "nominated ";
2461 OS << ' ';
2463 });
2464
2465 AddChild([=] {
2466 OS << "constructed ";
2468 OS << ' ';
2470 });
2471}
2472
2474 switch (D->getLanguage()) {
2476 OS << " C";
2477 break;
2479 OS << " C++";
2480 break;
2481 }
2482}
2483
2485 OS << ' ';
2487}
2488
2490 if (TypeSourceInfo *T = D->getFriendType())
2491 dumpType(T->getType());
2492}
2493
2495 dumpName(D);
2496 dumpType(D->getType());
2497 if (D->getSynthesize())
2498 OS << " synthesize";
2499
2500 switch (D->getAccessControl()) {
2501 case ObjCIvarDecl::None:
2502 OS << " none";
2503 break;
2505 OS << " private";
2506 break;
2508 OS << " protected";
2509 break;
2511 OS << " public";
2512 break;
2514 OS << " package";
2515 break;
2516 }
2517}
2518
2520 if (D->isInstanceMethod())
2521 OS << " -";
2522 else
2523 OS << " +";
2524 dumpName(D);
2525 dumpType(D->getReturnType());
2526
2527 if (D->isVariadic())
2528 OS << " variadic";
2529}
2530
2532 dumpName(D);
2533 switch (D->getVariance()) {
2535 break;
2536
2538 OS << " covariant";
2539 break;
2540
2542 OS << " contravariant";
2543 break;
2544 }
2545
2546 if (D->hasExplicitBound())
2547 OS << " bounded";
2549}
2550
2552 dumpName(D);
2555 for (const auto *P : D->protocols())
2556 dumpDeclRef(P);
2557}
2558
2560 dumpName(D);
2563}
2564
2566 dumpName(D);
2567
2568 for (const auto *Child : D->protocols())
2569 dumpDeclRef(Child);
2570}
2571
2573 dumpName(D);
2574 dumpDeclRef(D->getSuperClass(), "super");
2575
2577 for (const auto *Child : D->protocols())
2578 dumpDeclRef(Child);
2579}
2580
2582 const ObjCImplementationDecl *D) {
2583 dumpName(D);
2584 dumpDeclRef(D->getSuperClass(), "super");
2586}
2587
2589 const ObjCCompatibleAliasDecl *D) {
2590 dumpName(D);
2592}
2593
2595 dumpName(D);
2596 dumpType(D->getType());
2597
2599 OS << " required";
2601 OS << " optional";
2602
2606 OS << " readonly";
2608 OS << " assign";
2610 OS << " readwrite";
2612 OS << " retain";
2614 OS << " copy";
2616 OS << " nonatomic";
2618 OS << " atomic";
2620 OS << " weak";
2622 OS << " strong";
2624 OS << " unsafe_unretained";
2626 OS << " class";
2628 OS << " direct";
2630 dumpDeclRef(D->getGetterMethodDecl(), "getter");
2632 dumpDeclRef(D->getSetterMethodDecl(), "setter");
2633 }
2634}
2635
2639 OS << " synthesize";
2640 else
2641 OS << " dynamic";
2644}
2645
2647 if (D->isVariadic())
2648 OS << " variadic";
2649
2650 if (D->capturesCXXThis())
2651 OS << " captures_this";
2652}
2653
2655 dumpName(D);
2656}
2657
2659 VisitStmt(S);
2660 if (S->hasStoredFPFeatures())
2661 printFPOptions(S->getStoredFPFeatures());
2662}
2663
2665 if (D->isCBuffer())
2666 OS << " cbuffer";
2667 else
2668 OS << " tbuffer";
2669 dumpName(D);
2670}
2671
2673 OS << " " << S->getDirectiveKind();
2674 // TODO OpenACC: Dump clauses as well.
2675}
static double GetApproxValue(const llvm::APFloat &F)
Definition: APValue.cpp:622
#define V(N, I)
Definition: ASTContext.h:3255
DynTypedNode Node
#define SM(sm)
Definition: Cuda.cpp:82
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
This file defines OpenMP nodes for declarative directives.
Defines the C++ template declaration subclasses.
#define X(type, name)
Definition: Value.h: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:692
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:4308
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition: ExprCXX.h:2836
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3146
ArraySizeModifier getSizeModifier() const
Definition: Type.h:3160
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:3164
Attr - This represents one attribute.
Definition: Attr.h:42
attr::Kind getKind() const
Definition: Attr.h:88
bool isInherited() const
Definition: Attr.h:97
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:101
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5523
bool isDecltypeAuto() const
Definition: Type.h:5546
ConceptDecl * getTypeConstraintConcept() const
Definition: Type.h:5538
bool isConstrained() const
Definition: Type.h:5542
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3810
StringRef getOpcodeStr() const
Definition: Expr.h:3875
A binding in a decomposition declaration.
Definition: DeclCXX.h:4100
A class which contains all the information about a particular captured value.
Definition: Decl.h:4461
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4455
bool capturesCXXThis() const
Definition: Decl.h:4587
bool isVariadic() const
Definition: Decl.h:4530
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:1530
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2528
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2293
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1254
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1361
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2481
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3645
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition: ExprCXX.h:1801
Represents a static or instance method of a struct/union/class.
Definition: DeclCXX.h:2053
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:2224
A call to an overloaded operator written using operator syntax.
Definition: ExprCXX.h:81
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
CXXRecordDecl * getInstantiatedFromMemberClass() const
If this record is an instantiation of a member class, retrieves the member class from which it was in...
Definition: DeclCXX.cpp:1873
base_class_range bases()
Definition: DeclCXX.h:618
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:905
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1016
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:815
A C++ static_cast expression (C++ [expr.static.cast]).
Definition: ExprCXX.h:433
Represents the this expression in C++.
Definition: ExprCXX.h:1148
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3519
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2795
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition: Decl.h:4647
bool isNothrow() const
Definition: Decl.cpp:5386
CaseStmt - Represent a case statement.
Definition: Stmt.h:1799
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3465
const CXXBaseSpecifier *const * path_const_iterator
Definition: Expr.h:3532
Declaration of a class template.
Represents a 'co_await' expression.
Definition: ExprCXX.h:5123
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4058
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3395
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1604
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:3185
const llvm::APInt & getSize() const
Definition: Type.h:3206
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1059
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition: DeclCXX.h:3591
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition: DeclCXX.h:3682
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Definition: DeclCXX.h:3691
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
Definition: DeclCXX.h:3672
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition: DeclCXX.h:3666
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition: DeclCXX.cpp:3120
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition: StmtCXX.h:473
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition: DeclBase.h:2066
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1247
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition: DeclBase.h:1216
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:598
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition: DeclBase.h:1209
@ FOK_None
Not a friend object.
Definition: DeclBase.h:1207
@ FOK_Declared
A friend of a previously-declared entity.
Definition: DeclBase.h:1208
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition: DeclBase.h:833
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition: DeclBase.h:776
bool isInvalidDecl() const
Definition: DeclBase.h:593
SourceLocation getLocation() const
Definition: DeclBase.h:444
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:626
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:530
DeclContext * getDeclContext()
Definition: DeclBase.h:453
AccessSpecifier getAccess() const
Definition: DeclBase.h:512
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:908
Kind getKind() const
Definition: DeclBase.h:447
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:432
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:828
Represents a C++17 deduced template specialization type.
Definition: Type.h:5571
TemplateName getTemplateName() const
Retrieve the name of the template that we are deducing.
Definition: Type.h:5591
bool isDeduced() const
Definition: Type.h:5511
A qualified reference to a name whose declaration cannot yet be resolved.
Definition: ExprCXX.h:3285
Represents an array type in C++ whose size is a value-dependent expression.
Definition: Type.h:3343
SourceRange getBracketsRange() const
Definition: Type.h:3369
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3441
SourceLocation getAttributeLoc() const
Definition: Type.h:3457
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:3265
Represents an enum.
Definition: Decl.h:3832
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4037
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4040
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4046
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3992
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3436
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3442
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:2907
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition: Expr.h:6083
Represents difference between two FPOptions values.
Definition: LangOptions.h:875
Represents a member of a struct/union/class.
Definition: Decl.h:3025
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3113
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:122
Represents a function declaration or definition.
Definition: Decl.h:1959
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition: Decl.h:2798
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition: Decl.h:2314
param_iterator param_begin()
Definition: Decl.h:2663
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2477
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2765
bool isDeletedAsWritten() const
Definition: Decl.h:2481
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2297
bool param_empty() const
Definition: Decl.h:2662
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2322
bool isIneligibleOrNotSelected() const
Definition: Decl.h:2355
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
Definition: Decl.cpp:4223
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2288
FunctionDecl * getInstantiatedFromMemberFunction() const
If this function is an instantiation of a member function of a class template specialization,...
Definition: Decl.cpp:3969
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Definition: Decl.cpp:3647
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2776
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4198
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4442
Declaration of a template function.
Definition: DeclTemplate.h:958
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:3798
ExtInfo getExtInfo() const
Definition: Type.h:4127
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3417
bool isConst() const
Definition: Type.h:4133
bool isRestrict() const
Definition: Type.h:4135
bool isVolatile() const
Definition: Type.h:4134
Represents a C11 generic selection.
Definition: Expr.h:5695
AssociationTy< true > ConstAssociation
Definition: Expr.h:5927
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5947
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2860
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4901
bool isCBuffer() const
Definition: Decl.h:4929
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2136
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3625
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition: Decl.h:4760
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition: Decl.h:4818
Represents a field injected from an anonymous union/struct into the parent scope.
Definition: Decl.h:3309
ArrayRef< NamedDecl * > chain() const
Definition: Decl.h:3330
Describes an C or C++ initializer list.
Definition: Expr.h:4817
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4936
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5763
CXXRecordDecl * getDecl() const
Definition: Type.cpp:4000
Represents the declaration of a label.
Definition: Decl.h:499
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2029
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition: DeclCXX.h:3222
unsigned getManglingNumber() const
Definition: DeclCXX.h:3271
Represents a linkage specification.
Definition: DeclCXX.h:2927
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2950
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4679
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3158
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
Definition: Redeclarable.h:314
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:320
Describes a module or submodule.
Definition: Module.h:105
std::string getFullModuleName(bool AllowStringLiterals=false) const
Retrieve the full name of this module, including the path from its top-level module.
Definition: Module.cpp:244
This represents a decl that may have a name.
Definition: Decl.h:249
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:647
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
Represents a C++ namespace alias.
Definition: DeclCXX.h:3113
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3208
Represent a C++ namespace.
Definition: Decl.h:547
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2994
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:610
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2980
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:627
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false) const
Print this nested name specifier to the given output stream.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Pseudo declaration for capturing expressions.
Definition: DeclOpenMP.h:383
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
This represents '#pragma omp declare reduction ...' directive.
Definition: DeclOpenMP.h:177
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition: DeclOpenMP.h:238
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition: DeclOpenMP.h:220
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
Definition: DeclOpenMP.h:241
This is a basic class for representing single OpenMP executable directive.
Definition: StmtOpenMP.h:266
bool isStandaloneDirective() const
Returns whether or not this is a Standalone directive.
Definition: StmtOpenMP.cpp:58
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition: ExprOpenMP.h:275
This represents '#pragma omp requires...' directive.
Definition: DeclOpenMP.h:416
clauselist_range clauselists()
Definition: DeclOpenMP.h:441
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2323
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2169
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2368
protocol_range protocols() const
Definition: DeclObjC.h:2399
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2542
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2213
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2772
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2790
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2483
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2595
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2732
Represents an ObjC class declaration.
Definition: DeclObjC.h:1150
protocol_range protocols() const
Definition: DeclObjC.h:1355
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:6494
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:849
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1947
AccessControl getAccessControl() const
Definition: DeclObjC.h:1996
bool getSynthesize() const
Definition: DeclObjC.h:2003
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
bool isVariadic() const
Definition: DeclObjC.h:431
bool isInstanceMethod() const
Definition: DeclObjC.h:426
QualType getReturnType() const
Definition: DeclObjC.h:329
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:897
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:900
QualType getType() const
Definition: DeclObjC.h:800
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:811
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:908
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2802
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2875
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2871
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2866
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2079
protocol_range protocols() const
Definition: DeclObjC.h:2155
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:639
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition: StmtOpenACC.h:23
Represents a pack expansion of types.
Definition: Type.h:6111
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: Type.h:6136
Represents a #pragma comment line.
Definition: Decl.h:142
StringRef getArg() const
Definition: Decl.h:165
PragmaMSCommentKind getCommentKind() const
Definition: Decl.h:163
Represents a #pragma detect_mismatch line.
Definition: Decl.h:176
StringRef getName() const
Definition: Decl.h:197
StringRef getValue() const
Definition: Decl.h:198
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1962
StringRef getIdentKindName() const
Definition: Expr.h:2019
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:737
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:804
SplitQualType getSplitDesugaredType() const
Definition: Type.h:1092
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6922
std::string getAsString() const
void * getAsOpaquePtr() const
Definition: Type.h:784
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4133
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5091
RecordDecl * getDecl() const
Definition: Type.h:5101
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:3008
bool isSpelledAsLValue() const
Definition: Type.h:3021
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition: Stmt.h:3017
Represents an expression that computes the length of a parameter pack.
Definition: ExprCXX.h:4220
Encodes a location in the source.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
bool isValid() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:44
Stmt - This represents one statement.
Definition: Stmt.h:84
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1760
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1182
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5431
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.cpp:4050
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Definition: Type.cpp:4059
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5361
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
Definition: Type.h:5382
std::optional< unsigned > getPackIndex() const
Definition: Type.h:5391
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Definition: Type.cpp:4033
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2386
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition: Decl.h:3786
StringRef getKindName() const
Definition: Decl.h:3740
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3652
TagDecl * getDecl() const
Definition: Type.cpp:3900
Represents a template argument.
Definition: TemplateBase.h:61
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:363
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
Definition: TemplateBase.h:343
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:326
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
Definition: TemplateBase.h:350
NameKind getKind() const
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
Definition: TemplateName.h:247
void dump(raw_ostream &OS) const
Debugging aid that dumps the template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5631
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5697
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:5690
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:5324
bool isParameterPack() const
Definition: Type.h:5322
unsigned getIndex() const
Definition: Type.h:5321
unsigned getDepth() const
Definition: Type.h:5320
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node)
void VisitEnumDecl(const EnumDecl *D)
void VisitExprWithCleanups(const ExprWithCleanups *Node)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitCXXStaticCastExpr(const CXXStaticCastExpr *Node)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void dumpPointer(const void *Ptr)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitLinkageSpecDecl(const LinkageSpecDecl *D)
void VisitVectorType(const VectorType *T)
void VisitCoawaitExpr(const CoawaitExpr *Node)
void VisitUnaryOperator(const UnaryOperator *Node)
void dumpAccessSpecifier(AccessSpecifier AS)
void VisitDeducedTemplateSpecializationType(const DeducedTemplateSpecializationType *T)
void VisitObjCSelectorExpr(const ObjCSelectorExpr *Node)
void VisitCXXOperatorCallExpr(const CXXOperatorCallExpr *Node)
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *Node)
void VisitPragmaCommentDecl(const PragmaCommentDecl *D)
void VisitDependentScopeDeclRefExpr(const DependentScopeDeclRefExpr *Node)
void VisitImportDecl(const ImportDecl *D)
void VisitUsingEnumDecl(const UsingEnumDecl *D)
void VisitOMPCapturedExprDecl(const OMPCapturedExprDecl *D)
void VisitUnresolvedUsingType(const UnresolvedUsingType *T)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *Node)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitIndirectFieldDecl(const IndirectFieldDecl *D)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitUsingType(const UsingType *T)
void VisitInjectedClassNameType(const InjectedClassNameType *T)
void VisitBinaryOperator(const BinaryOperator *Node)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitBlockDecl(const BlockDecl *D)
void VisitCXXDeleteExpr(const CXXDeleteExpr *Node)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *Node)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitVarTemplateDecl(const VarTemplateDecl *D)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *Node)
TextNodeDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
void VisitPredefinedExpr(const PredefinedExpr *Node)
void dumpType(QualType T)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *Node)
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
void VisitUnresolvedUsingValueDecl(const UnresolvedUsingValueDecl *D)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *D)
void VisitObjCMessageExpr(const ObjCMessageExpr *Node)
void dumpSourceRange(SourceRange R)
void VisitMemberExpr(const MemberExpr *Node)
void VisitOpenACCConstructStmt(const OpenACCConstructStmt *S)
void VisitCompoundStmt(const CompoundStmt *Node)
void VisitConstantExpr(const ConstantExpr *Node)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Node)
void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D)
void VisitWhileStmt(const WhileStmt *Node)
void VisitCharacterLiteral(const CharacterLiteral *Node)
void VisitAccessSpecDecl(const AccessSpecDecl *D)
void VisitFunctionType(const FunctionType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitReturnStmt(const ReturnStmt *Node)
void VisitTypeLoc(TypeLoc TL)
void VisitAutoType(const AutoType *T)
void VisitObjCInterfaceType(const ObjCInterfaceType *T)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitTypedefDecl(const TypedefDecl *D)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void VisitIntegerLiteral(const IntegerLiteral *Node)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitGotoStmt(const GotoStmt *Node)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T)
void VisitFriendDecl(const FriendDecl *D)
void VisitSwitchStmt(const SwitchStmt *Node)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *Node)
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitUsingDecl(const UsingDecl *D)
void VisitConstantArrayType(const ConstantArrayType *T)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)
void VisitArrayType(const ArrayType *T)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitLifetimeExtendedTemporaryDecl(const LifetimeExtendedTemporaryDecl *D)
void VisitCXXRecordDecl(const CXXRecordDecl *D)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void dumpCleanupObject(const ExprWithCleanups::CleanupObject &C)
void VisitCaseStmt(const CaseStmt *Node)
void VisitRValueReferenceType(const ReferenceType *T)
void VisitPackExpansionType(const PackExpansionType *T)
void VisitConceptDecl(const ConceptDecl *D)
void VisitCallExpr(const CallExpr *Node)
void VisitCapturedDecl(const CapturedDecl *D)
void VisitBuiltinTemplateDecl(const BuiltinTemplateDecl *D)
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *Node)
void VisitOMPDeclareReductionDecl(const OMPDeclareReductionDecl *D)
void VisitCoreturnStmt(const CoreturnStmt *Node)
void VisitSizeOfPackExpr(const SizeOfPackExpr *Node)
void VisitDeclRefExpr(const DeclRefExpr *Node)
void VisitLabelStmt(const LabelStmt *Node)
void Visit(const comments::Comment *C, const comments::FullComment *FC)
void dumpNestedNameSpecifier(const NestedNameSpecifier *NNS)
void VisitLabelDecl(const LabelDecl *D)
void VisitUnaryTransformType(const UnaryTransformType *T)
void VisitStringLiteral(const StringLiteral *Str)
void VisitOMPRequiresDecl(const OMPRequiresDecl *D)
void dumpBareType(QualType T, bool Desugar=true)
void VisitTemplateSpecializationType(const TemplateSpecializationType *T)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitCompoundAssignOperator(const CompoundAssignOperator *Node)
void VisitCXXThisExpr(const CXXThisExpr *Node)
void dumpName(const NamedDecl *ND)
void VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *Node)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitFieldDecl(const FieldDecl *D)
void dumpDeclRef(const Decl *D, StringRef Label={})
void VisitRecordDecl(const RecordDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *Node)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)
void VisitCastExpr(const CastExpr *Node)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T)
void VisitExpressionTraitExpr(const ExpressionTraitExpr *Node)
void VisitAddrLabelExpr(const AddrLabelExpr *Node)
void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node)
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitTypeAliasDecl(const TypeAliasDecl *D)
void VisitVarDecl(const VarDecl *D)
void VisitFixedPointLiteral(const FixedPointLiteral *Node)
void VisitOMPIteratorExpr(const OMPIteratorExpr *Node)
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitUsingShadowDecl(const UsingShadowDecl *D)
void VisitNamespaceDecl(const NamespaceDecl *D)
void VisitTypeAliasTemplateDecl(const TypeAliasTemplateDecl *D)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *Node)
void VisitIfStmt(const IfStmt *Node)
void VisitCXXConstructExpr(const CXXConstructExpr *Node)
void VisitFunctionProtoType(const FunctionProtoType *T)
void dumpLocation(SourceLocation Loc)
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
void VisitOMPExecutableDirective(const OMPExecutableDirective *D)
void VisitImplicitCastExpr(const ImplicitCastExpr *Node)
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
void VisitCXXNamedCastExpr(const CXXNamedCastExpr *Node)
void VisitTagType(const TagType *T)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *Node)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitFunctionDecl(const FunctionDecl *D)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitTypeTraitExpr(const TypeTraitExpr *Node)
void dumpBareDeclRef(const Decl *D)
void VisitExtVectorElementExpr(const ExtVectorElementExpr *Node)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitFloatingLiteral(const FloatingLiteral *Node)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitRequiresExpr(const RequiresExpr *Node)
void VisitVariableArrayType(const VariableArrayType *T)
void VisitGenericSelectionExpr(const GenericSelectionExpr *E)
void VisitTemplateTypeParmType(const TemplateTypeParmType *T)
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitEnumConstantDecl(const EnumConstantDecl *D)
void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)
void dumpTemplateSpecializationKind(TemplateSpecializationKind TSK)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
void VisitBindingDecl(const BindingDecl *D)
void VisitTypedefType(const TypedefType *T)
void AddChild(Fn DoAddChild)
Add a child of the current node. Calls DoAddChild without arguments.
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3521
Declaration of an alias template.
RetTy Visit(TypeLoc TyLoc)
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition: TypeLoc.h:153
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:116
const Type * getTypePtr() const
Definition: TypeLoc.h:137
A container of type source information.
Definition: Type.h:6872
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6883
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition: ExprCXX.h:2751
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:1606
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
Definition: Type.cpp:444
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2427
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2419
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2094
const char * getTypeClassName() const
Definition: Type.cpp:3208
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2413
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2437
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2077
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7652
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3501
QualType getUnderlyingType() const
Definition: Decl.h:3454
TypedefNameDecl * getDecl() const
Definition: Type.h:4759
bool typeMatchesDecl() const
Definition: Type.h:4767
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2543
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2158
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1374
A unary type transform, which is a type constructed from another.
Definition: Type.h:5008
UTTKind getUTTKind() const
Definition: Type.h:5037
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3163
The iterator over UnresolvedSets.
Definition: UnresolvedSet.h:35
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4686
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4697
Represents a dependent using declaration which was marked with typename.
Definition: DeclCXX.h:3952
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3989
Represents a dependent using declaration which was not marked with typename.
Definition: DeclCXX.h:3855
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3899
Represents a C++ using-declaration.
Definition: DeclCXX.h:3505
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3542
Represents C++ using-directive.
Definition: DeclCXX.h:3008
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2943
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3706
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3750
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3313
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3377
UsingShadowDecl * getFoundDecl() const
Definition: Type.h:4726
bool typeMatchesDecl() const
Definition: Type.h:4735
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
QualType getType() const
Definition: Decl.h:717
Kind getKind() const
Definition: Value.h:135
Represents a variable declaration or definition.
Definition: Decl.h:918
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1546
TLSKind getTLSKind() const
Definition: Decl.cpp:2165
bool hasInit() const
Definition: Decl.cpp:2395
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1443
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2118
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:929
@ CInit
C-style initialization with assignment.
Definition: Decl.h:923
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:932
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:926
APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
Definition: Decl.cpp:2546
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1489
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Would the destruction of this variable have any effect, and if so, what kind?
Definition: Decl.cpp:2810
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1528
const Expr * getInit() const
Definition: Decl.h:1352
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:941
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:944
@ TLS_None
Not a TLS variable.
Definition: Decl.h:938
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1152
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:2746
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
Definition: Decl.cpp:2653
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition: Type.h:3289
SourceRange getBracketsRange() const
Definition: Type.h:3314
Represents a GCC generic vector type.
Definition: Type.h:3511
unsigned getNumElements() const
Definition: Type.h:3526
VectorKind getVectorKind() const
Definition: Type.h:3531
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2582
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:604
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
const CommandInfo * getCommandInfo(StringRef Name) const
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:65
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1083
An opening HTML tag with attributes.
Definition: Comment.h:433
A command with word-like arguments that is considered inline content.
Definition: Comment.h:335
Doxygen \param command.
Definition: Comment.h:711
static const char * getDirectionAsString(ParamCommandPassDirection D)
Definition: Comment.cpp:191
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:793
A verbatim block command (e.
Definition: Comment.h:879
A line of text contained in a verbatim block.
Definition: Comment.h:854
A verbatim line command.
Definition: Comment.h:930
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
RequirementKind getKind() const
Definition: ExprConcepts.h:198
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:218
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
The JSON file list parser is used to communicate input to InstallAPI.
static const TerminalColor NullColor
static const TerminalColor ErrorsColor
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
static const TerminalColor CommentColor
static const TerminalColor DeclNameColor
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:397
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:1555
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1558
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1561
@ OK_VectorComponent
A vector component is an element or range of elements on a vector.
Definition: Specifiers.h:154
@ OK_ObjCProperty
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
Definition: Specifiers.h:158
@ OK_ObjCSubscript
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition: Specifiers.h:163
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition: Specifiers.h:148
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
Definition: Specifiers.h:151
@ OK_MatrixComponent
A matrix component is a single element of a matrix.
Definition: Specifiers.h:166
static const TerminalColor StmtColor
static const TerminalColor UndeserializedColor
StorageClass
Storage classes.
Definition: Specifiers.h:245
@ SC_None
Definition: Specifiers.h:247
static const TerminalColor DeclKindNameColor
static const TerminalColor LocationColor
static const TerminalColor ValueKindColor
static const TerminalColor CastColor
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:132
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:141
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:136
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
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:185
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition: Specifiers.h:203
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition: Specifiers.h:199
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition: Specifiers.h:195
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition: Specifiers.h:191
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition: Specifiers.h:188
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
@ AltiVecBool
is AltiVec 'vector bool ...'
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ AltiVecVector
is AltiVec vector
@ AltiVecPixel
is AltiVec 'vector Pixel'
@ Neon
is ARM Neon vector
@ Generic
not a target-specific vector type
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
@ NeonPoly
is ARM Neon polynomial vector
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
static const TerminalColor ValueColor
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_DynamicNone
throw()
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
static const TerminalColor ObjectKindColor
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:180
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:174
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:172
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:177
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition: Type.h:4261
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition: Type.h:4265
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4251
Extra information about a function prototype.
Definition: Type.h:4277
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4284
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:670
Qualifiers Quals
The local qualifiers.
Definition: Type.h:675
Information about a single command.