clang: lib/AST/JSONNodeDumper.cpp Source File (original) (raw)
6#include "llvm/ADT/StringExtras.h"
7
8using namespace clang;
9
10void JSONNodeDumper::addPreviousDeclaration(const Decl *D) {
12#define DECL(DERIVED, BASE) \
13 case Decl::DERIVED: \
14 return writePreviousDeclImpl(cast<DERIVED##Decl>(D));
15#define ABSTRACT_DECL(DECL)
16#include "clang/AST/DeclNodes.inc"
17#undef ABSTRACT_DECL
18#undef DECL
19 }
20 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
21}
22
24 const char *AttrName = nullptr;
26#define ATTR(X) \
27 case attr::X: \
28 AttrName = #X"Attr"; \
29 break;
30#include "clang/Basic/AttrList.inc"
31#undef ATTR
32 }
33 JOS.attribute("id", createPointerRepresentation(A));
34 JOS.attribute("kind", AttrName);
35 JOS.attributeObject("range", [A, this] { writeSourceRange(A->getRange()); });
36 attributeOnlyIfTrue("inherited", A->isInherited());
37 attributeOnlyIfTrue("implicit", A->isImplicit());
38
39
40
41
42
43
44
46}
47
49 if (!S)
50 return;
51
52 JOS.attribute("id", createPointerRepresentation(S));
54 JOS.attributeObject("range",
55 [S, this] { writeSourceRange(S->getSourceRange()); });
56
57 if (const auto *E = dyn_cast(S)) {
58 JOS.attribute("type", createQualType(E->getType()));
59 const char *Category = nullptr;
60 switch (E->getValueKind()) {
61 case VK_LValue: Category = "lvalue"; break;
62 case VK_XValue: Category = "xvalue"; break;
64 Category = "prvalue";
65 break;
66 }
67 JOS.attribute("valueCategory", Category);
68 }
70}
71
73 JOS.attribute("id", createPointerRepresentation(T));
74
75 if ()
76 return;
77
78 JOS.attribute("kind", (llvm::Twine(T->getTypeClassName()) + "Type").str());
79 JOS.attribute("type", createQualType(QualType(T, 0), false));
80 attributeOnlyIfTrue("containsErrors", T->containsErrors());
81 attributeOnlyIfTrue("isDependent", T->isDependentType());
82 attributeOnlyIfTrue("isInstantiationDependent",
83 T->isInstantiationDependentType());
84 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
85 attributeOnlyIfTrue("containsUnexpandedPack",
86 T->containsUnexpandedParameterPack());
87 attributeOnlyIfTrue("isImported", T->isFromAST());
89}
90
92 JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
93 JOS.attribute("kind", "QualType");
94 JOS.attribute("type", createQualType(T));
95 JOS.attribute("qualifiers", T.split().Quals.getAsString());
96}
97
100 return;
101 JOS.attribute("kind",
103 ? "Qualified"
105 "TypeLoc")
106 .str());
107 JOS.attribute("type",
108 createQualType(QualType(TL.getType()), false));
109 JOS.attributeObject("range",
110 [TL, this] { writeSourceRange(TL.getSourceRange()); });
111}
112
114 JOS.attribute("id", createPointerRepresentation(D));
115
116 if (!D)
117 return;
118
119 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
120 JOS.attributeObject("loc",
121 [D, this] { writeSourceLocation(D->getLocation()); });
122 JOS.attributeObject("range",
123 [D, this] { writeSourceRange(D->getSourceRange()); });
124 attributeOnlyIfTrue("isImplicit", D->isImplicit());
125 attributeOnlyIfTrue("isInvalid", D->isInvalidDecl());
126
128 JOS.attribute("isUsed", true);
130 JOS.attribute("isReferenced", true);
131
132 if (const auto *ND = dyn_cast(D))
133 attributeOnlyIfTrue("isHidden", !ND->isUnconditionallyVisible());
134
136
137
138
139 const auto *ParentDeclContextDecl = dyn_cast(D->getDeclContext());
140 JOS.attribute("parentDeclContextId",
141 createPointerRepresentation(ParentDeclContextDecl));
142 }
143
144 addPreviousDeclaration(D);
146}
147
150 if ()
151 return;
152
153 JOS.attribute("id", createPointerRepresentation(C));
154 JOS.attribute("kind", C->getCommentKindName());
155 JOS.attributeObject("loc",
156 [C, this] { writeSourceLocation(C->getLocation()); });
157 JOS.attributeObject("range",
158 [C, this] { writeSourceRange(C->getSourceRange()); });
159
161}
162
164 const Decl *From, StringRef Label) {
165 JOS.attribute("kind", "TemplateArgument");
167 JOS.attributeObject("range", [R, this] { writeSourceRange(R); });
168
169 if (From)
170 JOS.attribute(Label.empty() ? "fromDecl" : Label, createBareDeclRef(From));
171
173}
174
176 JOS.attribute("kind", "CXXCtorInitializer");
177 if (Init->isAnyMemberInitializer())
178 JOS.attribute("anyInit", createBareDeclRef(Init->getAnyMember()));
179 else if (Init->isBaseInitializer())
180 JOS.attribute("baseInit",
181 createQualType(QualType(Init->getBaseClass(), 0)));
182 else if (Init->isDelegatingInitializer())
183 JOS.attribute("delegatingInit",
184 createQualType(Init->getTypeSourceInfo()->getType()));
185 else
186 llvm_unreachable("Unknown initializer type");
187}
188
190
192
194 JOS.attribute("kind", "Capture");
195 attributeOnlyIfTrue("byref", C.isByRef());
196 attributeOnlyIfTrue("nested", C.isNested());
197 if (C.getVariable())
198 JOS.attribute("var", createBareDeclRef(C.getVariable()));
199}
200
202 JOS.attribute("associationKind", A.getTypeSourceInfo() ? "case" : "default");
203 attributeOnlyIfTrue("selected", A.isSelected());
204}
205
207 if (!R)
208 return;
209
212 JOS.attribute("kind", "TypeRequirement");
213 break;
215 JOS.attribute("kind", "SimpleRequirement");
216 break;
218 JOS.attribute("kind", "CompoundRequirement");
219 break;
221 JOS.attribute("kind", "NestedRequirement");
222 break;
223 }
224
225 if (auto *ER = dyn_castconcepts::ExprRequirement(R))
226 attributeOnlyIfTrue("noexcept", ER->hasNoexceptRequirement());
227
228 attributeOnlyIfTrue("isDependent", R->isDependent());
231 attributeOnlyIfTrue("containsUnexpandedPack",
233}
234
236 std::string Str;
237 llvm::raw_string_ostream OS(Str);
238 Value.printPretty(OS, Ctx, Ty);
239 JOS.attribute("value", Str);
240}
241
243 JOS.attribute("kind", "ConceptReference");
244 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
246 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
248 JOS.object(
249 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
250 });
251 }
252 JOS.attributeObject("loc",
253 [CR, this] { writeSourceLocation(CR->getLocation()); });
254 JOS.attributeObject("range",
255 [CR, this] { writeSourceRange(CR->getSourceRange()); });
256}
257
258void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
260 return;
261
262 JOS.attributeBegin("includedFrom");
263 JOS.objectBegin();
264
265 if (!JustFirst) {
266
267 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
268 }
269
271 JOS.objectEnd();
272 JOS.attributeEnd();
273}
274
275void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc) {
276 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
277 if (Presumed.isValid()) {
278 StringRef ActualFile = SM.getBufferName(Loc);
279 auto [FID, FilePos] = SM.getDecomposedLoc(Loc);
280 unsigned ActualLine = SM.getLineNumber(FID, FilePos);
281 JOS.attribute("offset", FilePos);
282 if (LastLocFilename != ActualFile) {
283 JOS.attribute("file", ActualFile);
284 JOS.attribute("line", ActualLine);
285 } else if (LastLocLine != ActualLine)
286 JOS.attribute("line", ActualLine);
287
288 StringRef PresumedFile = Presumed.getFilename();
289 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
290 JOS.attribute("presumedFile", PresumedFile);
291
292 unsigned PresumedLine = Presumed.getLine();
293 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
294 JOS.attribute("presumedLine", PresumedLine);
295
297 JOS.attribute("tokLen",
299 LastLocFilename = ActualFile;
300 LastLocPresumedFilename = PresumedFile;
301 LastLocPresumedLine = PresumedLine;
302 LastLocLine = ActualLine;
303
304
305
306
307 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
308 true);
309 }
310}
311
312void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
313 SourceLocation Spelling = SM.getSpellingLoc(Loc);
314 SourceLocation Expansion = SM.getExpansionLoc(Loc);
315
316 if (Expansion != Spelling) {
317
318
319 JOS.attributeObject(
320 "spellingLoc", [Spelling, this] { writeBareSourceLocation(Spelling); });
321 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
322 writeBareSourceLocation(Expansion);
323
324
325 if (SM.isMacroArgExpansion(Loc))
326 JOS.attribute("isMacroArgExpansion", true);
327 });
328 } else
329 writeBareSourceLocation(Spelling);
330}
331
332void JSONNodeDumper::writeSourceRange(SourceRange R) {
333 JOS.attributeObject("begin",
334 [R, this] { writeSourceLocation(R.getBegin()); });
335 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
336}
337
338std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
339
340
341
342 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
343}
344
345llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
346 SplitQualType SQT = QT.split();
348 llvm::json::Object Ret{{"qualType", SQTS}};
349
350 if (Desugar && !QT.isNull()) {
352 if (DSQT != SQT) {
354 if (DSQTS != SQTS)
355 Ret["desugaredQualType"] = DSQTS;
356 }
357 if (const auto *TT = QT->getAs())
358 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
359 }
360 return Ret;
361}
362
363void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
364 JOS.attribute("id", createPointerRepresentation(D));
365 if (!D)
366 return;
367
368 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
369 if (const auto *ND = dyn_cast(D))
370 JOS.attribute("name", ND->getDeclName().getAsString());
371 if (const auto *VD = dyn_cast(D))
372 JOS.attribute("type", createQualType(VD->getType()));
373}
374
375llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
376 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
377 if (!D)
378 return Ret;
379
381 if (const auto *ND = dyn_cast(D))
382 Ret["name"] = ND->getDeclName().getAsString();
383 if (const auto *VD = dyn_cast(D))
384 Ret["type"] = createQualType(VD->getType());
385 return Ret;
386}
387
388llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
389 llvm::json::Array Ret;
390 if (C->path_empty())
391 return Ret;
392
393 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
394 const CXXBaseSpecifier *Base = *I;
396 Base->getType()->castAsCanonical()->getDecl());
397
398 llvm::json::Object Val{{"name", RD->getName()}};
399 if (Base->isVirtual())
400 Val["isVirtual"] = true;
401 Ret.push_back(std::move(Val));
402 }
403 return Ret;
404}
405
406#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
407#define FIELD1(Flag) FIELD2(#Flag, Flag)
408
409static llvm::json::Object
411 llvm::json::Object Ret;
412
413 FIELD2("exists", hasDefaultConstructor);
414 FIELD2("trivial", hasTrivialDefaultConstructor);
415 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
416 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
417 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
418 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
419 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
420
421 return Ret;
422}
423
424static llvm::json::Object
426 llvm::json::Object Ret;
427
428 FIELD2("simple", hasSimpleCopyConstructor);
429 FIELD2("trivial", hasTrivialCopyConstructor);
430 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
431 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
432 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
433 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
434 FIELD2("needsImplicit", needsImplicitCopyConstructor);
435 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
437 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
438
439 return Ret;
440}
441
442static llvm::json::Object
444 llvm::json::Object Ret;
445
446 FIELD2("exists", hasMoveConstructor);
447 FIELD2("simple", hasSimpleMoveConstructor);
448 FIELD2("trivial", hasTrivialMoveConstructor);
449 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
450 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
451 FIELD2("needsImplicit", needsImplicitMoveConstructor);
452 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
454 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
455
456 return Ret;
457}
458
459static llvm::json::Object
461 llvm::json::Object Ret;
462
463 FIELD2("simple", hasSimpleCopyAssignment);
464 FIELD2("trivial", hasTrivialCopyAssignment);
465 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
466 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
467 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
468 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
469 FIELD2("needsImplicit", needsImplicitCopyAssignment);
470 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
471
472 return Ret;
473}
474
475static llvm::json::Object
477 llvm::json::Object Ret;
478
479 FIELD2("exists", hasMoveAssignment);
480 FIELD2("simple", hasSimpleMoveAssignment);
481 FIELD2("trivial", hasTrivialMoveAssignment);
482 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
483 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
484 FIELD2("needsImplicit", needsImplicitMoveAssignment);
485 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
486
487 return Ret;
488}
489
490static llvm::json::Object
492 llvm::json::Object Ret;
493
494 FIELD2("simple", hasSimpleDestructor);
495 FIELD2("irrelevant", hasIrrelevantDestructor);
496 FIELD2("trivial", hasTrivialDestructor);
497 FIELD2("nonTrivial", hasNonTrivialDestructor);
498 FIELD2("userDeclared", hasUserDeclaredDestructor);
499 FIELD2("needsImplicit", needsImplicitDestructor);
500 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
502 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
503
504 return Ret;
505}
506
507llvm::json::Object
508JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
509 llvm::json::Object Ret;
510
511
512 FIELD1(isGenericLambda);
516 FIELD1(isStandardLayout);
517 FIELD1(isTriviallyCopyable);
520 FIELD1(isPolymorphic);
524 FIELD1(hasUserDeclaredConstructor);
525 FIELD1(hasConstexprNonCopyMoveConstructor);
526 FIELD1(hasMutableFields);
527 FIELD1(hasVariantMembers);
528 FIELD2("canConstDefaultInit", allowConstDefaultInit);
529
536
537 return Ret;
538}
539
540#undef FIELD1
541#undef FIELD2
542
543std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
545 if (AccessSpelling.empty())
546 return "none";
547 return AccessSpelling.str();
548}
549
550llvm::json::Object
551JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
552 llvm::json::Object Ret;
553
554 Ret["type"] = createQualType(BS.getType());
556 Ret["writtenAccess"] =
559 Ret["isVirtual"] = true;
561 Ret["isPackExpansion"] = true;
562
563 return Ret;
564}
565
567 JOS.attribute("aliasee", AA->getAliasee());
568}
569
571 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
572}
573
575 if (!DA->getMessage().empty())
576 JOS.attribute("message", DA->getMessage());
577 if (!DA->getReplacement().empty())
578 JOS.attribute("replacement", DA->getReplacement());
579}
580
582 if (!UA->getMessage().empty())
583 JOS.attribute("message", UA->getMessage());
584}
585
587 JOS.attribute("section_name", SA->getName());
588}
589
591 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
592 VA->getVisibility()));
593}
594
596 JOS.attribute("tls_model", TA->getModel());
597}
598
600 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
602 JOS.attribute("type", createQualType(TT->desugar()));
603}
604
606 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
607 JOS.attribute("type", createQualType(TT->desugar()));
608}
609
612 attributeOnlyIfTrue("noreturn", E.getNoReturn());
617}
618
622 attributeOnlyIfTrue("const", T->isConst());
623 attributeOnlyIfTrue("volatile", T->isVolatile());
624 attributeOnlyIfTrue("restrict", T->isRestrict());
625 attributeOnlyIfTrue("variadic", E.Variadic);
627 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
628 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
630 }
634 JOS.attribute("exceptionSpec", "throw");
635 llvm::json::Array Types;
637 Types.push_back(createQualType(QT));
638 JOS.attribute("exceptionTypes", std::move(Types));
639 } break;
641 JOS.attribute("exceptionSpec", "throw");
642 JOS.attribute("throwsAny", true);
643 break;
645 JOS.attribute("exceptionSpec", "noexcept");
646 break;
649 JOS.attribute("exceptionSpec", "noexcept");
650 JOS.attribute("conditionEvaluatesTo",
652
653
654 break;
656 JOS.attribute("exceptionSpec", "nothrow");
657 break;
658
659
660
661
667 }
669}
670
674
678 JOS.attribute("sizeModifier", "*");
679 break;
681 JOS.attribute("sizeModifier", "static");
682 break;
684 break;
685 }
686
688 if (!Str.empty())
689 JOS.attribute("indexTypeQualifiers", Str);
690}
691
698
701 JOS.attributeObject(
702 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
703}
704
709 break;
711 JOS.attribute("vectorKind", "altivec");
712 break;
714 JOS.attribute("vectorKind", "altivec pixel");
715 break;
717 JOS.attribute("vectorKind", "altivec bool");
718 break;
720 JOS.attribute("vectorKind", "neon");
721 break;
723 JOS.attribute("vectorKind", "neon poly");
724 break;
726 JOS.attribute("vectorKind", "fixed-length sve data vector");
727 break;
729 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
730 break;
732 JOS.attribute("vectorKind", "fixed-length rvv data vector");
733 break;
738 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
739 break;
740 }
741}
742
744 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
745}
746
748 switch (UTT->getUTTKind()) {
749#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
750 case UnaryTransformType::Enum: \
751 JOS.attribute("transformKind", #Trait); \
752 break;
753#include "clang/Basic/TransformTypeTraits.def"
754 }
755}
756
759 std::string Str;
760 llvm::raw_string_ostream OS(Str);
761 Qualifier.print(OS, PrintPolicy, true);
762 JOS.attribute("qualifier", Str);
763 }
764 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
765 if (TT->isTagOwned())
766 JOS.attribute("isTagOwned", true);
767}
768
770 const TemplateTypeParmType *TTPT) {
771 JOS.attribute("depth", TTPT->getDepth());
772 JOS.attribute("index", TTPT->getIndex());
773 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
774 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
775}
776
778 const SubstTemplateTypeParmType *STTPT) {
779 JOS.attribute("index", STTPT->getIndex());
780 if (auto PackIndex = STTPT->getPackIndex())
781 JOS.attribute("pack_index", *PackIndex);
782}
783
785 const SubstTemplateTypeParmPackType *T) {
786 JOS.attribute("index", T->getIndex());
787}
788
790 JOS.attribute("undeduced", !AT->isDeduced());
791 switch (AT->getKeyword()) {
793 JOS.attribute("typeKeyword", "auto");
794 break;
796 JOS.attribute("typeKeyword", "decltype(auto)");
797 break;
799 JOS.attribute("typeKeyword", "__auto_type");
800 break;
801 }
802}
803
805 const TemplateSpecializationType *TST) {
806 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
807
808 std::string Str;
809 llvm::raw_string_ostream OS(Str);
810 TST->getTemplateName().print(OS, PrintPolicy);
811 JOS.attribute("templateName", Str);
812}
813
815 const InjectedClassNameType *ICNT) {
816 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
817}
818
820 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
821}
822
825 JOS.attribute("numExpansions", *N);
826}
827
831
836
840
841
843 return;
844
845
846
847
849 return;
850
851
852
853 auto *VD = dyn_cast(ND);
854 if (VD && VD->hasLocalStorage())
855 return;
856
857
859 return;
860
861 std::string MangledName = ASTNameGen.getName(ND);
862 if (!MangledName.empty())
863 JOS.attribute("mangledName", MangledName);
864 }
865}
866
871
876
879 attributeOnlyIfTrue("isInline", ND->isInline());
880 attributeOnlyIfTrue("isNested", ND->isNested());
882 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
883}
884
886 JOS.attribute("nominatedNamespace",
888}
889
892 JOS.attribute("aliasedNamespace",
894}
895
897 std::string Name;
899 llvm::raw_string_ostream SOS(Name);
901 }
903 JOS.attribute("name", Name);
904}
905
907 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
908}
909
913
916 JOS.attribute("type", createQualType(VD->getType()));
917 if (const auto *P = dyn_cast(VD))
918 attributeOnlyIfTrue("explicitObjectParameter",
919 P->isExplicitObjectParameter());
920
928 }
930 attributeOnlyIfTrue("inline", VD->isInline());
931 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
932 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
939 JOS.attribute("init", "paren-list");
940 break;
941 }
942 }
943 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
945 JOS.attribute("TemplateInstantiationPattern",
946 createPointerRepresentation(Instance));
947}
948
951 JOS.attribute("type", createQualType(FD->getType()));
952 attributeOnlyIfTrue("mutable", FD->isMutable());
953 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
954 attributeOnlyIfTrue("isBitfield", FD->isBitField());
956}
957
960 JOS.attribute("type", createQualType(FD->getType()));
966 attributeOnlyIfTrue("pure", FD->isPureVirtual());
968 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
969 attributeOnlyIfTrue("variadic", FD->isVariadic());
971
973 JOS.attribute("explicitlyDefaulted",
974 FD->isDeleted() ? "deleted" : "default");
975
977 JOS.attribute("deletedMessage", Msg->getString());
978
980 JOS.attribute("TemplateInstantiationPattern",
981 createPointerRepresentation(Instance));
982}
983
987 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
989 JOS.attribute("scopedEnumTag",
992 JOS.attribute("TemplateInstantiationPattern",
993 createPointerRepresentation(Instance));
994}
997 JOS.attribute("type", createQualType(ECD->getType()));
998}
999
1007
1008 if (const auto *CTSD = dyn_cast(RD)) {
1009 if (CTSD->hasStrictPackMatch())
1010 JOS.attribute("strict-pack-match", true);
1011 }
1012
1014 JOS.attribute("TemplateInstantiationPattern",
1015 createPointerRepresentation(Instance));
1016
1017
1019 return;
1020
1021 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1023 JOS.attributeArray("bases", [this, RD] {
1024 for (const auto &Spec : RD->bases())
1025 JOS.value(createCXXBaseSpecifier(Spec));
1026 });
1027 }
1028}
1029
1032 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1033}
1034
1040 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1041
1043 JOS.attributeObject("defaultArg", [=] {
1047 });
1048}
1049
1053 JOS.attribute("type", createQualType(D->getType()));
1056 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1057
1059 JOS.attributeObject("defaultArg", [=] {
1063 });
1064}
1065
1071 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1072
1074 JOS.attributeObject("defaultArg", [=] {
1077 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1078 InheritedFrom,
1080 });
1081}
1082
1084 StringRef Lang;
1087 Lang = "C";
1088 break;
1090 Lang = "C++";
1091 break;
1092 }
1093 JOS.attribute("language", Lang);
1094 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1095}
1096
1098 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1099}
1100
1103 JOS.attribute("type", createQualType(T->getType()));
1104 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1105}
1106
1109 JOS.attribute("type", createQualType(D->getType()));
1110 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1117 }
1118}
1119
1122 JOS.attribute("returnType", createQualType(D->getReturnType()));
1124 attributeOnlyIfTrue("variadic", D->isVariadic());
1125}
1126
1133 break;
1135 JOS.attribute("variance", "covariant");
1136 break;
1138 JOS.attribute("variance", "contravariant");
1139 break;
1140 }
1141}
1142
1147
1148 llvm::json::Array Protocols;
1149 for (const auto* P : D->protocols())
1150 Protocols.push_back(createBareDeclRef(P));
1151 if (!Protocols.empty())
1152 JOS.attribute("protocols", std::move(Protocols));
1153}
1154
1160
1163
1164 llvm::json::Array Protocols;
1165 for (const auto *P : D->protocols())
1166 Protocols.push_back(createBareDeclRef(P));
1167 if (!Protocols.empty())
1168 JOS.attribute("protocols", std::move(Protocols));
1169}
1170
1173 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1175
1176 llvm::json::Array Protocols;
1177 for (const auto* P : D->protocols())
1178 Protocols.push_back(createBareDeclRef(P));
1179 if (!Protocols.empty())
1180 JOS.attribute("protocols", std::move(Protocols));
1181}
1182
1189
1195
1198 JOS.attribute("type", createQualType(D->getType()));
1199
1204 }
1205
1212 attributeOnlyIfTrue("readonly",
1215 attributeOnlyIfTrue("readwrite",
1219 attributeOnlyIfTrue("nonatomic",
1224 attributeOnlyIfTrue("unsafe_unretained",
1228 attributeOnlyIfTrue("nullability",
1230 attributeOnlyIfTrue("null_resettable",
1232 }
1233}
1234
1239 ? "synthesize"
1240 : "dynamic");
1241 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1243}
1244
1249
1253
1257
1259 std::string Str;
1260 llvm::raw_string_ostream OS(Str);
1261
1263 JOS.attribute("selector", Str);
1264
1267 JOS.attribute("receiverKind", "instance");
1268 break;
1270 JOS.attribute("receiverKind", "class");
1272 break;
1274 JOS.attribute("receiverKind", "super (instance)");
1275 JOS.attribute("superType", createQualType(OME->getSuperType()));
1276 break;
1278 JOS.attribute("receiverKind", "super (class)");
1279 JOS.attribute("superType", createQualType(OME->getSuperType()));
1280 break;
1281 }
1282
1284 if (OME->getType() != CallReturnTy)
1285 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1286}
1287
1290 std::string Str;
1291 llvm::raw_string_ostream OS(Str);
1292
1293 MD->getSelector().print(OS);
1294 JOS.attribute("selector", Str);
1295 }
1296}
1297
1299 std::string Str;
1300 llvm::raw_string_ostream OS(Str);
1301
1303 JOS.attribute("selector", Str);
1304}
1305
1307 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1308}
1309
1312 JOS.attribute("propertyKind", "implicit");
1314 JOS.attribute("getter", createBareDeclRef(MD));
1316 JOS.attribute("setter", createBareDeclRef(MD));
1317 } else {
1318 JOS.attribute("propertyKind", "explicit");
1320 }
1321
1322 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1323 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1324 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1325}
1326
1329 JOS.attribute("subscriptKind",
1331
1333 JOS.attribute("getter", createBareDeclRef(MD));
1335 JOS.attribute("setter", createBareDeclRef(MD));
1336}
1337
1339 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1340 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1341 JOS.attribute("isArrow", OIRE->isArrow());
1342}
1343
1345 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1346}
1347
1349 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1351 JOS.attribute("foundReferencedDecl",
1355 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1356 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1357 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1358 }
1360}
1361
1364 JOS.attribute("typeSourceInfo",
1366}
1367
1370
1373
1377
1379 JOS.attribute("isPostfix", UO->isPostfix());
1382 JOS.attribute("canOverflow", false);
1383}
1384
1388
1393 JOS.attribute("computeResultType",
1395}
1396
1398
1399
1402 JOS.attribute("isArrow", ME->isArrow());
1403 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1406 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1407 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1408 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1409 }
1410}
1411
1413 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1414 attributeOnlyIfTrue("isArray", NE->isArray());
1415 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1416 switch (NE->getInitializationStyle()) {
1418 break;
1420 JOS.attribute("initStyle", "call");
1421 break;
1423 JOS.attribute("initStyle", "list");
1424 break;
1425 }
1426 if (const FunctionDecl *FD = NE->getOperatorNew())
1427 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1428 if (const FunctionDecl *FD = NE->getOperatorDelete())
1429 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1430}
1432 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1433 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1436 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1437}
1438
1440 attributeOnlyIfTrue("implicit", TE->isImplicit());
1441}
1442
1445 llvm::json::Array Path = createCastPath(CE);
1446 if (!Path.empty())
1447 JOS.attribute("path", std::move(Path));
1448
1449
1451 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1452}
1453
1458
1460 attributeOnlyIfTrue("adl", CE->usesADL());
1461}
1462
1469
1473
1478
1479 JOS.attributeArray("lookups", [this, ULE] {
1481 JOS.value(createBareDeclRef(D));
1482 });
1483}
1484
1487 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1488}
1489
1494 JOS.attribute("typeArg", createQualType(Unadjusted));
1495 if (Adjusted != Unadjusted)
1496 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1497 }
1498}
1499
1504
1507 JOS.attribute("field", createBareDeclRef(FD));
1508}
1509
1514
1521
1524 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1525 attributeOnlyIfTrue("elidable", CE->isElidable());
1531
1534 JOS.attribute("constructionKind", "complete");
1535 break;
1537 JOS.attribute("constructionKind", "delegating");
1538 break;
1540 JOS.attribute("constructionKind", "non-virtual base");
1541 break;
1543 JOS.attribute("constructionKind", "virtual base");
1544 break;
1545 }
1546}
1547
1549 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1552 JOS.attributeArray("cleanups", [this, EWC] {
1554 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1555 JOS.value(createBareDeclRef(BD));
1556 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1557 llvm::json::Object Obj;
1558 Obj["id"] = createPointerRepresentation(CLE);
1559 Obj["kind"] = CLE->getStmtClassName();
1560 JOS.value(std::move(Obj));
1561 } else {
1562 llvm_unreachable("unexpected cleanup object type");
1563 }
1564 });
1565 }
1566}
1567
1571 JOS.attribute("temp", createPointerRepresentation(Temp));
1573 JOS.attribute("dtor", createBareDeclRef(Dtor));
1574}
1575
1579 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1580
1583 JOS.attribute("storageDuration", "automatic");
1584 break;
1586 JOS.attribute("storageDuration", "dynamic");
1587 break;
1589 JOS.attribute("storageDuration", "full expression");
1590 break;
1592 JOS.attribute("storageDuration", "static");
1593 break;
1595 JOS.attribute("storageDuration", "thread");
1596 break;
1597 }
1598
1600}
1601
1605
1609
1611 JOS.attribute("hasExplicitParameters", LE->hasExplicitParameters());
1612}
1613
1616 JOS.attribute("isArrow", DSME->isArrow());
1618 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1619 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1621
1623 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1625 JOS.object(
1626 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1627 });
1628 }
1629}
1630
1635
1638 IL->getValue().toString(Buffer,
1640 JOS.attribute("value", Buffer);
1641}
1643
1644
1645
1646
1647 JOS.attribute("value", CL->getValue());
1648}
1654 FL->getValue().toString(Buffer);
1655 JOS.attribute("value", Buffer);
1656}
1658 std::string Buffer;
1659 llvm::raw_string_ostream SS(Buffer);
1661 JOS.attribute("value", Buffer);
1662}
1666
1675
1683
1685 JOS.attribute("name", LS->getName());
1686 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1687 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1688}
1689
1692 JOS.attribute("targetLabelDeclId",
1693 createPointerRepresentation(LS->getLabelDecl()));
1694}
1695
1697 JOS.attribute("targetLabelDeclId",
1698 createPointerRepresentation(GS->getLabel()));
1699}
1700
1704
1706
1707
1708
1709 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1710}
1711
1713 JOS.attribute("isNull", true);
1714}
1716 JOS.attribute("type", createQualType(TA.getAsType()));
1717}
1720 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1721}
1723 JOS.attribute("isNullptr", true);
1724}
1743 JOS.attribute("isExpr", true);
1745 JOS.attribute("isCanonical", true);
1746}
1748 JOS.attribute("isPack", true);
1749}
1750
1751StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1752 if (Traits)
1753 return Traits->getCommandInfo(CommandID)->Name;
1756 return Info->Name;
1757 return "";
1758}
1759
1762 JOS.attribute("text", C->getText());
1763}
1764
1767 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1768
1769 switch (C->getRenderKind()) {
1771 JOS.attribute("renderKind", "normal");
1772 break;
1774 JOS.attribute("renderKind", "bold");
1775 break;
1777 JOS.attribute("renderKind", "emphasized");
1778 break;
1780 JOS.attribute("renderKind", "monospaced");
1781 break;
1783 JOS.attribute("renderKind", "anchor");
1784 break;
1785 }
1786
1787 llvm::json::Array Args;
1788 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1789 Args.push_back(C->getArgText(I));
1790
1791 if (!Args.empty())
1792 JOS.attribute("args", std::move(Args));
1793}
1794
1797 JOS.attribute("name", C->getTagName());
1798 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1799 attributeOnlyIfTrue("malformed", C->isMalformed());
1800
1801 llvm::json::Array Attrs;
1802 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1803 Attrs.push_back(
1804 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1805
1806 if (!Attrs.empty())
1807 JOS.attribute("attrs", std::move(Attrs));
1808}
1809
1812 JOS.attribute("name", C->getTagName());
1813}
1814
1817 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1818
1819 llvm::json::Array Args;
1820 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1821 Args.push_back(C->getArgText(I));
1822
1823 if (!Args.empty())
1824 JOS.attribute("args", std::move(Args));
1825}
1826
1829 switch (C->getDirection()) {
1831 JOS.attribute("direction", "in");
1832 break;
1834 JOS.attribute("direction", "out");
1835 break;
1837 JOS.attribute("direction", "in,out");
1838 break;
1839 }
1840 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1841
1842 if (C->hasParamName())
1843 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1844 : C->getParamNameAsWritten());
1845
1846 if (C->isParamIndexValid() && ->isVarArgParam())
1847 JOS.attribute("paramIdx", C->getParamIndex());
1848}
1849
1852 if (C->hasParamName())
1853 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1854 : C->getParamNameAsWritten());
1855 if (C->isPositionValid()) {
1856 llvm::json::Array Positions;
1857 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1858 Positions.push_back(C->getIndex(I));
1859
1860 if (!Positions.empty())
1861 JOS.attribute("positions", std::move(Positions));
1862 }
1863}
1864
1867 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1868 JOS.attribute("closeName", C->getCloseName());
1869}
1870
1874 JOS.attribute("text", C->getText());
1875}
1876
1879 JOS.attribute("text", C->getText());
1880}
1881
1882llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1883 llvm::json::Object Ret;
1884#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1885 if (FPO.has##NAME##Override()) \
1886 Ret.try_emplace(#NAME, static_cast(FPO.get##NAME##Override()));
1887#include "clang/Basic/FPOptions.def"
1888 return Ret;
1889}
1890
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
#define FIELD1(Flag)
Definition JSONNodeDumper.cpp:407
static llvm::json::Object createMoveAssignmentDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:476
#define FIELD2(Name, Flag)
Definition JSONNodeDumper.cpp:406
static llvm::json::Object createCopyAssignmentDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:460
static llvm::json::Object createCopyConstructorDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:425
static llvm::json::Object createDestructorDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:491
static llvm::json::Object createDefaultConstructorDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:410
static llvm::json::Object createMoveConstructorDefinitionData(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:443
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.
C Language Family Type Representation.
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
@ None
There is no such object (it's outside its lifetime).
const clang::PrintingPolicy & getPrintingPolicy() const
Represents an access specifier followed by colon ':'.
AddrLabelExpr - The GNU address of label extension, representing &&label.
LabelDecl * getLabel() const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
ArraySizeModifier getSizeModifier() const
Qualifiers getIndexTypeQualifiers() const
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
StringRef getOpAsString() const
Attr - This represents one attribute.
attr::Kind getKind() const
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
SourceRange getRange() const
A builtin binary operation expression such as "x + y" or "x <= y".
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
A class which contains all the information about a particular captured value.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
bool capturesCXXThis() const
Represents a base class of a C++ class.
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
QualType getType() const
Retrieves the type of the base class.
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
Represents binding an expression to a temporary.
CXXTemporary * getTemporary()
A boolean literal, per ([C++ lex.bool] Boolean literals).
Represents a call to a C++ constructor.
bool isElidable() const
Whether this construction is elidable.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
bool isImmediateEscalating() const
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Represents a C++ constructor within a class.
Represents a C++ base or member initializer.
A default argument (C++ [dcl.fct.default]).
bool hasRewrittenInit() const
A use of a default initializer in a constructor or in aggregate initialization.
bool hasRewrittenInit() const
Represents a delete expression for memory deallocation and destructor calls, e.g.
FunctionDecl * getOperatorDelete() const
bool isGlobalDelete() const
bool isArrayFormAsWritten() const
Represents a C++ member access expression where the actual member referenced could not be resolved be...
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
ArrayRef< TemplateArgumentLoc > template_arguments() const
Represents a C++ destructor within a class.
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Represents a C++ struct/union/class.
unsigned getNumBases() const
Retrieves the number of base classes of this class.
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Represents a C++ temporary.
const CXXDestructorDecl * getDestructor() const
Represents the this expression in C++.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
bool isTypeOperand() const
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
bool isListInitialization() const
Determine whether this expression models list-initialization.
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
CaseStmt - Represent a case statement.
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
static const char * getCastKindName(CastKind CK)
CompoundAssignOperator - For compound assignments (e.g.
QualType getComputationLHSType() const
QualType getComputationResultType() const
CompoundStmt - This represents a group of statements like { stmt stmt }.
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
bool hasStoredFPFeatures() const
A reference to a concept and its template args, as it appears in the code.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation getLocation() const
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
TemplateDecl * getNamedConcept() const
Represents the canonical version of C arrays with a specified constant size.
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
APValue getAPValueResult() const
APValue::ValueKind getResultAPValueKind() const
A reference to a declared variable, function, enum, etc.
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
bool isImmediateEscalating() const
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
bool isInvalidDecl() const
SourceLocation getLocation() const
const char * getDeclKindName() const
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
DeclContext * getDeclContext()
AccessSpecifier getAccess() const
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
std::string getAsString() const
Retrieve the human-readable string for this name.
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Represents an extended vector type where either the type or size is dependent.
SourceLocation getAttributeLoc() const
An instance of this object exists for each enum constant that is defined.
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
bool cleanupsHaveSideEffects() const
ArrayRef< CleanupObject > getObjects() const
unsigned getNumObjects() const
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
bool isValueDependent() const
Determines whether the value of this expression depends on.
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
bool isMutable() const
Determines whether this field is mutable (C++ only).
bool isBitField() const
Determines whether this field is a bitfield.
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
std::string getValueAsString(unsigned Radix) const
llvm::APFloat getValue() const
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
bool isPackExpansion() const
Represents a function declaration or definition.
bool isImmediateFunction() const
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
bool isVariadic() const
Whether this function is variadic.
bool isDeleted() const
Whether this function has been deleted.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
bool isDeletedAsWritten() const
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
bool isDefaulted() const
Whether this function is defaulted.
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Represents a prototype with parameter type info, e.g.
A class which abstracts out some details necessary for making a call.
CallingConv getCC() const
unsigned getRegParm() const
bool getHasRegParm() const
bool getProducesResult() const
FunctionType - C99 6.7.5.3 - Function Declarators.
static StringRef getNameForCallConv(CallingConv CC)
Represents a C11 generic selection.
AssociationTy< true > ConstAssociation
bool isResultDependent() const
Whether this generic selection is result-dependent.
GotoStmt - This represents a direct goto.
LabelDecl * getLabel() const
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
bool isNegatedConsteval() const
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
bool isPartOfExplicitCast() const
Describes an C or C++ initializer list.
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
Definition JSONNodeDumper.cpp:1327
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
Definition JSONNodeDumper.cpp:1171
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
Definition JSONNodeDumper.cpp:1474
void VisitCleanupAttr(const CleanupAttr *CA)
Definition JSONNodeDumper.cpp:570
void VisitCaseStmt(const CaseStmt *CS)
Definition JSONNodeDumper.cpp:1680
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
Definition JSONNodeDumper.cpp:1454
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
Definition JSONNodeDumper.cpp:890
void VisitFunctionProtoType(const FunctionProtoType *T)
Definition JSONNodeDumper.cpp:619
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
Definition JSONNodeDumper.cpp:1183
void VisitVectorType(const VectorType *VT)
Definition JSONNodeDumper.cpp:705
void VisitFunctionDecl(const FunctionDecl *FD)
Definition JSONNodeDumper.cpp:958
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
Definition JSONNodeDumper.cpp:1306
void VisitUsingDecl(const UsingDecl *UD)
Definition JSONNodeDumper.cpp:896
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
Definition JSONNodeDumper.cpp:995
void VisitOpenACCRoutineDecl(const OpenACCRoutineDecl *D)
Definition JSONNodeDumper.cpp:1372
void VisitConstantExpr(const ConstantExpr *CE)
Definition JSONNodeDumper.cpp:1500
void VisitRequiresExpr(const RequiresExpr *RE)
Definition JSONNodeDumper.cpp:1631
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
Definition JSONNodeDumper.cpp:1548
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
Definition JSONNodeDumper.cpp:1663
void VisitTagType(const TagType *TT)
Definition JSONNodeDumper.cpp:757
void Visit(const Attr *A)
Definition JSONNodeDumper.cpp:23
void VisitLabelStmt(const LabelStmt *LS)
Definition JSONNodeDumper.cpp:1684
void VisitRValueReferenceType(const ReferenceType *RT)
Definition JSONNodeDumper.cpp:671
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
Definition JSONNodeDumper.cpp:819
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
Definition JSONNodeDumper.cpp:1522
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
Definition JSONNodeDumper.cpp:1254
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
Definition JSONNodeDumper.cpp:1614
void VisitStringLiteral(const StringLiteral *SL)
Definition JSONNodeDumper.cpp:1657
void VisitBlockDecl(const BlockDecl *D)
Definition JSONNodeDumper.cpp:1245
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
Definition JSONNodeDumper.cpp:1606
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
Definition JSONNodeDumper.cpp:1470
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
Definition JSONNodeDumper.cpp:1515
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
Definition JSONNodeDumper.cpp:1490
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
Definition JSONNodeDumper.cpp:1235
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
Definition JSONNodeDumper.cpp:1097
void VisitDeprecatedAttr(const DeprecatedAttr *DA)
Definition JSONNodeDumper.cpp:574
void VisitMemberPointerType(const MemberPointerType *MPT)
Definition JSONNodeDumper.cpp:832
void VisitMemberExpr(const MemberExpr *ME)
Definition JSONNodeDumper.cpp:1397
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1815
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
Definition JSONNodeDumper.cpp:1005
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
Definition JSONNodeDumper.cpp:1066
void VisitSwitchStmt(const SwitchStmt *SS)
Definition JSONNodeDumper.cpp:1676
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1810
void VisitBinaryOperator(const BinaryOperator *BO)
Definition JSONNodeDumper.cpp:1385
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1871
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
Definition JSONNodeDumper.cpp:1050
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
Definition JSONNodeDumper.cpp:1035
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
Definition JSONNodeDumper.cpp:1083
void VisitTypedefDecl(const TypedefDecl *TD)
Definition JSONNodeDumper.cpp:867
void VisitTypedefType(const TypedefType *TT)
Definition JSONNodeDumper.cpp:599
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
Definition JSONNodeDumper.cpp:743
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
Definition JSONNodeDumper.cpp:784
void VisitUnaryTransformType(const UnaryTransformType *UTT)
Definition JSONNodeDumper.cpp:747
void VisitCallExpr(const CallExpr *CE)
Definition JSONNodeDumper.cpp:1459
void VisitVisibilityAttr(const VisibilityAttr *VA)
Definition JSONNodeDumper.cpp:590
void VisitOpenACCDeclareDecl(const OpenACCDeclareDecl *D)
Definition JSONNodeDumper.cpp:1371
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
Definition JSONNodeDumper.cpp:1389
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
Definition JSONNodeDumper.cpp:1827
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1865
void VisitAtomicExpr(const AtomicExpr *AE)
Definition JSONNodeDumper.cpp:1250
void VisitLoopControlStmt(const LoopControlStmt *LS)
Definition JSONNodeDumper.cpp:1690
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
Definition JSONNodeDumper.cpp:910
void VisitFloatingLiteral(const FloatingLiteral *FL)
Definition JSONNodeDumper.cpp:1652
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
Definition JSONNodeDumper.cpp:769
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
Definition JSONNodeDumper.cpp:885
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
Definition JSONNodeDumper.cpp:804
void VisitWhileStmt(const WhileStmt *WS)
Definition JSONNodeDumper.cpp:1701
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1718
void VisitVarDecl(const VarDecl *VD)
Definition JSONNodeDumper.cpp:914
void VisitEnumDecl(const EnumDecl *ED)
Definition JSONNodeDumper.cpp:984
void VisitPackTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1747
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1736
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1760
void VisitFieldDecl(const FieldDecl *FD)
Definition JSONNodeDumper.cpp:949
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
Definition JSONNodeDumper.cpp:1568
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1725
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
Definition JSONNodeDumper.cpp:1298
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
Definition JSONNodeDumper.cpp:1362
void VisitDeclRefExpr(const DeclRefExpr *DRE)
Definition JSONNodeDumper.cpp:1348
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1722
void VisitNamespaceDecl(const NamespaceDecl *ND)
Definition JSONNodeDumper.cpp:877
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
Definition JSONNodeDumper.cpp:1338
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1877
void VisitAutoType(const AutoType *AT)
Definition JSONNodeDumper.cpp:789
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
Definition JSONNodeDumper.cpp:1107
void VisitUnavailableAttr(const UnavailableAttr *UA)
Definition JSONNodeDumper.cpp:581
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
Definition JSONNodeDumper.cpp:828
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
Definition JSONNodeDumper.cpp:1196
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
Definition JSONNodeDumper.cpp:1120
void VisitStructuralValueTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1728
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
Definition JSONNodeDumper.cpp:1850
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
Definition JSONNodeDumper.cpp:1485
void VisitPredefinedExpr(const PredefinedExpr *PE)
Definition JSONNodeDumper.cpp:1374
void VisitAliasAttr(const AliasAttr *AA)
Definition JSONNodeDumper.cpp:566
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
Definition JSONNodeDumper.cpp:1155
void VisitPackExpansionType(const PackExpansionType *PET)
Definition JSONNodeDumper.cpp:823
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
Definition JSONNodeDumper.cpp:699
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1795
void VisitSectionAttr(const SectionAttr *SA)
Definition JSONNodeDumper.cpp:586
void VisitUsingType(const UsingType *TT)
Definition JSONNodeDumper.cpp:605
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT)
Definition JSONNodeDumper.cpp:777
void VisitArrayType(const ArrayType *AT)
Definition JSONNodeDumper.cpp:675
void VisitTypeTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1715
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
Definition JSONNodeDumper.cpp:1288
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
Definition JSONNodeDumper.cpp:1127
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
Definition JSONNodeDumper.cpp:1510
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1732
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
Definition JSONNodeDumper.cpp:1602
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
Definition JSONNodeDumper.cpp:1344
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
Definition JSONNodeDumper.cpp:1649
void VisitGotoStmt(const GotoStmt *GS)
Definition JSONNodeDumper.cpp:1696
void VisitCharacterLiteral(const CharacterLiteral *CL)
Definition JSONNodeDumper.cpp:1642
void VisitInitListExpr(const InitListExpr *ILE)
Definition JSONNodeDumper.cpp:1505
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
Definition JSONNodeDumper.cpp:1161
void VisitTLSModelAttr(const TLSModelAttr *TA)
Definition JSONNodeDumper.cpp:595
void VisitCompoundStmt(const CompoundStmt *IS)
Definition JSONNodeDumper.cpp:1891
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
Definition JSONNodeDumper.cpp:1030
void VisitCXXThisExpr(const CXXThisExpr *TE)
Definition JSONNodeDumper.cpp:1439
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
Definition JSONNodeDumper.cpp:1310
void VisitConstantArrayType(const ConstantArrayType *CAT)
Definition JSONNodeDumper.cpp:692
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
Definition JSONNodeDumper.cpp:1190
void VisitCXXNewExpr(const CXXNewExpr *NE)
Definition JSONNodeDumper.cpp:1412
void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *E)
Definition JSONNodeDumper.cpp:1368
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
Definition JSONNodeDumper.cpp:1705
void VisitNullTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1712
void VisitCastExpr(const CastExpr *CE)
Definition JSONNodeDumper.cpp:1443
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
Definition JSONNodeDumper.cpp:814
void VisitIfStmt(const IfStmt *IS)
Definition JSONNodeDumper.cpp:1667
void VisitUnaryOperator(const UnaryOperator *UO)
Definition JSONNodeDumper.cpp:1378
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
Definition JSONNodeDumper.cpp:1765
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
Definition JSONNodeDumper.cpp:1463
void VisitIntegerLiteral(const IntegerLiteral *IL)
Definition JSONNodeDumper.cpp:1636
void VisitUsingEnumDecl(const UsingEnumDecl *UED)
Definition JSONNodeDumper.cpp:906
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
Definition JSONNodeDumper.cpp:1258
void VisitLambdaExpr(const LambdaExpr *LE)
Definition JSONNodeDumper.cpp:1610
void VisitFunctionType(const FunctionType *T)
Definition JSONNodeDumper.cpp:610
void VisitRecordDecl(const RecordDecl *RD)
Definition JSONNodeDumper.cpp:1000
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
Definition JSONNodeDumper.cpp:872
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
Definition JSONNodeDumper.cpp:1741
void VisitNamedDecl(const NamedDecl *ND)
Definition JSONNodeDumper.cpp:837
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
Definition JSONNodeDumper.cpp:1143
void VisitFriendDecl(const FriendDecl *FD)
Definition JSONNodeDumper.cpp:1101
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
Definition JSONNodeDumper.cpp:1431
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
Definition JSONNodeDumper.cpp:1576
LabelStmt - Represents a label, which has a substatement.
LabelDecl * getDecl() const
const char * getName() const
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
static unsigned MeasureTokenLength(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
MeasureTokenLength - Relex the token at the specified location and return its length in bytes in the ...
Represents a linkage specification.
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Base class for BreakStmt and ContinueStmt.
LabelDecl * getLabelDecl()
bool hasLabelTarget() const
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
const IdentifierInfo * getMacroIdentifier() const
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
bool isMemberDataPointer() const
Returns true if the member type (i.e.
This represents a decl that may have a name.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
Represents a C++ namespace alias.
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Represent a C++ namespace.
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.
bool isNested() const
Returns true if this is a nested namespace declaration.
Represents a C++ nested name specifier, such as "\::std::vector::".
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
const DefArgStorage & getDefaultArgStorage() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
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.
This is a basic class for representing single OpenMP clause.
Represents Objective-C's @catch statement.
const VarDecl * getCatchParamDecl() const
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
ObjCBoxedExpr - used for generalized expression boxing.
ObjCMethodDecl * getBoxingMethod() const
ObjCCategoryDecl - Represents a category declaration.
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
protocol_range protocols() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
const ObjCInterfaceDecl * getClassInterface() const
ObjCEncodeExpr, used for @encode in Objective-C.
QualType getEncodedType() const
const ObjCInterfaceDecl * getClassInterface() const
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
const ObjCInterfaceDecl * getSuperClass() const
Represents an ObjC class declaration.
protocol_range protocols() const
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
ObjCIvarDecl - Represents an ObjC instance variable.
AccessControl getAccessControl() const
bool getSynthesize() const
ObjCIvarRefExpr - A reference to an ObjC instance variable.
An expression that sends a message to the given Objective-C object or class.
QualType getCallReturnType(ASTContext &Ctx) const
Selector getSelector() const
@ SuperInstance
The receiver is the instance of the superclass object.
@ Instance
The receiver is an object instance.
@ SuperClass
The receiver is a superclass.
@ Class
The receiver is a class.
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
QualType getSuperType() const
Retrieve the type referred to by 'super'.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
ObjCMethodDecl - Represents an instance or class method declaration.
bool isInstanceMethod() const
QualType getReturnType() const
Represents one property declaration in an Objective-C interface.
ObjCMethodDecl * getGetterMethodDecl() const
ObjCMethodDecl * getSetterMethodDecl() const
ObjCPropertyAttribute::Kind getPropertyAttributes() const
PropertyControl getPropertyImplementation() const
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
ObjCIvarDecl * getPropertyIvarDecl() const
Kind getPropertyImplementation() const
ObjCPropertyDecl * getPropertyDecl() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
ObjCPropertyDecl * getExplicitProperty() const
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
ObjCMethodDecl * getImplicitPropertyGetter() const
bool isImplicitProperty() const
ObjCMethodDecl * getImplicitPropertySetter() const
bool isSuperReceiver() const
Represents an Objective-C protocol declaration.
protocol_range protocols() const
ObjCProtocolExpr used for protocol expression in Objective-C.
ObjCProtocolDecl * getProtocol() const
ObjCSelectorExpr used for @selector in Objective-C.
Selector getSelector() const
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
bool isArraySubscriptRefExpr() const
ObjCMethodDecl * getAtIndexMethodDecl() const
ObjCMethodDecl * setAtIndexMethodDecl() const
Represents the declaration of an Objective-C type parameter.
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
DeclarationName getName() const
Gets the name looked up.
[C99 6.4.2.2] - A predefined identifier such as func.
PredefinedIdentKind getIdentKind() const
static StringRef getIdentKindName(PredefinedIdentKind IK)
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.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
A (possibly-)qualified type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
SplitQualType getSplitDesugaredType() const
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Base for LValueReferenceType and RValueReferenceType.
bool isSpelledAsLValue() const
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.
TypeSourceInfo * getTypeSourceInfo()
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.
NamedDecl * getPack() const
Retrieve the parameter pack.
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Stmt - This represents one statement.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
const char * getStmtClassName() const
StringLiteral - This represents a string literal expression, e.g.
void outputString(raw_ostream &OS) const
SwitchStmt - This represents a 'switch' stmt.
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
StringRef getKindName() const
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
bool isCanonicalExpr() const
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const DefArgStorage & getDefaultArgStorage() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
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.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getIndex() const
Retrieve the index of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template parameter.
const DefArgStorage & getDefaultArgStorage() const
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Base wrapper for a particular "section" of type source info.
QualType getType() const
Get the type for which this source info wrapper provides information.
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
TypeLocClass getTypeLocClass() const
const Type * getTypePtr() const
A container of type source information.
QualType getType() const
Return the type wrapped by this type source info.
void Visit(const Type *T)
The base class of the type hierarchy.
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
const char * getTypeClassName() const
const T * getAs() const
Member-template getAs'.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
QualType getUnderlyingType() const
TypedefNameDecl * getDecl() const
bool typeMatchesDecl() const
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
QualType getArgumentType() const
bool isArgumentType() const
UnaryExprOrTypeTrait getKind() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Represents the dependent type named by a dependently-scoped typename using declaration,...
UnresolvedUsingTypenameDecl * getDecl() const
Represents a C++ using-declaration.
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Represents C++ using-directive.
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Represents a C++ using-enum-declaration.
EnumDecl * getEnumDecl() const
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
UsingShadowDecl * getDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Represents a variable declaration or definition.
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
TLSKind getTLSKind() const
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
@ ListInit
Direct list-initialization (C++11)
@ CInit
C-style initialization with assignment.
@ ParenListInit
Parenthesized list-initialization (C++20)
@ CallInit
Call-style initialization (C++98)
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
bool isInline() const
Whether this variable is (C++1z) inline.
@ TLS_Static
TLS with a known-constant initializer.
@ TLS_Dynamic
TLS with a dynamic initializer.
@ TLS_None
Not a TLS variable.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Represents a GCC generic vector type.
unsigned getNumElements() const
VectorKind getVectorKind() const
WhileStmt - This represents a 'while' stmt.
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
A static requirement that can be used in a requires-expression to check properties of types and expre...
RequirementKind getKind() const
bool containsUnexpandedParameterPack() const
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
@ kind_nullability
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
bool Ret(InterpState &S, CodePtr &PC)
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
@ GNUAutoType
__auto_type (GNU extension)
@ DecltypeAuto
decltype(auto)
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
@ RQ_None
No ref-qualifier was provided.
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
StorageClass
Storage classes.
@ SD_Thread
Thread storage duration.
@ SD_Static
Static storage duration.
@ SD_FullExpression
Full-expression storage duration (for temporaries).
@ SD_Automatic
Automatic storage duration (most local variables).
@ SD_Dynamic
Dynamic storage duration.
const FunctionProtoType * T
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X is a subtype of X when the type parameter is covariant and T i...
@ AltiVecBool
is AltiVec 'vector bool ...'
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ AltiVecVector
is AltiVec vector
@ AltiVecPixel
is AltiVec 'vector Pixel'
@ Generic
not a target-specific vector type
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
@ NeonPoly
is ARM Neon polynomial vector
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
U cast(CodeGen::Address addr)
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ None
New-expression has no initializer as written.
@ Braces
New-expression has a C++11 list-initializer.
@ 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)
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
@ NOUR_None
This is an odr-use.
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
ExceptionSpecificationType Type
The kind of exception specification this is.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Extra information about a function prototype.
ExceptionSpecInfo ExceptionSpec
RefQualifierKind RefQualifier
unsigned HasTrailingReturn