clang 24.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/BuiltinTraits.inc"
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 if (FD->getFriendKind() !=
1157 VisitFriendDecl(FD);
1158 return;
1159 }
1160
1162 llvm::raw_svector_ostream OS(Str);
1163 FD->getFriendTemplateName().print(OS, PrintPolicy);
1164 JOS.attribute("templateName", Str);
1165 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1166}
1167
1169 VisitNamedDecl(D);
1170 JOS.attribute("type", createQualType(D->getType()));
1171 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1172 switch (D->getAccessControl()) {
1173 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1174 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1175 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1176 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1177 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1178 }
1179}
1180
1182 VisitNamedDecl(D);
1183 JOS.attribute("returnType", createQualType(D->getReturnType()));
1184 JOS.attribute("instance", D->isInstanceMethod());
1185 attributeOnlyIfTrue("variadic", D->isVariadic());
1186}
1187
1189 VisitNamedDecl(D);
1190 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1191 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1192 switch (D->getVariance()) {
1194 break;
1196 JOS.attribute("variance", "covariant");
1197 break;
1199 JOS.attribute("variance", "contravariant");
1200 break;
1201 }
1202}
1203
1205 VisitNamedDecl(D);
1206 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1207 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1208
1209 llvm::json::Array Protocols;
1210 for (const auto* P : D->protocols())
1211 Protocols.push_back(createBareDeclRef(P));
1212 if (!Protocols.empty())
1213 JOS.attribute("protocols", std::move(Protocols));
1214}
1215
1217 VisitNamedDecl(D);
1218 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1219 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1220}
1221
1223 VisitNamedDecl(D);
1224
1225 llvm::json::Array Protocols;
1226 for (const auto *P : D->protocols())
1227 Protocols.push_back(createBareDeclRef(P));
1228 if (!Protocols.empty())
1229 JOS.attribute("protocols", std::move(Protocols));
1230}
1231
1233 VisitNamedDecl(D);
1234 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1235 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1236
1237 llvm::json::Array Protocols;
1238 for (const auto* P : D->protocols())
1239 Protocols.push_back(createBareDeclRef(P));
1240 if (!Protocols.empty())
1241 JOS.attribute("protocols", std::move(Protocols));
1242}
1243
1245 const ObjCImplementationDecl *D) {
1246 VisitNamedDecl(D);
1247 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1248 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1249}
1250
1252 const ObjCCompatibleAliasDecl *D) {
1253 VisitNamedDecl(D);
1254 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1255}
1256
1258 VisitNamedDecl(D);
1259 JOS.attribute("type", createQualType(D->getType()));
1260
1261 switch (D->getPropertyImplementation()) {
1262 case ObjCPropertyDecl::None: break;
1263 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1264 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1265 }
1266
1270 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1272 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1273 attributeOnlyIfTrue("readonly",
1275 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1276 attributeOnlyIfTrue("readwrite",
1278 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1279 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1280 attributeOnlyIfTrue("nonatomic",
1282 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1283 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1284 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1285 attributeOnlyIfTrue("unsafe_unretained",
1287 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1288 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1289 attributeOnlyIfTrue("nullability",
1291 attributeOnlyIfTrue("null_resettable",
1293 }
1294}
1295
1298 JOS.attribute("implKind", D->getPropertyImplementation() ==
1300 ? "synthesize"
1301 : "dynamic");
1302 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1303 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1304}
1305
1307 attributeOnlyIfTrue("variadic", D->isVariadic());
1308 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1309}
1310
1312 JOS.attribute("name", AE->getOpAsString());
1313}
1314
1316 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1317}
1318
1320 std::string Str;
1321 llvm::raw_string_ostream OS(Str);
1322
1323 OME->getSelector().print(OS);
1324 JOS.attribute("selector", Str);
1325
1326 switch (OME->getReceiverKind()) {
1328 JOS.attribute("receiverKind", "instance");
1329 break;
1331 JOS.attribute("receiverKind", "class");
1332 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1333 break;
1335 JOS.attribute("receiverKind", "super (instance)");
1336 JOS.attribute("superType", createQualType(OME->getSuperType()));
1337 break;
1339 JOS.attribute("receiverKind", "super (class)");
1340 JOS.attribute("superType", createQualType(OME->getSuperType()));
1341 break;
1342 }
1343
1344 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1345 if (OME->getType() != CallReturnTy)
1346 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1347}
1348
1350 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1351 std::string Str;
1352 llvm::raw_string_ostream OS(Str);
1353
1354 MD->getSelector().print(OS);
1355 JOS.attribute("selector", Str);
1356 }
1357}
1358
1360 std::string Str;
1361 llvm::raw_string_ostream OS(Str);
1362
1363 OSE->getSelector().print(OS);
1364 JOS.attribute("selector", Str);
1365}
1366
1368 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1369}
1370
1372 if (OPRE->isImplicitProperty()) {
1373 JOS.attribute("propertyKind", "implicit");
1374 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1375 JOS.attribute("getter", createBareDeclRef(MD));
1376 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1377 JOS.attribute("setter", createBareDeclRef(MD));
1378 } else {
1379 JOS.attribute("propertyKind", "explicit");
1380 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1381 }
1382
1383 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1384 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1385 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1386}
1387
1389 const ObjCSubscriptRefExpr *OSRE) {
1390 JOS.attribute("subscriptKind",
1391 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1392
1393 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1394 JOS.attribute("getter", createBareDeclRef(MD));
1395 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1396 JOS.attribute("setter", createBareDeclRef(MD));
1397}
1398
1400 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1401 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1402 JOS.attribute("isArrow", OIRE->isArrow());
1403}
1404
1406 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1407}
1408
1410 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1411 if (DRE->getDecl() != DRE->getFoundDecl())
1412 JOS.attribute("foundReferencedDecl",
1413 createBareDeclRef(DRE->getFoundDecl()));
1414 switch (DRE->isNonOdrUse()) {
1415 case NOUR_None: break;
1416 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1417 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1418 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1419 }
1420 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1421}
1422
1424 const SYCLUniqueStableNameExpr *E) {
1425 JOS.attribute("typeSourceInfo",
1426 createQualType(E->getTypeSourceInfo()->getType()));
1427}
1428
1431
1434
1438
1440 JOS.attribute("isPostfix", UO->isPostfix());
1441 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1442 if (!UO->canOverflow())
1443 JOS.attribute("canOverflow", false);
1444}
1445
1447 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1448}
1449
1451 const CompoundAssignOperator *CAO) {
1453 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1454 JOS.attribute("computeResultType",
1455 createQualType(CAO->getComputationResultType()));
1456}
1457
1459 // Note, we always write this Boolean field because the information it conveys
1460 // is critical to understanding the AST node.
1461 ValueDecl *VD = ME->getMemberDecl();
1462 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1463 JOS.attribute("isArrow", ME->isArrow());
1464 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1465 switch (ME->isNonOdrUse()) {
1466 case NOUR_None: break;
1467 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1468 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1469 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1470 }
1471}
1472
1474 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1475 attributeOnlyIfTrue("isArray", NE->isArray());
1476 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1477 switch (NE->getInitializationStyle()) {
1479 break;
1481 JOS.attribute("initStyle", "call");
1482 break;
1484 JOS.attribute("initStyle", "list");
1485 break;
1486 }
1487 if (const FunctionDecl *FD = NE->getOperatorNew())
1488 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1489 if (const FunctionDecl *FD = NE->getOperatorDelete())
1490 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1491}
1493 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1494 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1495 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1496 if (const FunctionDecl *FD = DE->getOperatorDelete())
1497 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1498}
1499
1501 attributeOnlyIfTrue("implicit", TE->isImplicit());
1502}
1503
1505 JOS.attribute("castKind", CE->getCastKindName());
1506 llvm::json::Array Path = createCastPath(CE);
1507 if (!Path.empty())
1508 JOS.attribute("path", std::move(Path));
1509 // FIXME: This may not be useful information as it can be obtusely gleaned
1510 // from the inner[] array.
1511 if (const NamedDecl *ND = CE->getConversionFunction())
1512 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1513}
1514
1516 VisitCastExpr(ICE);
1517 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1518}
1519
1521 attributeOnlyIfTrue("adl", CE->usesADL());
1522}
1523
1525 const UnaryExprOrTypeTraitExpr *TTE) {
1526 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1527 if (TTE->isArgumentType())
1528 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1529}
1530
1534
1536 const UnresolvedLookupExpr *ULE) {
1537 JOS.attribute("usesADL", ULE->requiresADL());
1538 JOS.attribute("name", ULE->getName().getAsString());
1539
1540 JOS.attributeArray("lookups", [this, ULE] {
1541 for (const NamedDecl *D : ULE->decls())
1542 JOS.value(createBareDeclRef(D));
1543 });
1544}
1545
1547 JOS.attribute("name", ALE->getLabel()->getName());
1548 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1549}
1550
1552 if (CTE->isTypeOperand()) {
1553 QualType Adjusted = CTE->getTypeOperand(Ctx);
1554 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1555 JOS.attribute("typeArg", createQualType(Unadjusted));
1556 if (Adjusted != Unadjusted)
1557 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1558 }
1559}
1560
1565
1567 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1568 JOS.attribute("field", createBareDeclRef(FD));
1569}
1570
1572 const GenericSelectionExpr *GSE) {
1573 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1574}
1575
1577 const CXXUnresolvedConstructExpr *UCE) {
1578 if (UCE->getType() != UCE->getTypeAsWritten())
1579 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1580 attributeOnlyIfTrue("list", UCE->isListInitialization());
1581}
1582
1584 CXXConstructorDecl *Ctor = CE->getConstructor();
1585 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1586 attributeOnlyIfTrue("elidable", CE->isElidable());
1587 attributeOnlyIfTrue("list", CE->isListInitialization());
1588 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1589 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1590 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1591 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1592
1593 switch (CE->getConstructionKind()) {
1595 JOS.attribute("constructionKind", "complete");
1596 break;
1598 JOS.attribute("constructionKind", "delegating");
1599 break;
1601 JOS.attribute("constructionKind", "non-virtual base");
1602 break;
1604 JOS.attribute("constructionKind", "virtual base");
1605 break;
1606 }
1607}
1608
1610 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1612 if (EWC->getNumObjects()) {
1613 JOS.attributeArray("cleanups", [this, EWC] {
1614 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1615 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1616 JOS.value(createBareDeclRef(BD));
1617 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1618 llvm::json::Object Obj;
1619 Obj["id"] = createPointerRepresentation(CLE);
1620 Obj["kind"] = CLE->getStmtClassName();
1621 JOS.value(std::move(Obj));
1622 } else {
1623 llvm_unreachable("unexpected cleanup object type");
1624 }
1625 });
1626 }
1627}
1628
1630 const CXXBindTemporaryExpr *BTE) {
1631 const CXXTemporary *Temp = BTE->getTemporary();
1632 JOS.attribute("temp", createPointerRepresentation(Temp));
1633 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1634 JOS.attribute("dtor", createBareDeclRef(Dtor));
1635}
1636
1638 const MaterializeTemporaryExpr *MTE) {
1639 if (const ValueDecl *VD = MTE->getExtendingDecl())
1640 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1641
1642 switch (MTE->getStorageDuration()) {
1643 case SD_Automatic:
1644 JOS.attribute("storageDuration", "automatic");
1645 break;
1646 case SD_Dynamic:
1647 JOS.attribute("storageDuration", "dynamic");
1648 break;
1649 case SD_FullExpression:
1650 JOS.attribute("storageDuration", "full expression");
1651 break;
1652 case SD_Static:
1653 JOS.attribute("storageDuration", "static");
1654 break;
1655 case SD_Thread:
1656 JOS.attribute("storageDuration", "thread");
1657 break;
1658 }
1659
1660 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1661}
1662
1664 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1665}
1666
1668 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1669}
1670
1672 JOS.attribute("hasExplicitParameters", LE->hasExplicitParameters());
1673}
1674
1676 const CXXDependentScopeMemberExpr *DSME) {
1677 JOS.attribute("isArrow", DSME->isArrow());
1678 JOS.attribute("member", DSME->getMember().getAsString());
1679 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1680 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1681 DSME->hasExplicitTemplateArgs());
1682
1683 if (DSME->getNumTemplateArgs()) {
1684 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1685 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1686 JOS.object(
1687 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1688 });
1689 }
1690}
1691
1693 if (!RE->isValueDependent())
1694 JOS.attribute("satisfied", RE->isSatisfied());
1695}
1696
1698 llvm::SmallString<16> Buffer;
1699 IL->getValue().toString(Buffer,
1700 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1701 JOS.attribute("value", Buffer);
1702}
1704 // FIXME: This should probably print the character literal as a string,
1705 // rather than as a numerical value. It would be nice if the behavior matched
1706 // what we do to print a string literal; right now, it is impossible to tell
1707 // the difference between 'a' and L'a' in C from the JSON output.
1708 JOS.attribute("value", CL->getValue());
1709}
1711 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1712}
1714 llvm::SmallString<16> Buffer;
1715 FL->getValue().toString(Buffer);
1716 JOS.attribute("value", Buffer);
1717}
1719 std::string Buffer;
1720 llvm::raw_string_ostream SS(Buffer);
1721 SL->outputString(SS);
1722 JOS.attribute("value", Buffer);
1723}
1725 JOS.attribute("value", BLE->getValue());
1726}
1727
1729 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1730 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1731 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1732 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1733 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1734 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1735}
1736
1738 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1739 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1740}
1742 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1743}
1744
1746 JOS.attribute("name", LS->getName());
1747 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1748 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1749}
1750
1752 if (LS->hasLabelTarget())
1753 JOS.attribute("targetLabelDeclId",
1754 createPointerRepresentation(LS->getLabelDecl()));
1755}
1756
1758 JOS.attribute("targetLabelDeclId",
1759 createPointerRepresentation(GS->getLabel()));
1760}
1761
1763 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1764}
1765
1767 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1768 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1769 // null child node and ObjC gets no child node.
1770 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1771}
1772
1774 JOS.attribute("isNull", true);
1775}
1777 JOS.attribute("type", createQualType(TA.getAsType()));
1778}
1780 const TemplateArgument &TA) {
1781 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1782}
1784 JOS.attribute("isNullptr", true);
1785}
1787 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1788}
1794 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1795 // the output format.
1796}
1798 const TemplateArgument &TA) {
1799 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1800 // the output format.
1801}
1803 const TemplateArgument &TA) {
1804 JOS.attribute("isExpr", true);
1805 if (TA.isCanonicalExpr())
1806 JOS.attribute("isCanonical", true);
1807}
1809 JOS.attribute("isPack", true);
1810}
1811
1812StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1813 if (Traits)
1814 return Traits->getCommandInfo(CommandID)->Name;
1815 if (const comments::CommandInfo *Info =
1817 return Info->Name;
1818 return "<invalid>";
1819}
1820
1822 const comments::FullComment *) {
1823 JOS.attribute("text", C->getText());
1824}
1825
1828 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1829
1830 switch (C->getRenderKind()) {
1832 JOS.attribute("renderKind", "normal");
1833 break;
1835 JOS.attribute("renderKind", "bold");
1836 break;
1838 JOS.attribute("renderKind", "emphasized");
1839 break;
1841 JOS.attribute("renderKind", "monospaced");
1842 break;
1844 JOS.attribute("renderKind", "anchor");
1845 break;
1846 }
1847
1848 llvm::json::Array Args;
1849 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1850 Args.push_back(C->getArgText(I));
1851
1852 if (!Args.empty())
1853 JOS.attribute("args", std::move(Args));
1854}
1855
1858 JOS.attribute("name", C->getTagName());
1859 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1860 attributeOnlyIfTrue("malformed", C->isMalformed());
1861
1862 llvm::json::Array Attrs;
1863 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1864 Attrs.push_back(
1865 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1866
1867 if (!Attrs.empty())
1868 JOS.attribute("attrs", std::move(Attrs));
1869}
1870
1873 JOS.attribute("name", C->getTagName());
1874}
1875
1878 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1879
1880 llvm::json::Array Args;
1881 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1882 Args.push_back(C->getArgText(I));
1883
1884 if (!Args.empty())
1885 JOS.attribute("args", std::move(Args));
1886}
1887
1890 switch (C->getDirection()) {
1892 JOS.attribute("direction", "in");
1893 break;
1895 JOS.attribute("direction", "out");
1896 break;
1898 JOS.attribute("direction", "in,out");
1899 break;
1900 }
1901 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1902
1903 if (C->hasParamName())
1904 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1905 : C->getParamNameAsWritten());
1906
1907 if (C->isParamIndexValid() && !C->isVarArgParam())
1908 JOS.attribute("paramIdx", C->getParamIndex());
1909}
1910
1913 if (C->hasParamName())
1914 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1915 : C->getParamNameAsWritten());
1916 if (C->isPositionValid()) {
1917 llvm::json::Array Positions;
1918 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1919 Positions.push_back(C->getIndex(I));
1920
1921 if (!Positions.empty())
1922 JOS.attribute("positions", std::move(Positions));
1923 }
1924}
1925
1928 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1929 JOS.attribute("closeName", C->getCloseName());
1930}
1931
1934 const comments::FullComment *) {
1935 JOS.attribute("text", C->getText());
1936}
1937
1940 JOS.attribute("text", C->getText());
1941}
1942
1943llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1944 llvm::json::Object Ret;
1945#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1946 if (FPO.has##NAME##Override()) \
1947 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1948#include "clang/Basic/FPOptions.def"
1949 return Ret;
1950}
1951
1953 VisitStmt(S);
1954 if (S->hasStoredFPFeatures())
1955 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1956}
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)
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:876
Represents an access specifier followed by colon ':'.
Definition DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4561
LabelDecl * getLabel() const
Definition Expr.h:4584
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition TypeBase.h:3836
ArraySizeModifier getSizeModifier() const
Definition TypeBase.h:3850
Qualifiers getIndexTypeQualifiers() const
Definition TypeBase.h:3854
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6945
StringRef getOpAsString() const
Definition Expr.h:7009
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:4049
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:2142
Opcode getOpcode() const
Definition Expr.h:4094
A class which contains all the information about a particular captured value.
Definition Decl.h:4812
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4806
bool capturesCXXThis() const
Definition Decl.h:4938
bool isVariadic() const
Definition Decl.h:4881
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:1496
CXXTemporary * getTemporary()
Definition ExprCXX.h:1514
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:726
bool getValue() const
Definition ExprCXX.h:743
Represents a call to a C++ constructor.
Definition ExprCXX.h:1551
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1620
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1625
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1644
bool isImmediateEscalating() const
Definition ExprCXX.h:1709
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1653
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1614
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1633
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1662
Represents a C++ constructor within a class.
Definition DeclCXX.h:2637
Represents a C++ base or member initializer.
Definition DeclCXX.h:2402
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1273
bool hasRewrittenInit() const
Definition ExprCXX.h:1318
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1380
bool hasRewrittenInit() const
Definition ExprCXX.h:1409
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2629
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2668
bool isArrayForm() const
Definition ExprCXX.h:2655
bool isGlobalDelete() const
Definition ExprCXX.h:2654
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2656
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3869
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3968
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4063
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4042
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4007
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4038
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4070
Represents a C++ destructor within a class.
Definition DeclCXX.h:2902
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2358
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:2087
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition DeclCXX.h:905
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition DeclCXX.h:1018
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition DeclCXX.h:807
Represents a C++ temporary.
Definition ExprCXX.h:1462
const CXXDestructorDecl * getDestructor() const
Definition ExprCXX.h:1473
Represents the this expression in C++.
Definition ExprCXX.h:1157
bool isImplicit() const
Definition ExprCXX.h:1180
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:851
bool isTypeOperand() const
Definition ExprCXX.h:887
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition ExprCXX.cpp:166
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:894
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3743
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3798
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3777
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2954
bool usesADL() const
Definition Expr.h:3111
CaseStmt - Represent a case statement.
Definition Stmt.h:1929
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1992
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3687
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition Expr.cpp:2010
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1959
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4311
QualType getComputationLHSType() const
Definition Expr.h:4345
QualType getComputationResultType() const
Definition Expr.h:4348
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1749
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1799
bool hasStoredFPFeatures() const
Definition Stmt.h:1796
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:3874
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition TypeBase.h:3956
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1093
APValue getAPValueResult() const
Definition Expr.cpp:419
APValue::ValueKind getResultAPValueKind() const
Definition Expr.h:1159
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1281
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1392
ValueDecl * getDecl()
Definition Expr.h:1349
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1479
bool isImmediateEscalating() const
Definition Expr.h:1489
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
ASTContext & getASTContext() const LLVM_READONLY
Definition DeclBase.cpp:550
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition DeclBase.h: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:579
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:935
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:4215
SourceLocation getAttributeLoc() const
Definition TypeBase.h:4231
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3557
Represents an enum.
Definition Decl.h:4145
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4363
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4366
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4372
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4318
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5202
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:3660
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3695
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3684
unsigned getNumObjects() const
Definition ExprCXX.h:3688
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3666
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:3294
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3394
bool isBitField() const
Determines whether this field is a bitfield.
Definition Decl.h:3397
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition Decl.h:3474
std::string getValueAsString(unsigned Radix) const
Definition Expr.cpp:1016
llvm::APFloat getValue() const
Definition Expr.h:1677
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition DeclFriend.h:46
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition DeclFriend.h:96
bool isPackExpansion() const
Definition DeclFriend.h:113
Declaration of a friend template.
TemplateName getFriendTemplateName() const
FriendTemplateEntityKind getFriendKind() const
Represents a function declaration or definition.
Definition Decl.h:2058
bool isImmediateFunction() const
Definition Decl.cpp:3383
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2888
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:4307
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3120
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2666
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:3018
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition Decl.h:2596
bool isDeletedAsWritten() const
Definition Decl.h:2670
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2479
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2511
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2470
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:3029
Represents a prototype with parameter type info, e.g.
Definition TypeBase.h:5421
A class which abstracts out some details necessary for making a call.
Definition TypeBase.h:4728
CallingConv getCC() const
Definition TypeBase.h:4787
unsigned getRegParm() const
Definition TypeBase.h:4780
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4617
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3738
Represents a C11 generic selection.
Definition Expr.h:6199
AssociationTy< true > ConstAssociation
Definition Expr.h:6433
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6453
GotoStmt - This represents a direct goto.
Definition Stmt.h:2978
LabelDecl * getLabel() const
Definition Stmt.h:2991
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5328
bool isCBuffer() const
Definition Decl.h:5372
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:2268
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2343
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2340
bool isConstexpr() const
Definition Stmt.h:2461
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2337
bool isNegatedConsteval() const
Definition Stmt.h:2457
bool isConsteval() const
Definition Stmt.h:2448
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3864
bool isPartOfExplicitCast() const
Definition Expr.h:3895
Describes an C or C++ initializer list.
Definition Expr.h:5319
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5446
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 VisitFriendTemplateDecl(const FriendTemplateDecl *FD)
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:2155
LabelDecl * getDecl() const
Definition Stmt.h:2173
bool isSideEntry() const
Definition Stmt.h:2202
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:1971
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:3040
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3063
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition DeclCXX.h:3074
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3066
LabelDecl * getLabelDecl()
Definition Stmt.h:3104
bool hasLabelTarget() const
Definition Stmt.h:3099
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6300
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6315
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4919
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4944
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:4988
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:4969
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3375
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3458
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3599
bool isArrow() const
Definition Expr.h:3559
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition TypeBase.h:3767
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3789
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3795
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:3226
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3319
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:2335
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
Definition DeclObjC.h:2378
protocol_range protocols() const
Definition DeclObjC.h:2409
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition DeclObjC.h:2551
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition DeclObjC.h:2781
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2799
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:441
QualType getEncodedType() const
Definition ExprObjC.h:460
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2492
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition DeclObjC.h:2603
const ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.h:2741
Represents an ObjC class declaration.
Definition DeclObjC.h:1160
protocol_range protocols() const
Definition DeclObjC.h:1365
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.cpp:349
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
Definition TypeBase.h:8066
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition Type.cpp:988
ObjCIvarDecl - Represents an ObjC instance variable.
Definition DeclObjC.h:1958
AccessControl getAccessControl() const
Definition DeclObjC.h:2006
bool getSynthesize() const
Definition DeclObjC.h:2013
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:582
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:612
bool isArrow() const
Definition ExprObjC.h:620
bool isFreeIvar() const
Definition ExprObjC.h:621
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:973
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:987
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:981
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:984
@ Class
The receiver is a class.
Definition ExprObjC.h:978
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1320
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1377
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1262
ObjCMethodDecl - Represents an instance or class method declaration.
Definition DeclObjC.h:140
bool isVariadic() const
Definition DeclObjC.h:434
bool isInstanceMethod() const
Definition DeclObjC.h:429
QualType getReturnType() const
Definition DeclObjC.h:332
Represents one property declaration in an Objective-C interface.
Definition DeclObjC.h:734
ObjCMethodDecl * getGetterMethodDecl() const
Definition DeclObjC.h:907
ObjCMethodDecl * getSetterMethodDecl() const
Definition DeclObjC.h:910
QualType getType() const
Definition DeclObjC.h:810
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition DeclObjC.h:821
PropertyControl getPropertyImplementation() const
Definition DeclObjC.h:918
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition DeclObjC.h:2811
ObjCIvarDecl * getPropertyIvarDecl() const
Definition DeclObjC.h:2885
Kind getPropertyImplementation() const
Definition DeclObjC.h:2881
ObjCPropertyDecl * getPropertyDecl() const
Definition DeclObjC.h:2876
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:650
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:769
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:739
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:776
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:744
bool isImplicitProperty() const
Definition ExprObjC.h:736
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:749
bool isSuperReceiver() const
Definition ExprObjC.h:804
Represents an Objective-C protocol declaration.
Definition DeclObjC.h:2090
protocol_range protocols() const
Definition DeclObjC.h:2167
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:538
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:555
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:872
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:925
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:917
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:921
Represents the declaration of an Objective-C type parameter.
Definition DeclObjC.h:581
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition DeclObjC.h:643
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition DeclObjC.h:626
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2101
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3230
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3241
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2016
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2051
static StringRef getIdentKindName(PredefinedIdentKind IK)
Definition Expr.cpp:655
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:938
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition TypeBase.h:1005
SplitQualType getSplitDesugaredType() const
Definition TypeBase.h:1316
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition TypeBase.h:8525
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4459
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:3687
bool isSpelledAsLValue() const
Definition TypeBase.h:3700
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:2154
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:4440
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4508
Encodes a location in the source.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
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:85
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:343
const char * getStmtClassName() const
Definition Stmt.cpp:86
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1810
void outputString(raw_ostream &OS) const
Definition Expr.cpp:1215
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2518
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2579
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2576
StringRef getKindName() const
Definition Decl.h:4047
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3952
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.
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
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:3822
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:8475
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8486
The base class of the type hierarchy.
Definition TypeBase.h:1879
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2296
const char * getTypeClassName() const
Definition Type.cpp:3507
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9340
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3801
QualType getUnderlyingType() const
Definition Decl.h:3751
TypedefNameDecl * getDecl() const
Definition TypeBase.h:6266
QualType desugar() const
Definition Type.cpp:4205
bool typeMatchesDecl() const
Definition TypeBase.h:6274
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2636
QualType getArgumentType() const
Definition Expr.h:2679
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2668
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2255
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2325
Opcode getOpcode() const
Definition Expr.h:2291
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1412
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2309
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3389
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3458
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:6137
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6169
Represents a C++ using-declaration.
Definition DeclCXX.h:3616
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3653
Represents C++ using-directive.
Definition DeclCXX.h:3121
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3357
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3817
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3859
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3424
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3488
UsingShadowDecl * getDecl() const
Definition TypeBase.h:6209
QualType desugar() const
Definition TypeBase.h:6211
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:5656
Represents a variable declaration or definition.
Definition Decl.h:932
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1593
TLSKind getTLSKind() const
Definition Decl.cpp:2149
bool hasInit() const
Definition Decl.cpp:2379
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition Decl.h:1490
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition Decl.cpp:2102
@ ListInit
Direct list-initialization (C++11)
Definition Decl.h:943
@ CInit
C-style initialization with assignment.
Definition Decl.h:937
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:946
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:940
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
Definition Decl.cpp:2698
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition Decl.h:1536
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1575
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:955
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:958
@ TLS_None
Not a TLS variable.
Definition Decl.h:952
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1174
Represents a GCC generic vector type.
Definition TypeBase.h:4289
unsigned getNumElements() const
Definition TypeBase.h:4304
VectorKind getVectorKind() const
Definition TypeBase.h:4309
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2706
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2756
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:616
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:1097
An opening HTML tag with attributes.
Definition Comment.h:445
A command with word-like arguments that is considered inline content.
Definition Comment.h:341
Doxygen \param command.
Definition Comment.h:723
Doxygen \tparam command, describes a template parameter.
Definition Comment.h:805
A verbatim block command (e.
Definition Comment.h:891
A line of text contained in a verbatim block.
Definition Comment.h:866
A verbatim line command.
Definition Comment.h:942
A static requirement that can be used in a requires-expression to check properties of types and expre...
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)
Definition Interp.h:289
Top level wrappers for InstallAPI frontend operations.
const char * getTraitSpelling(TypeTrait T) LLVM_READONLY
Return the spelling of the trait T. Never null.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ GNUAutoType
__auto_type (GNU extension)
Definition TypeBase.h:1846
@ DecltypeAuto
decltype(auto)
Definition TypeBase.h:1843
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition Specifiers.h:420
@ RQ_None
No ref-qualifier was provided.
Definition TypeBase.h:1801
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition TypeBase.h:1804
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition TypeBase.h:1807
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:341
@ SD_Static
Static storage duration.
Definition Specifiers.h:342
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition Specifiers.h:339
@ SD_Automatic
Automatic storage duration (most local variables).
Definition Specifiers.h:340
@ SD_Dynamic
Dynamic storage duration.
Definition Specifiers.h:343
OptionalUnsigned< unsigned > UnsignedOrNone
const FunctionProtoType * T
@ 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
@ 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:558
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
Definition DeclObjC.h:566
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
Definition DeclObjC.h:562
@ AltiVecBool
is AltiVec 'vector bool ...'
Definition TypeBase.h:4259
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4268
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4253
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4256
@ Neon
is ARM Neon vector
Definition TypeBase.h:4262
@ Generic
not a target-specific vector type
Definition TypeBase.h:4250
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
Definition TypeBase.h:4274
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
Definition TypeBase.h:4277
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4265
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4271
U cast(CodeGen::Address addr)
Definition Address.h:327
@ PackIndex
Index of a pack indexing expression or specifier.
Definition Sema.h:846
@ Parens
New-expression has a C++98 paren-delimited initializer.
Definition ExprCXX.h:2248
@ None
New-expression has no initializer as written.
Definition ExprCXX.h:2245
@ Braces
New-expression has a C++11 list-initializer.
Definition ExprCXX.h:2251
@ 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:5480
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition TypeBase.h:5483
Extra information about a function prototype.
Definition TypeBase.h:5506
Information about a single command.