clang 19.0.0git
JSONNodeDumper.cpp
Go to the documentation of this file.
2#include "clang/AST/Type.h"
5#include "clang/Lex/Lexer.h"
6#include "llvm/ADT/StringExtras.h"
7#include <optional>
8
9using namespace clang;
10
11void JSONNodeDumper::addPreviousDeclaration(const Decl *D) {
12 switch (D->getKind()) {
13#define DECL(DERIVED, BASE) \
14 case Decl::DERIVED: \
15 return writePreviousDeclImpl(cast<DERIVED##Decl>(D));
16#define ABSTRACT_DECL(DECL)
17#include "clang/AST/DeclNodes.inc"
18#undef ABSTRACT_DECL
19#undef DECL
20 }
21 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
22}
23
25 const char *AttrName = nullptr;
26 switch (A->getKind()) {
27#define ATTR(X) \
28 case attr::X: \
29 AttrName = #X"Attr"; \
30 break;
31#include "clang/Basic/AttrList.inc"
32#undef ATTR
33 }
34 JOS.attribute("id", createPointerRepresentation(A));
35 JOS.attribute("kind", AttrName);
36 JOS.attributeObject("range", [A, this] { writeSourceRange(A->getRange()); });
37 attributeOnlyIfTrue("inherited", A->isInherited());
38 attributeOnlyIfTrue("implicit", A->isImplicit());
39
40 // FIXME: it would be useful for us to output the spelling kind as well as
41 // the actual spelling. This would allow us to distinguish between the
42 // various attribute syntaxes, but we don't currently track that information
43 // within the AST.
44 //JOS.attribute("spelling", A->getSpelling());
45
47}
48
50 if (!S)
51 return;
52
53 JOS.attribute("id", createPointerRepresentation(S));
54 JOS.attribute("kind", S->getStmtClassName());
55 JOS.attributeObject("range",
56 [S, this] { writeSourceRange(S->getSourceRange()); });
57
58 if (const auto *E = dyn_cast<Expr>(S)) {
59 JOS.attribute("type", createQualType(E->getType()));
60 const char *Category = nullptr;
61 switch (E->getValueKind()) {
62 case VK_LValue: Category = "lvalue"; break;
63 case VK_XValue: Category = "xvalue"; break;
64 case VK_PRValue:
65 Category = "prvalue";
66 break;
67 }
68 JOS.attribute("valueCategory", Category);
69 }
71}
72
74 JOS.attribute("id", createPointerRepresentation(T));
75
76 if (!T)
77 return;
78
79 JOS.attribute("kind", (llvm::Twine(T->getTypeClassName()) + "Type").str());
80 JOS.attribute("type", createQualType(QualType(T, 0), /*Desugar=*/false));
81 attributeOnlyIfTrue("containsErrors", T->containsErrors());
82 attributeOnlyIfTrue("isDependent", T->isDependentType());
83 attributeOnlyIfTrue("isInstantiationDependent",
85 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
86 attributeOnlyIfTrue("containsUnexpandedPack",
88 attributeOnlyIfTrue("isImported", T->isFromAST());
90}
91
93 JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
94 JOS.attribute("kind", "QualType");
95 JOS.attribute("type", createQualType(T));
96 JOS.attribute("qualifiers", T.split().Quals.getAsString());
97}
98
100 if (TL.isNull())
101 return;
102 JOS.attribute("kind",
103 (llvm::Twine(TL.getTypeLocClass() == TypeLoc::Qualified
104 ? "Qualified"
105 : TL.getTypePtr()->getTypeClassName()) +
106 "TypeLoc")
107 .str());
108 JOS.attribute("type",
109 createQualType(QualType(TL.getType()), /*Desugar=*/false));
110 JOS.attributeObject("range",
111 [TL, this] { writeSourceRange(TL.getSourceRange()); });
112}
113
115 JOS.attribute("id", createPointerRepresentation(D));
116
117 if (!D)
118 return;
119
120 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
121 JOS.attributeObject("loc",
122 [D, this] { writeSourceLocation(D->getLocation()); });
123 JOS.attributeObject("range",
124 [D, this] { writeSourceRange(D->getSourceRange()); });
125 attributeOnlyIfTrue("isImplicit", D->isImplicit());
126 attributeOnlyIfTrue("isInvalid", D->isInvalidDecl());
127
128 if (D->isUsed())
129 JOS.attribute("isUsed", true);
130 else if (D->isThisDeclarationReferenced())
131 JOS.attribute("isReferenced", true);
132
133 if (const auto *ND = dyn_cast<NamedDecl>(D))
134 attributeOnlyIfTrue("isHidden", !ND->isUnconditionallyVisible());
135
136 if (D->getLexicalDeclContext() != D->getDeclContext()) {
137 // Because of multiple inheritance, a DeclContext pointer does not produce
138 // the same pointer representation as a Decl pointer that references the
139 // same AST Node.
140 const auto *ParentDeclContextDecl = dyn_cast<Decl>(D->getDeclContext());
141 JOS.attribute("parentDeclContextId",
142 createPointerRepresentation(ParentDeclContextDecl));
143 }
144
145 addPreviousDeclaration(D);
147}
148
150 const comments::FullComment *FC) {
151 if (!C)
152 return;
153
154 JOS.attribute("id", createPointerRepresentation(C));
155 JOS.attribute("kind", C->getCommentKindName());
156 JOS.attributeObject("loc",
157 [C, this] { writeSourceLocation(C->getLocation()); });
158 JOS.attributeObject("range",
159 [C, this] { writeSourceRange(C->getSourceRange()); });
160
162}
163
165 const Decl *From, StringRef Label) {
166 JOS.attribute("kind", "TemplateArgument");
167 if (R.isValid())
168 JOS.attributeObject("range", [R, this] { writeSourceRange(R); });
169
170 if (From)
171 JOS.attribute(Label.empty() ? "fromDecl" : Label, createBareDeclRef(From));
172
174}
175
177 JOS.attribute("kind", "CXXCtorInitializer");
178 if (Init->isAnyMemberInitializer())
179 JOS.attribute("anyInit", createBareDeclRef(Init->getAnyMember()));
180 else if (Init->isBaseInitializer())
181 JOS.attribute("baseInit",
182 createQualType(QualType(Init->getBaseClass(), 0)));
183 else if (Init->isDelegatingInitializer())
184 JOS.attribute("delegatingInit",
185 createQualType(Init->getTypeSourceInfo()->getType()));
186 else
187 llvm_unreachable("Unknown initializer type");
188}
189
191
193
195 JOS.attribute("kind", "Capture");
196 attributeOnlyIfTrue("byref", C.isByRef());
197 attributeOnlyIfTrue("nested", C.isNested());
198 if (C.getVariable())
199 JOS.attribute("var", createBareDeclRef(C.getVariable()));
200}
201
203 JOS.attribute("associationKind", A.getTypeSourceInfo() ? "case" : "default");
204 attributeOnlyIfTrue("selected", A.isSelected());
205}
206
208 if (!R)
209 return;
210
211 switch (R->getKind()) {
213 JOS.attribute("kind", "TypeRequirement");
214 break;
216 JOS.attribute("kind", "SimpleRequirement");
217 break;
219 JOS.attribute("kind", "CompoundRequirement");
220 break;
222 JOS.attribute("kind", "NestedRequirement");
223 break;
224 }
225
226 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R))
227 attributeOnlyIfTrue("noexcept", ER->hasNoexceptRequirement());
228
229 attributeOnlyIfTrue("isDependent", R->isDependent());
230 if (!R->isDependent())
231 JOS.attribute("satisfied", R->isSatisfied());
232 attributeOnlyIfTrue("containsUnexpandedPack",
234}
235
237 std::string Str;
238 llvm::raw_string_ostream OS(Str);
239 Value.printPretty(OS, Ctx, Ty);
240 JOS.attribute("value", OS.str());
241}
242
244 JOS.attribute("kind", "ConceptReference");
245 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
246 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
247 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
248 for (const TemplateArgumentLoc &TAL : Args->arguments())
249 JOS.object(
250 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
251 });
252 }
253 JOS.attributeObject("loc",
254 [CR, this] { writeSourceLocation(CR->getLocation()); });
255 JOS.attributeObject("range",
256 [CR, this] { writeSourceRange(CR->getSourceRange()); });
257}
258
259void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
260 if (Loc.isInvalid())
261 return;
262
263 JOS.attributeBegin("includedFrom");
264 JOS.objectBegin();
265
266 if (!JustFirst) {
267 // Walk the stack recursively, then print out the presumed location.
268 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
269 }
270
271 JOS.attribute("file", Loc.getFilename());
272 JOS.objectEnd();
273 JOS.attributeEnd();
274}
275
276void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc,
277 bool IsSpelling) {
278 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
279 unsigned ActualLine = IsSpelling ? SM.getSpellingLineNumber(Loc)
280 : SM.getExpansionLineNumber(Loc);
281 StringRef ActualFile = SM.getBufferName(Loc);
282
283 if (Presumed.isValid()) {
284 JOS.attribute("offset", SM.getDecomposedLoc(Loc).second);
285 if (LastLocFilename != ActualFile) {
286 JOS.attribute("file", ActualFile);
287 JOS.attribute("line", ActualLine);
288 } else if (LastLocLine != ActualLine)
289 JOS.attribute("line", ActualLine);
290
291 StringRef PresumedFile = Presumed.getFilename();
292 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
293 JOS.attribute("presumedFile", PresumedFile);
294
295 unsigned PresumedLine = Presumed.getLine();
296 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
297 JOS.attribute("presumedLine", PresumedLine);
298
299 JOS.attribute("col", Presumed.getColumn());
300 JOS.attribute("tokLen",
301 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
302 LastLocFilename = ActualFile;
303 LastLocPresumedFilename = PresumedFile;
304 LastLocPresumedLine = PresumedLine;
305 LastLocLine = ActualLine;
306
307 // Orthogonal to the file, line, and column de-duplication is whether the
308 // given location was a result of an include. If so, print where the
309 // include location came from.
310 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
311 /*JustFirst*/ true);
312 }
313}
314
315void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
316 SourceLocation Spelling = SM.getSpellingLoc(Loc);
317 SourceLocation Expansion = SM.getExpansionLoc(Loc);
318
319 if (Expansion != Spelling) {
320 // If the expansion and the spelling are different, output subobjects
321 // describing both locations.
322 JOS.attributeObject("spellingLoc", [Spelling, this] {
323 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
324 });
325 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
326 writeBareSourceLocation(Expansion, /*IsSpelling*/ false);
327 // If there is a macro expansion, add extra information if the interesting
328 // bit is the macro arg expansion.
329 if (SM.isMacroArgExpansion(Loc))
330 JOS.attribute("isMacroArgExpansion", true);
331 });
332 } else
333 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
334}
335
336void JSONNodeDumper::writeSourceRange(SourceRange R) {
337 JOS.attributeObject("begin",
338 [R, this] { writeSourceLocation(R.getBegin()); });
339 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
340}
341
342std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
343 // Because JSON stores integer values as signed 64-bit integers, trying to
344 // represent them as such makes for very ugly pointer values in the resulting
345 // output. Instead, we convert the value to hex and treat it as a string.
346 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
347}
348
349llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
350 SplitQualType SQT = QT.split();
351 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
352 llvm::json::Object Ret{{"qualType", SQTS}};
353
354 if (Desugar && !QT.isNull()) {
356 if (DSQT != SQT) {
357 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
358 if (DSQTS != SQTS)
359 Ret["desugaredQualType"] = DSQTS;
360 }
361 if (const auto *TT = QT->getAs<TypedefType>())
362 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
363 }
364 return Ret;
365}
366
367void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
368 JOS.attribute("id", createPointerRepresentation(D));
369 if (!D)
370 return;
371
372 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
373 if (const auto *ND = dyn_cast<NamedDecl>(D))
374 JOS.attribute("name", ND->getDeclName().getAsString());
375 if (const auto *VD = dyn_cast<ValueDecl>(D))
376 JOS.attribute("type", createQualType(VD->getType()));
377}
378
379llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
380 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
381 if (!D)
382 return Ret;
383
384 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
385 if (const auto *ND = dyn_cast<NamedDecl>(D))
386 Ret["name"] = ND->getDeclName().getAsString();
387 if (const auto *VD = dyn_cast<ValueDecl>(D))
388 Ret["type"] = createQualType(VD->getType());
389 return Ret;
390}
391
392llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
393 llvm::json::Array Ret;
394 if (C->path_empty())
395 return Ret;
396
397 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
398 const CXXBaseSpecifier *Base = *I;
399 const auto *RD =
400 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
401
402 llvm::json::Object Val{{"name", RD->getName()}};
403 if (Base->isVirtual())
404 Val["isVirtual"] = true;
405 Ret.push_back(std::move(Val));
406 }
407 return Ret;
408}
409
410#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
411#define FIELD1(Flag) FIELD2(#Flag, Flag)
412
413static llvm::json::Object
415 llvm::json::Object Ret;
416
417 FIELD2("exists", hasDefaultConstructor);
418 FIELD2("trivial", hasTrivialDefaultConstructor);
419 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
420 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
421 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
422 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
423 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
424
425 return Ret;
426}
427
428static llvm::json::Object
430 llvm::json::Object Ret;
431
432 FIELD2("simple", hasSimpleCopyConstructor);
433 FIELD2("trivial", hasTrivialCopyConstructor);
434 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
435 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
436 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
437 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
438 FIELD2("needsImplicit", needsImplicitCopyConstructor);
439 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
441 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
442
443 return Ret;
444}
445
446static llvm::json::Object
448 llvm::json::Object Ret;
449
450 FIELD2("exists", hasMoveConstructor);
451 FIELD2("simple", hasSimpleMoveConstructor);
452 FIELD2("trivial", hasTrivialMoveConstructor);
453 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
454 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
455 FIELD2("needsImplicit", needsImplicitMoveConstructor);
456 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
458 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
459
460 return Ret;
461}
462
463static llvm::json::Object
465 llvm::json::Object Ret;
466
467 FIELD2("simple", hasSimpleCopyAssignment);
468 FIELD2("trivial", hasTrivialCopyAssignment);
469 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
470 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
471 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
472 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
473 FIELD2("needsImplicit", needsImplicitCopyAssignment);
474 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
475
476 return Ret;
477}
478
479static llvm::json::Object
481 llvm::json::Object Ret;
482
483 FIELD2("exists", hasMoveAssignment);
484 FIELD2("simple", hasSimpleMoveAssignment);
485 FIELD2("trivial", hasTrivialMoveAssignment);
486 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
487 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
488 FIELD2("needsImplicit", needsImplicitMoveAssignment);
489 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
490
491 return Ret;
492}
493
494static llvm::json::Object
496 llvm::json::Object Ret;
497
498 FIELD2("simple", hasSimpleDestructor);
499 FIELD2("irrelevant", hasIrrelevantDestructor);
500 FIELD2("trivial", hasTrivialDestructor);
501 FIELD2("nonTrivial", hasNonTrivialDestructor);
502 FIELD2("userDeclared", hasUserDeclaredDestructor);
503 FIELD2("needsImplicit", needsImplicitDestructor);
504 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
506 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
507
508 return Ret;
509}
510
511llvm::json::Object
512JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
513 llvm::json::Object Ret;
514
515 // This data is common to all C++ classes.
516 FIELD1(isGenericLambda);
517 FIELD1(isLambda);
518 FIELD1(isEmpty);
519 FIELD1(isAggregate);
520 FIELD1(isStandardLayout);
521 FIELD1(isTriviallyCopyable);
522 FIELD1(isPOD);
524 FIELD1(isPolymorphic);
525 FIELD1(isAbstract);
526 FIELD1(isLiteral);
528 FIELD1(hasUserDeclaredConstructor);
529 FIELD1(hasConstexprNonCopyMoveConstructor);
530 FIELD1(hasMutableFields);
531 FIELD1(hasVariantMembers);
532 FIELD2("canConstDefaultInit", allowConstDefaultInit);
533
534 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
537 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
538 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
540
541 return Ret;
542}
543
544#undef FIELD1
545#undef FIELD2
546
547std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
548 const auto AccessSpelling = getAccessSpelling(AS);
549 if (AccessSpelling.empty())
550 return "none";
551 return AccessSpelling.str();
552}
553
554llvm::json::Object
555JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
556 llvm::json::Object Ret;
557
558 Ret["type"] = createQualType(BS.getType());
559 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
560 Ret["writtenAccess"] =
561 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
562 if (BS.isVirtual())
563 Ret["isVirtual"] = true;
564 if (BS.isPackExpansion())
565 Ret["isPackExpansion"] = true;
566
567 return Ret;
568}
569
570void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
571 JOS.attribute("aliasee", AA->getAliasee());
572}
573
574void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
575 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
576}
577
578void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
579 if (!DA->getMessage().empty())
580 JOS.attribute("message", DA->getMessage());
581 if (!DA->getReplacement().empty())
582 JOS.attribute("replacement", DA->getReplacement());
583}
584
585void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
586 if (!UA->getMessage().empty())
587 JOS.attribute("message", UA->getMessage());
588}
589
590void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
591 JOS.attribute("section_name", SA->getName());
592}
593
594void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
595 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
596 VA->getVisibility()));
597}
598
599void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
600 JOS.attribute("tls_model", TA->getModel());
601}
602
604 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
605 if (!TT->typeMatchesDecl())
606 JOS.attribute("type", createQualType(TT->desugar()));
607}
608
610 JOS.attribute("decl", createBareDeclRef(TT->getFoundDecl()));
611 if (!TT->typeMatchesDecl())
612 JOS.attribute("type", createQualType(TT->desugar()));
613}
614
617 attributeOnlyIfTrue("noreturn", E.getNoReturn());
618 attributeOnlyIfTrue("producesResult", E.getProducesResult());
619 if (E.getHasRegParm())
620 JOS.attribute("regParm", E.getRegParm());
621 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
622}
623
626 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
627 attributeOnlyIfTrue("const", T->isConst());
628 attributeOnlyIfTrue("volatile", T->isVolatile());
629 attributeOnlyIfTrue("restrict", T->isRestrict());
630 attributeOnlyIfTrue("variadic", E.Variadic);
631 switch (E.RefQualifier) {
632 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
633 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
634 case RQ_None: break;
635 }
636 switch (E.ExceptionSpec.Type) {
637 case EST_DynamicNone:
638 case EST_Dynamic: {
639 JOS.attribute("exceptionSpec", "throw");
640 llvm::json::Array Types;
642 Types.push_back(createQualType(QT));
643 JOS.attribute("exceptionTypes", std::move(Types));
644 } break;
645 case EST_MSAny:
646 JOS.attribute("exceptionSpec", "throw");
647 JOS.attribute("throwsAny", true);
648 break;
650 JOS.attribute("exceptionSpec", "noexcept");
651 break;
652 case EST_NoexceptTrue:
654 JOS.attribute("exceptionSpec", "noexcept");
655 JOS.attribute("conditionEvaluatesTo",
657 //JOS.attributeWithCall("exceptionSpecExpr",
658 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
659 break;
660 case EST_NoThrow:
661 JOS.attribute("exceptionSpec", "nothrow");
662 break;
663 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
664 // suspect you can only run into them when executing an AST dump from within
665 // the debugger, which is not a use case we worry about for the JSON dumping
666 // feature.
668 case EST_Unevaluated:
670 case EST_Unparsed:
671 case EST_None: break;
672 }
674}
675
677 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
678}
679
681 switch (AT->getSizeModifier()) {
683 JOS.attribute("sizeModifier", "*");
684 break;
686 JOS.attribute("sizeModifier", "static");
687 break;
689 break;
690 }
691
692 std::string Str = AT->getIndexTypeQualifiers().getAsString();
693 if (!Str.empty())
694 JOS.attribute("indexTypeQualifiers", Str);
695}
696
698 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
699 // narrowing conversion to int64_t so it cannot be expressed.
700 JOS.attribute("size", CAT->getSExtSize());
701 VisitArrayType(CAT);
702}
703
705 const DependentSizedExtVectorType *VT) {
706 JOS.attributeObject(
707 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
708}
709
711 JOS.attribute("numElements", VT->getNumElements());
712 switch (VT->getVectorKind()) {
714 break;
716 JOS.attribute("vectorKind", "altivec");
717 break;
719 JOS.attribute("vectorKind", "altivec pixel");
720 break;
722 JOS.attribute("vectorKind", "altivec bool");
723 break;
724 case VectorKind::Neon:
725 JOS.attribute("vectorKind", "neon");
726 break;
728 JOS.attribute("vectorKind", "neon poly");
729 break;
731 JOS.attribute("vectorKind", "fixed-length sve data vector");
732 break;
734 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
735 break;
737 JOS.attribute("vectorKind", "fixed-length rvv data vector");
738 break;
740 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
741 break;
742 }
743}
744
746 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
747}
748
750 switch (UTT->getUTTKind()) {
751#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
752 case UnaryTransformType::Enum: \
753 JOS.attribute("transformKind", #Trait); \
754 break;
755#include "clang/Basic/TransformTypeTraits.def"
756 }
757}
758
760 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
761}
762
764 const TemplateTypeParmType *TTPT) {
765 JOS.attribute("depth", TTPT->getDepth());
766 JOS.attribute("index", TTPT->getIndex());
767 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
768 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
769}
770
772 const SubstTemplateTypeParmType *STTPT) {
773 JOS.attribute("index", STTPT->getIndex());
774 if (auto PackIndex = STTPT->getPackIndex())
775 JOS.attribute("pack_index", *PackIndex);
776}
777
780 JOS.attribute("index", T->getIndex());
781}
782
784 JOS.attribute("undeduced", !AT->isDeduced());
785 switch (AT->getKeyword()) {
787 JOS.attribute("typeKeyword", "auto");
788 break;
790 JOS.attribute("typeKeyword", "decltype(auto)");
791 break;
793 JOS.attribute("typeKeyword", "__auto_type");
794 break;
795 }
796}
797
799 const TemplateSpecializationType *TST) {
800 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
801
802 std::string Str;
803 llvm::raw_string_ostream OS(Str);
804 TST->getTemplateName().print(OS, PrintPolicy);
805 JOS.attribute("templateName", OS.str());
806}
807
809 const InjectedClassNameType *ICNT) {
810 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
811}
812
814 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
815}
816
818 if (std::optional<unsigned> N = PET->getNumExpansions())
819 JOS.attribute("numExpansions", *N);
820}
821
823 if (const NestedNameSpecifier *NNS = ET->getQualifier()) {
824 std::string Str;
825 llvm::raw_string_ostream OS(Str);
826 NNS->print(OS, PrintPolicy, /*ResolveTemplateArgs*/ true);
827 JOS.attribute("qualifier", OS.str());
828 }
829 if (const TagDecl *TD = ET->getOwnedTagDecl())
830 JOS.attribute("ownedTagDecl", createBareDeclRef(TD));
831}
832
834 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
835}
836
838 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
839 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
840}
841
843 if (ND && ND->getDeclName()) {
844 JOS.attribute("name", ND->getNameAsString());
845 // FIXME: There are likely other contexts in which it makes no sense to ask
846 // for a mangled name.
847 if (isa<RequiresExprBodyDecl>(ND->getDeclContext()))
848 return;
849
850 // If the declaration is dependent or is in a dependent context, then the
851 // mangling is unlikely to be meaningful (and in some cases may cause
852 // "don't know how to mangle this" assertion failures.
853 if (ND->isTemplated())
854 return;
855
856 // Mangled names are not meaningful for locals, and may not be well-defined
857 // in the case of VLAs.
858 auto *VD = dyn_cast<VarDecl>(ND);
859 if (VD && VD->hasLocalStorage())
860 return;
861
862 // Do not mangle template deduction guides.
863 if (isa<CXXDeductionGuideDecl>(ND))
864 return;
865
866 std::string MangledName = ASTNameGen.getName(ND);
867 if (!MangledName.empty())
868 JOS.attribute("mangledName", MangledName);
869 }
870}
871
873 VisitNamedDecl(TD);
874 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
875}
876
878 VisitNamedDecl(TAD);
879 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
880}
881
883 VisitNamedDecl(ND);
884 attributeOnlyIfTrue("isInline", ND->isInline());
885 attributeOnlyIfTrue("isNested", ND->isNested());
886 if (!ND->isOriginalNamespace())
887 JOS.attribute("originalNamespace",
888 createBareDeclRef(ND->getOriginalNamespace()));
889}
890
892 JOS.attribute("nominatedNamespace",
893 createBareDeclRef(UDD->getNominatedNamespace()));
894}
895
897 VisitNamedDecl(NAD);
898 JOS.attribute("aliasedNamespace",
899 createBareDeclRef(NAD->getAliasedNamespace()));
900}
901
903 std::string Name;
904 if (const NestedNameSpecifier *NNS = UD->getQualifier()) {
905 llvm::raw_string_ostream SOS(Name);
906 NNS->print(SOS, UD->getASTContext().getPrintingPolicy());
907 }
908 Name += UD->getNameAsString();
909 JOS.attribute("name", Name);
910}
911
913 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
914}
915
917 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
918}
919
921 VisitNamedDecl(VD);
922 JOS.attribute("type", createQualType(VD->getType()));
923 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
924 attributeOnlyIfTrue("explicitObjectParameter",
925 P->isExplicitObjectParameter());
926
927 StorageClass SC = VD->getStorageClass();
928 if (SC != SC_None)
929 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
930 switch (VD->getTLSKind()) {
931 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
932 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
933 case VarDecl::TLS_None: break;
934 }
935 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
936 attributeOnlyIfTrue("inline", VD->isInline());
937 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
938 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
939 if (VD->hasInit()) {
940 switch (VD->getInitStyle()) {
941 case VarDecl::CInit: JOS.attribute("init", "c"); break;
942 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
943 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
945 JOS.attribute("init", "paren-list");
946 break;
947 }
948 }
949 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
950}
951
953 VisitNamedDecl(FD);
954 JOS.attribute("type", createQualType(FD->getType()));
955 attributeOnlyIfTrue("mutable", FD->isMutable());
956 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
957 attributeOnlyIfTrue("isBitfield", FD->isBitField());
958 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
959}
960
962 VisitNamedDecl(FD);
963 JOS.attribute("type", createQualType(FD->getType()));
964 StorageClass SC = FD->getStorageClass();
965 if (SC != SC_None)
966 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
967 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
968 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
969 attributeOnlyIfTrue("pure", FD->isPureVirtual());
970 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
971 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
972 attributeOnlyIfTrue("variadic", FD->isVariadic());
973 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
974
975 if (FD->isDefaulted())
976 JOS.attribute("explicitlyDefaulted",
977 FD->isDeleted() ? "deleted" : "default");
978
979 if (StringLiteral *Msg = FD->getDeletedMessage())
980 JOS.attribute("deletedMessage", Msg->getString());
981}
982
984 VisitNamedDecl(ED);
985 if (ED->isFixed())
986 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
987 if (ED->isScoped())
988 JOS.attribute("scopedEnumTag",
989 ED->isScopedUsingClassTag() ? "class" : "struct");
990}
992 VisitNamedDecl(ECD);
993 JOS.attribute("type", createQualType(ECD->getType()));
994}
995
997 VisitNamedDecl(RD);
998 JOS.attribute("tagUsed", RD->getKindName());
999 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1000}
1002 VisitRecordDecl(RD);
1003
1004 // All other information requires a complete definition.
1005 if (!RD->isCompleteDefinition())
1006 return;
1007
1008 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1009 if (RD->getNumBases()) {
1010 JOS.attributeArray("bases", [this, RD] {
1011 for (const auto &Spec : RD->bases())
1012 JOS.value(createCXXBaseSpecifier(Spec));
1013 });
1014 }
1015}
1016
1018 VisitNamedDecl(D);
1019 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1020}
1021
1023 VisitNamedDecl(D);
1024 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1025 JOS.attribute("depth", D->getDepth());
1026 JOS.attribute("index", D->getIndex());
1027 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1028
1029 if (D->hasDefaultArgument())
1030 JOS.attributeObject("defaultArg", [=] {
1033 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1034 });
1035}
1036
1038 const NonTypeTemplateParmDecl *D) {
1039 VisitNamedDecl(D);
1040 JOS.attribute("type", createQualType(D->getType()));
1041 JOS.attribute("depth", D->getDepth());
1042 JOS.attribute("index", D->getIndex());
1043 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1044
1045 if (D->hasDefaultArgument())
1046 JOS.attributeObject("defaultArg", [=] {
1049 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1050 });
1051}
1052
1054 const TemplateTemplateParmDecl *D) {
1055 VisitNamedDecl(D);
1056 JOS.attribute("depth", D->getDepth());
1057 JOS.attribute("index", D->getIndex());
1058 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1059
1060 if (D->hasDefaultArgument())
1061 JOS.attributeObject("defaultArg", [=] {
1062 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1064 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1065 InheritedFrom,
1066 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1067 });
1068}
1069
1071 StringRef Lang;
1072 switch (LSD->getLanguage()) {
1074 Lang = "C";
1075 break;
1077 Lang = "C++";
1078 break;
1079 }
1080 JOS.attribute("language", Lang);
1081 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1082}
1083
1085 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1086}
1087
1089 if (const TypeSourceInfo *T = FD->getFriendType())
1090 JOS.attribute("type", createQualType(T->getType()));
1091}
1092
1094 VisitNamedDecl(D);
1095 JOS.attribute("type", createQualType(D->getType()));
1096 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1097 switch (D->getAccessControl()) {
1098 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1099 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1100 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1101 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1102 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1103 }
1104}
1105
1107 VisitNamedDecl(D);
1108 JOS.attribute("returnType", createQualType(D->getReturnType()));
1109 JOS.attribute("instance", D->isInstanceMethod());
1110 attributeOnlyIfTrue("variadic", D->isVariadic());
1111}
1112
1114 VisitNamedDecl(D);
1115 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1116 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1117 switch (D->getVariance()) {
1119 break;
1121 JOS.attribute("variance", "covariant");
1122 break;
1124 JOS.attribute("variance", "contravariant");
1125 break;
1126 }
1127}
1128
1130 VisitNamedDecl(D);
1131 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1132 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1133
1134 llvm::json::Array Protocols;
1135 for (const auto* P : D->protocols())
1136 Protocols.push_back(createBareDeclRef(P));
1137 if (!Protocols.empty())
1138 JOS.attribute("protocols", std::move(Protocols));
1139}
1140
1142 VisitNamedDecl(D);
1143 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1144 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1145}
1146
1148 VisitNamedDecl(D);
1149
1150 llvm::json::Array Protocols;
1151 for (const auto *P : D->protocols())
1152 Protocols.push_back(createBareDeclRef(P));
1153 if (!Protocols.empty())
1154 JOS.attribute("protocols", std::move(Protocols));
1155}
1156
1158 VisitNamedDecl(D);
1159 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1160 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1161
1162 llvm::json::Array Protocols;
1163 for (const auto* P : D->protocols())
1164 Protocols.push_back(createBareDeclRef(P));
1165 if (!Protocols.empty())
1166 JOS.attribute("protocols", std::move(Protocols));
1167}
1168
1170 const ObjCImplementationDecl *D) {
1171 VisitNamedDecl(D);
1172 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1173 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1174}
1175
1177 const ObjCCompatibleAliasDecl *D) {
1178 VisitNamedDecl(D);
1179 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1180}
1181
1183 VisitNamedDecl(D);
1184 JOS.attribute("type", createQualType(D->getType()));
1185
1186 switch (D->getPropertyImplementation()) {
1187 case ObjCPropertyDecl::None: break;
1188 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1189 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1190 }
1191
1195 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1197 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1198 attributeOnlyIfTrue("readonly",
1200 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1201 attributeOnlyIfTrue("readwrite",
1203 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1204 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1205 attributeOnlyIfTrue("nonatomic",
1207 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1208 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1209 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1210 attributeOnlyIfTrue("unsafe_unretained",
1212 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1213 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1214 attributeOnlyIfTrue("nullability",
1216 attributeOnlyIfTrue("null_resettable",
1218 }
1219}
1220
1223 JOS.attribute("implKind", D->getPropertyImplementation() ==
1225 ? "synthesize"
1226 : "dynamic");
1227 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1228 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1229}
1230
1232 attributeOnlyIfTrue("variadic", D->isVariadic());
1233 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1234}
1235
1237 JOS.attribute("name", AE->getOpAsString());
1238}
1239
1241 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1242}
1243
1245 std::string Str;
1246 llvm::raw_string_ostream OS(Str);
1247
1248 OME->getSelector().print(OS);
1249 JOS.attribute("selector", OS.str());
1250
1251 switch (OME->getReceiverKind()) {
1253 JOS.attribute("receiverKind", "instance");
1254 break;
1256 JOS.attribute("receiverKind", "class");
1257 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1258 break;
1260 JOS.attribute("receiverKind", "super (instance)");
1261 JOS.attribute("superType", createQualType(OME->getSuperType()));
1262 break;
1264 JOS.attribute("receiverKind", "super (class)");
1265 JOS.attribute("superType", createQualType(OME->getSuperType()));
1266 break;
1267 }
1268
1269 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1270 if (OME->getType() != CallReturnTy)
1271 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1272}
1273
1275 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1276 std::string Str;
1277 llvm::raw_string_ostream OS(Str);
1278
1279 MD->getSelector().print(OS);
1280 JOS.attribute("selector", OS.str());
1281 }
1282}
1283
1285 std::string Str;
1286 llvm::raw_string_ostream OS(Str);
1287
1288 OSE->getSelector().print(OS);
1289 JOS.attribute("selector", OS.str());
1290}
1291
1293 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1294}
1295
1297 if (OPRE->isImplicitProperty()) {
1298 JOS.attribute("propertyKind", "implicit");
1299 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1300 JOS.attribute("getter", createBareDeclRef(MD));
1301 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1302 JOS.attribute("setter", createBareDeclRef(MD));
1303 } else {
1304 JOS.attribute("propertyKind", "explicit");
1305 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1306 }
1307
1308 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1309 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1310 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1311}
1312
1314 const ObjCSubscriptRefExpr *OSRE) {
1315 JOS.attribute("subscriptKind",
1316 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1317
1318 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1319 JOS.attribute("getter", createBareDeclRef(MD));
1320 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1321 JOS.attribute("setter", createBareDeclRef(MD));
1322}
1323
1325 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1326 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1327 JOS.attribute("isArrow", OIRE->isArrow());
1328}
1329
1331 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1332}
1333
1335 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1336 if (DRE->getDecl() != DRE->getFoundDecl())
1337 JOS.attribute("foundReferencedDecl",
1338 createBareDeclRef(DRE->getFoundDecl()));
1339 switch (DRE->isNonOdrUse()) {
1340 case NOUR_None: break;
1341 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1342 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1343 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1344 }
1345 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1346}
1347
1349 const SYCLUniqueStableNameExpr *E) {
1350 JOS.attribute("typeSourceInfo",
1351 createQualType(E->getTypeSourceInfo()->getType()));
1352}
1353
1355 JOS.attribute("name", PredefinedExpr::getIdentKindName(PE->getIdentKind()));
1356}
1357
1359 JOS.attribute("isPostfix", UO->isPostfix());
1360 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1361 if (!UO->canOverflow())
1362 JOS.attribute("canOverflow", false);
1363}
1364
1366 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1367}
1368
1370 const CompoundAssignOperator *CAO) {
1372 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1373 JOS.attribute("computeResultType",
1374 createQualType(CAO->getComputationResultType()));
1375}
1376
1378 // Note, we always write this Boolean field because the information it conveys
1379 // is critical to understanding the AST node.
1380 ValueDecl *VD = ME->getMemberDecl();
1381 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1382 JOS.attribute("isArrow", ME->isArrow());
1383 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1384 switch (ME->isNonOdrUse()) {
1385 case NOUR_None: break;
1386 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1387 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1388 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1389 }
1390}
1391
1393 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1394 attributeOnlyIfTrue("isArray", NE->isArray());
1395 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1396 switch (NE->getInitializationStyle()) {
1398 break;
1400 JOS.attribute("initStyle", "call");
1401 break;
1403 JOS.attribute("initStyle", "list");
1404 break;
1405 }
1406 if (const FunctionDecl *FD = NE->getOperatorNew())
1407 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1408 if (const FunctionDecl *FD = NE->getOperatorDelete())
1409 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1410}
1412 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1413 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1414 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1415 if (const FunctionDecl *FD = DE->getOperatorDelete())
1416 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1417}
1418
1420 attributeOnlyIfTrue("implicit", TE->isImplicit());
1421}
1422
1424 JOS.attribute("castKind", CE->getCastKindName());
1425 llvm::json::Array Path = createCastPath(CE);
1426 if (!Path.empty())
1427 JOS.attribute("path", std::move(Path));
1428 // FIXME: This may not be useful information as it can be obtusely gleaned
1429 // from the inner[] array.
1430 if (const NamedDecl *ND = CE->getConversionFunction())
1431 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1432}
1433
1435 VisitCastExpr(ICE);
1436 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1437}
1438
1440 attributeOnlyIfTrue("adl", CE->usesADL());
1441}
1442
1444 const UnaryExprOrTypeTraitExpr *TTE) {
1445 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1446 if (TTE->isArgumentType())
1447 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1448}
1449
1451 VisitNamedDecl(SOPE->getPack());
1452}
1453
1455 const UnresolvedLookupExpr *ULE) {
1456 JOS.attribute("usesADL", ULE->requiresADL());
1457 JOS.attribute("name", ULE->getName().getAsString());
1458
1459 JOS.attributeArray("lookups", [this, ULE] {
1460 for (const NamedDecl *D : ULE->decls())
1461 JOS.value(createBareDeclRef(D));
1462 });
1463}
1464
1466 JOS.attribute("name", ALE->getLabel()->getName());
1467 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1468}
1469
1471 if (CTE->isTypeOperand()) {
1472 QualType Adjusted = CTE->getTypeOperand(Ctx);
1473 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1474 JOS.attribute("typeArg", createQualType(Unadjusted));
1475 if (Adjusted != Unadjusted)
1476 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1477 }
1478}
1479
1482 Visit(CE->getAPValueResult(), CE->getType());
1483}
1484
1486 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1487 JOS.attribute("field", createBareDeclRef(FD));
1488}
1489
1491 const GenericSelectionExpr *GSE) {
1492 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1493}
1494
1496 const CXXUnresolvedConstructExpr *UCE) {
1497 if (UCE->getType() != UCE->getTypeAsWritten())
1498 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1499 attributeOnlyIfTrue("list", UCE->isListInitialization());
1500}
1501
1503 CXXConstructorDecl *Ctor = CE->getConstructor();
1504 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1505 attributeOnlyIfTrue("elidable", CE->isElidable());
1506 attributeOnlyIfTrue("list", CE->isListInitialization());
1507 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1508 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1509 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1510 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1511
1512 switch (CE->getConstructionKind()) {
1514 JOS.attribute("constructionKind", "complete");
1515 break;
1517 JOS.attribute("constructionKind", "delegating");
1518 break;
1520 JOS.attribute("constructionKind", "non-virtual base");
1521 break;
1523 JOS.attribute("constructionKind", "virtual base");
1524 break;
1525 }
1526}
1527
1529 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1531 if (EWC->getNumObjects()) {
1532 JOS.attributeArray("cleanups", [this, EWC] {
1533 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1534 if (auto *BD = CO.dyn_cast<BlockDecl *>()) {
1535 JOS.value(createBareDeclRef(BD));
1536 } else if (auto *CLE = CO.dyn_cast<CompoundLiteralExpr *>()) {
1537 llvm::json::Object Obj;
1538 Obj["id"] = createPointerRepresentation(CLE);
1539 Obj["kind"] = CLE->getStmtClassName();
1540 JOS.value(std::move(Obj));
1541 } else {
1542 llvm_unreachable("unexpected cleanup object type");
1543 }
1544 });
1545 }
1546}
1547
1549 const CXXBindTemporaryExpr *BTE) {
1550 const CXXTemporary *Temp = BTE->getTemporary();
1551 JOS.attribute("temp", createPointerRepresentation(Temp));
1552 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1553 JOS.attribute("dtor", createBareDeclRef(Dtor));
1554}
1555
1557 const MaterializeTemporaryExpr *MTE) {
1558 if (const ValueDecl *VD = MTE->getExtendingDecl())
1559 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1560
1561 switch (MTE->getStorageDuration()) {
1562 case SD_Automatic:
1563 JOS.attribute("storageDuration", "automatic");
1564 break;
1565 case SD_Dynamic:
1566 JOS.attribute("storageDuration", "dynamic");
1567 break;
1568 case SD_FullExpression:
1569 JOS.attribute("storageDuration", "full expression");
1570 break;
1571 case SD_Static:
1572 JOS.attribute("storageDuration", "static");
1573 break;
1574 case SD_Thread:
1575 JOS.attribute("storageDuration", "thread");
1576 break;
1577 }
1578
1579 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1580}
1581
1583 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1584}
1585
1587 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1588}
1589
1591 const CXXDependentScopeMemberExpr *DSME) {
1592 JOS.attribute("isArrow", DSME->isArrow());
1593 JOS.attribute("member", DSME->getMember().getAsString());
1594 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1595 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1596 DSME->hasExplicitTemplateArgs());
1597
1598 if (DSME->getNumTemplateArgs()) {
1599 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1600 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1601 JOS.object(
1602 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1603 });
1604 }
1605}
1606
1608 if (!RE->isValueDependent())
1609 JOS.attribute("satisfied", RE->isSatisfied());
1610}
1611
1613 llvm::SmallString<16> Buffer;
1614 IL->getValue().toString(Buffer,
1615 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1616 JOS.attribute("value", Buffer);
1617}
1619 // FIXME: This should probably print the character literal as a string,
1620 // rather than as a numerical value. It would be nice if the behavior matched
1621 // what we do to print a string literal; right now, it is impossible to tell
1622 // the difference between 'a' and L'a' in C from the JSON output.
1623 JOS.attribute("value", CL->getValue());
1624}
1626 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1627}
1629 llvm::SmallString<16> Buffer;
1630 FL->getValue().toString(Buffer);
1631 JOS.attribute("value", Buffer);
1632}
1634 std::string Buffer;
1635 llvm::raw_string_ostream SS(Buffer);
1636 SL->outputString(SS);
1637 JOS.attribute("value", SS.str());
1638}
1640 JOS.attribute("value", BLE->getValue());
1641}
1642
1644 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1645 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1646 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1647 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1648 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1649 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1650}
1651
1653 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1654 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1655}
1657 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1658}
1659
1661 JOS.attribute("name", LS->getName());
1662 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1663 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1664}
1666 JOS.attribute("targetLabelDeclId",
1667 createPointerRepresentation(GS->getLabel()));
1668}
1669
1671 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1672}
1673
1675 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1676 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1677 // null child node and ObjC gets no child node.
1678 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1679}
1680
1682 JOS.attribute("isNull", true);
1683}
1685 JOS.attribute("type", createQualType(TA.getAsType()));
1686}
1688 const TemplateArgument &TA) {
1689 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1690}
1692 JOS.attribute("isNullptr", true);
1693}
1695 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1696}
1698 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1699 // the output format.
1700}
1702 const TemplateArgument &TA) {
1703 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1704 // the output format.
1705}
1707 const TemplateArgument &TA) {
1708 JOS.attribute("isExpr", true);
1709}
1711 JOS.attribute("isPack", true);
1712}
1713
1714StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1715 if (Traits)
1716 return Traits->getCommandInfo(CommandID)->Name;
1717 if (const comments::CommandInfo *Info =
1719 return Info->Name;
1720 return "<invalid>";
1721}
1722
1724 const comments::FullComment *) {
1725 JOS.attribute("text", C->getText());
1726}
1727
1730 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1731
1732 switch (C->getRenderKind()) {
1734 JOS.attribute("renderKind", "normal");
1735 break;
1737 JOS.attribute("renderKind", "bold");
1738 break;
1740 JOS.attribute("renderKind", "emphasized");
1741 break;
1743 JOS.attribute("renderKind", "monospaced");
1744 break;
1746 JOS.attribute("renderKind", "anchor");
1747 break;
1748 }
1749
1750 llvm::json::Array Args;
1751 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1752 Args.push_back(C->getArgText(I));
1753
1754 if (!Args.empty())
1755 JOS.attribute("args", std::move(Args));
1756}
1757
1760 JOS.attribute("name", C->getTagName());
1761 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1762 attributeOnlyIfTrue("malformed", C->isMalformed());
1763
1764 llvm::json::Array Attrs;
1765 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1766 Attrs.push_back(
1767 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1768
1769 if (!Attrs.empty())
1770 JOS.attribute("attrs", std::move(Attrs));
1771}
1772
1775 JOS.attribute("name", C->getTagName());
1776}
1777
1780 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1781
1782 llvm::json::Array Args;
1783 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1784 Args.push_back(C->getArgText(I));
1785
1786 if (!Args.empty())
1787 JOS.attribute("args", std::move(Args));
1788}
1789
1792 switch (C->getDirection()) {
1794 JOS.attribute("direction", "in");
1795 break;
1797 JOS.attribute("direction", "out");
1798 break;
1800 JOS.attribute("direction", "in,out");
1801 break;
1802 }
1803 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1804
1805 if (C->hasParamName())
1806 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1807 : C->getParamNameAsWritten());
1808
1809 if (C->isParamIndexValid() && !C->isVarArgParam())
1810 JOS.attribute("paramIdx", C->getParamIndex());
1811}
1812
1815 if (C->hasParamName())
1816 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1817 : C->getParamNameAsWritten());
1818 if (C->isPositionValid()) {
1819 llvm::json::Array Positions;
1820 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1821 Positions.push_back(C->getIndex(I));
1822
1823 if (!Positions.empty())
1824 JOS.attribute("positions", std::move(Positions));
1825 }
1826}
1827
1830 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1831 JOS.attribute("closeName", C->getCloseName());
1832}
1833
1836 const comments::FullComment *) {
1837 JOS.attribute("text", C->getText());
1838}
1839
1842 JOS.attribute("text", C->getText());
1843}
1844
1845llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1846 llvm::json::Object Ret;
1847#define OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1848 if (FPO.has##NAME##Override()) \
1849 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1850#include "clang/Basic/FPOptions.def"
1851 return Ret;
1852}
1853
1855 VisitStmt(S);
1856 if (S->hasStoredFPFeatures())
1857 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1858}
DynTypedNode Node
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
int Category
Definition: Format.cpp:2975
#define FIELD1(Flag)
static llvm::json::Object createMoveAssignmentDefinitionData(const CXXRecordDecl *RD)
#define FIELD2(Name, Flag)
static llvm::json::Object createCopyAssignmentDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createCopyConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDestructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDefaultConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createMoveConstructorDefinitionData(const CXXRecordDecl *RD)
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.
std::string Label
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
@ None
There is no such object (it's outside its lifetime).
Definition: APValue.h:129
const LangOptions & getLangOpts() const
Definition: ASTContext.h:775
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:697
std::string getName(const Decl *D)
Definition: Mangle.cpp:597
Represents an access specifier followed by colon ':'.
Definition: DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4338
LabelDecl * getLabel() const
Definition: Expr.h:4361
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: Type.h:3308
ArraySizeModifier getSizeModifier() const
Definition: Type.h:3322
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:3326
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6437
StringRef getOpAsString() const
Definition: Expr.h:6502
Attr - This represents one attribute.
Definition: Attr.h:42
attr::Kind getKind() const
Definition: Attr.h:88
bool isInherited() const
Definition: Attr.h:97
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:101
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5771
AutoTypeKeyword getKeyword() const
Definition: Type.h:5802
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3840
StringRef getOpcodeStr() const
Definition: Expr.h:3905
Opcode getOpcode() const
Definition: Expr.h:3884
A class which contains all the information about a particular captured value.
Definition: Decl.h:4501
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4495
bool capturesCXXThis() const
Definition: Decl.h:4627
bool isVariadic() const
Definition: Decl.h:4570
Represents a base class of a C++ class.
Definition: DeclCXX.h:146
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
Definition: DeclCXX.h:242
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition: DeclCXX.h:203
QualType getType() const
Retrieves the type of the base class.
Definition: DeclCXX.h:249
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
Definition: DeclCXX.h:210
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
Definition: DeclCXX.h:230
Represents binding an expression to a temporary.
Definition: ExprCXX.h:1485
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1503
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
bool getValue() const
Definition: ExprCXX.h:737
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1540
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1609
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition: ExprCXX.h:1614
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1633
bool isImmediateEscalating() const
Definition: ExprCXX.h:1698
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition: ExprCXX.h:1642
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1603
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1622
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1651
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2532
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2297
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1264
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1371
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2491
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2530
bool isArrayForm() const
Definition: ExprCXX.h:2517
bool isGlobalDelete() const
Definition: ExprCXX.h:2516
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2518
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3655
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition: ExprCXX.h:3758
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3853
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition: ExprCXX.h:3832
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3797
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition: ExprCXX.h:3828
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3860
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2796
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2234
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
base_class_range bases()
Definition: DeclCXX.h:618
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition: DeclCXX.h:612
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:905
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1016
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:815
Represents a C++ temporary.
Definition: ExprCXX.h:1453
const CXXDestructorDecl * getDestructor() const
Definition: ExprCXX.h:1464
Represents the this expression in C++.
Definition: ExprCXX.h:1148
bool isImplicit() const
Definition: ExprCXX.h:1171
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:845
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition: ExprCXX.cpp:162
bool isTypeOperand() const
Definition: ExprCXX.h:881
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:888
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3529
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3584
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3563
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2820
bool usesADL() const
Definition: Expr.h:2980
CaseStmt - Represent a case statement.
Definition: Stmt.h:1806
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition: Stmt.h:1873
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3483
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition: Expr.cpp:2003
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1952
unsigned getValue() const
Definition: Expr.h:1610
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4088
QualType getComputationLHSType() const
Definition: Expr.h:4122
QualType getComputationResultType() const
Definition: Expr.h:4125
CompoundLiteralExpr - [C99 6.5.2.5].
Definition: Expr.h:3413
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1611
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:128
SourceRange getSourceRange() const LLVM_READONLY
Definition: ASTConcept.h:195
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:203
SourceLocation getLocation() const
Definition: ASTConcept.h:179
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:207
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:3346
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition: Type.h:3428
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1072
APValue getAPValueResult() const
Definition: Expr.cpp:413
APValue::ValueKind getResultAPValueKind() const
Definition: Expr.h:1138
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1260
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1365
ValueDecl * getDecl()
Definition: Expr.h:1328
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1452
bool isImmediateEscalating() const
Definition: Expr.h:1462
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:598
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
Definition: DeclBase.cpp:262
bool isInvalidDecl() const
Definition: DeclBase.h:593
SourceLocation getLocation() const
Definition: DeclBase.h:444
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:626
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:530
DeclContext * getDeclContext()
Definition: DeclBase.h:453
AccessSpecifier getAccess() const
Definition: DeclBase.h:512
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:907
Kind getKind() const
Definition: DeclBase.h:447
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:432
std::string getAsString() const
Retrieve the human-readable string for this name.
bool isDeduced() const
Definition: Type.h:5759
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Definition: DeclTemplate.h:345
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3689
SourceLocation getAttributeLoc() const
Definition: Type.h:3705
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
Definition: Type.h:6161
TagDecl * getOwnedTagDecl() const
Return the (re)declaration of this type owned by this occurrence of this type, or nullptr if there is...
Definition: Type.h:6209
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:6196
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3298
Represents an enum.
Definition: Decl.h:3868
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4073
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4076
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4082
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:4028
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3446
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3481
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3470
unsigned getNumObjects() const
Definition: ExprCXX.h:3474
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3452
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:175
QualType getType() const
Definition: Expr.h:142
Represents difference between two FPOptions values.
Definition: LangOptions.h:901
Represents a member of a struct/union/class.
Definition: Decl.h:3058
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3146
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3149
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition: Decl.h:3219
std::string getValueAsString(unsigned Radix) const
Definition: Expr.cpp:1012
llvm::APFloat getValue() const
Definition: Expr.h:1647
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:122
Represents a function declaration or definition.
Definition: Decl.h:1971
bool isImmediateFunction() const
Definition: Decl.cpp:3288
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition: Decl.h:2668
bool isVariadic() const
Whether this function is variadic.
Definition: Decl.cpp:3089
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2503
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2798
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition: Decl.h:2433
bool isDeletedAsWritten() const
Definition: Decl.h:2507
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2323
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2348
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2314
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2809
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4446
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4690
A class which abstracts out some details necessary for making a call.
Definition: Type.h:4157
CallingConv getCC() const
Definition: Type.h:4219
unsigned getRegParm() const
Definition: Type.h:4212
bool getHasRegParm() const
Definition: Type.h:4210
bool getNoReturn() const
Definition: Type.h:4205
bool getProducesResult() const
Definition: Type.h:4206
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: Type.h:4046
ExtInfo getExtInfo() const
Definition: Type.h:4375
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3470
bool isConst() const
Definition: Type.h:4381
bool isRestrict() const
Definition: Type.h:4383
bool isVolatile() const
Definition: Type.h:4382
Represents a C11 generic selection.
Definition: Expr.h:5725
AssociationTy< true > ConstAssociation
Definition: Expr.h:5957
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5977
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2867
LabelDecl * getLabel() const
Definition: Stmt.h:2880
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4941
bool isCBuffer() const
Definition: Decl.h:4969
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2143
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition: Stmt.h:2218
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition: Stmt.h:2215
bool isConstexpr() const
Definition: Stmt.h:2336
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:2212
bool isNegatedConsteval() const
Definition: Stmt.h:2332
bool isConsteval() const
Definition: Stmt.h:2323
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3655
bool isPartOfExplicitCast() const
Definition: Expr.h:3686
Describes an C or C++ initializer list.
Definition: Expr.h:4847
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4966
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:6011
CXXRecordDecl * getDecl() const
Definition: Type.cpp:4094
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void VisitUsingDecl(const UsingDecl *UD)
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void VisitConstantExpr(const ConstantExpr *CE)
void VisitRequiresExpr(const RequiresExpr *RE)
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
void VisitTagType(const TagType *TT)
void Visit(const Attr *A)
void VisitLabelStmt(const LabelStmt *LS)
void VisitRValueReferenceType(const ReferenceType *RT)
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
void VisitStringLiteral(const StringLiteral *SL)
void VisitBlockDecl(const BlockDecl *D)
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
void VisitDeprecatedAttr(const DeprecatedAttr *DA)
void VisitMemberPointerType(const MemberPointerType *MPT)
void VisitMemberExpr(const MemberExpr *ME)
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitSwitchStmt(const SwitchStmt *SS)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitBinaryOperator(const BinaryOperator *BO)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
void VisitTypedefDecl(const TypedefDecl *TD)
void VisitTypedefType(const TypedefType *TT)
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitElaboratedType(const ElaboratedType *ET)
void VisitUnaryTransformType(const UnaryTransformType *UTT)
void VisitCallExpr(const CallExpr *CE)
void VisitVisibilityAttr(const VisibilityAttr *VA)
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void VisitAtomicExpr(const AtomicExpr *AE)
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
void VisitFloatingLiteral(const FloatingLiteral *FL)
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
void VisitWhileStmt(const WhileStmt *WS)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitVarDecl(const VarDecl *VD)
void VisitEnumDecl(const EnumDecl *ED)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitFieldDecl(const FieldDecl *FD)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
void VisitDeclRefExpr(const DeclRefExpr *DRE)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitNamespaceDecl(const NamespaceDecl *ND)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitAutoType(const AutoType *AT)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitUnavailableAttr(const UnavailableAttr *UA)
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
void VisitPredefinedExpr(const PredefinedExpr *PE)
void VisitAliasAttr(const AliasAttr *AA)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitPackExpansionType(const PackExpansionType *PET)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitSectionAttr(const SectionAttr *SA)
void VisitUsingType(const UsingType *TT)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT)
void VisitArrayType(const ArrayType *AT)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
void VisitGotoStmt(const GotoStmt *GS)
void VisitCharacterLiteral(const CharacterLiteral *CL)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitTLSModelAttr(const TLSModelAttr *TA)
void VisitCompoundStmt(const CompoundStmt *IS)
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
void VisitCXXThisExpr(const CXXThisExpr *TE)
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
void VisitConstantArrayType(const ConstantArrayType *CAT)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *NE)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitCastExpr(const CastExpr *CE)
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
void VisitIfStmt(const IfStmt *IS)
void VisitUnaryOperator(const UnaryOperator *UO)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
void VisitIntegerLiteral(const IntegerLiteral *IL)
void VisitUsingEnumDecl(const UsingEnumDecl *UED)
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
void VisitFunctionType(const FunctionType *T)
void VisitRecordDecl(const RecordDecl *RD)
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitNamedDecl(const NamedDecl *ND)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitFriendDecl(const FriendDecl *FD)
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2036
LabelDecl * getDecl() const
Definition: Stmt.h:2054
bool isSideEntry() const
Definition: Stmt.h:2075
const char * getName() const
Definition: Stmt.cpp:421
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 ...
Definition: Lexer.cpp:499
Represents a linkage specification.
Definition: DeclCXX.h:2931
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2954
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition: DeclCXX.h:2965
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition: Type.h:5032
const IdentifierInfo * getMacroIdentifier() const
Definition: Type.h:5047
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4689
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition: ExprCXX.h:4714
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition: ExprCXX.h:4758
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4739
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3172
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3255
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
Definition: Expr.h:3396
bool isArrow() const
Definition: Expr.h:3356
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:3250
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition: Type.h:3270
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition: Type.h:3276
This represents a decl that may have a name.
Definition: Decl.h:249
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:647
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition: Decl.h:276
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
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...
Definition: Decl.h:292
Represents a C++ namespace alias.
Definition: DeclCXX.h:3117
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3212
Represent a C++ namespace.
Definition: Decl.h:547
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:3007
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:610
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2993
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:627
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
llvm::json::OStream JOS
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.
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.
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getDepth() const
Get the nesting depth of the template parameter.
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
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:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:146
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2323
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2157
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2366
protocol_range protocols() const
Definition: DeclObjC.h:2397
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2539
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2198
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2767
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2785
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
QualType getEncodedType() const
Definition: ExprObjC.h:429
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2480
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2590
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2727
Represents an ObjC class declaration.
Definition: DeclObjC.h:1152
protocol_range protocols() const
Definition: DeclObjC.h:1356
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1628
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:352
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6742
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:892
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1948
AccessControl getAccessControl() const
Definition: DeclObjC.h:1996
bool getSynthesize() const
Definition: DeclObjC.h:2003
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:579
bool isArrow() const
Definition: ExprObjC.h:587
bool isFreeIvar() const
Definition: ExprObjC.h:588
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
QualType getCallReturnType(ASTContext &Ctx) const
Definition: ExprObjC.cpp:265
Selector getSelector() const
Definition: ExprObjC.cpp:293
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition: ExprObjC.h:1279
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition: ExprObjC.h:1336
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
bool isVariadic() const
Definition: DeclObjC.h:431
bool isInstanceMethod() const
Definition: DeclObjC.h:426
QualType getReturnType() const
Definition: DeclObjC.h:329
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:899
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:902
QualType getType() const
Definition: DeclObjC.h:802
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:813
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:910
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2797
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2870
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2866
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2861
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition: ExprObjC.h:736
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:706
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition: ExprObjC.h:743
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:711
bool isImplicitProperty() const
Definition: ExprObjC.h:703
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:716
bool isSuperReceiver() const
Definition: ExprObjC.h:775
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2079
protocol_range protocols() const
Definition: DeclObjC.h:2155
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:522
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
Selector getSelector() const
Definition: ExprObjC.h:469
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
bool isArraySubscriptRefExpr() const
Definition: ExprObjC.h:897
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:889
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:893
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:639
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:22
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:3074
DeclarationName getName() const
Gets the name looked up.
Definition: ExprCXX.h:3085
Represents a pack expansion of types.
Definition: Type.h:6359
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: Type.h:6384
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:1986
StringRef getIdentKindName() const
Definition: Expr.h:2043
PredefinedIdentKind getIdentKind() const
Definition: Expr.h:2021
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.
bool isValid() const
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.
Definition: Type.h:738
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:805
SplitQualType getSplitDesugaredType() const
Definition: Type.h:1093
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:7170
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4169
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5339
RecordDecl * getDecl() const
Definition: Type.h:5349
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3170
bool isSpelledAsLValue() const
Definition: Type.h:3183
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
bool isSatisfied() const
Whether or not the requires clause is satisfied.
Definition: ExprConcepts.h:562
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2091
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:4230
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4299
Encodes a location in the source.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
StringRef getBufferName(SourceLocation Loc, bool *Invalid=nullptr) const
Return the filename or buffer identifier of the buffer the location is in.
bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc=nullptr) const
Tests whether the given source location represents a macro argument's expansion into the function-lik...
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID.
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
bool isValid() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:44
Stmt - This represents one statement.
Definition: Stmt.h:84
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1773
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1213
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5679
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5609
std::optional< unsigned > getPackIndex() const
Definition: Type.h:5639
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: Type.h:5637
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2393
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition: Stmt.h:2454
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition: Stmt.h:2451
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3585
StringRef getKindName() const
Definition: Decl.h:3776
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3688
TagDecl * getDecl() const
Definition: Type.cpp:3993
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:574
Represents a template argument.
Definition: TemplateBase.h:61
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:363
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:326
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5879
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5945
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:5938
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.
QualType 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
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:5572
bool isParameterPack() const
Definition: Type.h:5570
unsigned getIndex() const
Definition: Type.h:5569
unsigned getDepth() const
Definition: Type.h:5568
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3556
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition: TypeLoc.h:153
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:116
bool isNull() const
Definition: TypeLoc.h:121
const Type * getTypePtr() const
Definition: TypeLoc.h:137
A container of type source information.
Definition: Type.h:7120
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:7131
void Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
The base class of the type hierarchy.
Definition: Type.h:1607
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition: Type.cpp:2134
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2451
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2443
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2114
const char * getTypeClassName() const
Definition: Type.cpp:3261
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2437
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2461
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2097
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7913
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3535
QualType getUnderlyingType() const
Definition: Decl.h:3488
TypedefNameDecl * getDecl() const
Definition: Type.h:5007
QualType desugar() const
Definition: Type.cpp:3813
bool typeMatchesDecl() const
Definition: Type.h:5015
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2568
QualType getArgumentType() const
Definition: Expr.h:2611
bool isArgumentType() const
Definition: Expr.h:2610
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2600
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2183
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:2257
Opcode getOpcode() const
Definition: Expr.h:2223
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1405
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2241
A unary type transform, which is a type constructed from another.
Definition: Type.h:5256
UTTKind getUTTKind() const
Definition: Type.h:5285
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3173
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3241
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4934
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4945
Represents a C++ using-declaration.
Definition: DeclCXX.h:3509
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3546
Represents C++ using-directive.
Definition: DeclCXX.h:3012
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2956
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3710
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3754
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3317
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3381
QualType desugar() const
Definition: Type.h:4980
UsingShadowDecl * getFoundDecl() const
Definition: Type.h:4974
bool typeMatchesDecl() const
Definition: Type.h:4983
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
QualType getType() const
Definition: Decl.h:717
Represents a variable declaration or definition.
Definition: Decl.h:918
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1549
TLSKind getTLSKind() const
Definition: Decl.cpp:2165
bool hasInit() const
Definition: Decl.cpp:2395
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1446
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2118
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:929
@ CInit
C-style initialization with assignment.
Definition: Decl.h:923
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:932
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:926
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1492
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1531
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:941
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:944
@ TLS_None
Not a TLS variable.
Definition: Decl.h:938
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1155
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
Definition: Decl.cpp:2663
Represents a GCC generic vector type.
Definition: Type.h:3759
unsigned getNumElements() const
Definition: Type.h:3774
VectorKind getVectorKind() const
Definition: Type.h:3779
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2589
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2639
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:604
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
const CommandInfo * getCommandInfo(StringRef Name) const
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:65
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1083
An opening HTML tag with attributes.
Definition: Comment.h:433
A command with word-like arguments that is considered inline content.
Definition: Comment.h:335
Doxygen \param command.
Definition: Comment.h:711
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:793
A verbatim block command (e.
Definition: Comment.h:879
A line of text contained in a verbatim block.
Definition: Comment.h:854
A verbatim line command.
Definition: Comment.h:930
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
RequirementKind getKind() const
Definition: ExprConcepts.h:198
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:218
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
@ 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, APValue &Result)
Definition: Interp.h:217
The JSON file list parser is used to communicate input to InstallAPI.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ GNUAutoType
__auto_type (GNU extension)
@ DecltypeAuto
decltype(auto)
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:398
@ RQ_None
No ref-qualifier was provided.
Definition: Type.h:1556
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1559
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1562
StorageClass
Storage classes.
Definition: Specifiers.h:245
@ SC_None
Definition: Specifiers.h:247
@ SD_Thread
Thread storage duration.
Definition: Specifiers.h:327
@ SD_Static
Static storage duration.
Definition: Specifiers.h:328
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition: Specifiers.h:325
@ SD_Automatic
Automatic storage duration (most local variables).
Definition: Specifiers.h:326
@ SD_Dynamic
Dynamic storage duration.
Definition: Specifiers.h:329
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:132
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:141
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:136
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
const FunctionProtoType * T
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
@ AltiVecBool
is AltiVec 'vector bool ...'
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ AltiVecVector
is AltiVec vector
@ AltiVecPixel
is AltiVec 'vector Pixel'
@ Neon
is ARM Neon vector
@ Generic
not a target-specific vector type
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
@ NeonPoly
is ARM Neon polynomial vector
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
@ 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_DynamicNone
throw()
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:180
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:174
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:172
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:177
unsigned long uint64_t
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4499
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition: Type.h:4502
Extra information about a function prototype.
Definition: Type.h:4525
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4532
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:671
Information about a single command.