clang 23.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
8using namespace clang;
9
10void JSONNodeDumper::addPreviousDeclaration(const Decl *D) {
11 switch (D->getKind()) {
12#define DECL(DERIVED, BASE) \
13 case Decl::DERIVED: \
14 return writePreviousDeclImpl(cast<DERIVED##Decl>(D));
15#define ABSTRACT_DECL(DECL)
16#include "clang/AST/DeclNodes.inc"
17#undef ABSTRACT_DECL
18#undef DECL
19 }
20 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
21}
22
24 const char *AttrName = nullptr;
25 switch (A->getKind()) {
26#define ATTR(X) \
27 case attr::X: \
28 AttrName = #X"Attr"; \
29 break;
30#include "clang/Basic/AttrList.inc"
31#undef ATTR
32 }
33 JOS.attribute("id", createPointerRepresentation(A));
34 JOS.attribute("kind", AttrName);
35 JOS.attributeObject("range", [A, this] { writeSourceRange(A->getRange()); });
36 attributeOnlyIfTrue("inherited", A->isInherited());
37 attributeOnlyIfTrue("implicit", A->isImplicit());
38
39 // FIXME: it would be useful for us to output the spelling kind as well as
40 // the actual spelling. This would allow us to distinguish between the
41 // various attribute syntaxes, but we don't currently track that information
42 // within the AST.
43 //JOS.attribute("spelling", A->getSpelling());
44
46}
47
49 if (!S)
50 return;
51
52 JOS.attribute("id", createPointerRepresentation(S));
53 JOS.attribute("kind", S->getStmtClassName());
54 JOS.attributeObject("range",
55 [S, this] { writeSourceRange(S->getSourceRange()); });
56
57 if (const auto *E = dyn_cast<Expr>(S)) {
58 JOS.attribute("type", createQualType(E->getType()));
59 const char *Category = nullptr;
60 switch (E->getValueKind()) {
61 case VK_LValue: Category = "lvalue"; break;
62 case VK_XValue: Category = "xvalue"; break;
63 case VK_PRValue:
64 Category = "prvalue";
65 break;
66 }
67 JOS.attribute("valueCategory", Category);
68 }
70}
71
73 JOS.attribute("id", createPointerRepresentation(T));
74
75 if (!T)
76 return;
77
78 JOS.attribute("kind", (llvm::Twine(T->getTypeClassName()) + "Type").str());
79 JOS.attribute("type", createQualType(QualType(T, 0), /*Desugar=*/false));
80 attributeOnlyIfTrue("containsErrors", T->containsErrors());
81 attributeOnlyIfTrue("isDependent", T->isDependentType());
82 attributeOnlyIfTrue("isInstantiationDependent",
83 T->isInstantiationDependentType());
84 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
85 attributeOnlyIfTrue("containsUnexpandedPack",
86 T->containsUnexpandedParameterPack());
87 attributeOnlyIfTrue("isImported", T->isFromAST());
89}
90
92 JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
93 JOS.attribute("kind", "QualType");
94 JOS.attribute("type", createQualType(T));
95 JOS.attribute("qualifiers", T.split().Quals.getAsString());
96}
97
99 if (TL.isNull())
100 return;
101 JOS.attribute("kind",
102 (llvm::Twine(TL.getTypeLocClass() == TypeLoc::Qualified
103 ? "Qualified"
104 : TL.getTypePtr()->getTypeClassName()) +
105 "TypeLoc")
106 .str());
107 JOS.attribute("type",
108 createQualType(QualType(TL.getType()), /*Desugar=*/false));
109 JOS.attributeObject("range",
110 [TL, this] { writeSourceRange(TL.getSourceRange()); });
111}
112
114 JOS.attribute("id", createPointerRepresentation(D));
115
116 if (!D)
117 return;
118
119 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
120 JOS.attributeObject("loc",
121 [D, this] { writeSourceLocation(D->getLocation()); });
122 JOS.attributeObject("range",
123 [D, this] { writeSourceRange(D->getSourceRange()); });
124 attributeOnlyIfTrue("isImplicit", D->isImplicit());
125 attributeOnlyIfTrue("isInvalid", D->isInvalidDecl());
126
127 if (D->isUsed())
128 JOS.attribute("isUsed", true);
129 else if (D->isThisDeclarationReferenced())
130 JOS.attribute("isReferenced", true);
131
132 if (const auto *ND = dyn_cast<NamedDecl>(D))
133 attributeOnlyIfTrue("isHidden", !ND->isUnconditionallyVisible());
134
135 if (D->getLexicalDeclContext() != D->getDeclContext()) {
136 // Because of multiple inheritance, a DeclContext pointer does not produce
137 // the same pointer representation as a Decl pointer that references the
138 // same AST Node.
139 const auto *ParentDeclContextDecl = dyn_cast<Decl>(D->getDeclContext());
140 JOS.attribute("parentDeclContextId",
141 createPointerRepresentation(ParentDeclContextDecl));
142 }
143
144 addPreviousDeclaration(D);
146}
147
149 const comments::FullComment *FC) {
150 if (!C)
151 return;
152
153 JOS.attribute("id", createPointerRepresentation(C));
154 JOS.attribute("kind", C->getCommentKindName());
155 JOS.attributeObject("loc",
156 [C, this] { writeSourceLocation(C->getLocation()); });
157 JOS.attributeObject("range",
158 [C, this] { writeSourceRange(C->getSourceRange()); });
159
161}
162
164 const Decl *From, StringRef Label) {
165 JOS.attribute("kind", "TemplateArgument");
166 if (R.isValid())
167 JOS.attributeObject("range", [R, this] { writeSourceRange(R); });
168
169 if (From)
170 JOS.attribute(Label.empty() ? "fromDecl" : Label, createBareDeclRef(From));
171
173}
174
176 JOS.attribute("kind", "CXXCtorInitializer");
177 if (Init->isAnyMemberInitializer())
178 JOS.attribute("anyInit", createBareDeclRef(Init->getAnyMember()));
179 else if (Init->isBaseInitializer())
180 JOS.attribute("baseInit",
181 createQualType(QualType(Init->getBaseClass(), 0)));
182 else if (Init->isDelegatingInitializer())
183 JOS.attribute("delegatingInit",
184 createQualType(Init->getTypeSourceInfo()->getType()));
185 else
186 llvm_unreachable("Unknown initializer type");
187}
188
190
192
194 JOS.attribute("kind", "Capture");
195 attributeOnlyIfTrue("byref", C.isByRef());
196 attributeOnlyIfTrue("nested", C.isNested());
197 if (C.getVariable())
198 JOS.attribute("var", createBareDeclRef(C.getVariable()));
199}
200
202 JOS.attribute("associationKind", A.getTypeSourceInfo() ? "case" : "default");
203 attributeOnlyIfTrue("selected", A.isSelected());
204}
205
207 if (!R)
208 return;
209
210 switch (R->getKind()) {
212 JOS.attribute("kind", "TypeRequirement");
213 break;
215 JOS.attribute("kind", "SimpleRequirement");
216 break;
218 JOS.attribute("kind", "CompoundRequirement");
219 break;
221 JOS.attribute("kind", "NestedRequirement");
222 break;
223 }
224
225 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R))
226 attributeOnlyIfTrue("noexcept", ER->hasNoexceptRequirement());
227
228 attributeOnlyIfTrue("isDependent", R->isDependent());
229 if (!R->isDependent())
230 JOS.attribute("satisfied", R->isSatisfied());
231 attributeOnlyIfTrue("containsUnexpandedPack",
232 R->containsUnexpandedParameterPack());
233}
234
236 std::string Str;
237 llvm::raw_string_ostream OS(Str);
238 Value.printPretty(OS, Ctx, Ty);
239 JOS.attribute("value", Str);
240}
241
243 JOS.attribute("kind", "ConceptReference");
244 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
245 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
246 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
247 for (const TemplateArgumentLoc &TAL : Args->arguments())
248 JOS.object(
249 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
250 });
251 }
252 JOS.attributeObject("loc",
253 [CR, this] { writeSourceLocation(CR->getLocation()); });
254 JOS.attributeObject("range",
255 [CR, this] { writeSourceRange(CR->getSourceRange()); });
256}
257
258void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
259 if (Loc.isInvalid())
260 return;
261
262 JOS.attributeBegin("includedFrom");
263 JOS.objectBegin();
264
265 if (!JustFirst) {
266 // Walk the stack recursively, then print out the presumed location.
267 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
268 }
269
270 JOS.attribute("file", Loc.getFilename());
271 JOS.objectEnd();
272 JOS.attributeEnd();
273}
274
275void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc) {
276 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
277 if (Presumed.isValid()) {
278 StringRef ActualFile = SM.getBufferName(Loc);
279 auto [FID, FilePos] = SM.getDecomposedLoc(Loc);
280 unsigned ActualLine = SM.getLineNumber(FID, FilePos);
281 JOS.attribute("offset", FilePos);
282 if (LastLocFilename != ActualFile) {
283 JOS.attribute("file", ActualFile);
284 JOS.attribute("line", ActualLine);
285 } else if (LastLocLine != ActualLine)
286 JOS.attribute("line", ActualLine);
287
288 StringRef PresumedFile = Presumed.getFilename();
289 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
290 JOS.attribute("presumedFile", PresumedFile);
291
292 unsigned PresumedLine = Presumed.getLine();
293 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
294 JOS.attribute("presumedLine", PresumedLine);
295
296 JOS.attribute("col", Presumed.getColumn());
297 JOS.attribute("tokLen",
298 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
299 LastLocFilename = ActualFile;
300 LastLocPresumedFilename = PresumedFile;
301 LastLocPresumedLine = PresumedLine;
302 LastLocLine = ActualLine;
303
304 // Orthogonal to the file, line, and column de-duplication is whether the
305 // given location was a result of an include. If so, print where the
306 // include location came from.
307 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
308 /*JustFirst*/ true);
309 }
310}
311
312void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
313 SourceLocation Spelling = SM.getSpellingLoc(Loc);
314 SourceLocation Expansion = SM.getExpansionLoc(Loc);
315
316 if (Expansion != Spelling) {
317 // If the expansion and the spelling are different, output subobjects
318 // describing both locations.
319 JOS.attributeObject(
320 "spellingLoc", [Spelling, this] { writeBareSourceLocation(Spelling); });
321 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
322 writeBareSourceLocation(Expansion);
323 // If there is a macro expansion, add extra information if the interesting
324 // bit is the macro arg expansion.
325 if (SM.isMacroArgExpansion(Loc))
326 JOS.attribute("isMacroArgExpansion", true);
327 });
328 } else
329 writeBareSourceLocation(Spelling);
330}
331
332void JSONNodeDumper::writeSourceRange(SourceRange R) {
333 JOS.attributeObject("begin",
334 [R, this] { writeSourceLocation(R.getBegin()); });
335 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
336}
337
338std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
339 // Because JSON stores integer values as signed 64-bit integers, trying to
340 // represent them as such makes for very ugly pointer values in the resulting
341 // output. Instead, we convert the value to hex and treat it as a string.
342 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
343}
344
345llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
346 SplitQualType SQT = QT.split();
347 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
348 llvm::json::Object Ret{{"qualType", SQTS}};
349
350 if (Desugar && !QT.isNull()) {
351 SplitQualType DSQT = QT.getSplitDesugaredType();
352 if (DSQT != SQT) {
353 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
354 if (DSQTS != SQTS)
355 Ret["desugaredQualType"] = DSQTS;
356 }
357 if (const auto *TT = QT->getAs<TypedefType>())
358 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
359 }
360 return Ret;
361}
362
363void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
364 JOS.attribute("id", createPointerRepresentation(D));
365 if (!D)
366 return;
367
368 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
369 if (const auto *ND = dyn_cast<NamedDecl>(D))
370 JOS.attribute("name", ND->getDeclName().getAsString());
371 if (const auto *VD = dyn_cast<ValueDecl>(D))
372 JOS.attribute("type", createQualType(VD->getType()));
373}
374
375llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
376 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
377 if (!D)
378 return Ret;
379
380 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
381 if (const auto *ND = dyn_cast<NamedDecl>(D))
382 Ret["name"] = ND->getDeclName().getAsString();
383 if (const auto *VD = dyn_cast<ValueDecl>(D))
384 Ret["type"] = createQualType(VD->getType());
385 return Ret;
386}
387
388llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
389 llvm::json::Array Ret;
390 if (C->path_empty())
391 return Ret;
392
393 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
394 const CXXBaseSpecifier *Base = *I;
395 const auto *RD = cast<CXXRecordDecl>(
396 Base->getType()->castAsCanonical<RecordType>()->getDecl());
397
398 llvm::json::Object Val{{"name", RD->getName()}};
399 if (Base->isVirtual())
400 Val["isVirtual"] = true;
401 Ret.push_back(std::move(Val));
402 }
403 return Ret;
404}
405
406#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
407#define FIELD1(Flag) FIELD2(#Flag, Flag)
408
409static llvm::json::Object
411 llvm::json::Object Ret;
412
413 FIELD2("exists", hasDefaultConstructor);
414 FIELD2("trivial", hasTrivialDefaultConstructor);
415 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
416 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
417 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
418 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
419 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
420
421 return Ret;
422}
423
424static llvm::json::Object
426 llvm::json::Object Ret;
427
428 FIELD2("simple", hasSimpleCopyConstructor);
429 FIELD2("trivial", hasTrivialCopyConstructor);
430 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
431 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
432 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
433 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
434 FIELD2("needsImplicit", needsImplicitCopyConstructor);
435 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
437 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
438
439 return Ret;
440}
441
442static llvm::json::Object
444 llvm::json::Object Ret;
445
446 FIELD2("exists", hasMoveConstructor);
447 FIELD2("simple", hasSimpleMoveConstructor);
448 FIELD2("trivial", hasTrivialMoveConstructor);
449 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
450 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
451 FIELD2("needsImplicit", needsImplicitMoveConstructor);
452 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
454 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
455
456 return Ret;
457}
458
459static llvm::json::Object
461 llvm::json::Object Ret;
462
463 FIELD2("simple", hasSimpleCopyAssignment);
464 FIELD2("trivial", hasTrivialCopyAssignment);
465 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
466 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
467 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
468 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
469 FIELD2("needsImplicit", needsImplicitCopyAssignment);
470 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
471
472 return Ret;
473}
474
475static llvm::json::Object
477 llvm::json::Object Ret;
478
479 FIELD2("exists", hasMoveAssignment);
480 FIELD2("simple", hasSimpleMoveAssignment);
481 FIELD2("trivial", hasTrivialMoveAssignment);
482 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
483 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
484 FIELD2("needsImplicit", needsImplicitMoveAssignment);
485 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
486
487 return Ret;
488}
489
490static llvm::json::Object
492 llvm::json::Object Ret;
493
494 FIELD2("simple", hasSimpleDestructor);
495 FIELD2("irrelevant", hasIrrelevantDestructor);
496 FIELD2("trivial", hasTrivialDestructor);
497 FIELD2("nonTrivial", hasNonTrivialDestructor);
498 FIELD2("userDeclared", hasUserDeclaredDestructor);
499 FIELD2("needsImplicit", needsImplicitDestructor);
500 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
502 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
503
504 return Ret;
505}
506
507llvm::json::Object
508JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
509 llvm::json::Object Ret;
510
511 // This data is common to all C++ classes.
512 FIELD1(isGenericLambda);
513 FIELD1(isLambda);
514 FIELD1(isEmpty);
515 FIELD1(isAggregate);
516 FIELD1(isStandardLayout);
517 FIELD1(isTriviallyCopyable);
518 FIELD1(isPOD);
520 FIELD1(isPolymorphic);
521 FIELD1(isAbstract);
522 FIELD1(isLiteral);
524 FIELD1(hasUserDeclaredConstructor);
525 FIELD1(hasConstexprNonCopyMoveConstructor);
526 FIELD1(hasMutableFields);
527 FIELD1(hasVariantMembers);
528 FIELD2("canConstDefaultInit", allowConstDefaultInit);
529
530 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
533 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
534 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
536
537 return Ret;
538}
539
540#undef FIELD1
541#undef FIELD2
542
543std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
544 const auto AccessSpelling = getAccessSpelling(AS);
545 if (AccessSpelling.empty())
546 return "none";
547 return AccessSpelling.str();
548}
549
550llvm::json::Object
551JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
552 llvm::json::Object Ret;
553
554 Ret["type"] = createQualType(BS.getType());
555 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
556 Ret["writtenAccess"] =
557 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
558 if (BS.isVirtual())
559 Ret["isVirtual"] = true;
560 if (BS.isPackExpansion())
561 Ret["isPackExpansion"] = true;
562
563 return Ret;
564}
565
566void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
567 JOS.attribute("aliasee", AA->getAliasee());
568}
569
570void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
571 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
572}
573
574void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
575 if (!DA->getMessage().empty())
576 JOS.attribute("message", DA->getMessage());
577 if (!DA->getReplacement().empty())
578 JOS.attribute("replacement", DA->getReplacement());
579}
580
581void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
582 if (!UA->getMessage().empty())
583 JOS.attribute("message", UA->getMessage());
584}
585
586void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
587 JOS.attribute("section_name", SA->getName());
588}
589
590void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
591 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
592 VA->getVisibility()));
593}
594
595void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
596 JOS.attribute("tls_model", TA->getModel());
597}
598
599void JSONNodeDumper::VisitAvailabilityAttr(const AvailabilityAttr *AA) {
600 if (const IdentifierInfo *Platform = AA->getPlatform())
601 JOS.attribute("platform", Platform->getName());
602 if (!AA->getIntroduced().empty())
603 JOS.attribute("introduced", AA->getIntroduced().getAsString());
604 if (!AA->getDeprecated().empty())
605 JOS.attribute("deprecated", AA->getDeprecated().getAsString());
606 if (!AA->getObsoleted().empty())
607 JOS.attribute("obsoleted", AA->getObsoleted().getAsString());
608 attributeOnlyIfTrue("unavailable", AA->getUnavailable());
609 if (!AA->getMessage().empty())
610 JOS.attribute("message", AA->getMessage());
611 attributeOnlyIfTrue("strict", AA->getStrict());
612 if (!AA->getReplacement().empty())
613 JOS.attribute("replacement", AA->getReplacement());
614 if (AA->getPriority() != 0)
615 JOS.attribute("priority", AA->getPriority());
616 if (const IdentifierInfo *Env = AA->getEnvironment())
617 JOS.attribute("environment", Env->getName());
618}
619
621 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
622 if (!TT->typeMatchesDecl())
623 JOS.attribute("type", createQualType(TT->desugar()));
624}
625
627 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
628 JOS.attribute("type", createQualType(TT->desugar()));
629}
630
632 FunctionType::ExtInfo E = T->getExtInfo();
633 attributeOnlyIfTrue("noreturn", E.getNoReturn());
634 attributeOnlyIfTrue("producesResult", E.getProducesResult());
635 if (E.getHasRegParm())
636 JOS.attribute("regParm", E.getRegParm());
637 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
638}
639
641 FunctionProtoType::ExtProtoInfo E = T->getExtProtoInfo();
642 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
643 attributeOnlyIfTrue("const", T->isConst());
644 attributeOnlyIfTrue("volatile", T->isVolatile());
645 attributeOnlyIfTrue("restrict", T->isRestrict());
646 attributeOnlyIfTrue("variadic", E.Variadic);
647 switch (E.RefQualifier) {
648 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
649 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
650 case RQ_None: break;
651 }
652 switch (E.ExceptionSpec.Type) {
653 case EST_DynamicNone:
654 case EST_Dynamic: {
655 JOS.attribute("exceptionSpec", "throw");
656 llvm::json::Array Types;
658 Types.push_back(createQualType(QT));
659 JOS.attribute("exceptionTypes", std::move(Types));
660 } break;
661 case EST_MSAny:
662 JOS.attribute("exceptionSpec", "throw");
663 JOS.attribute("throwsAny", true);
664 break;
666 JOS.attribute("exceptionSpec", "noexcept");
667 break;
668 case EST_NoexceptTrue:
670 JOS.attribute("exceptionSpec", "noexcept");
671 JOS.attribute("conditionEvaluatesTo",
673 //JOS.attributeWithCall("exceptionSpecExpr",
674 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
675 break;
676 case EST_NoThrow:
677 JOS.attribute("exceptionSpec", "nothrow");
678 break;
679 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
680 // suspect you can only run into them when executing an AST dump from within
681 // the debugger, which is not a use case we worry about for the JSON dumping
682 // feature.
684 case EST_Unevaluated:
686 case EST_Unparsed:
687 case EST_None: break;
688 }
690}
691
693 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
694}
695
697 switch (AT->getSizeModifier()) {
699 JOS.attribute("sizeModifier", "*");
700 break;
702 JOS.attribute("sizeModifier", "static");
703 break;
705 break;
706 }
707
708 std::string Str = AT->getIndexTypeQualifiers().getAsString();
709 if (!Str.empty())
710 JOS.attribute("indexTypeQualifiers", Str);
711}
712
714 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
715 // narrowing conversion to int64_t so it cannot be expressed.
716 JOS.attribute("size", CAT->getSExtSize());
717 VisitArrayType(CAT);
718}
719
721 const DependentSizedExtVectorType *VT) {
722 JOS.attributeObject(
723 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
724}
725
727 JOS.attribute("numElements", VT->getNumElements());
728 switch (VT->getVectorKind()) {
730 break;
732 JOS.attribute("vectorKind", "altivec");
733 break;
735 JOS.attribute("vectorKind", "altivec pixel");
736 break;
738 JOS.attribute("vectorKind", "altivec bool");
739 break;
740 case VectorKind::Neon:
741 JOS.attribute("vectorKind", "neon");
742 break;
744 JOS.attribute("vectorKind", "neon poly");
745 break;
747 JOS.attribute("vectorKind", "fixed-length sve data vector");
748 break;
750 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
751 break;
753 JOS.attribute("vectorKind", "fixed-length rvv data vector");
754 break;
759 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
760 break;
761 }
762}
763
765 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
766}
767
768void JSONNodeDumper::VisitUnaryTransformType(const UnaryTransformType *UTT) {
769 switch (UTT->getUTTKind()) {
770#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
771 case UnaryTransformType::Enum: \
772 JOS.attribute("transformKind", #Trait); \
773 break;
774#include "clang/Basic/TransformTypeTraits.def"
775 }
776}
777
778void JSONNodeDumper::VisitTagType(const TagType *TT) {
779 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
780 std::string Str;
781 llvm::raw_string_ostream OS(Str);
782 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
783 JOS.attribute("qualifier", Str);
784 }
785 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
786 if (TT->isTagOwned())
787 JOS.attribute("isTagOwned", true);
788}
789
791 const TemplateTypeParmType *TTPT) {
792 JOS.attribute("depth", TTPT->getDepth());
793 JOS.attribute("index", TTPT->getIndex());
794 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
795 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
796}
797
799 const SubstTemplateTypeParmType *STTPT) {
800 JOS.attribute("index", STTPT->getIndex());
801 if (auto PackIndex = STTPT->getPackIndex())
802 JOS.attribute("pack_index", *PackIndex);
803}
804
806 const SubstTemplateTypeParmPackType *T) {
807 JOS.attribute("index", T->getIndex());
808}
809
810void JSONNodeDumper::VisitAutoType(const AutoType *AT) {
811 JOS.attribute("undeduced", !AT->isDeduced());
812 switch (AT->getKeyword()) {
814 JOS.attribute("typeKeyword", "auto");
815 break;
817 JOS.attribute("typeKeyword", "decltype(auto)");
818 break;
820 JOS.attribute("typeKeyword", "__auto_type");
821 break;
822 }
823}
824
826 const TemplateSpecializationType *TST) {
827 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
828
829 std::string Str;
830 llvm::raw_string_ostream OS(Str);
831 TST->getTemplateName().print(OS, PrintPolicy);
832 JOS.attribute("templateName", Str);
833}
834
836 const InjectedClassNameType *ICNT) {
837 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
838}
839
841 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
842}
843
844void JSONNodeDumper::VisitPackExpansionType(const PackExpansionType *PET) {
845 if (UnsignedOrNone N = PET->getNumExpansions())
846 JOS.attribute("numExpansions", *N);
847}
848
850 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
851}
852
854 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
855 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
856}
857
859 if (ND && ND->getDeclName()) {
860 JOS.attribute("name", ND->getNameAsString());
861 // FIXME: There are likely other contexts in which it makes no sense to ask
862 // for a mangled name.
864 return;
865
866 // If the declaration is dependent or is in a dependent context, then the
867 // mangling is unlikely to be meaningful (and in some cases may cause
868 // "don't know how to mangle this" assertion failures.
869 if (ND->isTemplated())
870 return;
871
872 // Mangled names are not meaningful for locals, and may not be well-defined
873 // in the case of VLAs.
874 auto *VD = dyn_cast<VarDecl>(ND);
875 if (VD && VD->hasLocalStorage())
876 return;
877
878 // Do not mangle template deduction guides.
880 return;
881
882 std::string MangledName = ASTNameGen.getName(ND);
883 if (!MangledName.empty())
884 JOS.attribute("mangledName", MangledName);
885 }
886}
887
889 VisitNamedDecl(TD);
890 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
891}
892
894 VisitNamedDecl(TAD);
895 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
896}
897
899 VisitNamedDecl(ND);
900 attributeOnlyIfTrue("isInline", ND->isInline());
901 attributeOnlyIfTrue("isNested", ND->isNested());
902 if (!ND->isFirstDecl())
903 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
904}
905
907 JOS.attribute("nominatedNamespace",
908 createBareDeclRef(UDD->getNominatedNamespace()));
909}
910
912 VisitNamedDecl(NAD);
913 JOS.attribute("aliasedNamespace",
914 createBareDeclRef(NAD->getAliasedNamespace()));
915}
916
918 std::string Name;
919 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
920 llvm::raw_string_ostream SOS(Name);
921 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
922 }
923 Name += UD->getNameAsString();
924 JOS.attribute("name", Name);
925}
926
928 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
929}
930
932 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
933}
934
936 VisitNamedDecl(VD);
937 JOS.attribute("type", createQualType(VD->getType()));
938 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
939 attributeOnlyIfTrue("explicitObjectParameter",
940 P->isExplicitObjectParameter());
941
942 StorageClass SC = VD->getStorageClass();
943 if (SC != SC_None)
944 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
945 switch (VD->getTLSKind()) {
946 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
947 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
948 case VarDecl::TLS_None: break;
949 }
950 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
951 attributeOnlyIfTrue("inline", VD->isInline());
952 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
953 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
954 if (VD->hasInit()) {
955 switch (VD->getInitStyle()) {
956 case VarDecl::CInit: JOS.attribute("init", "c"); break;
957 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
958 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
960 JOS.attribute("init", "paren-list");
961 break;
962 }
963 }
964 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
965 if (const auto *Instance = VD->getTemplateInstantiationPattern())
966 JOS.attribute("TemplateInstantiationPattern",
967 createPointerRepresentation(Instance));
968}
969
971 VisitNamedDecl(FD);
972 JOS.attribute("type", createQualType(FD->getType()));
973 attributeOnlyIfTrue("mutable", FD->isMutable());
974 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
975 attributeOnlyIfTrue("isBitfield", FD->isBitField());
976 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
977}
978
980 VisitNamedDecl(FD);
981 JOS.attribute("type", createQualType(FD->getType()));
982 StorageClass SC = FD->getStorageClass();
983 if (SC != SC_None)
984 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
985 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
986 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
987 attributeOnlyIfTrue("pure", FD->isPureVirtual());
988 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
989 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
990 attributeOnlyIfTrue("variadic", FD->isVariadic());
991 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
992
993 if (FD->isDefaulted())
994 JOS.attribute("explicitlyDefaulted",
995 FD->isDeleted() ? "deleted" : "default");
996
997 if (StringLiteral *Msg = FD->getDeletedMessage())
998 JOS.attribute("deletedMessage", Msg->getString());
999
1000 if (const auto *Instance = FD->getTemplateInstantiationPattern())
1001 JOS.attribute("TemplateInstantiationPattern",
1002 createPointerRepresentation(Instance));
1003}
1004
1006 VisitNamedDecl(ED);
1007 if (ED->isFixed())
1008 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
1009 if (ED->isScoped())
1010 JOS.attribute("scopedEnumTag",
1011 ED->isScopedUsingClassTag() ? "class" : "struct");
1012 if (const auto *Instance = ED->getTemplateInstantiationPattern())
1013 JOS.attribute("TemplateInstantiationPattern",
1014 createPointerRepresentation(Instance));
1015}
1017 VisitNamedDecl(ECD);
1018 JOS.attribute("type", createQualType(ECD->getType()));
1019}
1020
1022 VisitNamedDecl(RD);
1023 JOS.attribute("tagUsed", RD->getKindName());
1024 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1025}
1027 VisitRecordDecl(RD);
1028
1029 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1030 if (CTSD->hasStrictPackMatch())
1031 JOS.attribute("strict-pack-match", true);
1032 }
1033
1034 if (const auto *Instance = RD->getTemplateInstantiationPattern())
1035 JOS.attribute("TemplateInstantiationPattern",
1036 createPointerRepresentation(Instance));
1037
1038 // All other information requires a complete definition.
1039 if (!RD->isCompleteDefinition())
1040 return;
1041
1042 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1043 if (RD->getNumBases()) {
1044 JOS.attributeArray("bases", [this, RD] {
1045 for (const auto &Spec : RD->bases())
1046 JOS.value(createCXXBaseSpecifier(Spec));
1047 });
1048 }
1049}
1050
1052 VisitNamedDecl(D);
1053 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1054}
1055
1057 VisitNamedDecl(D);
1058 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1059 JOS.attribute("depth", D->getDepth());
1060 JOS.attribute("index", D->getIndex());
1061 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1062
1063 if (D->hasDefaultArgument())
1064 JOS.attributeObject("defaultArg", [=] {
1067 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1068 });
1069}
1070
1072 const NonTypeTemplateParmDecl *D) {
1073 VisitNamedDecl(D);
1074 JOS.attribute("type", createQualType(D->getType()));
1075 JOS.attribute("depth", D->getDepth());
1076 JOS.attribute("index", D->getIndex());
1077 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1078
1079 if (D->hasDefaultArgument())
1080 JOS.attributeObject("defaultArg", [=] {
1083 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1084 });
1085}
1086
1088 const TemplateTemplateParmDecl *D) {
1089 VisitNamedDecl(D);
1090 JOS.attribute("depth", D->getDepth());
1091 JOS.attribute("index", D->getIndex());
1092 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1093
1094 if (D->hasDefaultArgument())
1095 JOS.attributeObject("defaultArg", [=] {
1096 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1098 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1099 InheritedFrom,
1100 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1101 });
1102}
1103
1105 StringRef Lang;
1106 switch (LSD->getLanguage()) {
1108 Lang = "C";
1109 break;
1111 Lang = "C++";
1112 break;
1113 }
1114 JOS.attribute("language", Lang);
1115 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1116}
1117
1119 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1120}
1121
1123 const ExplicitInstantiationDecl *D) {
1124 attributeOnlyIfTrue("isExternTemplate", D->isExternTemplate());
1125 if (D->getSpecialization())
1126 JOS.attribute("specializationDeclId",
1127 createPointerRepresentation(D->getSpecialization()));
1128 switch (D->getTemplateSpecializationKind()) {
1129 case TSK_Undeclared:
1130 break;
1132 JOS.attribute("templateSpecializationKind", "implicit_instantiation");
1133 break;
1135 JOS.attribute("templateSpecializationKind", "explicit_specialization");
1136 break;
1138 JOS.attribute("templateSpecializationKind",
1139 "explicit_instantiation_declaration");
1140 break;
1142 JOS.attribute("templateSpecializationKind",
1143 "explicit_instantiation_definition");
1144 break;
1145 }
1146}
1147
1149 if (const TypeSourceInfo *T = FD->getFriendType())
1150 JOS.attribute("type", createQualType(T->getType()));
1151 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1152}
1153
1155 VisitNamedDecl(D);
1156 JOS.attribute("type", createQualType(D->getType()));
1157 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1158 switch (D->getAccessControl()) {
1159 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1160 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1161 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1162 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1163 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1164 }
1165}
1166
1168 VisitNamedDecl(D);
1169 JOS.attribute("returnType", createQualType(D->getReturnType()));
1170 JOS.attribute("instance", D->isInstanceMethod());
1171 attributeOnlyIfTrue("variadic", D->isVariadic());
1172}
1173
1175 VisitNamedDecl(D);
1176 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1177 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1178 switch (D->getVariance()) {
1180 break;
1182 JOS.attribute("variance", "covariant");
1183 break;
1185 JOS.attribute("variance", "contravariant");
1186 break;
1187 }
1188}
1189
1191 VisitNamedDecl(D);
1192 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1193 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1194
1195 llvm::json::Array Protocols;
1196 for (const auto* P : D->protocols())
1197 Protocols.push_back(createBareDeclRef(P));
1198 if (!Protocols.empty())
1199 JOS.attribute("protocols", std::move(Protocols));
1200}
1201
1203 VisitNamedDecl(D);
1204 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1205 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1206}
1207
1209 VisitNamedDecl(D);
1210
1211 llvm::json::Array Protocols;
1212 for (const auto *P : D->protocols())
1213 Protocols.push_back(createBareDeclRef(P));
1214 if (!Protocols.empty())
1215 JOS.attribute("protocols", std::move(Protocols));
1216}
1217
1219 VisitNamedDecl(D);
1220 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1221 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1222
1223 llvm::json::Array Protocols;
1224 for (const auto* P : D->protocols())
1225 Protocols.push_back(createBareDeclRef(P));
1226 if (!Protocols.empty())
1227 JOS.attribute("protocols", std::move(Protocols));
1228}
1229
1231 const ObjCImplementationDecl *D) {
1232 VisitNamedDecl(D);
1233 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1234 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1235}
1236
1238 const ObjCCompatibleAliasDecl *D) {
1239 VisitNamedDecl(D);
1240 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1241}
1242
1244 VisitNamedDecl(D);
1245 JOS.attribute("type", createQualType(D->getType()));
1246
1247 switch (D->getPropertyImplementation()) {
1248 case ObjCPropertyDecl::None: break;
1249 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1250 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1251 }
1252
1256 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1258 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1259 attributeOnlyIfTrue("readonly",
1261 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1262 attributeOnlyIfTrue("readwrite",
1264 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1265 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1266 attributeOnlyIfTrue("nonatomic",
1268 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1269 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1270 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1271 attributeOnlyIfTrue("unsafe_unretained",
1273 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1274 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1275 attributeOnlyIfTrue("nullability",
1277 attributeOnlyIfTrue("null_resettable",
1279 }
1280}
1281
1284 JOS.attribute("implKind", D->getPropertyImplementation() ==
1286 ? "synthesize"
1287 : "dynamic");
1288 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1289 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1290}
1291
1293 attributeOnlyIfTrue("variadic", D->isVariadic());
1294 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1295}
1296
1298 JOS.attribute("name", AE->getOpAsString());
1299}
1300
1302 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1303}
1304
1306 std::string Str;
1307 llvm::raw_string_ostream OS(Str);
1308
1309 OME->getSelector().print(OS);
1310 JOS.attribute("selector", Str);
1311
1312 switch (OME->getReceiverKind()) {
1314 JOS.attribute("receiverKind", "instance");
1315 break;
1317 JOS.attribute("receiverKind", "class");
1318 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1319 break;
1321 JOS.attribute("receiverKind", "super (instance)");
1322 JOS.attribute("superType", createQualType(OME->getSuperType()));
1323 break;
1325 JOS.attribute("receiverKind", "super (class)");
1326 JOS.attribute("superType", createQualType(OME->getSuperType()));
1327 break;
1328 }
1329
1330 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1331 if (OME->getType() != CallReturnTy)
1332 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1333}
1334
1336 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1337 std::string Str;
1338 llvm::raw_string_ostream OS(Str);
1339
1340 MD->getSelector().print(OS);
1341 JOS.attribute("selector", Str);
1342 }
1343}
1344
1346 std::string Str;
1347 llvm::raw_string_ostream OS(Str);
1348
1349 OSE->getSelector().print(OS);
1350 JOS.attribute("selector", Str);
1351}
1352
1354 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1355}
1356
1358 if (OPRE->isImplicitProperty()) {
1359 JOS.attribute("propertyKind", "implicit");
1360 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1361 JOS.attribute("getter", createBareDeclRef(MD));
1362 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1363 JOS.attribute("setter", createBareDeclRef(MD));
1364 } else {
1365 JOS.attribute("propertyKind", "explicit");
1366 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1367 }
1368
1369 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1370 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1371 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1372}
1373
1375 const ObjCSubscriptRefExpr *OSRE) {
1376 JOS.attribute("subscriptKind",
1377 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1378
1379 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1380 JOS.attribute("getter", createBareDeclRef(MD));
1381 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1382 JOS.attribute("setter", createBareDeclRef(MD));
1383}
1384
1386 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1387 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1388 JOS.attribute("isArrow", OIRE->isArrow());
1389}
1390
1392 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1393}
1394
1396 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1397 if (DRE->getDecl() != DRE->getFoundDecl())
1398 JOS.attribute("foundReferencedDecl",
1399 createBareDeclRef(DRE->getFoundDecl()));
1400 switch (DRE->isNonOdrUse()) {
1401 case NOUR_None: break;
1402 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1403 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1404 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1405 }
1406 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1407}
1408
1410 const SYCLUniqueStableNameExpr *E) {
1411 JOS.attribute("typeSourceInfo",
1412 createQualType(E->getTypeSourceInfo()->getType()));
1413}
1414
1417
1420
1424
1426 JOS.attribute("isPostfix", UO->isPostfix());
1427 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1428 if (!UO->canOverflow())
1429 JOS.attribute("canOverflow", false);
1430}
1431
1433 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1434}
1435
1437 const CompoundAssignOperator *CAO) {
1439 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1440 JOS.attribute("computeResultType",
1441 createQualType(CAO->getComputationResultType()));
1442}
1443
1445 // Note, we always write this Boolean field because the information it conveys
1446 // is critical to understanding the AST node.
1447 ValueDecl *VD = ME->getMemberDecl();
1448 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1449 JOS.attribute("isArrow", ME->isArrow());
1450 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1451 switch (ME->isNonOdrUse()) {
1452 case NOUR_None: break;
1453 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1454 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1455 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1456 }
1457}
1458
1460 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1461 attributeOnlyIfTrue("isArray", NE->isArray());
1462 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1463 switch (NE->getInitializationStyle()) {
1465 break;
1467 JOS.attribute("initStyle", "call");
1468 break;
1470 JOS.attribute("initStyle", "list");
1471 break;
1472 }
1473 if (const FunctionDecl *FD = NE->getOperatorNew())
1474 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1475 if (const FunctionDecl *FD = NE->getOperatorDelete())
1476 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1477}
1479 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1480 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1481 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1482 if (const FunctionDecl *FD = DE->getOperatorDelete())
1483 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1484}
1485
1487 attributeOnlyIfTrue("implicit", TE->isImplicit());
1488}
1489
1491 JOS.attribute("castKind", CE->getCastKindName());
1492 llvm::json::Array Path = createCastPath(CE);
1493 if (!Path.empty())
1494 JOS.attribute("path", std::move(Path));
1495 // FIXME: This may not be useful information as it can be obtusely gleaned
1496 // from the inner[] array.
1497 if (const NamedDecl *ND = CE->getConversionFunction())
1498 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1499}
1500
1502 VisitCastExpr(ICE);
1503 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1504}
1505
1507 attributeOnlyIfTrue("adl", CE->usesADL());
1508}
1509
1511 const UnaryExprOrTypeTraitExpr *TTE) {
1512 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1513 if (TTE->isArgumentType())
1514 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1515}
1516
1520
1522 const UnresolvedLookupExpr *ULE) {
1523 JOS.attribute("usesADL", ULE->requiresADL());
1524 JOS.attribute("name", ULE->getName().getAsString());
1525
1526 JOS.attributeArray("lookups", [this, ULE] {
1527 for (const NamedDecl *D : ULE->decls())
1528 JOS.value(createBareDeclRef(D));
1529 });
1530}
1531
1533 JOS.attribute("name", ALE->getLabel()->getName());
1534 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1535}
1536
1538 if (CTE->isTypeOperand()) {
1539 QualType Adjusted = CTE->getTypeOperand(Ctx);
1540 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1541 JOS.attribute("typeArg", createQualType(Unadjusted));
1542 if (Adjusted != Unadjusted)
1543 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1544 }
1545}
1546
1551
1553 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1554 JOS.attribute("field", createBareDeclRef(FD));
1555}
1556
1558 const GenericSelectionExpr *GSE) {
1559 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1560}
1561
1563 const CXXUnresolvedConstructExpr *UCE) {
1564 if (UCE->getType() != UCE->getTypeAsWritten())
1565 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1566 attributeOnlyIfTrue("list", UCE->isListInitialization());
1567}
1568
1570 CXXConstructorDecl *Ctor = CE->getConstructor();
1571 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1572 attributeOnlyIfTrue("elidable", CE->isElidable());
1573 attributeOnlyIfTrue("list", CE->isListInitialization());
1574 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1575 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1576 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1577 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1578
1579 switch (CE->getConstructionKind()) {
1581 JOS.attribute("constructionKind", "complete");
1582 break;
1584 JOS.attribute("constructionKind", "delegating");
1585 break;
1587 JOS.attribute("constructionKind", "non-virtual base");
1588 break;
1590 JOS.attribute("constructionKind", "virtual base");
1591 break;
1592 }
1593}
1594
1596 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1598 if (EWC->getNumObjects()) {
1599 JOS.attributeArray("cleanups", [this, EWC] {
1600 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1601 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1602 JOS.value(createBareDeclRef(BD));
1603 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1604 llvm::json::Object Obj;
1605 Obj["id"] = createPointerRepresentation(CLE);
1606 Obj["kind"] = CLE->getStmtClassName();
1607 JOS.value(std::move(Obj));
1608 } else {
1609 llvm_unreachable("unexpected cleanup object type");
1610 }
1611 });
1612 }
1613}
1614
1616 const CXXBindTemporaryExpr *BTE) {
1617 const CXXTemporary *Temp = BTE->getTemporary();
1618 JOS.attribute("temp", createPointerRepresentation(Temp));
1619 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1620 JOS.attribute("dtor", createBareDeclRef(Dtor));
1621}
1622
1624 const MaterializeTemporaryExpr *MTE) {
1625 if (const ValueDecl *VD = MTE->getExtendingDecl())
1626 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1627
1628 switch (MTE->getStorageDuration()) {
1629 case SD_Automatic:
1630 JOS.attribute("storageDuration", "automatic");
1631 break;
1632 case SD_Dynamic:
1633 JOS.attribute("storageDuration", "dynamic");
1634 break;
1635 case SD_FullExpression:
1636 JOS.attribute("storageDuration", "full expression");
1637 break;
1638 case SD_Static:
1639 JOS.attribute("storageDuration", "static");
1640 break;
1641 case SD_Thread:
1642 JOS.attribute("storageDuration", "thread");
1643 break;
1644 }
1645
1646 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1647}
1648
1650 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1651}
1652
1654 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1655}
1656
1658 JOS.attribute("hasExplicitParameters", LE->hasExplicitParameters());
1659}
1660
1662 const CXXDependentScopeMemberExpr *DSME) {
1663 JOS.attribute("isArrow", DSME->isArrow());
1664 JOS.attribute("member", DSME->getMember().getAsString());
1665 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1666 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1667 DSME->hasExplicitTemplateArgs());
1668
1669 if (DSME->getNumTemplateArgs()) {
1670 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1671 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1672 JOS.object(
1673 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1674 });
1675 }
1676}
1677
1679 if (!RE->isValueDependent())
1680 JOS.attribute("satisfied", RE->isSatisfied());
1681}
1682
1684 llvm::SmallString<16> Buffer;
1685 IL->getValue().toString(Buffer,
1686 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1687 JOS.attribute("value", Buffer);
1688}
1690 // FIXME: This should probably print the character literal as a string,
1691 // rather than as a numerical value. It would be nice if the behavior matched
1692 // what we do to print a string literal; right now, it is impossible to tell
1693 // the difference between 'a' and L'a' in C from the JSON output.
1694 JOS.attribute("value", CL->getValue());
1695}
1697 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1698}
1700 llvm::SmallString<16> Buffer;
1701 FL->getValue().toString(Buffer);
1702 JOS.attribute("value", Buffer);
1703}
1705 std::string Buffer;
1706 llvm::raw_string_ostream SS(Buffer);
1707 SL->outputString(SS);
1708 JOS.attribute("value", Buffer);
1709}
1711 JOS.attribute("value", BLE->getValue());
1712}
1713
1715 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1716 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1717 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1718 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1719 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1720 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1721}
1722
1724 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1725 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1726}
1728 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1729}
1730
1732 JOS.attribute("name", LS->getName());
1733 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1734 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1735}
1736
1738 if (LS->hasLabelTarget())
1739 JOS.attribute("targetLabelDeclId",
1740 createPointerRepresentation(LS->getLabelDecl()));
1741}
1742
1744 JOS.attribute("targetLabelDeclId",
1745 createPointerRepresentation(GS->getLabel()));
1746}
1747
1749 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1750}
1751
1753 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1754 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1755 // null child node and ObjC gets no child node.
1756 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1757}
1758
1760 JOS.attribute("isNull", true);
1761}
1763 JOS.attribute("type", createQualType(TA.getAsType()));
1764}
1766 const TemplateArgument &TA) {
1767 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1768}
1770 JOS.attribute("isNullptr", true);
1771}
1773 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1774}
1780 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1781 // the output format.
1782}
1784 const TemplateArgument &TA) {
1785 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1786 // the output format.
1787}
1789 const TemplateArgument &TA) {
1790 JOS.attribute("isExpr", true);
1791 if (TA.isCanonicalExpr())
1792 JOS.attribute("isCanonical", true);
1793}
1795 JOS.attribute("isPack", true);
1796}
1797
1798StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1799 if (Traits)
1800 return Traits->getCommandInfo(CommandID)->Name;
1801 if (const comments::CommandInfo *Info =
1803 return Info->Name;
1804 return "<invalid>";
1805}
1806
1808 const comments::FullComment *) {
1809 JOS.attribute("text", C->getText());
1810}
1811
1814 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1815
1816 switch (C->getRenderKind()) {
1818 JOS.attribute("renderKind", "normal");
1819 break;
1821 JOS.attribute("renderKind", "bold");
1822 break;
1824 JOS.attribute("renderKind", "emphasized");
1825 break;
1827 JOS.attribute("renderKind", "monospaced");
1828 break;
1830 JOS.attribute("renderKind", "anchor");
1831 break;
1832 }
1833
1834 llvm::json::Array Args;
1835 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1836 Args.push_back(C->getArgText(I));
1837
1838 if (!Args.empty())
1839 JOS.attribute("args", std::move(Args));
1840}
1841
1844 JOS.attribute("name", C->getTagName());
1845 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1846 attributeOnlyIfTrue("malformed", C->isMalformed());
1847
1848 llvm::json::Array Attrs;
1849 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1850 Attrs.push_back(
1851 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1852
1853 if (!Attrs.empty())
1854 JOS.attribute("attrs", std::move(Attrs));
1855}
1856
1859 JOS.attribute("name", C->getTagName());
1860}
1861
1864 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1865
1866 llvm::json::Array Args;
1867 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1868 Args.push_back(C->getArgText(I));
1869
1870 if (!Args.empty())
1871 JOS.attribute("args", std::move(Args));
1872}
1873
1876 switch (C->getDirection()) {
1878 JOS.attribute("direction", "in");
1879 break;
1881 JOS.attribute("direction", "out");
1882 break;
1884 JOS.attribute("direction", "in,out");
1885 break;
1886 }
1887 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1888
1889 if (C->hasParamName())
1890 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1891 : C->getParamNameAsWritten());
1892
1893 if (C->isParamIndexValid() && !C->isVarArgParam())
1894 JOS.attribute("paramIdx", C->getParamIndex());
1895}
1896
1899 if (C->hasParamName())
1900 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1901 : C->getParamNameAsWritten());
1902 if (C->isPositionValid()) {
1903 llvm::json::Array Positions;
1904 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1905 Positions.push_back(C->getIndex(I));
1906
1907 if (!Positions.empty())
1908 JOS.attribute("positions", std::move(Positions));
1909 }
1910}
1911
1914 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1915 JOS.attribute("closeName", C->getCloseName());
1916}
1917
1920 const comments::FullComment *) {
1921 JOS.attribute("text", C->getText());
1922}
1923
1926 JOS.attribute("text", C->getText());
1927}
1928
1929llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1930 llvm::json::Object Ret;
1931#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1932 if (FPO.has##NAME##Override()) \
1933 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1934#include "clang/Basic/FPOptions.def"
1935 return Ret;
1936}
1937
1939 VisitStmt(S);
1940 if (S->hasStoredFPFeatures())
1941 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1942}
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
#define FIELD1(Flag)
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)
#define SM(sm)
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class....
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition APValue.h:122
@ None
There is no such object (it's outside its lifetime).
Definition APValue.h:129
const clang::PrintingPolicy & getPrintingPolicy() const
Definition ASTContext.h:858
Represents an access specifier followed by colon ':'.
Definition DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4553
LabelDecl * getLabel() const
Definition Expr.h:4576
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition TypeBase.h:3777
ArraySizeModifier getSizeModifier() const
Definition TypeBase.h:3791
Qualifiers getIndexTypeQualifiers() const
Definition TypeBase.h:3795
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6927
StringRef getOpAsString() const
Definition Expr.h:6991
Attr - This represents one attribute.
Definition Attr.h:46
attr::Kind getKind() const
Definition Attr.h:92
bool isInherited() const
Definition Attr.h:101
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition Attr.h:105
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4041
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:2133
Opcode getOpcode() const
Definition Expr.h:4086
A class which contains all the information about a particular captured value.
Definition Decl.h:4696
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4690
bool capturesCXXThis() const
Definition Decl.h:4822
bool isVariadic() const
Definition Decl.h:4765
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:1497
CXXTemporary * getTemporary()
Definition ExprCXX.h:1515
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:727
bool getValue() const
Definition ExprCXX.h:744
Represents a call to a C++ constructor.
Definition ExprCXX.h:1552
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1621
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1626
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1645
bool isImmediateEscalating() const
Definition ExprCXX.h:1710
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1654
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1615
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1634
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1663
Represents a C++ constructor within a class.
Definition DeclCXX.h:2624
Represents a C++ base or member initializer.
Definition DeclCXX.h:2389
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1274
bool hasRewrittenInit() const
Definition ExprCXX.h:1319
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1381
bool hasRewrittenInit() const
Definition ExprCXX.h:1410
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2630
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2669
bool isArrayForm() const
Definition ExprCXX.h:2656
bool isGlobalDelete() const
Definition ExprCXX.h:2655
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2657
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3870
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3969
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4064
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4043
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4008
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4039
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4071
Represents a C++ destructor within a class.
Definition DeclCXX.h:2889
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2359
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
base_class_range bases()
Definition DeclCXX.h:608
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition DeclCXX.h:602
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
Definition DeclCXX.cpp:2085
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition DeclCXX.h:902
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition DeclCXX.h:1013
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition DeclCXX.h:805
Represents a C++ temporary.
Definition ExprCXX.h:1463
const CXXDestructorDecl * getDestructor() const
Definition ExprCXX.h:1474
Represents the this expression in C++.
Definition ExprCXX.h:1158
bool isImplicit() const
Definition ExprCXX.h:1181
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:852
bool isTypeOperand() const
Definition ExprCXX.h:888
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition ExprCXX.cpp:161
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:895
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3744
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3799
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3778
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2946
bool usesADL() const
Definition Expr.h:3103
CaseStmt - Represent a case statement.
Definition Stmt.h:1926
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1989
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3679
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition Expr.cpp:2002
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1951
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4303
QualType getComputationLHSType() const
Definition Expr.h:4337
QualType getComputationResultType() const
Definition Expr.h:4340
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1746
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1796
bool hasStoredFPFeatures() const
Definition Stmt.h:1793
A reference to a concept and its template args, as it appears in the code.
Definition ASTConcept.h:130
SourceRange getSourceRange() const LLVM_READONLY
Definition ASTConcept.h:193
SourceLocation getLocation() const
Definition ASTConcept.h:182
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition ASTConcept.h:203
TemplateDecl * getNamedConcept() const
Definition ASTConcept.h:201
Represents the canonical version of C arrays with a specified constant size.
Definition TypeBase.h:3815
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition TypeBase.h:3897
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1085
APValue getAPValueResult() const
Definition Expr.cpp:413
APValue::ValueKind getResultAPValueKind() const
Definition Expr.h:1151
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1273
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1384
ValueDecl * getDecl()
Definition Expr.h:1341
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1471
bool isImmediateEscalating() const
Definition Expr.h:1481
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
ASTContext & getASTContext() const LLVM_READONLY
Definition DeclBase.cpp:547
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition DeclBase.h:601
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
Definition DeclBase.cpp:308
bool isInvalidDecl() const
Definition DeclBase.h:596
SourceLocation getLocation() const
Definition DeclBase.h:447
const char * getDeclKindName() const
Definition DeclBase.cpp:169
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition DeclBase.h:629
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition DeclBase.cpp:576
DeclContext * getDeclContext()
Definition DeclBase.h:456
AccessSpecifier getAccess() const
Definition DeclBase.h:515
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition DeclBase.h:931
Kind getKind() const
Definition DeclBase.h:450
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition DeclBase.h:435
std::string getAsString() const
Retrieve the human-readable string for this name.
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Represents an extended vector type where either the type or size is dependent.
Definition TypeBase.h:4156
SourceLocation getAttributeLoc() const
Definition TypeBase.h:4172
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3441
Represents an enum.
Definition Decl.h:4029
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4247
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4250
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4256
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4202
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5134
Represents an explicit instantiation of a template entity in source code.
TemplateSpecializationKind getTemplateSpecializationKind() const
NamedDecl * getSpecialization() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3661
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3696
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3685
unsigned getNumObjects() const
Definition ExprCXX.h:3689
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3667
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:177
QualType getType() const
Definition Expr.h:144
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
Definition Decl.h:3178
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3278
bool isBitField() const
Determines whether this field is a bitfield.
Definition Decl.h:3281
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition Decl.h:3358
std::string getValueAsString(unsigned Radix) const
Definition Expr.cpp:1010
llvm::APFloat getValue() const
Definition Expr.h:1669
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:125
bool isPackExpansion() const
Definition DeclFriend.h:190
Represents a function declaration or definition.
Definition Decl.h:2018
bool isImmediateFunction() const
Definition Decl.cpp:3335
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2776
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
Definition Decl.cpp:4259
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3128
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2558
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:2906
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition Decl.h:2488
bool isDeletedAsWritten() const
Definition Decl.h:2562
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2371
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2403
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2362
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:2917
Represents a prototype with parameter type info, e.g.
Definition TypeBase.h:5362
A class which abstracts out some details necessary for making a call.
Definition TypeBase.h:4669
CallingConv getCC() const
Definition TypeBase.h:4728
unsigned getRegParm() const
Definition TypeBase.h:4721
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4558
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3699
Represents a C11 generic selection.
Definition Expr.h:6181
AssociationTy< true > ConstAssociation
Definition Expr.h:6415
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6435
GotoStmt - This represents a direct goto.
Definition Stmt.h:2975
LabelDecl * getLabel() const
Definition Stmt.h:2988
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5212
bool isCBuffer() const
Definition Decl.h:5256
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition Stmt.h:2265
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2340
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2337
bool isConstexpr() const
Definition Stmt.h:2458
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2334
bool isNegatedConsteval() const
Definition Stmt.h:2454
bool isConsteval() const
Definition Stmt.h:2445
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3856
bool isPartOfExplicitCast() const
Definition Expr.h:3887
Describes an C or C++ initializer list.
Definition Expr.h:5302
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5428
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 VisitAvailabilityAttr(const AvailabilityAttr *AA)
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 VisitOpenACCRoutineDecl(const OpenACCRoutineDecl *D)
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 VisitUnaryTransformType(const UnaryTransformType *UTT)
void VisitCallExpr(const CallExpr *CE)
void VisitVisibilityAttr(const VisibilityAttr *VA)
void VisitOpenACCDeclareDecl(const OpenACCDeclareDecl *D)
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 VisitLoopControlStmt(const LoopControlStmt *LS)
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 VisitExplicitInstantiationDecl(const ExplicitInstantiationDecl *D)
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 VisitStructuralValueTemplateArgument(const TemplateArgument &TA)
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 VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *E)
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 VisitLambdaExpr(const LambdaExpr *LE)
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:2152
LabelDecl * getDecl() const
Definition Stmt.h:2170
bool isSideEntry() const
Definition Stmt.h:2199
const char * getName() const
Definition Stmt.cpp:437
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1972
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:509
Represents a linkage specification.
Definition DeclCXX.h:3031
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3054
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition DeclCXX.h:3065
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3063
LabelDecl * getLabelDecl()
Definition Stmt.h:3101
bool hasLabelTarget() const
Definition Stmt.h:3096
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6241
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6256
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4920
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4945
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:4989
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:4970
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3450
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3591
bool isArrow() const
Definition Expr.h:3551
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition TypeBase.h:3708
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3730
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3736
This represents a decl that may have a name.
Definition Decl.h:274
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:656
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition Decl.h:301
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:340
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:317
Represents a C++ namespace alias.
Definition DeclCXX.h:3217
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3310
Represent a C++ namespace.
Definition Decl.h:592
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition Decl.h:648
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition Decl.h:657
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.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
This is a basic class for representing single OpenMP clause.
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:119
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:159
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:181
ObjCCategoryDecl - Represents a category declaration.
Definition DeclObjC.h:2329
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
Definition DeclObjC.h:2372
protocol_range protocols() const
Definition DeclObjC.h:2403
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition DeclObjC.h:2545
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition DeclObjC.h:2775
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2793
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:441
QualType getEncodedType() const
Definition ExprObjC.h:460
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2486
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition DeclObjC.h:2597
const ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.h:2735
Represents an ObjC class declaration.
Definition DeclObjC.h:1154
protocol_range protocols() const
Definition DeclObjC.h:1359
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.cpp:349
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
Definition TypeBase.h:7998
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition Type.cpp:988
ObjCIvarDecl - Represents an ObjC instance variable.
Definition DeclObjC.h:1952
AccessControl getAccessControl() const
Definition DeclObjC.h:2000
bool getSynthesize() const
Definition DeclObjC.h:2007
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:580
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:610
bool isArrow() const
Definition ExprObjC.h:618
bool isFreeIvar() const
Definition ExprObjC.h:619
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:971
QualType getCallReturnType(ASTContext &Ctx) const
Definition ExprObjC.cpp:273
Selector getSelector() const
Definition ExprObjC.cpp:301
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:985
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:979
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:982
@ Class
The receiver is a class.
Definition ExprObjC.h:976
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1318
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1375
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1260
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:731
ObjCMethodDecl * getGetterMethodDecl() const
Definition DeclObjC.h:901
ObjCMethodDecl * getSetterMethodDecl() const
Definition DeclObjC.h:904
QualType getType() const
Definition DeclObjC.h:804
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition DeclObjC.h:815
PropertyControl getPropertyImplementation() const
Definition DeclObjC.h:912
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition DeclObjC.h:2805
ObjCIvarDecl * getPropertyIvarDecl() const
Definition DeclObjC.h:2879
Kind getPropertyImplementation() const
Definition DeclObjC.h:2875
ObjCPropertyDecl * getPropertyDecl() const
Definition DeclObjC.h:2870
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:648
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:767
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:737
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:774
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:742
bool isImplicitProperty() const
Definition ExprObjC.h:734
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:747
bool isSuperReceiver() const
Definition ExprObjC.h:802
Represents an Objective-C protocol declaration.
Definition DeclObjC.h:2084
protocol_range protocols() const
Definition DeclObjC.h:2161
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:536
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:553
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:486
Selector getSelector() const
Definition ExprObjC.h:500
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:870
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:923
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:915
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:919
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:640
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition DeclObjC.h:623
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2093
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3231
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3242
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2008
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2043
static StringRef getIdentKindName(PredefinedIdentKind IK)
Definition Expr.cpp:649
Represents an unpacked "presumed" location which can be presented to the user.
unsigned getColumn() const
Return the presumed column number of this location.
const char * getFilename() const
Return the presumed filename of this location.
unsigned getLine() const
Return the presumed line number of this location.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
A (possibly-)qualified type.
Definition TypeBase.h:937
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition TypeBase.h:1004
SplitQualType getSplitDesugaredType() const
Definition TypeBase.h:1311
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition TypeBase.h:8457
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4343
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Base for LValueReferenceType and RValueReferenceType.
Definition TypeBase.h:3628
bool isSpelledAsLValue() const
Definition TypeBase.h:3641
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
bool isSatisfied() const
Whether or not the requires clause is satisfied.
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2146
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:4441
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4509
Encodes a location in the source.
A trivial tuple used to represent a source range.
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition StmtVisitor.h:45
Stmt - This represents one statement.
Definition Stmt.h:86
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:343
const char * getStmtClassName() const
Definition Stmt.cpp:86
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1802
void outputString(raw_ostream &OS) const
Definition Expr.cpp:1209
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2515
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2576
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2573
StringRef getKindName() const
Definition Decl.h:3931
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3836
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
bool isCanonicalExpr() const
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const DefArgStorage & getDefaultArgStorage() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getIndex() const
Retrieve the index of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template parameter.
const DefArgStorage & getDefaultArgStorage() const
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition Decl.h:3706
Base wrapper for a particular "section" of type source info.
Definition TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition TypeLoc.h:154
TypeLocClass getTypeLocClass() const
Definition TypeLoc.h:116
bool isNull() const
Definition TypeLoc.h:121
const Type * getTypePtr() const
Definition TypeLoc.h:137
A container of type source information.
Definition TypeBase.h:8407
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8418
The base class of the type hierarchy.
Definition TypeBase.h:1871
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2266
const char * getTypeClassName() const
Definition Type.cpp:3472
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9266
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3685
QualType getUnderlyingType() const
Definition Decl.h:3635
TypedefNameDecl * getDecl() const
Definition TypeBase.h:6207
QualType desugar() const
Definition Type.cpp:4168
bool typeMatchesDecl() const
Definition TypeBase.h:6215
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2628
QualType getArgumentType() const
Definition Expr.h:2671
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2660
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2247
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2317
Opcode getOpcode() const
Definition Expr.h:2283
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1406
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2301
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3390
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3459
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:6078
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6110
Represents a C++ using-declaration.
Definition DeclCXX.h:3607
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3644
Represents C++ using-directive.
Definition DeclCXX.h:3112
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3349
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3808
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3850
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3415
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3479
UsingShadowDecl * getDecl() const
Definition TypeBase.h:6150
QualType desugar() const
Definition TypeBase.h:6152
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
QualType getType() const
Definition Decl.h:723
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition Decl.cpp:5588
Represents a variable declaration or definition.
Definition Decl.h:924
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1582
TLSKind getTLSKind() const
Definition Decl.cpp:2147
bool hasInit() const
Definition Decl.cpp:2377
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition Decl.h:1479
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition Decl.cpp:2100
@ ListInit
Direct list-initialization (C++11)
Definition Decl.h:935
@ CInit
C-style initialization with assignment.
Definition Decl.h:929
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:938
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:932
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
Definition Decl.cpp:2693
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition Decl.h:1525
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1564
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:947
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:950
@ TLS_None
Not a TLS variable.
Definition Decl.h:944
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1166
Represents a GCC generic vector type.
Definition TypeBase.h:4230
unsigned getNumElements() const
Definition TypeBase.h:4245
VectorKind getVectorKind() const
Definition TypeBase.h:4250
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2703
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2753
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:625
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition Comment.h:66
A full comment attached to a declaration, contains block content.
Definition Comment.h:1104
An opening HTML tag with attributes.
Definition Comment.h:454
A command with word-like arguments that is considered inline content.
Definition Comment.h:341
Doxygen \param command.
Definition Comment.h:732
Doxygen \tparam command, describes a template parameter.
Definition Comment.h:814
A verbatim block command (e.
Definition Comment.h:900
A line of text contained in a verbatim block.
Definition Comment.h:875
A verbatim line command.
Definition Comment.h:951
A static requirement that can be used in a requires-expression to check properties of types and expre...
RetTy Visit(PTR(Decl) D)
Definition DeclVisitor.h:38
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
Definition SPIR.cpp:35
@ kind_nullability
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
PRESERVE_NONE bool Ret(InterpState &S, CodePtr &PC)
Definition Interp.h:258
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ GNUAutoType
__auto_type (GNU extension)
Definition TypeBase.h:1838
@ DecltypeAuto
decltype(auto)
Definition TypeBase.h:1835
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition Specifiers.h:422
@ RQ_None
No ref-qualifier was provided.
Definition TypeBase.h:1793
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition TypeBase.h:1796
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition TypeBase.h:1799
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:124
StorageClass
Storage classes.
Definition Specifiers.h:249
@ SC_None
Definition Specifiers.h:251
@ SD_Thread
Thread storage duration.
Definition Specifiers.h:343
@ SD_Static
Static storage duration.
Definition Specifiers.h:344
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition Specifiers.h:341
@ SD_Automatic
Automatic storage duration (most local variables).
Definition Specifiers.h:342
@ SD_Dynamic
Dynamic storage duration.
Definition Specifiers.h:345
OptionalUnsigned< unsigned > UnsignedOrNone
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:136
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition Specifiers.h:145
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition Specifiers.h:140
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
Definition Specifiers.h:207
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
Definition Specifiers.h:203
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
Definition Specifiers.h:199
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
Definition Specifiers.h:195
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
Definition Specifiers.h:192
@ Invariant
The parameter is invariant: must match exactly.
Definition DeclObjC.h:555
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
Definition DeclObjC.h:563
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
Definition DeclObjC.h:559
@ AltiVecBool
is AltiVec 'vector bool ...'
Definition TypeBase.h:4200
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4209
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4194
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4197
@ Neon
is ARM Neon vector
Definition TypeBase.h:4203
@ Generic
not a target-specific vector type
Definition TypeBase.h:4191
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
Definition TypeBase.h:4215
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
Definition TypeBase.h:4218
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4206
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4212
U cast(CodeGen::Address addr)
Definition Address.h:327
@ Parens
New-expression has a C++98 paren-delimited initializer.
Definition ExprCXX.h:2249
@ None
New-expression has no initializer as written.
Definition ExprCXX.h:2246
@ Braces
New-expression has a C++11 list-initializer.
Definition ExprCXX.h:2252
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition Specifiers.h:184
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition Specifiers.h:178
@ NOUR_None
This is an odr-use.
Definition Specifiers.h:176
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition Specifiers.h:181
unsigned long uint64_t
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition TypeBase.h:5421
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition TypeBase.h:5424
Extra information about a function prototype.
Definition TypeBase.h:5447
Information about a single command.