clang 24.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"
23#include "clang/Basic/Module.h"
26#include "llvm/ADT/StringExtras.h"
27#include "llvm/Frontend/HLSL/HLSLRootSignature.h"
28
29#include <algorithm>
30#include <utility>
31
32using namespace clang;
33
34static void dumpPreviousDeclImpl(raw_ostream &OS, ...) {}
35
36template <typename T>
37static void dumpPreviousDeclImpl(raw_ostream &OS, const Mergeable<T> *D) {
38 const T *First = D->getFirstDecl();
39 if (First != D)
40 OS << " first " << First;
41}
42
43template <typename T>
44static void dumpPreviousDeclImpl(raw_ostream &OS, const Redeclarable<T> *D) {
45 const T *Prev = D->getPreviousDecl();
46 if (Prev)
47 OS << " prev " << Prev;
48}
49
50/// Dump the previous declaration in the redeclaration chain for a declaration,
51/// if any.
52static void dumpPreviousDecl(raw_ostream &OS, const Decl *D) {
53 switch (D->getKind()) {
54#define DECL(DERIVED, BASE) \
55 case Decl::DERIVED: \
56 return dumpPreviousDeclImpl(OS, cast<DERIVED##Decl>(D));
57#define ABSTRACT_DECL(DECL)
58#include "clang/AST/DeclNodes.inc"
59 }
60 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
61}
62
63TextNodeDumper::TextNodeDumper(raw_ostream &OS, const ASTContext &Context,
64 bool ShowColors)
65 : TextTreeStructure(OS, ShowColors), OS(OS), ShowColors(ShowColors),
66 Context(&Context), SM(&Context.getSourceManager()),
67 PrintPolicy(Context.getPrintingPolicy()),
68 Traits(&Context.getCommentCommandTraits()) {}
69
70TextNodeDumper::TextNodeDumper(raw_ostream &OS, bool ShowColors)
71 : TextTreeStructure(OS, ShowColors), OS(OS), ShowColors(ShowColors) {}
72
74 const comments::FullComment *FC) {
75 if (!C) {
76 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
77 OS << "<<<NULL>>>";
78 return;
79 }
80
81 {
82 ColorScope Color(OS, ShowColors, ASTDumpColor::Comment);
83 OS << C->getCommentKindName();
84 }
86 dumpSourceRange(C->getSourceRange());
87
88 ConstCommentVisitor<TextNodeDumper, void,
89 const comments::FullComment *>::visit(C, FC);
90}
91
93 {
94 ColorScope Color(OS, ShowColors, ASTDumpColor::Attr);
95
96 switch (A->getKind()) {
97#define ATTR(X) \
98 case attr::X: \
99 OS << #X; \
100 break;
101#include "clang/Basic/AttrList.inc"
102 }
103 OS << "Attr";
104 }
105 dumpPointer(A);
107 if (A->isInherited())
108 OS << " Inherited";
109 if (A->isImplicit())
110 OS << " Implicit";
111
113}
114
116 const Decl *From, StringRef Label) {
117 OS << "TemplateArgument";
118 if (R.isValid())
120
121 if (From)
122 dumpDeclRef(From, Label);
123
125}
126
127void TextNodeDumper::Visit(const Stmt *Node) {
128 if (!Node) {
129 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
130 OS << "<<<NULL>>>";
131 return;
132 }
133 {
134 ColorScope Color(OS, ShowColors, ASTDumpColor::Stmt);
135 OS << Node->getStmtClassName();
136 }
137 dumpPointer(Node);
139
140 if (const auto *E = dyn_cast<Expr>(Node)) {
141 dumpType(E->getType());
142
143 if (E->containsErrors()) {
144 ColorScope Color(OS, ShowColors, ASTDumpColor::Errors);
145 OS << " contains-errors";
146 }
147
148 {
149 ColorScope Color(OS, ShowColors, ASTDumpColor::ValueKind);
150 switch (E->getValueKind()) {
151 case VK_PRValue:
152 break;
153 case VK_LValue:
154 OS << " lvalue";
155 break;
156 case VK_XValue:
157 OS << " xvalue";
158 break;
159 }
160 }
161
162 {
163 ColorScope Color(OS, ShowColors, ASTDumpColor::ObjectKind);
164 switch (E->getObjectKind()) {
165 case OK_Ordinary:
166 break;
167 case OK_BitField:
168 OS << " bitfield";
169 break;
170 case OK_ObjCProperty:
171 OS << " objcproperty";
172 break;
173 case OK_ObjCSubscript:
174 OS << " objcsubscript";
175 break;
177 OS << " vectorcomponent";
178 break;
180 OS << " matrixcomponent";
181 break;
182 }
183 }
184 }
185
187}
188
190 if (!T) {
191 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
192 OS << "<<<NULL>>>";
193 return;
194 }
195 if (isa<LocInfoType>(T)) {
196 {
197 ColorScope Color(OS, ShowColors, ASTDumpColor::Type);
198 OS << "LocInfo Type";
199 }
200 dumpPointer(T);
201 return;
202 }
203
204 {
205 ColorScope Color(OS, ShowColors, ASTDumpColor::Type);
206 OS << T->getTypeClassName() << "Type";
207 }
208 dumpPointer(T);
209 OS << " ";
210 dumpBareType(QualType(T, 0), false);
211
212 QualType SingleStepDesugar =
213 T->getLocallyUnqualifiedSingleStepDesugaredType();
214 if (SingleStepDesugar != QualType(T, 0))
215 OS << " sugar";
216
217 if (T->containsErrors()) {
218 ColorScope Color(OS, ShowColors, ASTDumpColor::Errors);
219 OS << " contains-errors";
220 }
221
222 if (T->isDependentType())
223 OS << " dependent";
224 else if (T->isInstantiationDependentType())
225 OS << " instantiation_dependent";
226
227 if (T->isVariablyModifiedType())
228 OS << " variably_modified";
229 if (T->containsUnexpandedParameterPack())
230 OS << " contains_unexpanded_pack";
231 if (T->isFromAST())
232 OS << " imported";
233
235}
236
238 OS << "QualType";
239 dumpPointer(T.getAsOpaquePtr());
240 OS << " ";
241 dumpBareType(T, false);
242 OS << " " << T.split().Quals.getAsString();
243}
244
246 if (!TL) {
247 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
248 OS << "<<<NULL>>>";
249 return;
250 }
251
252 {
253 ColorScope Color(OS, ShowColors, ASTDumpColor::Type);
255 ? "Qualified"
256 : TL.getType()->getTypeClassName())
257 << "TypeLoc";
258 }
260 OS << ' ';
261 dumpBareType(TL.getType(), /*Desugar=*/false);
262
264}
265
267 if (!D) {
268 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
269 OS << "<<<NULL>>>";
270 return;
271 }
272
273 {
274 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
275 OS << D->getDeclKindName() << "Decl";
276 }
277 dumpPointer(D);
278 if (D->getLexicalDeclContext() != D->getDeclContext())
279 OS << " parent " << cast<Decl>(D->getDeclContext());
280 dumpPreviousDecl(OS, D);
282 OS << ' ';
284 if (D->isFromASTFile())
285 OS << " imported";
286 if (Module *M = D->getOwningModule())
287 OS << " in " << M->getFullModuleName();
288 if (auto *ND = dyn_cast<NamedDecl>(D))
290 const_cast<NamedDecl *>(ND)))
291 AddChild([=] { OS << "also in " << M->getFullModuleName(); });
292 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
293 if (!ND->isUnconditionallyVisible())
294 OS << " hidden";
295 if (D->isImplicit())
296 OS << " implicit";
297
298 if (D->isUsed())
299 OS << " used";
300 else if (D->isThisDeclarationReferenced())
301 OS << " referenced";
302
303 if (D->isInvalidDecl())
304 OS << " invalid";
305 if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
306 if (FD->isConstexprSpecified())
307 OS << " constexpr";
308 if (FD->isConsteval())
309 OS << " consteval";
310 else if (FD->isImmediateFunction())
311 OS << " immediate";
312 if (FD->isMultiVersion())
313 OS << " multiversion";
314 }
315
316 if (!isa<FunctionDecl>(*D)) {
317 const auto *MD = dyn_cast<ObjCMethodDecl>(D);
318 if (!MD || !MD->isThisDeclarationADefinition()) {
319 const auto *DC = dyn_cast<DeclContext>(D);
320 if (DC && DC->hasExternalLexicalStorage()) {
321 ColorScope Color(OS, ShowColors, ASTDumpColor::Undeserialized);
322 OS << " <undeserialized declarations>";
323 }
324 }
325 }
326
327 switch (D->getFriendObjectKind()) {
328 case Decl::FOK_None:
329 break;
331 OS << " friend";
332 break;
334 OS << " friend_undeclared";
335 break;
336 }
337
339}
340
342 OS << "CXXCtorInitializer";
343 if (Init->isAnyMemberInitializer()) {
344 OS << ' ';
345 dumpBareDeclRef(Init->getAnyMember());
346 } else if (Init->isBaseInitializer()) {
347 dumpType(QualType(Init->getBaseClass(), 0));
348 } else if (Init->isDelegatingInitializer()) {
349 dumpType(Init->getTypeSourceInfo()->getType());
350 } else {
351 llvm_unreachable("Unknown initializer type");
352 }
353}
354
356 OS << "capture";
357 if (C.isByRef())
358 OS << " byref";
359 if (C.isNested())
360 OS << " nested";
361 if (C.getVariable()) {
362 OS << ' ';
363 dumpBareDeclRef(C.getVariable());
364 }
365}
366
368 if (!C) {
369 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
370 OS << "<<<NULL>>> OMPClause";
371 return;
372 }
373 {
374 ColorScope Color(OS, ShowColors, ASTDumpColor::Attr);
375 OpenMPClauseKind CKind = C->getClauseKind();
376 StringRef ClauseName(CKind == llvm::omp::Clause::OMPC_update_depend_objects
377 ? StringRef("UpdateDependObjects")
378 : llvm::omp::getOpenMPClauseName(CKind));
379 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
380 << ClauseName.drop_front() << "Clause";
381 }
382 dumpPointer(C);
383 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
384 if (C->isImplicit())
385 OS << " <implicit>";
386}
387
389 const OpenACCAsteriskSizeExpr *E) {
390 // Nothing to do here, only location exists, and that is printed elsewhere.
391}
392
394 if (!C) {
395 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
396 OS << "<<<NULL>>> OpenACCClause";
397 return;
398 }
399 {
400 ColorScope Color(OS, ShowColors, ASTDumpColor::Attr);
401 OS << C->getClauseKind();
402
403 // Handle clauses with parens for types that have no children, likely
404 // because there is no sub expression.
405 switch (C->getClauseKind()) {
407 OS << '(' << cast<OpenACCDefaultClause>(C)->getDefaultClauseKind() << ')';
408 break;
441 // The condition expression will be printed as a part of the 'children',
442 // but print 'clause' here so it is clear what is happening from the dump.
443 OS << " clause";
444 break;
446 OS << " clause";
447 // print the list of all GangKinds, so that there is some sort of
448 // relationship to the expressions listed afterwards.
449 auto *GC = cast<OpenACCGangClause>(C);
450
451 for (unsigned I = 0; I < GC->getNumExprs(); ++I) {
452 OS << " " << GC->getExpr(I).first;
453 }
454 break;
455 }
457 OS << " clause";
458 if (cast<OpenACCCollapseClause>(C)->hasForce())
459 OS << ": force";
460 break;
461
465 OS << " clause";
466 if (cast<OpenACCCopyClause>(C)->getModifierList() !=
468 OS << " modifiers: " << cast<OpenACCCopyClause>(C)->getModifierList();
469 break;
473 OS << " clause";
474 if (cast<OpenACCCopyInClause>(C)->getModifierList() !=
476 OS << " modifiers: " << cast<OpenACCCopyInClause>(C)->getModifierList();
477 break;
481 OS << " clause";
482 if (cast<OpenACCCopyOutClause>(C)->getModifierList() !=
484 OS << " modifiers: "
485 << cast<OpenACCCopyOutClause>(C)->getModifierList();
486 break;
490 OS << " clause";
491 if (cast<OpenACCCreateClause>(C)->getModifierList() !=
493 OS << " modifiers: " << cast<OpenACCCreateClause>(C)->getModifierList();
494 break;
496 OS << " clause";
497 if (cast<OpenACCWaitClause>(C)->hasDevNumExpr())
498 OS << " has devnum";
499 if (cast<OpenACCWaitClause>(C)->hasQueuesTag())
500 OS << " has queues tag";
501 break;
504 OS << "(";
505 llvm::interleaveComma(
506 cast<OpenACCDeviceTypeClause>(C)->getArchitectures(), OS,
507 [&](const DeviceTypeArgument &Arch) {
508 if (Arch.getIdentifierInfo() == nullptr)
509 OS << "*";
510 else
511 OS << Arch.getIdentifierInfo()->getName();
512 });
513 OS << ")";
514 break;
516 OS << " clause Operator: "
517 << cast<OpenACCReductionClause>(C)->getReductionOp();
518 break;
520 OS << " clause";
521 if (cast<OpenACCBindClause>(C)->isIdentifierArgument())
522 OS << " identifier '"
523 << cast<OpenACCBindClause>(C)->getIdentifierArgument()->getName()
524 << "'";
525 else
526 AddChild(
527 [=] { Visit(cast<OpenACCBindClause>(C)->getStringArgument()); });
528 }
529 }
530 dumpPointer(C);
531 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
532}
533
535 const TypeSourceInfo *TSI = A.getTypeSourceInfo();
536 if (TSI) {
537 OS << "case ";
538 dumpType(TSI->getType());
539 } else {
540 OS << "default";
541 }
542
543 if (A.isSelected())
544 OS << " selected";
545}
546
548 if (!R) {
549 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
550 OS << "<<<NULL>>> ConceptReference";
551 return;
552 }
553
554 OS << "ConceptReference";
555 dumpPointer(R);
556 dumpSourceRange(R->getSourceRange());
557 OS << ' ';
558 dumpBareConcept(R->getNamedConcept());
559}
560
562 if (!R) {
563 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
564 OS << "<<<NULL>>> Requirement";
565 return;
566 }
567
568 {
569 ColorScope Color(OS, ShowColors, ASTDumpColor::Stmt);
570 switch (R->getKind()) {
572 OS << "TypeRequirement";
573 break;
575 OS << "SimpleRequirement";
576 break;
578 OS << "CompoundRequirement";
579 break;
581 OS << "NestedRequirement";
582 break;
583 }
584 }
585
586 dumpPointer(R);
587
588 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R)) {
589 if (ER->hasNoexceptRequirement())
590 OS << " noexcept";
591 }
592
593 if (R->isDependent())
594 OS << " dependent";
595 else
596 OS << (R->isSatisfied() ? " satisfied" : " unsatisfied");
597 if (R->containsUnexpandedParameterPack())
598 OS << " contains_unexpanded_pack";
599}
600
601static double GetApproxValue(const llvm::APFloat &F) {
602 llvm::APFloat V = F;
603 bool ignored;
604 V.convert(llvm::APFloat::IEEEdouble(), llvm::APFloat::rmNearestTiesToEven,
605 &ignored);
606 return V.convertToDouble();
607}
608
609/// True if the \p APValue \p Value can be folded onto the current line.
610static bool isSimpleAPValue(const APValue &Value) {
611 switch (Value.getKind()) {
612 case APValue::None:
614 case APValue::Int:
615 case APValue::Float:
619 case APValue::LValue:
623 return true;
624 case APValue::Vector:
625 case APValue::Array:
626 case APValue::Struct:
627 case APValue::Matrix:
628 return false;
629 case APValue::Union:
630 return isSimpleAPValue(Value.getUnionValue());
631 }
632 llvm_unreachable("unexpected APValue kind!");
633}
634
635/// Dump the children of the \p APValue \p Value.
636///
637/// \param[in] Value The \p APValue to visit
638/// \param[in] Ty The \p QualType passed to \p Visit
639///
640/// \param[in] IdxToChildFun A function mapping an \p APValue and an index
641/// to one of the child of the \p APValue
642///
643/// \param[in] NumChildren \p IdxToChildFun will be called on \p Value with
644/// the indices in the range \p [0,NumChildren(
645///
646/// \param[in] LabelSingular The label to use on a line with a single child
647/// \param[in] LabelPlurial The label to use on a line with multiple children
648void TextNodeDumper::dumpAPValueChildren(
649 const APValue &Value, QualType Ty,
650 const APValue &(*IdxToChildFun)(const APValue &, unsigned),
651 unsigned NumChildren, StringRef LabelSingular, StringRef LabelPlurial) {
652 // To save some vertical space we print up to MaxChildrenPerLine APValues
653 // considered to be simple (by isSimpleAPValue) on a single line.
654 constexpr unsigned MaxChildrenPerLine = 4;
655 unsigned I = 0;
656 while (I < NumChildren) {
657 unsigned J = I;
658 while (J < NumChildren) {
659 if (isSimpleAPValue(IdxToChildFun(Value, J)) &&
660 (J - I < MaxChildrenPerLine)) {
661 ++J;
662 continue;
663 }
664 break;
665 }
666
667 J = std::max(I + 1, J);
668
669 // Print [I,J) on a single line.
670 AddChild(J - I > 1 ? LabelPlurial : LabelSingular, [=]() {
671 for (unsigned X = I; X < J; ++X) {
672 Visit(IdxToChildFun(Value, X), Ty);
673 if (X + 1 != J)
674 OS << ", ";
675 }
676 });
677 I = J;
678 }
679}
680
682 ColorScope Color(OS, ShowColors, ASTDumpColor::ValueKind);
683 switch (Value.getKind()) {
684 case APValue::None:
685 OS << "None";
686 return;
688 OS << "Indeterminate";
689 return;
690 case APValue::Int:
691 OS << "Int ";
692 {
693 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
694 OS << Value.getInt();
695 }
696 return;
697 case APValue::Float:
698 OS << "Float ";
699 {
700 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
701 OS << GetApproxValue(Value.getFloat());
702 }
703 return;
705 OS << "FixedPoint ";
706 {
707 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
708 OS << Value.getFixedPoint();
709 }
710 return;
711 case APValue::Vector: {
712 unsigned VectorLength = Value.getVectorLength();
713 OS << "Vector length=" << VectorLength;
714
715 dumpAPValueChildren(
716 Value, Ty,
717 [](const APValue &Value, unsigned Index) -> const APValue & {
718 return Value.getVectorElt(Index);
719 },
720 VectorLength, "element", "elements");
721 return;
722 }
724 OS << "ComplexInt ";
725 {
726 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
727 OS << Value.getComplexIntReal() << " + " << Value.getComplexIntImag()
728 << 'i';
729 }
730 return;
732 OS << "ComplexFloat ";
733 {
734 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
735 OS << GetApproxValue(Value.getComplexFloatReal()) << " + "
736 << GetApproxValue(Value.getComplexFloatImag()) << 'i';
737 }
738 return;
739 case APValue::LValue: {
740 (void)Context;
741 OS << "LValue Base=";
742 APValue::LValueBase B = Value.getLValueBase();
743 if (B.isNull())
744 OS << "null";
745 else if (const auto *BE = B.dyn_cast<const Expr *>()) {
746 OS << BE->getStmtClassName() << ' ';
747 dumpPointer(BE);
748 } else if (const auto BTI = B.dyn_cast<TypeInfoLValue>()) {
749 OS << "TypeInfoLValue ";
750 ColorScope Color(OS, ShowColors, ASTDumpColor::Type);
751 BTI.print(OS, PrintPolicy);
752 } else if (B.is<DynamicAllocLValue>()) {
753 OS << "DynamicAllocLValue";
754 auto BDA = B.getDynamicAllocType();
755 dumpType(BDA);
756 } else {
757 const auto *VDB = B.get<const ValueDecl *>();
758 OS << VDB->getDeclKindName() << "Decl";
759 dumpPointer(VDB);
760 }
761 OS << ", Null=" << Value.isNullPointer()
762 << ", Offset=" << Value.getLValueOffset().getQuantity()
763 << ", OnePastTheEnd=" << Value.isLValueOnePastTheEnd()
764 << ", HasPath=" << Value.hasLValuePath();
765 if (Value.hasLValuePath()) {
766 OS << ", PathLength=" << Value.getLValuePath().size();
767 OS << ", Path=(";
768 llvm::ListSeparator Sep;
769 for (const auto &PathEntry : Value.getLValuePath()) {
770 // We're printing all entries as array indices because don't have the
771 // type information here to do anything else.
772 OS << Sep << PathEntry.getAsArrayIndex();
773 }
774 OS << ")";
775 }
776 return;
777 }
778 case APValue::Array: {
779 unsigned ArraySize = Value.getArraySize();
780 unsigned NumInitializedElements = Value.getArrayInitializedElts();
781 OS << "Array size=" << ArraySize;
782
783 dumpAPValueChildren(
784 Value, Ty,
785 [](const APValue &Value, unsigned Index) -> const APValue & {
786 return Value.getArrayInitializedElt(Index);
787 },
788 NumInitializedElements, "element", "elements");
789
790 if (Value.hasArrayFiller()) {
791 AddChild("filler", [=] {
792 {
793 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
794 OS << ArraySize - NumInitializedElements << " x ";
795 }
796 Visit(Value.getArrayFiller(), Ty);
797 });
798 }
799
800 return;
801 }
802 case APValue::Struct: {
803 OS << "Struct";
804
805 dumpAPValueChildren(
806 Value, Ty,
807 [](const APValue &Value, unsigned Index) -> const APValue & {
808 return Value.getStructBase(Index);
809 },
810 Value.getStructNumBases(), "base", "bases");
811
812 dumpAPValueChildren(
813 Value, Ty,
814 [](const APValue &Value, unsigned Index) -> const APValue & {
815 return Value.getStructField(Index);
816 },
817 Value.getStructNumFields(), "field", "fields");
818
819 dumpAPValueChildren(
820 Value, Ty,
821 [](const APValue &Value, unsigned Index) -> const APValue & {
822 return Value.getStructVirtualBase(Index);
823 },
824 Value.getStructNumVirtualBases(), "vbase", "vbases");
825 return;
826 }
827 case APValue::Matrix: {
828 unsigned NumRows = Value.getMatrixNumRows();
829 unsigned NumCols = Value.getMatrixNumColumns();
830 OS << "Matrix " << NumRows << "x" << NumCols;
831
832 dumpAPValueChildren(
833 Value, Ty,
834 [](const APValue &Value, unsigned Index) -> const APValue & {
835 return Value.getMatrixElt(Index);
836 },
837 Value.getMatrixNumElements(), "element", "elements");
838 return;
839 }
840 case APValue::Union: {
841 OS << "Union";
842 {
843 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
844 if (const FieldDecl *FD = Value.getUnionField())
845 OS << " ." << *cast<NamedDecl>(FD);
846 }
847 // If the union value is considered to be simple, fold it into the
848 // current line to save some vertical space.
849 const APValue &UnionValue = Value.getUnionValue();
850 if (isSimpleAPValue(UnionValue)) {
851 OS << ' ';
852 Visit(UnionValue, Ty);
853 } else {
854 AddChild([=] { Visit(UnionValue, Ty); });
855 }
856
857 return;
858 }
860 OS << "MemberPointer ";
861 auto Path = Value.getMemberPointerPath();
862 for (const CXXRecordDecl *D : Path) {
863 {
864 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclName);
865 OS << D->getDeclName();
866 }
867 OS << "::";
868 }
869
870 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclName);
871 if (const ValueDecl *MemDecl = Value.getMemberPointerDecl())
872 OS << MemDecl->getDeclName();
873 else
874 OS << "null";
875 return;
876 }
878 OS << "AddrLabelDiff ";
879 OS << "&&" << Value.getAddrLabelDiffLHS()->getLabel()->getName();
880 OS << " - ";
881 OS << "&&" << Value.getAddrLabelDiffRHS()->getLabel()->getName();
882 return;
884 OS << "Reflection ";
885 switch (Value.getReflectionOperandKind()) {
887 OS << "std::meta::info{}";
888 break;
890 OS << "^^";
891 const TypeSourceInfo *TSI = static_cast<const TypeSourceInfo *>(
892 Value.getReflectionOpaqueOperand());
893 TSI->getType().print(OS, PrintPolicy);
894 break;
895 }
896 }
897 return;
898 }
899 llvm_unreachable("Unknown APValue kind!");
900}
901
902void TextNodeDumper::dumpPointer(const void *Ptr) {
903 ColorScope Color(OS, ShowColors, ASTDumpColor::Address);
904 OS << ' ' << Ptr;
905}
906
908 if (!SM)
909 return;
910
911 ColorScope Color(OS, ShowColors, ASTDumpColor::Location);
912 SourceLocation SpellingLoc = SM->getSpellingLoc(Loc);
913
914 // The general format we print out is filename:line:col, but we drop pieces
915 // that haven't changed since the last loc printed.
916 PresumedLoc PLoc = SM->getPresumedLoc(SpellingLoc);
917
918 if (PLoc.isInvalid()) {
919 OS << "<invalid sloc>";
920 return;
921 }
922
923 if (strcmp(PLoc.getFilename(), LastLocFilename) != 0) {
924 OS << PLoc.getFilename() << ':' << PLoc.getLine() << ':'
925 << PLoc.getColumn();
926 LastLocFilename = PLoc.getFilename();
927 LastLocLine = PLoc.getLine();
928 } else if (PLoc.getLine() != LastLocLine) {
929 OS << "line" << ':' << PLoc.getLine() << ':' << PLoc.getColumn();
930 LastLocLine = PLoc.getLine();
931 } else {
932 OS << "col" << ':' << PLoc.getColumn();
933 }
934}
935
937 // Can't translate locations if a SourceManager isn't available.
938 if (!SM)
939 return;
940
941 OS << " <";
942 dumpLocation(R.getBegin());
943 if (R.getBegin() != R.getEnd()) {
944 OS << ", ";
945 dumpLocation(R.getEnd());
946 }
947 OS << ">";
948
949 // <t2.c:123:421[blah], t2.c:412:321>
950}
951
953 ColorScope Color(OS, ShowColors, ASTDumpColor::Type);
954
955 SplitQualType T_split = T.split();
956 std::string T_str = QualType::getAsString(T_split, PrintPolicy);
957 OS << "'" << T_str << "'";
958
959 if (Desugar && !T.isNull()) {
960 // If the type is sugared, also dump a (shallow) desugared type when
961 // it is visibly different.
962 SplitQualType D_split = T.getSplitDesugaredType();
963 if (T_split != D_split) {
964 std::string D_str = QualType::getAsString(D_split, PrintPolicy);
965 if (T_str != D_str)
966 OS << ":'" << QualType::getAsString(D_split, PrintPolicy) << "'";
967 }
968 }
969}
970
972 OS << ' ';
974}
975
977 {
978 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
979 OS << "Concept";
980 }
981
982 const TemplateDecl *TD = TN.getAsTemplateDecl();
983 dumpPointer(TD);
984
985 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclName);
986 OS << " '";
987 TN.print(OS, PrintPolicy, TemplateName::Qualified::None);
988 OS << '\'';
989}
990
992 if (!D) {
993 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
994 OS << "<<<NULL>>>";
995 return;
996 }
997
998 {
999 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
1000 OS << D->getDeclKindName();
1001 }
1002 dumpPointer(D);
1003
1004 if (const NamedDecl *ND = dyn_cast<NamedDecl>(D)) {
1005 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclName);
1006 if (DeclarationName Name = ND->getDeclName())
1007 OS << " '" << Name << '\'';
1008 else
1009 switch (ND->getKind()) {
1010 case Decl::Decomposition:
1011 if (auto Bindings = cast<DecompositionDecl>(ND)->bindings();
1012 !Bindings.empty())
1013 OS << " first_binding '" << Bindings[0]->getDeclName() << '\'';
1014 else
1015 OS << " no_bindings";
1016 break;
1017 case Decl::Field: {
1018 auto *FD = cast<FieldDecl>(ND);
1019 OS << " field_index " << FD->getFieldIndex();
1020 break;
1021 }
1022 case Decl::ParmVar: {
1023 auto *PD = cast<ParmVarDecl>(ND);
1024 OS << " depth " << PD->getFunctionScopeDepth() << " index "
1025 << PD->getFunctionScopeIndex();
1026 break;
1027 }
1028 case Decl::TemplateTypeParm: {
1029 auto *TD = cast<TemplateTypeParmDecl>(ND);
1030 OS << " depth " << TD->getDepth() << " index " << TD->getIndex();
1031 break;
1032 }
1033 case Decl::NonTypeTemplateParm: {
1034 auto *TD = cast<NonTypeTemplateParmDecl>(ND);
1035 OS << " depth " << TD->getDepth() << " index " << TD->getIndex();
1036 break;
1037 }
1038 default:
1039 // Var, Namespace, (CXX)Record: Nothing else besides source location.
1040 dumpSourceRange(ND->getSourceRange());
1041 break;
1042 }
1043 }
1044
1045 if (const ValueDecl *VD = dyn_cast<ValueDecl>(D))
1046 dumpType(VD->getType());
1047}
1048
1050 if (ND->getDeclName()) {
1051 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclName);
1052 OS << ' ' << ND->getDeclName();
1053 }
1054}
1055
1057 const auto AccessSpelling = getAccessSpelling(AS);
1058 if (AccessSpelling.empty())
1059 return;
1060 OS << AccessSpelling;
1061}
1062
1065 if (auto *BD = dyn_cast<BlockDecl *>(C))
1066 dumpDeclRef(BD, "cleanup");
1067 else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(C))
1068 AddChild([=] {
1069 OS << "cleanup ";
1070 {
1071 ColorScope Color(OS, ShowColors, ASTDumpColor::Stmt);
1072 OS << CLE->getStmtClassName();
1073 }
1074 dumpPointer(CLE);
1075 });
1076 else
1077 llvm_unreachable("unexpected cleanup type");
1078}
1079
1082 switch (TSK) {
1083 case TSK_Undeclared:
1084 break;
1086 OS << " implicit_instantiation";
1087 break;
1089 OS << " explicit_specialization";
1090 break;
1092 OS << " explicit_instantiation_declaration";
1093 break;
1095 OS << " explicit_instantiation_definition";
1096 break;
1097 }
1098}
1099
1101 if (!NNS)
1102 return;
1103
1104 AddChild([=] {
1105 OS << "NestedNameSpecifier";
1106
1107 switch (NNS.getKind()) {
1109 auto [Namespace, Prefix] = NNS.getAsNamespaceAndPrefix();
1110 OS << " "; // "Namespace" is printed as the decl kind.
1111 dumpBareDeclRef(Namespace);
1113 break;
1114 }
1116 OS << " TypeSpec";
1117 dumpType(QualType(NNS.getAsType(), 0));
1118 break;
1120 OS << " Global";
1121 break;
1123 OS << " Super";
1124 break;
1126 llvm_unreachable("unexpected null nested name specifier");
1127 }
1128 });
1129}
1130
1131void TextNodeDumper::dumpDeclRef(const Decl *D, StringRef Label) {
1132 if (!D)
1133 return;
1134
1135 AddChild([=] {
1136 if (!Label.empty())
1137 OS << Label << ' ';
1138 dumpBareDeclRef(D);
1139 });
1140}
1141
1144 {
1145 llvm::raw_svector_ostream SS(Str);
1146 TA.print(PrintPolicy, SS, /*IncludeType=*/true);
1147 }
1148 OS << " '" << Str << "'";
1149
1150 if (!Context)
1151 return;
1152
1153 if (TemplateArgument CanonTA = Context->getCanonicalTemplateArgument(TA);
1154 !CanonTA.structurallyEquals(TA)) {
1155 llvm::SmallString<128> CanonStr;
1156 {
1157 llvm::raw_svector_ostream SS(CanonStr);
1158 CanonTA.print(PrintPolicy, SS, /*IncludeType=*/true);
1159 }
1160 if (CanonStr != Str)
1161 OS << ":'" << CanonStr << "'";
1162 }
1163}
1164
1165const char *TextNodeDumper::getCommandName(unsigned CommandID) {
1166 if (Traits)
1167 return Traits->getCommandInfo(CommandID)->Name;
1168 const comments::CommandInfo *Info =
1170 if (Info)
1171 return Info->Name;
1172 return "<not a builtin command>";
1173}
1174
1175void TextNodeDumper::printFPOptions(FPOptionsOverride FPO) {
1176#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1177 if (FPO.has##NAME##Override()) \
1178 OS << " " #NAME "=" << FPO.get##NAME##Override();
1179#include "clang/Basic/FPOptions.def"
1180}
1181
1183 const comments::FullComment *) {
1184 OS << " Text=\"" << C->getText() << "\"";
1185}
1186
1189 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
1190 switch (C->getRenderKind()) {
1192 OS << " RenderNormal";
1193 break;
1195 OS << " RenderBold";
1196 break;
1198 OS << " RenderMonospaced";
1199 break;
1201 OS << " RenderEmphasized";
1202 break;
1204 OS << " RenderAnchor";
1205 break;
1206 }
1207
1208 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
1209 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
1210}
1211
1214 OS << " Name=\"" << C->getTagName() << "\"";
1215 if (C->getNumAttrs() != 0) {
1216 OS << " Attrs: ";
1217 for (unsigned i = 0, e = C->getNumAttrs(); i != e; ++i) {
1218 const comments::HTMLStartTagComment::Attribute &Attr = C->getAttr(i);
1219 OS << " \"" << Attr.Name << "=\"" << Attr.Value << "\"";
1220 }
1221 }
1222 if (C->isSelfClosing())
1223 OS << " SelfClosing";
1224}
1225
1228 OS << " Name=\"" << C->getTagName() << "\"";
1229}
1230
1233 OS << " Name=\"" << getCommandName(C->getCommandID()) << "\"";
1234 for (unsigned i = 0, e = C->getNumArgs(); i != e; ++i)
1235 OS << " Arg[" << i << "]=\"" << C->getArgText(i) << "\"";
1236}
1237
1240 OS << " "
1242
1243 if (C->isDirectionExplicit())
1244 OS << " explicitly";
1245 else
1246 OS << " implicitly";
1247
1248 if (C->hasParamName()) {
1249 if (C->isParamIndexValid())
1250 OS << " Param=\"" << C->getParamName(FC) << "\"";
1251 else
1252 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1253 }
1254
1255 if (C->isParamIndexValid() && !C->isVarArgParam())
1256 OS << " ParamIndex=" << C->getParamIndex();
1257}
1258
1261 if (C->hasParamName()) {
1262 if (C->isPositionValid())
1263 OS << " Param=\"" << C->getParamName(FC) << "\"";
1264 else
1265 OS << " Param=\"" << C->getParamNameAsWritten() << "\"";
1266 }
1267
1268 if (C->isPositionValid()) {
1269 OS << " Position=<";
1270 for (unsigned i = 0, e = C->getDepth(); i != e; ++i) {
1271 OS << C->getIndex(i);
1272 if (i != e - 1)
1273 OS << ", ";
1274 }
1275 OS << ">";
1276 }
1277}
1278
1281 OS << " Name=\"" << getCommandName(C->getCommandID())
1282 << "\""
1283 " CloseName=\""
1284 << C->getCloseName() << "\"";
1285}
1286
1289 const comments::FullComment *) {
1290 OS << " Text=\"" << C->getText() << "\"";
1291}
1292
1295 OS << " Text=\"" << C->getText() << "\"";
1296}
1297
1299 OS << " null";
1300}
1301
1303 OS << " type";
1305}
1306
1308 const TemplateArgument &TA) {
1309 OS << " decl";
1311 dumpDeclRef(TA.getAsDecl());
1312}
1313
1315 OS << " nullptr";
1317}
1318
1320 OS << " integral";
1322}
1323
1325 const TemplateArgument &TA) {
1326 OS << " structural value";
1328}
1329
1331 AddChild(Label, [=] {
1332 {
1334 {
1335 llvm::raw_svector_ostream SS(Str);
1336 TN.print(SS, PrintPolicy);
1337 }
1338 OS << "'" << Str << "'";
1339
1340 if (Context) {
1341 if (TemplateName CanonTN = Context->getCanonicalTemplateName(TN);
1342 CanonTN != TN) {
1343 llvm::SmallString<128> CanonStr;
1344 {
1345 llvm::raw_svector_ostream SS(CanonStr);
1346 CanonTN.print(SS, PrintPolicy);
1347 }
1348 if (CanonStr != Str)
1349 OS << ":'" << CanonStr << "'";
1350 }
1351 }
1352 }
1354 });
1355}
1356
1358 switch (TN.getKind()) {
1360 AddChild([=] { Visit(TN.getAsTemplateDecl()); });
1361 return;
1363 const UsingShadowDecl *USD = TN.getAsUsingShadowDecl();
1364 AddChild([=] { Visit(USD); });
1365 AddChild("target", [=] { Visit(USD->getTargetDecl()); });
1366 return;
1367 }
1369 OS << " qualified";
1371 if (QTN->hasTemplateKeyword())
1372 OS << " keyword";
1375 return;
1376 }
1378 OS << " dependent";
1381 return;
1382 }
1384 OS << " subst";
1387 OS << " index " << STS->getIndex();
1389 OS << " pack_index " << *PackIndex;
1390 if (STS->getFinal())
1391 OS << " final";
1392 if (const TemplateTemplateParmDecl *P = STS->getParameter())
1393 AddChild("parameter", [=] { Visit(P); });
1394 dumpDeclRef(STS->getAssociatedDecl(), "associated");
1395 dumpTemplateName(STS->getReplacement(), "replacement");
1396 return;
1397 }
1399 OS << " deduced";
1401 dumpTemplateName(DTS->getUnderlying(), "underlying");
1402 AddChild("defaults", [=] {
1403 auto [StartPos, Args] = DTS->getDefaultArguments();
1404 OS << " start " << StartPos;
1405 for (const TemplateArgument &Arg : Args)
1406 AddChild([=] { Visit(Arg, SourceRange()); });
1407 });
1408 return;
1409 }
1411 OS << " pack_indexing";
1413 if (PI->isFullySubstituted())
1414 OS << " fully_substituted";
1415 if (UnsignedOrNone Index = PI->getSelectedIndex())
1416 OS << " index " << *Index;
1417 dumpTemplateName(PI->getPattern(), "pattern");
1418 AddChild("index", [=] { Visit(PI->getIndexExpr()); });
1419 for (TemplateName Expansion : PI->getExpansions())
1420 dumpTemplateName(Expansion, "expansion");
1421 return;
1422 }
1423 // FIXME: Implement these.
1425 OS << " overloaded";
1426 return;
1428 OS << " assumed";
1429 return;
1431 OS << " subst_pack";
1432 return;
1433 }
1434 llvm_unreachable("Unexpected TemplateName Kind");
1435}
1436
1442
1449
1451 const TemplateArgument &TA) {
1452 OS << " expr";
1453 if (TA.isCanonicalExpr())
1454 OS << " canonical";
1456}
1457
1459 OS << " pack";
1461}
1462
1463static void dumpBasePath(raw_ostream &OS, const CastExpr *Node) {
1464 if (Node->path_empty())
1465 return;
1466
1467 OS << " (";
1468 bool First = true;
1470 E = Node->path_end();
1471 I != E; ++I) {
1472 const CXXBaseSpecifier *Base = *I;
1473 if (!First)
1474 OS << " -> ";
1475
1476 const auto *RD = cast<CXXRecordDecl>(
1477 Base->getType()->castAsCanonical<RecordType>()->getDecl());
1478
1479 if (Base->isVirtual())
1480 OS << "virtual ";
1481 OS << RD->getName();
1482 First = false;
1483 }
1484
1485 OS << ')';
1486}
1487
1489 switch (ND->getFormalLinkage()) {
1490 case Linkage::None:
1491 // A lot of declarations have no linkage, so we only dump linkage if there
1492 // is one.
1493 break;
1494 case Linkage::Internal:
1495 OS << " internal-linkage";
1496 break;
1497 case Linkage::External:
1498 OS << " external-linkage";
1499 break;
1500 case Linkage::Module:
1501 OS << " module-linkage";
1502 break;
1503 case Linkage::Invalid:
1504 llvm_unreachable("Linkage hasn't been computed!");
1507 llvm_unreachable("Not a formal linkage!");
1508 }
1509
1510 switch (ND->getVisibility()) {
1512 // A lot of declarations have default visibility, so we only dump other
1513 // kinds of visibility.
1514 break;
1516 OS << " hidden-visibility";
1517 break;
1519 OS << " protected-visibility";
1520 break;
1521 }
1522}
1523
1525 if (!Node->isNamed())
1526 return;
1527
1528 OS << " '" << Node->getLabelDecl()->getIdentifier()->getName() << "' (";
1529
1530 auto *Target = Node->getNamedLoopOrSwitch();
1531 if (!Target) {
1532 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
1533 OS << "<<<NULL>>>";
1534 } else {
1535 {
1536 ColorScope Color(OS, ShowColors, ASTDumpColor::Stmt);
1537 OS << Target->getStmtClassName();
1538 }
1540 }
1541 OS << ")";
1542}
1543
1545 if (Node->hasInitStorage())
1546 OS << " has_init";
1547 if (Node->hasVarStorage())
1548 OS << " has_var";
1549 if (Node->hasElseStorage())
1550 OS << " has_else";
1551 if (Node->isConstexpr())
1552 OS << " constexpr";
1553 if (Node->isConsteval()) {
1554 OS << " ";
1555 if (Node->isNegatedConsteval())
1556 OS << "!";
1557 OS << "consteval";
1558 }
1559}
1560
1562 if (Node->hasInitStorage())
1563 OS << " has_init";
1564 if (Node->hasVarStorage())
1565 OS << " has_var";
1566}
1567
1569 if (Node->hasVarStorage())
1570 OS << " has_var";
1571}
1572
1574 OS << " '" << Node->getName() << "'";
1575 if (Node->isSideEntry())
1576 OS << " side_entry";
1577}
1578
1580 OS << " '" << Node->getLabel()->getName() << "'";
1581 dumpPointer(Node->getLabel());
1582}
1583
1585 if (Node->caseStmtIsGNURange())
1586 OS << " gnu_range";
1587}
1588
1590 if (const VarDecl *Cand = Node->getNRVOCandidate()) {
1591 OS << " nrvo_candidate(";
1592 dumpBareDeclRef(Cand);
1593 OS << ")";
1594 }
1595}
1596
1598 if (Node->isImplicit())
1599 OS << " implicit";
1600}
1601
1603 if (Node->isImplicit())
1604 OS << " implicit";
1605}
1606
1608 const CXXExpansionStmtPattern *Node) {
1609 switch (Node->getKind()) {
1611 OS << " enumerating";
1612 return;
1614 OS << " iterating";
1615 return;
1617 OS << " destructuring";
1618 return;
1620 OS << " dependent";
1621 return;
1622 }
1623
1624 llvm_unreachable("invalid expansion statement kind");
1625}
1626
1628 const CXXExpansionStmtInstantiation *Node) {
1630 OS << " applies_lifetime_extension";
1631}
1632
1634 if (Node->hasAPValueResult())
1635 AddChild("value",
1636 [=] { Visit(Node->getAPValueResult(), Node->getType()); });
1637}
1638
1640 if (Node->usesADL())
1641 OS << " adl";
1642 if (Node->hasStoredFPFeatures())
1643 printFPOptions(Node->getFPFeatures());
1644}
1645
1647 const char *OperatorSpelling = clang::getOperatorSpelling(Node->getOperator());
1648 if (OperatorSpelling)
1649 OS << " '" << OperatorSpelling << "'";
1650
1651 VisitCallExpr(Node);
1652}
1653
1655 OS << " <";
1656 {
1657 ColorScope Color(OS, ShowColors, ASTDumpColor::Cast);
1658 OS << Node->getCastKindName();
1659 }
1660 dumpBasePath(OS, Node);
1661 OS << ">";
1662 if (Node->hasStoredFPFeatures())
1663 printFPOptions(Node->getFPFeatures());
1664}
1665
1667 VisitCastExpr(Node);
1668 if (Node->isPartOfExplicitCast())
1669 OS << " part_of_explicit_cast";
1670}
1671
1673 OS << " ";
1674 dumpBareDeclRef(Node->getDecl());
1676 if (Node->getDecl() != Node->getFoundDecl()) {
1677 OS << " (";
1679 OS << ")";
1680 }
1681 switch (Node->isNonOdrUse()) {
1682 case NOUR_None: break;
1683 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1684 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1685 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1686 }
1688 OS << " dependent_capture";
1689 else if (Node->refersToEnclosingVariableOrCapture())
1690 OS << " refers_to_enclosing_variable_or_capture";
1691
1692 if (Node->isImmediateEscalating())
1693 OS << " immediate-escalating";
1694}
1695
1701
1703 const DependentTemplateIdExpr *Node) {
1704 OS << (Node->isConceptReference() ? " concept" : " variable template");
1705 dumpTemplateName(Node->getTemplateName(), "name");
1706}
1707
1709 const UnresolvedLookupExpr *Node) {
1710 OS << " (";
1711 if (!Node->requiresADL())
1712 OS << "no ";
1713 OS << "ADL) = '" << Node->getName() << '\'';
1714
1716 E = Node->decls_end();
1717 if (I == E)
1718 OS << " empty";
1719 for (; I != E; ++I)
1720 dumpPointer(*I);
1721}
1722
1724 {
1725 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
1726 OS << " " << Node->getDecl()->getDeclKindName() << "Decl";
1727 }
1728 OS << "='" << *Node->getDecl() << "'";
1729 dumpPointer(Node->getDecl());
1730 if (Node->isFreeIvar())
1731 OS << " isFreeIvar";
1732}
1733
1738
1742
1744 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
1745 OS << " " << Node->getValue();
1746}
1747
1749 bool isSigned = Node->getType()->isSignedIntegerType();
1750 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
1751 OS << " " << toString(Node->getValue(), 10, isSigned);
1752}
1753
1755 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
1756 OS << " " << Node->getValueAsString(/*Radix=*/10);
1757}
1758
1760 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
1761 OS << " " << Node->getValueAsApproximateDouble();
1762}
1763
1765 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
1766 OS << " ";
1767 Str->outputString(OS);
1768}
1769
1771 if (auto *Field = ILE->getInitializedFieldInUnion()) {
1772 OS << " field ";
1773 dumpBareDeclRef(Field);
1774 }
1775 OS << ' ' << (ILE->isExplicit() ? "explicit" : "implicit");
1776}
1777
1779 if (E->isResultDependent())
1780 OS << " result_dependent";
1781}
1782
1784 OS << " " << (Node->isPostfix() ? "postfix" : "prefix") << " '"
1785 << UnaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1786 if (!Node->canOverflow())
1787 OS << " cannot overflow";
1788 if (Node->hasStoredFPFeatures())
1789 printFPOptions(Node->getStoredFPFeatures());
1790}
1791
1793 const UnaryExprOrTypeTraitExpr *Node) {
1794 OS << " " << getTraitSpelling(Node->getKind());
1795
1796 if (Node->isArgumentType())
1797 dumpType(Node->getArgumentType());
1798}
1799
1801 OS << " " << (Node->isArrow() ? "->" : ".") << *Node->getMemberDecl();
1802 dumpPointer(Node->getMemberDecl());
1804 switch (Node->isNonOdrUse()) {
1805 case NOUR_None: break;
1806 case NOUR_Unevaluated: OS << " non_odr_use_unevaluated"; break;
1807 case NOUR_Constant: OS << " non_odr_use_constant"; break;
1808 case NOUR_Discarded: OS << " non_odr_use_discarded"; break;
1809 }
1810}
1811
1813 const ExtVectorElementExpr *Node) {
1814 OS << " " << Node->getAccessor().getNameStart();
1815}
1816
1818 OS << " " << Node->getAccessor().getNameStart();
1819}
1820
1822 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode()) << "'";
1823 if (Node->hasStoredFPFeatures())
1824 printFPOptions(Node->getStoredFPFeatures());
1825}
1826
1828 const CompoundAssignOperator *Node) {
1829 OS << " '" << BinaryOperator::getOpcodeStr(Node->getOpcode())
1830 << "' ComputeLHSTy=";
1832 OS << " ComputeResultTy=";
1834 if (Node->hasStoredFPFeatures())
1835 printFPOptions(Node->getStoredFPFeatures());
1836}
1837
1839 OS << " " << Node->getLabel()->getName();
1840 dumpPointer(Node->getLabel());
1841}
1842
1844 OS << " " << Node->getCastName() << "<"
1845 << Node->getTypeAsWritten().getAsString() << ">"
1846 << " <" << Node->getCastKindName();
1847 dumpBasePath(OS, Node);
1848 OS << ">";
1849}
1850
1852 OS << " " << (Node->getValue() ? "true" : "false");
1853}
1854
1856 if (Node->isImplicit())
1857 OS << " implicit";
1859 OS << " dependent_capture";
1860 OS << " this";
1861}
1862
1864 const CXXFunctionalCastExpr *Node) {
1865 OS << " functional cast to " << Node->getTypeAsWritten().getAsString() << " <"
1866 << Node->getCastKindName() << ">";
1867 if (Node->hasStoredFPFeatures())
1868 printFPOptions(Node->getFPFeatures());
1869}
1870
1873 if (Node->hasStoredFPFeatures())
1874 printFPOptions(Node->getFPFeatures());
1875}
1876
1878 const CXXUnresolvedConstructExpr *Node) {
1879 dumpType(Node->getTypeAsWritten());
1880 if (Node->isListInitialization())
1881 OS << " list";
1882}
1883
1885 CXXConstructorDecl *Ctor = Node->getConstructor();
1886 dumpType(Ctor->getType());
1887 if (Node->isElidable())
1888 OS << " elidable";
1889 if (Node->isListInitialization())
1890 OS << " list";
1891 if (Node->isStdInitListInitialization())
1892 OS << " std::initializer_list";
1893 if (Node->requiresZeroInitialization())
1894 OS << " zeroing";
1895 if (Node->isImmediateEscalating())
1896 OS << " immediate-escalating";
1897}
1898
1900 const CXXBindTemporaryExpr *Node) {
1901 OS << " (CXXTemporary";
1902 dumpPointer(Node);
1903 OS << ")";
1904}
1905
1907 if (Node->isGlobalNew())
1908 OS << " global";
1909 if (Node->isArray())
1910 OS << " array";
1911 if (Node->getOperatorNew()) {
1912 OS << ' ';
1914 }
1915 // We could dump the deallocation function used in case of error, but it's
1916 // usually not that interesting.
1917}
1918
1920 if (Node->isGlobalDelete())
1921 OS << " global";
1922 if (Node->isArrayForm())
1923 OS << " array";
1924 if (Node->getOperatorDelete()) {
1925 OS << ' ';
1927 }
1928}
1929
1931 OS << " " << getTraitSpelling(Node->getTrait());
1932}
1933
1935 OS << " " << getTraitSpelling(Node->getTrait());
1936}
1937
1941
1943 if (Node->hasRewrittenInit())
1944 OS << " has rewritten init";
1945}
1946
1948 if (Node->hasRewrittenInit())
1949 OS << " has rewritten init";
1950}
1951
1953 const MaterializeTemporaryExpr *Node) {
1954 if (const ValueDecl *VD = Node->getExtendingDecl()) {
1955 OS << " extended by ";
1956 dumpBareDeclRef(VD);
1957 }
1958}
1959
1961 for (unsigned i = 0, e = Node->getNumObjects(); i != e; ++i)
1962 dumpCleanupObject(Node->getObject(i));
1963}
1964
1966 dumpPointer(Node->getPack());
1967 dumpName(Node->getPack());
1968}
1969
1971 const CXXDependentScopeMemberExpr *Node) {
1972 OS << " " << (Node->isArrow() ? "->" : ".") << Node->getMember();
1973}
1974
1976 OS << " selector=";
1977 Node->getSelector().print(OS);
1978 switch (Node->getReceiverKind()) {
1980 break;
1981
1983 OS << " class=";
1985 break;
1986
1988 OS << " super (instance)";
1989 break;
1990
1992 OS << " super (class)";
1993 break;
1994 }
1995}
1996
1998 if (auto *BoxingMethod = Node->getBoxingMethod()) {
1999 OS << " selector=";
2000 BoxingMethod->getSelector().print(OS);
2001 }
2002}
2003
2005 if (!Node->getCatchParamDecl())
2006 OS << " catch all";
2007}
2008
2012
2014 OS << " ";
2015 Node->getSelector().print(OS);
2016}
2017
2019 OS << ' ' << *Node->getProtocol();
2020}
2021
2023 if (Node->isImplicitProperty()) {
2024 OS << " Kind=MethodRef Getter=\"";
2025 if (Node->getImplicitPropertyGetter())
2027 else
2028 OS << "(null)";
2029
2030 OS << "\" Setter=\"";
2031 if (ObjCMethodDecl *Setter = Node->getImplicitPropertySetter())
2032 Setter->getSelector().print(OS);
2033 else
2034 OS << "(null)";
2035 OS << "\"";
2036 } else {
2037 OS << " Kind=PropertyRef Property=\"" << *Node->getExplicitProperty()
2038 << '"';
2039 }
2040
2041 if (Node->isSuperReceiver())
2042 OS << " super";
2043
2044 OS << " Messaging=";
2045 if (Node->isMessagingGetter() && Node->isMessagingSetter())
2046 OS << "Getter&Setter";
2047 else if (Node->isMessagingGetter())
2048 OS << "Getter";
2049 else if (Node->isMessagingSetter())
2050 OS << "Setter";
2051}
2052
2054 const ObjCSubscriptRefExpr *Node) {
2055 if (Node->isArraySubscriptRefExpr())
2056 OS << " Kind=ArraySubscript GetterForArray=\"";
2057 else
2058 OS << " Kind=DictionarySubscript GetterForDictionary=\"";
2059 if (Node->getAtIndexMethodDecl())
2060 Node->getAtIndexMethodDecl()->getSelector().print(OS);
2061 else
2062 OS << "(null)";
2063
2064 if (Node->isArraySubscriptRefExpr())
2065 OS << "\" SetterForArray=\"";
2066 else
2067 OS << "\" SetterForDictionary=\"";
2068 if (Node->setAtIndexMethodDecl())
2069 Node->setAtIndexMethodDecl()->getSelector().print(OS);
2070 else
2071 OS << "(null)";
2072}
2073
2075 OS << " " << (Node->getValue() ? "__objc_yes" : "__objc_no");
2076}
2077
2079 OS << " ";
2080 for (unsigned I = 0, E = Node->numOfIterators(); I < E; ++I) {
2081 Visit(Node->getIteratorDecl(I));
2082 OS << " = ";
2083 const OMPIteratorExpr::IteratorRange Range = Node->getIteratorRange(I);
2084 OS << " begin ";
2085 Visit(Range.Begin);
2086 OS << " end ";
2087 Visit(Range.End);
2088 if (Range.Step) {
2089 OS << " step ";
2090 Visit(Range.Step);
2091 }
2092 }
2093}
2094
2100
2102 const RequiresExpr *Node) {
2103 if (!Node->isValueDependent())
2104 OS << (Node->isSatisfied() ? " satisfied" : " unsatisfied");
2105}
2106
2108 if (T->isSpelledAsLValue())
2109 OS << " written as lvalue reference";
2110}
2111
2113 switch (T->getSizeModifier()) {
2115 break;
2117 OS << " static";
2118 break;
2120 OS << " *";
2121 break;
2122 }
2123 OS << " " << T->getIndexTypeQualifiers().getAsString();
2124}
2125
2127 OS << " " << T->getSize();
2129}
2130
2134
2139
2142 OS << " ";
2143 dumpLocation(T->getAttributeLoc());
2144}
2145
2147 switch (T->getVectorKind()) {
2149 break;
2151 OS << " altivec";
2152 break;
2154 OS << " altivec pixel";
2155 break;
2157 OS << " altivec bool";
2158 break;
2159 case VectorKind::Neon:
2160 OS << " neon";
2161 break;
2163 OS << " neon poly";
2164 break;
2166 OS << " fixed-length sve data vector";
2167 break;
2169 OS << " fixed-length sve predicate vector";
2170 break;
2171 default:
2172 assert(isRVVFixedLengthVectorKind(T->getVectorKind()) &&
2173 "unexpected vector kind");
2174 OS << (isRVVFixedLengthMaskVectorKind(T->getVectorKind())
2175 ? " fixed-length rvv mask vector ratio "
2176 : " fixed-length rvv data vector lmul ")
2177 << getRVVFixedLengthString(T->getVectorKind());
2178 break;
2179 }
2180 OS << " " << T->getNumElements();
2181}
2182
2184 auto EI = T->getExtInfo();
2185 if (EI.getNoReturn())
2186 OS << " noreturn";
2187 if (EI.getProducesResult())
2188 OS << " produces_result";
2189 if (EI.getHasRegParm())
2190 OS << " regparm " << EI.getRegParm();
2191 OS << " " << FunctionType::getNameForCallConv(EI.getCC());
2192}
2193
2195 auto EPI = T->getExtProtoInfo();
2196 if (EPI.HasTrailingReturn)
2197 OS << " trailing_return";
2198 if (T->isConst())
2199 OS << " const";
2200 if (T->isVolatile())
2201 OS << " volatile";
2202 if (T->isRestrict())
2203 OS << " restrict";
2204 if (T->getExtProtoInfo().Variadic)
2205 OS << " variadic";
2206 switch (EPI.RefQualifier) {
2207 case RQ_None:
2208 break;
2209 case RQ_LValue:
2210 OS << " &";
2211 break;
2212 case RQ_RValue:
2213 OS << " &&";
2214 break;
2215 }
2216
2217 switch (EPI.ExceptionSpec.Type) {
2218 case EST_None:
2219 break;
2220 case EST_DynamicNone:
2221 OS << " exceptionspec_dynamic_none";
2222 break;
2223 case EST_Dynamic:
2224 OS << " exceptionspec_dynamic";
2225 break;
2226 case EST_MSAny:
2227 OS << " exceptionspec_ms_any";
2228 break;
2229 case EST_NoThrow:
2230 OS << " exceptionspec_nothrow";
2231 break;
2232 case EST_BasicNoexcept:
2233 OS << " exceptionspec_basic_noexcept";
2234 break;
2236 OS << " exceptionspec_dependent_noexcept";
2237 break;
2238 case EST_NoexceptFalse:
2239 OS << " exceptionspec_noexcept_false";
2240 break;
2241 case EST_NoexceptTrue:
2242 OS << " exceptionspec_noexcept_true";
2243 break;
2244 case EST_Unevaluated:
2245 OS << " exceptionspec_unevaluated";
2246 break;
2247 case EST_Uninstantiated:
2248 OS << " exceptionspec_uninstantiated";
2249 break;
2250 case EST_Unparsed:
2251 OS << " exceptionspec_unparsed";
2252 break;
2253 }
2254 if (!EPI.ExceptionSpec.Exceptions.empty()) {
2255 AddChild([=] {
2256 OS << "Exceptions:";
2257 for (unsigned I = 0, N = EPI.ExceptionSpec.Exceptions.size(); I != N;
2258 ++I) {
2259 if (I)
2260 OS << ",";
2261 dumpType(EPI.ExceptionSpec.Exceptions[I]);
2262 }
2263 });
2264 }
2265 if (EPI.ExceptionSpec.NoexceptExpr) {
2266 AddChild([=] {
2267 OS << "NoexceptExpr: ";
2268 Visit(EPI.ExceptionSpec.NoexceptExpr);
2269 });
2270 }
2271 dumpDeclRef(EPI.ExceptionSpec.SourceDecl, "ExceptionSourceDecl");
2272 dumpDeclRef(EPI.ExceptionSpec.SourceTemplate, "ExceptionSourceTemplate");
2273
2274 // FIXME: Consumed parameters.
2276}
2277
2279 if (ElaboratedTypeKeyword K = T->getKeyword();
2281 OS << ' ' << TypeWithKeyword::getKeywordName(K);
2282 dumpNestedNameSpecifier(T->getQualifier());
2283 dumpDeclRef(T->getDecl());
2284}
2285
2287 if (ElaboratedTypeKeyword K = T->getKeyword();
2289 OS << ' ' << TypeWithKeyword::getKeywordName(K);
2290 dumpNestedNameSpecifier(T->getQualifier());
2291 dumpDeclRef(T->getDecl());
2292 dumpType(T->desugar());
2293}
2294
2296 if (ElaboratedTypeKeyword K = T->getKeyword();
2298 OS << ' ' << TypeWithKeyword::getKeywordName(K);
2299 dumpNestedNameSpecifier(T->getQualifier());
2300 dumpDeclRef(T->getDecl());
2301 if (!T->typeMatchesDecl()) {
2302 OS << " divergent";
2303 dumpType(T->desugar());
2304 }
2305}
2306
2307void TextNodeDumper::VisitUnaryTransformType(const UnaryTransformType *T) {
2308 switch (T->getUTTKind()) {
2309#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
2310 case UnaryTransformType::Enum: \
2311 OS << " " #Trait; \
2312 break;
2313#include "clang/Basic/BuiltinTraits.inc"
2314 }
2315}
2316
2317void TextNodeDumper::VisitTagType(const TagType *T) {
2318 if (T->isCanonicalUnqualified())
2319 OS << " canonical";
2320 if (T->isTagOwned())
2321 OS << " owns_tag";
2322 if (T->isInjected())
2323 OS << " injected";
2324 if (ElaboratedTypeKeyword K = T->getKeyword();
2326 OS << ' ' << TypeWithKeyword::getKeywordName(K);
2327 dumpNestedNameSpecifier(T->getQualifier());
2328 dumpDeclRef(T->getDecl());
2329}
2330
2331void TextNodeDumper::VisitTemplateTypeParmType(const TemplateTypeParmType *T) {
2332 OS << " depth " << T->getDepth() << " index " << T->getIndex();
2333 if (T->isParameterPack())
2334 OS << " pack";
2335 dumpDeclRef(T->getDecl());
2336}
2337
2339 const SubstTemplateTypeParmType *T) {
2340 dumpDeclRef(T->getAssociatedDecl());
2341 VisitTemplateTypeParmDecl(T->getReplacedParameter());
2342 if (auto PackIndex = T->getPackIndex())
2343 OS << " pack_index " << *PackIndex;
2344 if (T->getFinal())
2345 OS << " final";
2346}
2347
2349 const SubstTemplateTypeParmPackType *T) {
2350 dumpDeclRef(T->getAssociatedDecl());
2351 VisitTemplateTypeParmDecl(T->getReplacedParameter());
2352}
2353
2354void TextNodeDumper::VisitDeducedType(const DeducedType *T) {
2355 switch (T->getDeducedKind()) {
2357 OS << " undeduced";
2358 break;
2360 break;
2362 OS << " deduced-as-dependent";
2363 break;
2365 OS << " deduced-as-pack";
2366 break;
2367 }
2368}
2369
2370void TextNodeDumper::VisitAutoType(const AutoType *T) {
2372 // Not necessary to dump the keyword since it's spelled plainly in the printed
2373 // type anyway.
2374 if (T->isConstrained())
2375 AddChild([=] { dumpBareConcept(T->getTypeConstraintConcept()); });
2376}
2377
2379 const DeducedTemplateSpecializationType *T) {
2381 dumpTemplateName(T->getTemplateName(), "name");
2382}
2383
2385 const TemplateSpecializationType *T) {
2386 if (T->isTypeAlias())
2387 OS << " alias";
2388 if (ElaboratedTypeKeyword K = T->getKeyword();
2390 OS << ' ' << TypeWithKeyword::getKeywordName(K);
2391 dumpTemplateName(T->getTemplateName(), "name");
2392}
2393
2395 const InjectedClassNameType *T) {
2396 dumpDeclRef(T->getDecl());
2397}
2398
2402
2403void TextNodeDumper::VisitPackExpansionType(const PackExpansionType *T) {
2404 if (auto N = T->getNumExpansions())
2405 OS << " expansions " << *N;
2406}
2407
2409 // By default, add extra Type details with no extra loc info.
2411}
2412// FIXME: override behavior for TypeLocs that have interesting location
2413// information, such as the qualifier in ElaboratedTypeLoc.
2414
2416
2418 dumpName(D);
2420 if (D->isModulePrivate())
2421 OS << " __module_private__";
2422
2423 const TagDecl *TD = D->getUnderlyingType()->getAsTagDecl();
2424 if (TD && TD->getTypedefNameForAnonDecl()) {
2426 }
2427}
2428
2430 if (D->isScoped()) {
2431 if (D->isScopedUsingClassTag())
2432 OS << " class";
2433 else
2434 OS << " struct";
2435 }
2436 dumpName(D);
2437 if (D->isModulePrivate())
2438 OS << " __module_private__";
2439 if (D->isFixed())
2441
2442 if (const auto *Instance = D->getTemplateInstantiationPattern()) {
2443 OS << " instantiated_from";
2444 dumpPointer(Instance);
2445 }
2446
2448}
2449
2451 OS << ' ' << D->getKindName();
2452 dumpName(D);
2453 if (D->isModulePrivate())
2454 OS << " __module_private__";
2455 if (D->isCompleteDefinition())
2456 OS << " definition";
2457
2458 if (!D->isImplicit() && !D->getDescribedTemplate()) {
2460 }
2461}
2462
2467
2469 dumpName(D);
2470 dumpType(D->getType());
2471
2472 for (const auto *Child : D->chain())
2473 dumpDeclRef(Child);
2474}
2475
2477 dumpName(D);
2478 dumpType(D->getType());
2480
2481 StorageClass SC = D->getStorageClass();
2482 if (SC != SC_None)
2484 if (D->isInlineSpecified())
2485 OS << " inline";
2486 if (D->isVirtualAsWritten())
2487 OS << " virtual";
2488 if (D->isModulePrivate())
2489 OS << " __module_private__";
2490
2491 if (D->isPureVirtual())
2492 OS << " pure";
2493 if (D->isDefaulted()) {
2494 OS << " default";
2495 if (D->isDeleted())
2496 OS << "_delete";
2497 }
2498 if (D->isDeletedAsWritten())
2499 OS << " delete";
2500 if (D->isTrivial())
2501 OS << " trivial";
2502
2503 if (const StringLiteral *M = D->getDeletedMessage())
2504 AddChild("delete message", [=] { Visit(M); });
2505
2507 OS << (isa<CXXDestructorDecl>(D) ? " not_selected" : " ineligible");
2508
2509 if (const auto *FPT = D->getType()->getAs<FunctionProtoType>()) {
2510 FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
2511 switch (EPI.ExceptionSpec.Type) {
2512 default:
2513 break;
2514 case EST_Unevaluated:
2515 OS << " noexcept-unevaluated " << EPI.ExceptionSpec.SourceDecl;
2516 break;
2517 case EST_Uninstantiated:
2518 OS << " noexcept-uninstantiated " << EPI.ExceptionSpec.SourceTemplate;
2519 break;
2520 }
2521 }
2522
2523 if (const auto *MD = dyn_cast<CXXMethodDecl>(D)) {
2524 if (MD->size_overridden_methods() != 0) {
2525 auto dumpOverride = [=](const CXXMethodDecl *D) {
2526 SplitQualType T_split = D->getType().split();
2527 OS << D << " " << D->getParent()->getName() << "::" << D->getDeclName()
2528 << " '" << QualType::getAsString(T_split, PrintPolicy) << "'";
2529 };
2530
2531 AddChild([=] {
2532 auto Overrides = MD->overridden_methods();
2533 OS << "Overrides: [ ";
2534 dumpOverride(*Overrides.begin());
2535 for (const auto *Override : llvm::drop_begin(Overrides)) {
2536 OS << ", ";
2537 dumpOverride(Override);
2538 }
2539 OS << " ]";
2540 });
2541 }
2542 }
2543
2544 if (!D->isInlineSpecified() && D->isInlined()) {
2545 OS << " implicit-inline";
2546 }
2547 // Since NumParams comes from the FunctionProtoType of the FunctionDecl and
2548 // the Params are set later, it is possible for a dump during debugging to
2549 // encounter a FunctionDecl that has been created but hasn't been assigned
2550 // ParmVarDecls yet.
2551 if (!D->param_empty() && !D->param_begin())
2552 OS << " <<<NULL params x " << D->getNumParams() << ">>>";
2553
2554 if (const auto *Instance = D->getTemplateInstantiationPattern()) {
2555 OS << " instantiated_from";
2556 dumpPointer(Instance);
2557 }
2558
2561 }
2562}
2563
2565 const CXXDeductionGuideDecl *D) {
2567 switch (D->getDeductionCandidateKind()) {
2570 return;
2572 OS << " aggregate ";
2573 break;
2574 }
2575}
2576
2579 OS << " extended by ";
2581 OS << " mangling ";
2582 {
2583 ColorScope Color(OS, ShowColors, ASTDumpColor::Value);
2584 OS << D->getManglingNumber();
2585 }
2586}
2587
2589 dumpName(D);
2590 dumpType(D->getType());
2591 if (D->isMutable())
2592 OS << " mutable";
2593 if (D->isModulePrivate())
2594 OS << " __module_private__";
2595}
2596
2599 dumpName(D);
2600 if (const auto *P = dyn_cast<ParmVarDecl>(D);
2601 P && P->isExplicitObjectParameter())
2602 OS << " this";
2603
2604 dumpType(D->getType());
2606 StorageClass SC = D->getStorageClass();
2607 if (SC != SC_None)
2609 switch (D->getTLSKind()) {
2610 case VarDecl::TLS_None:
2611 break;
2613 OS << " tls";
2614 break;
2616 OS << " tls_dynamic";
2617 break;
2618 }
2619 if (D->isModulePrivate())
2620 OS << " __module_private__";
2621 if (D->isNRVOVariable())
2622 OS << " nrvo";
2623 if (D->isInline())
2624 OS << " inline";
2625 if (D->isConstexpr())
2626 OS << " constexpr";
2627 if (D->hasInit()) {
2628 switch (D->getInitStyle()) {
2629 case VarDecl::CInit:
2630 OS << " cinit";
2631 break;
2632 case VarDecl::CallInit:
2633 OS << " callinit";
2634 break;
2635 case VarDecl::ListInit:
2636 OS << " listinit";
2637 break;
2639 OS << " parenlistinit";
2640 }
2641 }
2642 if (D->needsDestruction(D->getASTContext()))
2643 OS << " destroyed";
2644 if (D->isParameterPack())
2645 OS << " pack";
2646
2647 if (const auto *Instance = D->getTemplateInstantiationPattern()) {
2648 OS << " instantiated_from";
2649 dumpPointer(Instance);
2650 }
2651
2652 if (D->hasInit()) {
2653 const Expr *E = D->getInit();
2654 // Only dump the value of constexpr VarDecls for now.
2655 if (E && !E->isValueDependent() && D->isConstexpr() &&
2656 !D->getType()->isDependentType()) {
2657 const APValue *Value = D->evaluateValue();
2658 if (Value)
2659 AddChild("value", [=] { Visit(*Value, E->getType()); });
2660 }
2661 }
2662
2663 if (!D->getDescribedVarTemplate()) {
2665 }
2666}
2667
2669 dumpName(D);
2670 dumpType(D->getType());
2671}
2672
2674 if (D->isNothrow())
2675 OS << " nothrow";
2676}
2677
2679 OS << ' ' << D->getImportedModule()->getFullModuleName();
2680
2681 for (Decl *InitD :
2683 dumpDeclRef(InitD, "initializer");
2684}
2685
2687 OS << ' ';
2688 switch (D->getCommentKind()) {
2689 case PCK_Unknown:
2690 llvm_unreachable("unexpected pragma comment kind");
2691 case PCK_Compiler:
2692 OS << "compiler";
2693 break;
2694 case PCK_ExeStr:
2695 OS << "exestr";
2696 break;
2697 case PCK_Lib:
2698 OS << "lib";
2699 break;
2700 case PCK_Linker:
2701 OS << "linker";
2702 break;
2703 case PCK_User:
2704 OS << "user";
2705 break;
2706 case PCK_Copyright:
2707 OS << "copyright";
2708 break;
2709 }
2710 StringRef Arg = D->getArg();
2711 if (!Arg.empty())
2712 OS << " \"" << Arg << "\"";
2713}
2714
2716 const PragmaDetectMismatchDecl *D) {
2717 OS << " \"" << D->getName() << "\" \"" << D->getValue() << "\"";
2718}
2719
2721 const OMPExecutableDirective *D) {
2722 if (D->isStandaloneDirective())
2723 OS << " openmp_standalone_directive";
2724}
2725
2727 const OMPDeclareReductionDecl *D) {
2728 dumpName(D);
2729 dumpType(D->getType());
2730 OS << " combiner";
2732 if (const auto *Initializer = D->getInitializer()) {
2733 OS << " initializer";
2735 switch (D->getInitializerKind()) {
2737 OS << " omp_priv = ";
2738 break;
2740 OS << " omp_priv ()";
2741 break;
2743 break;
2744 }
2745 }
2746}
2747
2749 for (const auto *C : D->clauselists()) {
2750 AddChild([=] {
2751 if (!C) {
2752 ColorScope Color(OS, ShowColors, ASTDumpColor::Null);
2753 OS << "<<<NULL>>> OMPClause";
2754 return;
2755 }
2756 {
2757 ColorScope Color(OS, ShowColors, ASTDumpColor::Attr);
2758 StringRef ClauseName(
2759 llvm::omp::getOpenMPClauseName(C->getClauseKind()));
2760 OS << "OMP" << ClauseName.substr(/*Start=*/0, /*N=*/1).upper()
2761 << ClauseName.drop_front() << "Clause";
2762 }
2763 dumpPointer(C);
2764 dumpSourceRange(SourceRange(C->getBeginLoc(), C->getEndLoc()));
2765 });
2766 }
2767}
2768
2773
2775 dumpName(D);
2776 if (D->isInline())
2777 OS << " inline";
2778 if (D->isNested())
2779 OS << " nested";
2780 if (!D->isFirstDecl())
2781 dumpDeclRef(D->getFirstDecl(), "original");
2782
2784}
2785
2790
2795
2797 dumpName(D);
2799
2800 const TagDecl *TD = D->getUnderlyingType()->getAsTagDecl();
2801 if (TD && TD->getTypedefNameForAnonDecl()) {
2803 }
2804}
2805
2811
2813 VisitRecordDecl(D);
2814 if (const auto *Instance = D->getTemplateInstantiationPattern()) {
2815 OS << " instantiated_from";
2816 dumpPointer(Instance);
2817 }
2818 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(D)) {
2819 dumpTemplateSpecializationKind(CTSD->getSpecializationKind());
2820 if (CTSD->hasStrictPackMatch())
2821 OS << " strict-pack-match";
2822 }
2823
2825
2826 if (!D->isCompleteDefinition())
2827 return;
2828
2829 AddChild([=] {
2830 {
2831 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2832 OS << "DefinitionData";
2833 }
2834#define FLAG(fn, name) \
2835 if (D->fn()) \
2836 OS << " " #name;
2837 FLAG(isParsingBaseSpecifiers, parsing_base_specifiers);
2838
2839 FLAG(isGenericLambda, generic);
2840 FLAG(isLambda, lambda);
2841
2842 FLAG(isAnonymousStructOrUnion, is_anonymous);
2843 FLAG(canPassInRegisters, pass_in_registers);
2844 FLAG(isEmpty, empty);
2845 FLAG(isAggregate, aggregate);
2846 FLAG(isStandardLayout, standard_layout);
2847 FLAG(isTriviallyCopyable, trivially_copyable);
2848 FLAG(isPOD, pod);
2849 FLAG(isTrivial, trivial);
2850 FLAG(isPolymorphic, polymorphic);
2851 FLAG(isAbstract, abstract);
2852 FLAG(isLiteral, literal);
2853
2854 FLAG(hasUserDeclaredConstructor, has_user_declared_ctor);
2855 FLAG(hasConstexprNonCopyMoveConstructor, has_constexpr_non_copy_move_ctor);
2856 FLAG(hasMutableFields, has_mutable_fields);
2857 FLAG(hasVariantMembers, has_variant_members);
2858 FLAG(allowConstDefaultInit, can_const_default_init);
2859
2860 AddChild([=] {
2861 {
2862 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2863 OS << "DefaultConstructor";
2864 }
2865 FLAG(hasDefaultConstructor, exists);
2866 FLAG(hasTrivialDefaultConstructor, trivial);
2867 FLAG(hasNonTrivialDefaultConstructor, non_trivial);
2868 FLAG(hasUserProvidedDefaultConstructor, user_provided);
2869 FLAG(hasConstexprDefaultConstructor, constexpr);
2870 FLAG(needsImplicitDefaultConstructor, needs_implicit);
2871 FLAG(defaultedDefaultConstructorIsConstexpr, defaulted_is_constexpr);
2872 });
2873
2874 AddChild([=] {
2875 {
2876 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2877 OS << "CopyConstructor";
2878 }
2879 FLAG(hasSimpleCopyConstructor, simple);
2880 FLAG(hasTrivialCopyConstructor, trivial);
2881 FLAG(hasNonTrivialCopyConstructor, non_trivial);
2882 FLAG(hasUserDeclaredCopyConstructor, user_declared);
2883 FLAG(hasCopyConstructorWithConstParam, has_const_param);
2884 FLAG(needsImplicitCopyConstructor, needs_implicit);
2885 FLAG(needsOverloadResolutionForCopyConstructor,
2886 needs_overload_resolution);
2888 FLAG(defaultedCopyConstructorIsDeleted, defaulted_is_deleted);
2889 FLAG(implicitCopyConstructorHasConstParam, implicit_has_const_param);
2890 });
2891
2892 AddChild([=] {
2893 {
2894 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2895 OS << "MoveConstructor";
2896 }
2897 FLAG(hasMoveConstructor, exists);
2898 FLAG(hasSimpleMoveConstructor, simple);
2899 FLAG(hasTrivialMoveConstructor, trivial);
2900 FLAG(hasNonTrivialMoveConstructor, non_trivial);
2901 FLAG(hasUserDeclaredMoveConstructor, user_declared);
2902 FLAG(needsImplicitMoveConstructor, needs_implicit);
2903 FLAG(needsOverloadResolutionForMoveConstructor,
2904 needs_overload_resolution);
2906 FLAG(defaultedMoveConstructorIsDeleted, defaulted_is_deleted);
2907 });
2908
2909 AddChild([=] {
2910 {
2911 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2912 OS << "CopyAssignment";
2913 }
2914 FLAG(hasSimpleCopyAssignment, simple);
2915 FLAG(hasTrivialCopyAssignment, trivial);
2916 FLAG(hasNonTrivialCopyAssignment, non_trivial);
2917 FLAG(hasCopyAssignmentWithConstParam, has_const_param);
2918 FLAG(hasUserDeclaredCopyAssignment, user_declared);
2919 FLAG(needsImplicitCopyAssignment, needs_implicit);
2920 FLAG(needsOverloadResolutionForCopyAssignment, needs_overload_resolution);
2921 FLAG(implicitCopyAssignmentHasConstParam, implicit_has_const_param);
2922 });
2923
2924 AddChild([=] {
2925 {
2926 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2927 OS << "MoveAssignment";
2928 }
2929 FLAG(hasMoveAssignment, exists);
2930 FLAG(hasSimpleMoveAssignment, simple);
2931 FLAG(hasTrivialMoveAssignment, trivial);
2932 FLAG(hasNonTrivialMoveAssignment, non_trivial);
2933 FLAG(hasUserDeclaredMoveAssignment, user_declared);
2934 FLAG(needsImplicitMoveAssignment, needs_implicit);
2935 FLAG(needsOverloadResolutionForMoveAssignment, needs_overload_resolution);
2936 });
2937
2938 AddChild([=] {
2939 {
2940 ColorScope Color(OS, ShowColors, ASTDumpColor::DeclKindName);
2941 OS << "Destructor";
2942 }
2943 FLAG(hasSimpleDestructor, simple);
2944 FLAG(hasIrrelevantDestructor, irrelevant);
2945 FLAG(hasTrivialDestructor, trivial);
2946 FLAG(hasNonTrivialDestructor, non_trivial);
2947 FLAG(hasUserDeclaredDestructor, user_declared);
2948 FLAG(hasConstexprDestructor, constexpr);
2949 FLAG(needsImplicitDestructor, needs_implicit);
2950 FLAG(needsOverloadResolutionForDestructor, needs_overload_resolution);
2952 FLAG(defaultedDestructorIsDeleted, defaulted_is_deleted);
2953 });
2954 });
2955
2956 for (const auto &I : D->bases()) {
2957 AddChild([=] {
2958 if (I.isVirtual())
2959 OS << "virtual ";
2960 dumpAccessSpecifier(I.getAccessSpecifier());
2961 dumpType(I.getType());
2962 if (I.isPackExpansion())
2963 OS << "...";
2964 });
2965 }
2966}
2967
2972
2977
2982
2986
2988 if (const auto *TC = D->getTypeConstraint()) {
2989 OS << ' ';
2990 dumpBareConcept(TC->getNamedConcept());
2991 if (const auto *USD =
2992 dyn_cast_if_present<UsingShadowDecl>(TC->getFoundDecl())) {
2993 OS << " (";
2994 dumpBareDeclRef(USD);
2995 OS << ")";
2996 }
2997 } else if (D->wasDeclaredWithTypename())
2998 OS << " typename";
2999 else
3000 OS << " class";
3001 OS << " depth " << D->getDepth() << " index " << D->getIndex();
3002 if (D->isParameterPack())
3003 OS << " ...";
3004 dumpName(D);
3005}
3006
3008 const NonTypeTemplateParmDecl *D) {
3009 dumpType(D->getType());
3010 OS << " depth " << D->getDepth() << " index " << D->getIndex();
3011 if (D->isParameterPack())
3012 OS << " ...";
3013 dumpName(D);
3014}
3015
3017 const TemplateTemplateParmDecl *D) {
3018 OS << " depth " << D->getDepth() << " index " << D->getIndex();
3019 if (D->isParameterPack())
3020 OS << " ...";
3021 dumpName(D);
3022}
3023
3025 OS << ' ';
3027 OS << D->getDeclName();
3029}
3030
3032 OS << ' ';
3034}
3035
3037 const UnresolvedUsingTypenameDecl *D) {
3038 OS << ' ';
3040 OS << D->getDeclName();
3041}
3042
3044 const UnresolvedUsingValueDecl *D) {
3045 OS << ' ';
3047 OS << D->getDeclName();
3048 dumpType(D->getType());
3049}
3050
3055
3057 const ConstructorUsingShadowDecl *D) {
3058 if (D->constructsVirtualBase())
3059 OS << " virtual";
3060
3061 AddChild([=] {
3062 OS << "target ";
3064 });
3065
3066 AddChild([=] {
3067 OS << "nominated ";
3069 OS << ' ';
3071 });
3072
3073 AddChild([=] {
3074 OS << "constructed ";
3076 OS << ' ';
3078 });
3079}
3080
3082 switch (D->getLanguage()) {
3084 OS << " C";
3085 break;
3087 OS << " C++";
3088 break;
3089 }
3090}
3091
3093 OS << ' ';
3095}
3096
3098 const ExplicitInstantiationDecl *D) {
3100 if (D->isExternTemplate())
3101 OS << " extern";
3102 if (D->getQualifierLoc())
3104 if (const NamedDecl *Spec = D->getSpecialization()) {
3105 OS << " '" << Spec->getDeclName() << "'";
3106 dumpDeclRef(Spec);
3107 }
3108}
3109
3111 if (TypeSourceInfo *T = D->getFriendType())
3112 dumpType(T->getType());
3113 if (D->isPackExpansion())
3114 OS << "...";
3115}
3116
3118 if (D->getFriendKind() !=
3120 VisitFriendDecl(D);
3121 return;
3122 }
3123
3125 if (D->isPackExpansion())
3126 OS << "...";
3127}
3128
3130 dumpName(D);
3131 dumpType(D->getType());
3132 if (D->getSynthesize())
3133 OS << " synthesize";
3134
3135 switch (D->getAccessControl()) {
3136 case ObjCIvarDecl::None:
3137 OS << " none";
3138 break;
3140 OS << " private";
3141 break;
3143 OS << " protected";
3144 break;
3146 OS << " public";
3147 break;
3149 OS << " package";
3150 break;
3151 }
3152}
3153
3155 if (D->isInstanceMethod())
3156 OS << " -";
3157 else
3158 OS << " +";
3159 dumpName(D);
3160 dumpType(D->getReturnType());
3161
3162 if (D->isVariadic())
3163 OS << " variadic";
3164}
3165
3167 dumpName(D);
3168 switch (D->getVariance()) {
3170 break;
3171
3173 OS << " covariant";
3174 break;
3175
3177 OS << " contravariant";
3178 break;
3179 }
3180
3181 if (D->hasExplicitBound())
3182 OS << " bounded";
3184}
3185
3187 dumpName(D);
3190 for (const auto *P : D->protocols())
3191 dumpDeclRef(P);
3192}
3193
3199
3201 dumpName(D);
3202
3203 for (const auto *Child : D->protocols())
3204 dumpDeclRef(Child);
3205}
3206
3208 dumpName(D);
3209 dumpDeclRef(D->getSuperClass(), "super");
3210
3212 for (const auto *Child : D->protocols())
3213 dumpDeclRef(Child);
3214}
3215
3222
3228
3230 dumpName(D);
3231 dumpType(D->getType());
3232
3234 OS << " required";
3236 OS << " optional";
3237
3241 OS << " readonly";
3243 OS << " assign";
3245 OS << " readwrite";
3247 OS << " retain";
3249 OS << " copy";
3251 OS << " nonatomic";
3253 OS << " atomic";
3255 OS << " weak";
3257 OS << " strong";
3259 OS << " unsafe_unretained";
3261 OS << " class";
3263 OS << " direct";
3265 dumpDeclRef(D->getGetterMethodDecl(), "getter");
3267 dumpDeclRef(D->getSetterMethodDecl(), "setter");
3268 }
3269}
3270
3274 OS << " synthesize";
3275 else
3276 OS << " dynamic";
3279}
3280
3282 if (D->isVariadic())
3283 OS << " variadic";
3284
3285 if (D->capturesCXXThis())
3286 OS << " captures_this";
3287}
3288
3293
3295 VisitStmt(S);
3296 if (S->hasStoredFPFeatures())
3297 printFPOptions(S->getStoredFPFeatures());
3298}
3299
3301 if (D->isCBuffer())
3302 OS << " cbuffer";
3303 else
3304 OS << " tbuffer";
3305 dumpName(D);
3306}
3307
3309 const HLSLRootSignatureDecl *D) {
3310 dumpName(D);
3311 OS << " version: ";
3312 switch (D->getVersion()) {
3313 case llvm::dxbc::RootSignatureVersion::V1_0:
3314 OS << "1.0";
3315 break;
3316 case llvm::dxbc::RootSignatureVersion::V1_1:
3317 OS << "1.1";
3318 break;
3319 case llvm::dxbc::RootSignatureVersion::V1_2:
3320 OS << "1.2";
3321 break;
3322 }
3323 OS << ", ";
3324 llvm::hlsl::rootsig::dumpRootElements(OS, D->getRootElements());
3325}
3326
3328 OS << (E->isInOut() ? " inout" : " out");
3329}
3330
3335 if (S->isOrphanedLoopConstruct())
3336 OS << " <orphan>";
3337 else
3338 OS << " parent: " << S->getParentComputeConstructKind();
3339}
3340
3345
3349
3354
3359
3364
3369 const OpenACCCacheConstruct *S) {
3371 if (S->hasReadOnly())
3372 OS <<" readonly";
3373}
3388
3394
3396 OS << " " << D->getDirectiveKind();
3397
3398 for (const OpenACCClause *C : D->clauses())
3399 AddChild([=] {
3400 Visit(C);
3401 for (const Stmt *S : C->children())
3402 AddChild([=] { Visit(S); });
3403 });
3404}
3406 OS << " " << D->getDirectiveKind();
3407
3409
3410 AddChild([=] { Visit(D->getFunctionReference()); });
3411
3412 for (const OpenACCClause *C : D->clauses())
3413 AddChild([=] {
3414 Visit(C);
3415 for (const Stmt *S : C->children())
3416 AddChild([=] { Visit(S); });
3417 });
3418}
3419
3421 const OpenACCRoutineDeclAttr *A) {
3422 for (const OpenACCClause *C : A->Clauses)
3423 AddChild([=] {
3424 Visit(C);
3425 for (const Stmt *S : C->children())
3426 AddChild([=] { Visit(S); });
3427 });
3428}
3429
3430void TextNodeDumper::VisitOMPCaptureKindAttr(const OMPCaptureKindAttr *A) {
3431 OS << " " << llvm::omp::getOpenMPClauseName(A->getCaptureKind());
3432}
3433
3435 AddChild("begin", [=] { OS << S->getStartingElementPos(); });
3436 AddChild("number of elements", [=] { OS << S->getDataElementCount(); });
3437}
3438
3440 OS << ' ' << AE->getOpAsString();
3441}
3442
3444 VisitStmt(S);
3445 if (S->hasStoredFPFeatures())
3446 printFPOptions(S->getStoredFPFeatures());
3447}
static double GetApproxValue(const llvm::APFloat &F)
Definition APValue.cpp:739
#define V(N, I)
Defines enumerations for traits support.
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:97
Defines the clang::Module class, which describes a module in the source code.
llvm::SmallVector< std::pair< const MemRegion *, SVal >, 4 > Bindings
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.
C Language Family Type Representation.
OpenACCAtomicKind getAtomicKind() const
bool hasReadOnly() const
This class represents a 'loop' construct. The 'loop' construct applies to a 'for' loop (or range-for ...
bool isOrphanedLoopConstruct() const
OpenACC 3.3 2.9: An orphaned loop construct is a loop construct that is not lexically enclosed within...
OpenACCDirectiveKind getParentComputeConstructKind() const
llvm::APInt getValue() const
QualType getDynamicAllocType() const
Definition APValue.cpp:182
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition APValue.h:158
@ Indeterminate
This object has an indeterminate value (C++ [basic.indet]).
Definition APValue.h:167
@ None
There is no such object (it's outside its lifetime).
Definition APValue.h:165
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:245
ArrayRef< Decl * > getModuleInitializers(Module *M)
Get the initializations to perform when importing a module, if any.
const clang::PrintingPolicy & getPrintingPolicy() const
Definition ASTContext.h:905
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:4619
LabelDecl * getLabel() const
Definition Expr.h:4642
An Embarcadero array type trait, as used in the implementation of __array_rank and __array_extent.
Definition ExprCXX.h:3011
ArrayTypeTrait getTrait() const
Definition ExprCXX.h:3051
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition TypeBase.h:3820
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:7014
StringRef getOpAsString() const
Definition Expr.h:7078
Attr - This represents one attribute.
Definition Attr.h:47
attr::Kind getKind() const
Definition Attr.h:93
bool isInherited() const
Definition Attr.h:102
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition Attr.h:106
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4107
StringRef getOpcodeStr() const
Definition Expr.h:4173
bool hasStoredFPFeatures() const
Definition Expr.h:4292
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4304
Opcode getOpcode() const
Definition Expr.h:4152
A binding in a decomposition declaration.
Definition DeclCXX.h:4223
A class which contains all the information about a particular captured value.
Definition Decl.h:4832
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4826
bool capturesCXXThis() const
Definition Decl.h:4958
bool isVariadic() const
Definition Decl.h:4901
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:1498
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:728
bool getValue() const
Definition ExprCXX.h:745
Represents a call to a C++ constructor.
Definition ExprCXX.h:1553
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1622
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1646
bool isImmediateEscalating() const
Definition ExprCXX.h:1711
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1655
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1616
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1635
Represents a C++ constructor within a class.
Definition DeclCXX.h:2645
Represents a C++ base or member initializer.
Definition DeclCXX.h:2410
Represents a C++ deduction guide declaration.
Definition DeclCXX.h:2001
DeductionCandidate getDeductionCandidateKind() const
Definition DeclCXX.h:2100
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1275
bool hasRewrittenInit() const
Definition ExprCXX.h:1320
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1382
bool hasRewrittenInit() const
Definition ExprCXX.h:1411
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2631
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2670
bool isArrayForm() const
Definition ExprCXX.h:2657
bool isGlobalDelete() const
Definition ExprCXX.h:2656
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3924
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4023
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4062
Represents the code generated for an expanded expansion statement.
Definition StmtCXX.h:1028
bool shouldApplyLifetimeExtensionToPreamble() const
Definition StmtCXX.h:1077
CXXExpansionStmtPattern - Represents an unexpanded C++ expansion statement.
Definition StmtCXX.h:675
ExpansionStmtKind getKind() const
Definition StmtCXX.h:774
Represents an explicit C++ type conversion that uses "functional" notation (C++ [expr....
Definition ExprCXX.h:1836
Represents a static or instance method of a struct/union/class.
Definition DeclCXX.h:2153
Abstract class common to all of the C++ "named"/"keyword" casts.
Definition ExprCXX.h:380
const char * getCastName() const
getCastName - Get the name of the C++ cast being used, e.g., "static_cast", "dynamic_cast",...
Definition ExprCXX.cpp:800
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2360
bool isArray() const
Definition ExprCXX.h:2469
FunctionDecl * getOperatorNew() const
Definition ExprCXX.h:2464
bool isGlobalNew() const
Definition ExprCXX.h:2526
A call to an overloaded operator written using operator syntax.
Definition ExprCXX.h:86
OverloadedOperatorKind getOperator() const
Returns the kind of overloaded operator that this expression refers to.
Definition ExprCXX.h:116
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
base_class_range bases()
Definition DeclCXX.h:609
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
Definition DeclCXX.cpp:2087
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition DeclCXX.h:910
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition DeclCXX.h:1023
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition DeclCXX.h:812
A C++ static_cast expression (C++ [expr.static.cast]).
Definition ExprCXX.h:441
Represents the this expression in C++.
Definition ExprCXX.h:1159
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition ExprCXX.h:1185
bool isImplicit() const
Definition ExprCXX.h:1182
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3798
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3853
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3832
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:3012
bool hasStoredFPFeatures() const
Definition Expr.h:3171
bool usesADL() const
Definition Expr.h:3169
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3311
Represents the body of a CapturedStmt, and serves as its DeclContext.
Definition Decl.h:5098
bool isNothrow() const
Definition Decl.cpp:5801
CaseStmt - Represent a case statement.
Definition Stmt.h:1931
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1994
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3745
path_iterator path_begin()
Definition Expr.h:3815
bool hasStoredFPFeatures() const
Definition Expr.h:3844
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1987
path_iterator path_end()
Definition Expr.h:3816
const CXXBaseSpecifier *const * path_const_iterator
Definition Expr.h:3812
bool path_empty() const
Definition Expr.h:3813
FPOptionsOverride getFPFeatures() const
Definition Expr.h:3865
unsigned getValue() const
Definition Expr.h:1674
Declaration of a class template.
Represents a 'co_await' expression.
Definition ExprCXX.h:5423
bool isImplicit() const
Definition ExprCXX.h:5445
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4369
QualType getComputationLHSType() const
Definition Expr.h:4403
QualType getComputationResultType() const
Definition Expr.h:4406
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1751
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1801
bool hasStoredFPFeatures() const
Definition Stmt.h:1798
Declaration of a C++20 concept.
A reference to a concept and its template args, as it appears in the code.
Definition ASTConcept.h:127
Represents the specialization of a concept - evaluates to a prvalue of type bool.
NamedDecl * getFoundDecl() const
Represents the canonical version of C arrays with a specified constant size.
Definition TypeBase.h:3858
An expression that occurs in a constant context and the result of evaluating the expression.
Definition Expr.h:1127
APValue getAPValueResult() const
Definition Expr.cpp:419
bool hasAPValueResult() const
Definition Expr.h:1202
Represents a shadow constructor declaration introduced into a class by a C++11 using-declaration that...
Definition DeclCXX.h:3715
CXXRecordDecl * getConstructedBaseClass() const
Get the base class whose constructor or constructor shadow declaration is passed the constructor argu...
Definition DeclCXX.h:3806
bool constructsVirtualBase() const
Returns true if the constructed base class is a virtual base class subobject of this declaration's cl...
Definition DeclCXX.h:3815
ConstructorUsingShadowDecl * getConstructedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the base class for which we don't have an explicit ini...
Definition DeclCXX.h:3796
ConstructorUsingShadowDecl * getNominatedBaseClassShadowDecl() const
Get the inheriting constructor declaration for the direct base class from which this using shadow dec...
Definition DeclCXX.h:3790
CXXRecordDecl * getNominatedBaseClass() const
Get the base class that was named in the using declaration.
Definition DeclCXX.cpp:3510
ConvertVectorExpr - Clang builtin function __builtin_convertvector This AST node provides support for...
Definition Expr.h:4788
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:4851
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:4846
Represents a 'co_return' statement in the C++ Coroutines TS.
Definition StmtCXX.h:474
bool isImplicit() const
Definition StmtCXX.h:507
DeclContext * getParent()
getParent - Returns the containing DeclContext.
Definition DeclBase.h:2108
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1315
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1426
NestedNameSpecifier getQualifier() const
If the name was qualified, retrieves the nested-name-specifier that precedes the name.
Definition Expr.h:1416
bool refersToEnclosingVariableOrCapture() const
Does this DeclRefExpr refer to an enclosing local or a captured variable?
Definition Expr.h:1519
bool isCapturedByCopyInLambdaWithExplicitObjectParameter() const
Definition Expr.h:1531
ValueDecl * getDecl()
Definition Expr.h:1383
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1513
bool isImmediateEscalating() const
Definition Expr.h:1523
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
TemplateDecl * getDescribedTemplate() const
If this is a declaration that describes some template, this method returns that template declaration.
Definition DeclBase.cpp:285
FriendObjectKind getFriendObjectKind() const
Determines whether this declaration is the object of a friend declaration and, if so,...
Definition DeclBase.h:1244
ASTContext & getASTContext() const LLVM_READONLY
Definition DeclBase.cpp:550
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition DeclBase.h:602
@ FOK_Undeclared
A friend of a previously-undeclared entity.
Definition DeclBase.h:1237
@ FOK_None
Not a friend object.
Definition DeclBase.h:1235
@ FOK_Declared
A friend of a previously-declared entity.
Definition DeclBase.h:1236
Module * getOwningModule() const
Get the module that owns this declaration (for visibility purposes).
Definition DeclBase.h:855
bool isFromASTFile() const
Determine whether this declaration came from an AST file (such as a precompiled header or module) rat...
Definition DeclBase.h:806
bool isInvalidDecl() const
Definition DeclBase.h:597
SourceLocation getLocation() const
Definition DeclBase.h:448
const char * getDeclKindName() const
Definition DeclBase.cpp:169
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition DeclBase.h:630
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition DeclBase.cpp:579
DeclContext * getDeclContext()
Definition DeclBase.h:457
AccessSpecifier getAccess() const
Definition DeclBase.h:516
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition DeclBase.h:936
Kind getKind() const
Definition DeclBase.h:451
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition DeclBase.h:436
The name of a declaration.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition Decl.h:839
TemplateName getUnderlying() const
DefaultArguments getDefaultArguments() const
A qualified reference to a name whose declaration cannot yet be resolved.
Definition ExprCXX.h:3564
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies this declaration.
Definition ExprCXX.h:3616
Represents an array type in C++ whose size is a value-dependent expression.
Definition TypeBase.h:4109
Represents an extended vector type where either the type or size is dependent.
Definition TypeBase.h:4199
A template-id naming a variable template or a concept through a template template parameter.
Definition ExprCXX.h:3480
TemplateName getTemplateName() const
Definition ExprCXX.h:3508
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
Symbolic representation of a dynamic allocation.
Definition APValue.h:79
IdentifierInfo & getAccessor() const
Definition Expr.h:6671
Represents a reference to emded data.
Definition Expr.h:5204
unsigned getStartingElementPos() const
Definition Expr.h:5225
size_t getDataElementCount() const
Definition Expr.h:5226
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3574
Represents an enum.
Definition Decl.h:4162
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4380
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4383
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4389
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4335
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5234
QualType getTypeAsWritten() const
getTypeAsWritten - Returns the type that this expression is casting to, as written in the source code...
Definition Expr.h:4024
Represents an explicit instantiation of a template entity in source code.
TemplateSpecializationKind getTemplateSpecializationKind() const
NamedDecl * getSpecialization() const
NestedNameSpecifierLoc getQualifierLoc() const
Returns the qualifier regardless of where it is stored.
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3715
CleanupObject getObject(unsigned i) const
Definition ExprCXX.h:3745
unsigned getNumObjects() const
Definition ExprCXX.h:3743
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3721
This represents one expression.
Definition Expr.h:114
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:179
QualType getType() const
Definition Expr.h:146
An expression trait intrinsic.
Definition ExprCXX.h:3084
ExpressionTrait getTrait() const
Definition ExprCXX.h:3119
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
Definition Expr.h:6696
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
Definition Decl.h:3311
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3411
std::string getValueAsString(unsigned Radix) const
Definition Expr.cpp:1020
double getValueAsApproximateDouble() const
getValueAsApproximateDouble - This returns the value as an inaccurate double.
Definition Expr.cpp:1099
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition DeclFriend.h:46
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition DeclFriend.h:96
bool isPackExpansion() const
Definition DeclFriend.h:113
Declaration of a friend template.
TemplateName getFriendTemplateName() const
FriendTemplateEntityKind getFriendKind() const
Represents a function declaration or definition.
Definition Decl.h:2071
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2901
bool isInlined() const
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr...
Definition Decl.h:3068
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
Definition Decl.cpp:4326
bool isTrivial() const
Whether this function is "trivial" in some specialized C++ senses.
Definition Decl.h:2516
param_iterator param_begin()
Definition Decl.h:2929
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2679
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:3035
bool isDeletedAsWritten() const
Definition Decl.h:2683
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2492
bool param_empty() const
Definition Decl.h:2928
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2524
bool isIneligibleOrNotSelected() const
Definition Decl.h:2557
TemplateSpecializationKind getTemplateSpecializationKind() const
Determine what kind of template instantiation this function represents.
Definition Decl.cpp:4479
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2483
unsigned getNumParams() const
Return the number of parameters this function must have based on its FunctionType.
Definition Decl.cpp:3886
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:3046
Represents a prototype with parameter type info, e.g.
Definition TypeBase.h:5548
Declaration of a template function.
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4744
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3847
Represents a C11 generic selection.
Definition Expr.h:6268
AssociationTy< true > ConstAssociation
Definition Expr.h:6502
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6522
GotoStmt - This represents a direct goto.
Definition Stmt.h:2980
LabelDecl * getLabel() const
Definition Stmt.h:2993
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5348
bool isCBuffer() const
Definition Decl.h:5392
This class represents temporary values used to represent inout and out arguments in HLSL.
Definition Expr.h:7483
bool isInOut() const
returns true if the parameter is inout and false if the parameter is out.
Definition Expr.h:7542
ArrayRef< llvm::hlsl::rootsig::RootElement > getRootElements() const
Definition Decl.h:5465
llvm::dxbc::RootSignatureVersion getVersion() const
Definition Decl.h:5463
const char * getNameStart() const
Return the beginning of the actual null-terminated string for this identifier.
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition Stmt.h:2270
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2345
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2342
bool isConstexpr() const
Definition Stmt.h:2463
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2339
bool isNegatedConsteval() const
Definition Stmt.h:2459
bool isConsteval() const
Definition Stmt.h:2450
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3922
bool isPartOfExplicitCast() const
Definition Expr.h:3953
Describes a module import declaration, which makes the contents of the named module visible in the cu...
Definition Decl.h:5207
Module * getImportedModule() const
Retrieve the module that was imported by the import declaration.
Definition Decl.h:5265
Represents a field injected from an anonymous union/struct into the parent scope.
Definition Decl.h:3618
ArrayRef< NamedDecl * > chain() const
Definition Decl.h:3639
Describes an C or C++ initializer list.
Definition Expr.h:5377
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5515
bool isExplicit() const
Definition Expr.h:5531
Represents the declaration of a label.
Definition Decl.h:526
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2157
bool isSideEntry() const
Definition Stmt.h:2204
const char * getName() const
Definition Stmt.cpp:437
Implicit declaration of a temporary that was materialized by a MaterializeTemporaryExpr and lifetime-...
Definition DeclCXX.h:3346
Represents a linkage specification.
Definition DeclCXX.h:3053
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3076
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3068
LabelDecl * getLabelDecl()
Definition Stmt.h:3106
bool isNamed() const
Definition Stmt.h:3101
const Stmt * getNamedLoopOrSwitch() const
If this is a named break/continue, get the loop or switch statement that this targets.
Definition Stmt.cpp:1535
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4974
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:5024
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3433
NestedNameSpecifier getQualifier() const
If the member name was qualified, retrieves the nested-name-specifier that precedes the member name.
Definition Expr.h:3544
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3516
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3657
bool isArrow() const
Definition Expr.h:3617
Provides common interface for the Decls that cannot be redeclared, but can be merged if the same decl...
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Describes a module or submodule.
Definition Module.h:340
std::string getFullModuleName(bool AllowStringLiterals=false) const
Retrieve the full name of this module, including the path from its top-level module.
Definition Module.cpp:242
This represents a decl that may have a name.
Definition Decl.h:276
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:657
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Definition Decl.h:297
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition Decl.h:303
Visibility getVisibility() const
Determines the visibility of this entity.
Definition Decl.h:446
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:342
Linkage getFormalLinkage() const
Get the linkage from a semantic point of view.
Definition Decl.cpp:1209
Represents a C++ namespace alias.
Definition DeclCXX.h:3239
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3332
Represent a C++ namespace.
Definition Decl.h:594
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition Decl.h:650
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition Decl.h:659
NestedNameSpecifier getNestedNameSpecifier() const
Retrieve the nested-name-specifier to which this instance refers.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
NamespaceAndPrefix getAsNamespaceAndPrefix() const
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool ResolveTemplateArguments=false, bool PrintFinalScopeResOp=true) const
Print this nested name specifier to the given output stream.
@ MicrosoftSuper
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in.
@ Global
The global specifier '::'. There is no stored value.
@ Namespace
A namespace-like entity, stored as a NamespaceBaseDecl*.
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:445
This is a basic class for representing single OpenMP clause.
This represents 'pragma omp declare reduction ...' directive.
Definition DeclOpenMP.h:239
Expr * getInitializer()
Get initializer expression (if specified) of the declare reduction construct.
Definition DeclOpenMP.h:300
Expr * getCombiner()
Get combiner expression of the declare reduction construct.
Definition DeclOpenMP.h:282
OMPDeclareReductionInitKind getInitializerKind() const
Get initializer kind.
Definition DeclOpenMP.h:303
OpenMP 5.0 [2.1.6 Iterators] Iterators are identifiers that expand to multiple values in the clause o...
Definition ExprOpenMP.h:151
IteratorRange getIteratorRange(unsigned I)
Gets the iterator range for the given iterator.
Definition Expr.cpp:5611
unsigned numOfIterators() const
Returns number of iterator definitions.
Definition ExprOpenMP.h:275
Decl * getIteratorDecl(unsigned I)
Gets the iterator declaration for the given iterator.
Definition Expr.cpp:5607
This represents 'pragma omp requires...' directive.
Definition DeclOpenMP.h:479
clauselist_range clauselists()
Definition DeclOpenMP.h:504
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:118
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:158
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:180
ObjCCategoryDecl - Represents a category declaration.
Definition DeclObjC.h:2335
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
Definition DeclObjC.h:2378
protocol_range protocols() const
Definition DeclObjC.h:2409
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition DeclObjC.h:2551
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition DeclObjC.h:2781
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2799
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:440
QualType getEncodedType() const
Definition ExprObjC.h:459
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2492
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition DeclObjC.h:2603
const ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.h:2741
Represents an ObjC class declaration.
Definition DeclObjC.h:1160
protocol_range protocols() const
Definition DeclObjC.h:1365
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.cpp:349
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
Definition TypeBase.h:8163
ObjCIvarDecl - Represents an ObjC instance variable.
Definition DeclObjC.h:1958
AccessControl getAccessControl() const
Definition DeclObjC.h:2006
bool getSynthesize() const
Definition DeclObjC.h:2013
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:581
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:611
bool isFreeIvar() const
Definition ExprObjC.h:620
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:972
Selector getSelector() const
Definition ExprObjC.cpp:301
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:986
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:980
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:983
@ Class
The receiver is a class.
Definition ExprObjC.h:977
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1319
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1261
ObjCMethodDecl - Represents an instance or class method declaration.
Definition DeclObjC.h:140
bool isVariadic() const
Definition DeclObjC.h:434
Selector getSelector() const
Definition DeclObjC.h:330
bool isInstanceMethod() const
Definition DeclObjC.h:429
QualType getReturnType() const
Definition DeclObjC.h:332
Represents one property declaration in an Objective-C interface.
Definition DeclObjC.h:734
ObjCMethodDecl * getGetterMethodDecl() const
Definition DeclObjC.h:907
ObjCMethodDecl * getSetterMethodDecl() const
Definition DeclObjC.h:910
QualType getType() const
Definition DeclObjC.h:810
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition DeclObjC.h:821
PropertyControl getPropertyImplementation() const
Definition DeclObjC.h:918
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition DeclObjC.h:2811
ObjCIvarDecl * getPropertyIvarDecl() const
Definition DeclObjC.h:2885
Kind getPropertyImplementation() const
Definition DeclObjC.h:2881
ObjCPropertyDecl * getPropertyDecl() const
Definition DeclObjC.h:2876
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:649
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:768
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:738
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:775
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:743
bool isImplicitProperty() const
Definition ExprObjC.h:735
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:748
bool isSuperReceiver() const
Definition ExprObjC.h:803
Represents an Objective-C protocol declaration.
Definition DeclObjC.h:2090
protocol_range protocols() const
Definition DeclObjC.h:2167
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:537
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:554
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:485
Selector getSelector() const
Definition ExprObjC.h:499
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:871
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:924
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:916
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:920
Represents the declaration of an Objective-C type parameter.
Definition DeclObjC.h:581
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition DeclObjC.h:643
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition DeclObjC.h:626
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2159
This is the base type for all OpenACC Clauses.
OpenACCDirectiveKind getDirectiveKind() const
Definition DeclOpenACC.h:56
ArrayRef< const OpenACCClause * > clauses() const
Definition DeclOpenACC.h:62
This is the base class for an OpenACC statement-level construct, other construct types are expected t...
Definition StmtOpenACC.h:26
OpenACCDirectiveKind getDirectiveKind() const
Definition StmtOpenACC.h:57
SourceLocation getRParenLoc() const
const Expr * getFunctionReference() const
SourceLocation getLParenLoc() const
UnresolvedSetImpl::iterator decls_iterator
Definition ExprCXX.h:3234
decls_iterator decls_begin() const
Definition ExprCXX.h:3236
decls_iterator decls_end() const
Definition ExprCXX.h:3239
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3253
A structure for storing a pack-index-template-name ([temp.names]).
UnsignedOrNone getSelectedIndex() const
ArrayRef< TemplateName > getExpansions() const
Represents a #pragma comment line.
Definition Decl.h:169
StringRef getArg() const
Definition Decl.h:192
PragmaMSCommentKind getCommentKind() const
Definition Decl.h:190
Represents a #pragma detect_mismatch line.
Definition Decl.h:203
StringRef getName() const
Definition Decl.h:224
StringRef getValue() const
Definition Decl.h:225
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2074
StringRef getIdentKindName() const
Definition Expr.h:2131
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2109
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 TypeBase.h:938
void print(raw_ostream &OS, const PrintingPolicy &Policy, const Twine &PlaceHolder=Twine(), unsigned Indentation=0) const
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition TypeBase.h:8599
std::string getAsString() const
static std::string getAsString(SplitQualType split, const PrintingPolicy &Policy)
Definition TypeBase.h:1348
Represents a template name as written in source code.
NestedNameSpecifier getQualifier() const
Return the nested name specifier that qualifies this name.
TemplateName getUnderlyingTemplate() const
Return the underlying template name.
bool hasTemplateKeyword() const
Whether the template name was prefixed by the "template" keyword.
Represents a struct/union/class.
Definition Decl.h:4476
Provides common interface for the Decls that can be redeclared.
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
decl_type * getPreviousDecl()
Return the previous declaration of this declaration or NULL if this is the first declaration.
Base for LValueReferenceType and RValueReferenceType.
Definition TypeBase.h:3678
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
bool isSatisfied() const
Whether or not the requires clause is satisfied.
ReturnStmt - This represents a return, optionally of an expression: return; return 4;.
Definition Stmt.h:3173
const VarDecl * getNRVOCandidate() const
Retrieve the variable that might be used for the named return value optimization.
Definition Stmt.h:3209
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2212
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4495
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4563
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Definition Stmt.h:85
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:343
const char * getStmtClassName() const
Definition Stmt.cpp:86
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1844
void outputString(raw_ostream &OS) const
Prints the contents of the string to OS.
Definition Expr.cpp:1219
A structure for storing the information associated with a substituted template template parameter.
TemplateTemplateParmDecl * getParameter() const
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2520
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2581
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2578
Represents the declaration of a struct/union/class/enum.
Definition Decl.h:3868
StringRef getKindName() const
Definition Decl.h:4064
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3969
TypedefNameDecl * getTypedefNameForAnonDecl() const
Definition Decl.h:4105
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name of this declaration, if it was present in ...
Definition Decl.h:4114
Represents a template argument.
TemplateName getAsTemplate() const
Retrieve the template name for a template name argument.
bool structurallyEquals(const TemplateArgument &Other) const
Determines whether two template arguments are superficially the same.
void print(const PrintingPolicy &Policy, raw_ostream &Out, bool IncludeType) const
Print this template argument to the given output stream.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
bool isCanonicalExpr() const
TemplateName getAsTemplateOrTemplatePattern() const
Retrieve the template argument as a template name; if the argument is a pack expansion,...
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
DeducedTemplateStorage * getAsDeducedTemplateName() const
Retrieve the deduced template info, if any.
DependentTemplateName * getAsDependentTemplateName() const
Retrieve the underlying dependent template name structure, if any.
QualifiedTemplateName * getAsQualifiedTemplateName() const
Retrieve the underlying qualified template name structure, if any.
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
NameKind getKind() const
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
@ OverloadedTemplate
A set of overloaded template declarations.
@ PackIndexingTemplate
A pack-index-template-name.
@ Template
A single template declaration.
@ DependentTemplate
A dependent template name that has not been resolved to a template (or set of templates).
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
@ DeducedTemplate
A template name that refers to another TemplateName with deduced default arguments.
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
@ AssumedTemplate
An unqualified-id that has been assumed to name a function template that will be found by ADL.
UsingShadowDecl * getAsUsingShadowDecl() const
Retrieve the using shadow declaration through which the underlying template declaration is introduced...
SubstTemplateTemplateParmStorage * getAsSubstTemplateTemplateParm() const
Retrieve the substituted template template parameter, if known.
PackIndexingTemplateStorage * getAsPackIndexingTemplate() const
Retrieve the pack-index-template-name storage, if any.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
unsigned getIndex() const
Retrieve the index of the template parameter.
const TypeConstraint * getTypeConstraint() const
Returns the type constraint associated with this template parameter (if any).
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template parameter.
void VisitCXXFunctionalCastExpr(const CXXFunctionalCastExpr *Node)
void VisitDeducedType(const DeducedType *T)
void VisitEnumDecl(const EnumDecl *D)
void VisitExprWithCleanups(const ExprWithCleanups *Node)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitCXXStaticCastExpr(const CXXStaticCastExpr *Node)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void dumpPointer(const void *Ptr)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitOpenACCLoopConstruct(const OpenACCLoopConstruct *S)
void VisitLinkageSpecDecl(const LinkageSpecDecl *D)
void VisitVectorType(const VectorType *T)
void VisitLoopControlStmt(const LoopControlStmt *L)
void VisitHLSLRootSignatureDecl(const HLSLRootSignatureDecl *D)
void VisitCoawaitExpr(const CoawaitExpr *Node)
void VisitUnaryOperator(const UnaryOperator *Node)
void dumpAccessSpecifier(AccessSpecifier AS)
void VisitExplicitInstantiationDecl(const ExplicitInstantiationDecl *D)
void VisitHLSLOutArgExpr(const HLSLOutArgExpr *E)
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 VisitOpenACCRoutineDecl(const OpenACCRoutineDecl *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 VisitOMPCaptureKindAttr(const OMPCaptureKindAttr *A)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitCXXExpansionStmtInstantiation(const CXXExpansionStmtInstantiation *Node)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitIndirectFieldDecl(const IndirectFieldDecl *D)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitUsingType(const UsingType *T)
void VisitInjectedClassNameType(const InjectedClassNameType *T)
void VisitBinaryOperator(const BinaryOperator *Node)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *Node)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitBlockDecl(const BlockDecl *D)
void VisitCXXDeleteExpr(const CXXDeleteExpr *Node)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *Node)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitVarTemplateDecl(const VarTemplateDecl *D)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitConceptSpecializationExpr(const ConceptSpecializationExpr *Node)
void VisitCXXDeductionGuideDecl(const CXXDeductionGuideDecl *D)
TextNodeDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
void VisitPredefinedExpr(const PredefinedExpr *Node)
void dumpType(QualType T)
void VisitDependentTemplateIdExpr(const DependentTemplateIdExpr *Node)
void VisitMatrixElementExpr(const MatrixElementExpr *Node)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *Node)
void dumpNestedNameSpecifier(NestedNameSpecifier NNS)
void VisitStructuralValueTemplateArgument(const TemplateArgument &TA)
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 VisitOpenACCDataConstruct(const OpenACCDataConstruct *S)
void dumpBareTemplateName(TemplateName TN)
void VisitOpenACCConstructStmt(const OpenACCConstructStmt *S)
void VisitCompoundStmt(const CompoundStmt *Node)
void VisitConstantExpr(const ConstantExpr *Node)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *Node)
void VisitOpenACCDeclareDecl(const OpenACCDeclareDecl *D)
void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *S)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Node)
void VisitConstructorUsingShadowDecl(const ConstructorUsingShadowDecl *D)
void VisitWhileStmt(const WhileStmt *Node)
void VisitCharacterLiteral(const CharacterLiteral *Node)
void VisitAccessSpecDecl(const AccessSpecDecl *D)
void VisitFunctionType(const FunctionType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitReturnStmt(const ReturnStmt *Node)
void VisitTypeLoc(TypeLoc TL)
void VisitAutoType(const AutoType *T)
void VisitObjCInterfaceType(const ObjCInterfaceType *T)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitTypedefDecl(const TypedefDecl *D)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Node)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void VisitIntegerLiteral(const IntegerLiteral *Node)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitGotoStmt(const GotoStmt *Node)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *T)
void VisitFriendDecl(const FriendDecl *D)
void VisitSwitchStmt(const SwitchStmt *Node)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *Node)
void VisitEmbedExpr(const EmbedExpr *S)
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitUsingDecl(const UsingDecl *D)
void VisitConstantArrayType(const ConstantArrayType *T)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *Node)
void VisitArrayType(const ArrayType *T)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *Node)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitLifetimeExtendedTemporaryDecl(const LifetimeExtendedTemporaryDecl *D)
void VisitCXXRecordDecl(const CXXRecordDecl *D)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void dumpCleanupObject(const ExprWithCleanups::CleanupObject &C)
void VisitOpenACCExitDataConstruct(const OpenACCExitDataConstruct *S)
void VisitCaseStmt(const CaseStmt *Node)
void VisitRValueReferenceType(const ReferenceType *T)
void VisitPackExpansionType(const PackExpansionType *T)
void VisitConceptDecl(const ConceptDecl *D)
void VisitOpenACCEnterDataConstruct(const OpenACCEnterDataConstruct *S)
void VisitCallExpr(const CallExpr *Node)
void VisitCapturedDecl(const CapturedDecl *D)
void VisitOpenACCWaitConstruct(const OpenACCWaitConstruct *S)
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 VisitOpenACCUpdateConstruct(const OpenACCUpdateConstruct *S)
void Visit(const comments::Comment *C, const comments::FullComment *FC)
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 VisitOpenACCInitConstruct(const OpenACCInitConstruct *S)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitCompoundAssignOperator(const CompoundAssignOperator *Node)
void VisitCXXThisExpr(const CXXThisExpr *Node)
void VisitOpenACCRoutineDeclAttr(const OpenACCRoutineDeclAttr *A)
void dumpName(const NamedDecl *ND)
void dumpTemplateName(TemplateName TN, StringRef Label={})
void VisitArrayTypeTraitExpr(const ArrayTypeTraitExpr *Node)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitFieldDecl(const FieldDecl *D)
void dumpDeclRef(const Decl *D, StringRef Label={})
void VisitRecordDecl(const RecordDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *Node)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *Node)
void VisitCastExpr(const CastExpr *Node)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *T)
void VisitExpressionTraitExpr(const ExpressionTraitExpr *Node)
void VisitAddrLabelExpr(const AddrLabelExpr *Node)
void VisitUnresolvedUsingTypenameDecl(const UnresolvedUsingTypenameDecl *D)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *Node)
void VisitOpenACCAtomicConstruct(const OpenACCAtomicConstruct *S)
void dumpLinkageAndVisibility(const NamedDecl *ND)
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 VisitOpenACCCacheConstruct(const OpenACCCacheConstruct *S)
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 VisitOpenACCHostDataConstruct(const OpenACCHostDataConstruct *S)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *Node)
void VisitIfStmt(const IfStmt *Node)
void VisitCXXConstructExpr(const CXXConstructExpr *Node)
void VisitFunctionProtoType(const FunctionProtoType *T)
void dumpTemplateArgument(const TemplateArgument &TA)
void dumpLocation(SourceLocation Loc)
void VisitDependentSizedArrayType(const DependentSizedArrayType *T)
void VisitOpenACCCombinedConstruct(const OpenACCCombinedConstruct *S)
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 VisitOpenACCSetConstruct(const OpenACCSetConstruct *S)
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 VisitConvertVectorExpr(const ConvertVectorExpr *S)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitOpenACCShutdownConstruct(const OpenACCShutdownConstruct *S)
void dumpBareConcept(TemplateName TN)
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 VisitFriendTemplateDecl(const FriendTemplateDecl *D)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitEnumConstantDecl(const EnumConstantDecl *D)
void VisitPragmaDetectMismatchDecl(const PragmaDetectMismatchDecl *D)
void dumpTemplateSpecializationKind(TemplateSpecializationKind TSK)
void VisitAtomicExpr(const AtomicExpr *AE)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitClassTemplateDecl(const ClassTemplateDecl *D)
void VisitBindingDecl(const BindingDecl *D)
void VisitCXXExpansionStmtPattern(const CXXExpansionStmtPattern *Node)
void VisitTypedefType(const TypedefType *T)
TextTreeStructure(raw_ostream &OS, bool ShowColors)
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:3839
Declaration of an alias template.
Symbolic representation of typeid(T) for some type T.
Definition APValue.h:48
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:154
TypeLocClass getTypeLocClass() const
Definition TypeLoc.h:116
const Type * getTypePtr() const
Definition TypeLoc.h:137
A container of type source information.
Definition TypeBase.h:8549
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8560
A type trait used in the implementation of various C++11 and Library TR1 trait templates.
Definition ExprCXX.h:2901
TypeTrait getTrait() const
Determine which type trait this expression uses.
Definition ExprCXX.h:2950
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 TypeBase.h:1879
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2392
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
Definition Type.h:63
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition TypeBase.h:2863
const char * getTypeClassName() const
Definition Type.cpp:3610
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9431
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3818
QualType getUnderlyingType() const
Definition Decl.h:3768
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2694
QualType getArgumentType() const
Definition Expr.h:2737
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2726
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2313
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2383
Opcode getOpcode() const
Definition Expr.h:2349
bool hasStoredFPFeatures() const
Is FPFeatures in Trailing Storage?
Definition Expr.h:2450
FPOptionsOverride getStoredFPFeatures() const
Get FPFeatures from trailing storage.
Definition Expr.h:2453
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1438
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2367
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3373
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3442
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:6263
Represents a dependent using declaration which was marked with typename.
Definition DeclCXX.h:4075
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:4112
Represents a dependent using declaration which was not marked with typename.
Definition DeclCXX.h:3978
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:4022
Represents a C++ using-declaration.
Definition DeclCXX.h:3629
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3666
Represents C++ using-directive.
Definition DeclCXX.h:3134
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3357
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3830
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3872
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3437
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3501
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:714
QualType getType() const
Definition Decl.h:725
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition Decl.cpp:5688
Kind getKind() const
Definition Value.h:137
Represents a variable declaration or definition.
Definition Decl.h:934
VarTemplateDecl * getDescribedVarTemplate() const
Retrieves the variable template that is described by this variable declaration.
Definition Decl.cpp:2802
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1606
TLSKind getTLSKind() const
Definition Decl.cpp:2149
bool hasInit() const
Definition Decl.cpp:2400
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition Decl.h:1503
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition Decl.cpp:2102
@ ListInit
Direct list-initialization (C++11)
Definition Decl.h:945
@ CInit
C-style initialization with assignment.
Definition Decl.h:939
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:948
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:942
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
Definition Decl.cpp:2719
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition Decl.h:1549
QualType::DestructionKind needsDestruction(const ASTContext &Ctx) const
Would the destruction of this variable have any effect, and if so, what kind?
Definition Decl.cpp:2843
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1588
const Expr * getInit() const
Definition Decl.h:1393
const APValue * evaluateValue() const
Attempt to evaluate the value of the initializer attached to this declaration, and produce notes expl...
Definition Decl.cpp:2568
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:957
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:960
@ TLS_None
Not a TLS variable.
Definition Decl.h:954
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1176
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:2771
Declaration of a variable template.
Represents a C array with a specified size that is not an integer-constant-expression.
Definition TypeBase.h:4064
Represents a GCC generic vector type.
Definition TypeBase.h:4398
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2708
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2758
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition Comment.h:616
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
Any part of the comment.
Definition Comment.h:66
A full comment attached to a declaration, contains block content.
Definition Comment.h:1097
An opening HTML tag with attributes.
Definition Comment.h:445
A command with word-like arguments that is considered inline content.
Definition Comment.h:341
Doxygen \param command.
Definition Comment.h:723
static const char * getDirectionAsString(ParamCommandPassDirection D)
Definition Comment.cpp:189
Doxygen \tparam command, describes a template parameter.
Definition Comment.h:805
A verbatim block command (e.
Definition Comment.h:891
A line of text contained in a verbatim block.
Definition Comment.h:866
A verbatim line command.
Definition Comment.h:942
A static requirement that can be used in a requires-expression to check properties of types and expre...
Top level wrappers for InstallAPI frontend operations.
const char * getTraitSpelling(TypeTrait T) LLVM_READONLY
Return the spelling of the trait T. Never null.
bool isa(CodeGen::Address addr)
Definition Address.h:330
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition Specifiers.h:423
@ 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_Copyright
Definition PragmaKinds.h:21
@ PCK_Unknown
Definition PragmaKinds.h:15
@ PCK_User
Definition PragmaKinds.h:20
@ RQ_None
No ref-qualifier was provided.
Definition TypeBase.h:1801
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition TypeBase.h:1804
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition TypeBase.h:1807
@ OK_VectorComponent
A vector component is an element or range of elements of a vector.
Definition Specifiers.h:161
@ 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:165
@ OK_ObjCSubscript
An Objective-C array/dictionary subscripting which reads an object or writes at the subscripted array...
Definition Specifiers.h:170
@ OK_Ordinary
An ordinary object is located at an address in memory.
Definition Specifiers.h:155
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
Definition Specifiers.h:158
@ OK_MatrixComponent
A matrix component is a single element or range of elements of a matrix.
Definition Specifiers.h:173
@ Override
Merge availability attributes for an override, which requires an exact match or a weakening of constr...
Definition Sema.h:629
@ Auto
'auto' clause, allowed on 'loop' directives.
@ Bind
'bind' clause, allowed on routine constructs.
@ Gang
'gang' clause, allowed on 'loop' and Combined constructs.
@ Wait
'wait' clause, allowed on Compute, Data, 'update', and Combined constructs.
@ DevicePtr
'deviceptr' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ PCopyOut
'copyout' clause alias 'pcopyout'. Preserved for diagnostic purposes.
@ VectorLength
'vector_length' clause, allowed on 'parallel', 'kernels', 'parallel loop', and 'kernels loop' constru...
@ Async
'async' clause, allowed on Compute, Data, 'update', 'wait', and Combined constructs.
@ PresentOrCreate
'create' clause alias 'present_or_create'.
@ Collapse
'collapse' clause, allowed on 'loop' and Combined constructs.
@ NoHost
'nohost' clause, allowed on 'routine' directives.
@ PresentOrCopy
'copy' clause alias 'present_or_copy'. Preserved for diagnostic purposes.
@ DeviceNum
'device_num' clause, allowed on 'init', 'shutdown', and 'set' constructs.
@ Private
'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...
@ Invalid
Represents an invalid clause, for the purposes of parsing.
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Copy
'copy' clause, allowed on Compute and Combined Constructs, plus 'data' and 'declare'.
@ Worker
'worker' clause, allowed on 'loop', Combined, and 'routine' directives.
@ Create
'create' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ DeviceType
'device_type' clause, allowed on Compute, 'data', 'init', 'shutdown', 'set', update',...
@ DefaultAsync
'default_async' clause, allowed on 'set' construct.
@ Attach
'attach' clause, allowed on Compute and Combined constructs, plus 'data' and 'enter data'.
@ Shortloop
'shortloop' is represented in the ACC.td file, but isn't present in the standard.
@ NumGangs
'num_gangs' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs.
@ If
'if' clause, allowed on all the Compute Constructs, Data Constructs, Executable Constructs,...
@ Default
'default' clause, allowed on parallel, serial, kernel (and compound) constructs.
@ UseDevice
'use_device' clause, allowed on 'host_data' construct.
@ NoCreate
'no_create' clause, allowed on allowed on Compute and Combined constructs, plus 'data'.
@ PresentOrCopyOut
'copyout' clause alias 'present_or_copyout'.
@ Link
'link' clause, allowed on 'declare' construct.
@ Reduction
'reduction' clause, allowed on Parallel, Serial, Loop, and the combined constructs.
@ Self
'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
@ CopyOut
'copyout' clause, allowed on Compute and Combined constructs, plus 'data', 'exit data',...
@ Seq
'seq' clause, allowed on 'loop' and 'routine' directives.
@ FirstPrivate
'firstprivate' clause, allowed on 'parallel', 'serial', 'parallel loop', and 'serial loop' constructs...
@ Host
'host' clause, allowed on 'update' construct.
@ PCopy
'copy' clause alias 'pcopy'. Preserved for diagnostic purposes.
@ Tile
'tile' clause, allowed on 'loop' and Combined constructs.
@ PCopyIn
'copyin' clause alias 'pcopyin'. Preserved for diagnostic purposes.
@ DeviceResident
'device_resident' clause, allowed on the 'declare' construct.
@ PCreate
'create' clause alias 'pcreate'. Preserved for diagnostic purposes.
@ Present
'present' clause, allowed on Compute and Combined constructs, plus 'data' and 'declare'.
@ DType
'dtype' clause, an alias for 'device_type', stored separately for diagnostic purposes.
@ CopyIn
'copyin' clause, allowed on Compute and Combined constructs, plus 'data', 'enter data',...
@ Device
'device' clause, allowed on the 'update' construct.
@ Independent
'independent' clause, allowed on 'loop' directives.
@ NumWorkers
'num_workers' clause, allowed on 'parallel', 'kernels', parallel loop', and 'kernels loop' constructs...
@ IfPresent
'if_present' clause, allowed on 'host_data' and 'update' directives.
@ Detach
'detach' clause, allowed on the 'exit data' construct.
@ Delete
'delete' clause, allowed on the 'exit data' construct.
@ PresentOrCopyIn
'copyin' clause alias 'present_or_copyin'.
@ Finalize
'finalize' clause, allowed on 'exit data' directive.
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:127
StringRef getRVVFixedLengthString(VectorKind VK)
Return the LMUL of an RVV fixed-length data vector kind, "mf8" .
Definition TypeBase.h:4359
StorageClass
Storage classes.
Definition Specifiers.h:252
@ SC_None
Definition Specifiers.h:254
bool isRVVFixedLengthVectorKind(VectorKind VK)
True if VK is one of the RVV fixed-length data or mask vector kinds.
Definition TypeBase.h:4352
IdentifierLoc DeviceTypeArgument
@ VisibleNone
No linkage according to the standard, but is visible from other translation units because of types de...
Definition Linkage.h:48
@ None
No linkage, which means that the entity is unique and can only be referred to from within its scope.
Definition Linkage.h:30
@ UniqueExternal
External linkage within a unique namespace.
Definition Linkage.h:44
@ Internal
Internal linkage, which indicates that the entity can be referred to from within the translation unit...
Definition Linkage.h:35
@ External
External linkage, which indicates that the entity can be referred to from other translation units.
Definition Linkage.h:58
@ Module
Module linkage, which indicates that the entity can be referred to from other translation units withi...
Definition Linkage.h:54
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
@ Deduced
The normal deduced case.
Definition TypeBase.h:1818
@ Undeduced
Not deduced yet. This is for example an 'auto' which was just parsed.
Definition TypeBase.h:1813
@ DeducedAsPack
Same as above, but additionally this represents a case where the deduced entity itself is a pack.
Definition TypeBase.h:1834
@ DeducedAsDependent
This is a special case where the initializer is dependent, so we can't deduce a type yet.
Definition TypeBase.h:1828
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:139
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition Specifiers.h:148
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition Specifiers.h:143
TemplateSpecializationKind
Describes the kind of template specialization that a particular template specialization declaration r...
Definition Specifiers.h:192
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition Specifiers.h:210
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition Specifiers.h:206
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition Specifiers.h:202
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition Specifiers.h:198
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition Specifiers.h:195
@ Invariant
The parameter is invariant: must match exactly.
Definition DeclObjC.h:558
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
Definition DeclObjC.h:566
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
Definition DeclObjC.h:562
const char * getOperatorSpelling(OverloadedOperatorKind Operator)
Retrieve the spelling of the given overloaded operator, without the preceding "operator" keyword.
@ AltiVecBool
is AltiVec 'vector bool ...'
Definition TypeBase.h:4243
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4252
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4237
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4240
@ Neon
is ARM Neon vector
Definition TypeBase.h:4246
@ Generic
not a target-specific vector type
Definition TypeBase.h:4234
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4249
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4255
U cast(CodeGen::Address addr)
Definition Address.h:327
@ PackIndex
Index of a pack indexing expression or specifier.
Definition Sema.h:844
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
Definition TypeBase.h:6146
@ None
No keyword precedes the qualified type name.
Definition TypeBase.h:6167
llvm::omp::Clause OpenMPClauseKind
OpenMP clauses.
Definition OpenMPKinds.h:28
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ 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)
bool isRVVFixedLengthMaskVectorKind(VectorKind VK)
True if VK is one of the RVV fixed-length mask vector kinds, i.e.
Definition TypeBase.h:4338
@ HiddenVisibility
Objects with "hidden" visibility are not seen by the dynamic linker.
Definition Visibility.h:37
@ ProtectedVisibility
Objects with "protected" visibility are seen by the dynamic linker but always dynamically resolve to ...
Definition Visibility.h:42
@ DefaultVisibility
Objects with "default" visibility are seen by the dynamic linker and act like normal objects.
Definition Visibility.h:46
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition Specifiers.h:187
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition Specifiers.h:181
@ NOUR_None
This is an odr-use.
Definition Specifiers.h:179
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition Specifiers.h:184
static constexpr TerminalColor Value
static constexpr TerminalColor Address
static constexpr TerminalColor Comment
static constexpr TerminalColor DeclKindName
static constexpr TerminalColor ObjectKind
static constexpr TerminalColor Null
static constexpr TerminalColor Location
static constexpr TerminalColor Attr
static constexpr TerminalColor DeclName
static constexpr TerminalColor Stmt
static constexpr TerminalColor Cast
static constexpr TerminalColor ValueKind
static constexpr TerminalColor Undeserialized
static constexpr TerminalColor Type
static constexpr TerminalColor Errors
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
Definition TypeBase.h:5617
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
Definition TypeBase.h:5621
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition TypeBase.h:5607
Extra information about a function prototype.
Definition TypeBase.h:5633
static StringRef getKeywordName(ElaboratedTypeKeyword Keyword)
Definition Type.cpp:3569
Iterator range representation begin:end[:step].
Definition ExprOpenMP.h:154
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition TypeBase.h:871
Information about a single command.