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(
246 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
247 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
248 for (const TemplateArgumentLoc &TAL : Args->arguments())
249 JOS.object(
250 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
251 });
252 }
253 JOS.attributeObject("loc",
254 [CR, this] { writeSourceLocation(CR->getLocation()); });
255 JOS.attributeObject("range",
256 [CR, this] { writeSourceRange(CR->getSourceRange()); });
257}
258
259void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
260 if (Loc.isInvalid())
261 return;
262
263 JOS.attributeBegin("includedFrom");
264 JOS.objectBegin();
265
266 if (!JustFirst) {
267 // Walk the stack recursively, then print out the presumed location.
268 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
269 }
270
271 JOS.attribute("file", Loc.getFilename());
272 JOS.objectEnd();
273 JOS.attributeEnd();
274}
275
276void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc) {
277 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
278 if (Presumed.isValid()) {
279 StringRef ActualFile = SM.getBufferName(Loc);
280 auto [FID, FilePos] = SM.getDecomposedLoc(Loc);
281 unsigned ActualLine = SM.getLineNumber(FID, FilePos);
282 JOS.attribute("offset", FilePos);
283 if (LastLocFilename != ActualFile) {
284 JOS.attribute("file", ActualFile);
285 JOS.attribute("line", ActualLine);
286 } else if (LastLocLine != ActualLine)
287 JOS.attribute("line", ActualLine);
288
289 StringRef PresumedFile = Presumed.getFilename();
290 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
291 JOS.attribute("presumedFile", PresumedFile);
292
293 unsigned PresumedLine = Presumed.getLine();
294 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
295 JOS.attribute("presumedLine", PresumedLine);
296
297 JOS.attribute("col", Presumed.getColumn());
298 JOS.attribute("tokLen",
299 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
300 LastLocFilename = ActualFile;
301 LastLocPresumedFilename = PresumedFile;
302 LastLocPresumedLine = PresumedLine;
303 LastLocLine = ActualLine;
304
305 // Orthogonal to the file, line, and column de-duplication is whether the
306 // given location was a result of an include. If so, print where the
307 // include location came from.
308 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
309 /*JustFirst*/ true);
310 }
311}
312
313void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
314 SourceLocation Spelling = SM.getSpellingLoc(Loc);
315 SourceLocation Expansion = SM.getExpansionLoc(Loc);
316
317 if (Expansion != Spelling) {
318 // If the expansion and the spelling are different, output subobjects
319 // describing both locations.
320 JOS.attributeObject(
321 "spellingLoc", [Spelling, this] { writeBareSourceLocation(Spelling); });
322 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
323 writeBareSourceLocation(Expansion);
324 // If there is a macro expansion, add extra information if the interesting
325 // bit is the macro arg expansion.
326 if (SM.isMacroArgExpansion(Loc))
327 JOS.attribute("isMacroArgExpansion", true);
328 });
329 } else
330 writeBareSourceLocation(Spelling);
331}
332
333void JSONNodeDumper::writeSourceRange(SourceRange R) {
334 JOS.attributeObject("begin",
335 [R, this] { writeSourceLocation(R.getBegin()); });
336 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
337}
338
339std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
340 // Because JSON stores integer values as signed 64-bit integers, trying to
341 // represent them as such makes for very ugly pointer values in the resulting
342 // output. Instead, we convert the value to hex and treat it as a string.
343 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
344}
345
346llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
347 SplitQualType SQT = QT.split();
348 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
349 llvm::json::Object Ret{{"qualType", SQTS}};
350
351 if (Desugar && !QT.isNull()) {
352 SplitQualType DSQT = QT.getSplitDesugaredType();
353 if (DSQT != SQT) {
354 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
355 if (DSQTS != SQTS)
356 Ret["desugaredQualType"] = DSQTS;
357 }
358 if (const auto *TT = QT->getAs<TypedefType>())
359 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
360 }
361 return Ret;
362}
363
364void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
365 JOS.attribute("id", createPointerRepresentation(D));
366 if (!D)
367 return;
368
369 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
370 if (const auto *ND = dyn_cast<NamedDecl>(D))
371 JOS.attribute("name", ND->getDeclName().getAsString());
372 if (const auto *VD = dyn_cast<ValueDecl>(D))
373 JOS.attribute("type", createQualType(VD->getType()));
374}
375
376llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
377 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
378 if (!D)
379 return Ret;
380
381 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
382 if (const auto *ND = dyn_cast<NamedDecl>(D))
383 Ret["name"] = ND->getDeclName().getAsString();
384 if (const auto *VD = dyn_cast<ValueDecl>(D))
385 Ret["type"] = createQualType(VD->getType());
386 return Ret;
387}
388
389llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
390 llvm::json::Array Ret;
391 if (C->path_empty())
392 return Ret;
393
394 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
395 const CXXBaseSpecifier *Base = *I;
396 const auto *RD = cast<CXXRecordDecl>(
397 Base->getType()->castAsCanonical<RecordType>()->getDecl());
398
399 llvm::json::Object Val{{"name", RD->getName()}};
400 if (Base->isVirtual())
401 Val["isVirtual"] = true;
402 Ret.push_back(std::move(Val));
403 }
404 return Ret;
405}
406
407#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
408#define FIELD1(Flag) FIELD2(#Flag, Flag)
409
410static llvm::json::Object
412 llvm::json::Object Ret;
413
414 FIELD2("exists", hasDefaultConstructor);
415 FIELD2("trivial", hasTrivialDefaultConstructor);
416 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
417 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
418 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
419 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
420 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
421
422 return Ret;
423}
424
425static llvm::json::Object
427 llvm::json::Object Ret;
428
429 FIELD2("simple", hasSimpleCopyConstructor);
430 FIELD2("trivial", hasTrivialCopyConstructor);
431 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
432 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
433 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
434 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
435 FIELD2("needsImplicit", needsImplicitCopyConstructor);
436 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
438 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
439
440 return Ret;
441}
442
443static llvm::json::Object
445 llvm::json::Object Ret;
446
447 FIELD2("exists", hasMoveConstructor);
448 FIELD2("simple", hasSimpleMoveConstructor);
449 FIELD2("trivial", hasTrivialMoveConstructor);
450 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
451 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
452 FIELD2("needsImplicit", needsImplicitMoveConstructor);
453 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
455 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
456
457 return Ret;
458}
459
460static llvm::json::Object
462 llvm::json::Object Ret;
463
464 FIELD2("simple", hasSimpleCopyAssignment);
465 FIELD2("trivial", hasTrivialCopyAssignment);
466 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
467 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
468 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
469 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
470 FIELD2("needsImplicit", needsImplicitCopyAssignment);
471 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
472
473 return Ret;
474}
475
476static llvm::json::Object
478 llvm::json::Object Ret;
479
480 FIELD2("exists", hasMoveAssignment);
481 FIELD2("simple", hasSimpleMoveAssignment);
482 FIELD2("trivial", hasTrivialMoveAssignment);
483 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
484 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
485 FIELD2("needsImplicit", needsImplicitMoveAssignment);
486 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
487
488 return Ret;
489}
490
491static llvm::json::Object
493 llvm::json::Object Ret;
494
495 FIELD2("simple", hasSimpleDestructor);
496 FIELD2("irrelevant", hasIrrelevantDestructor);
497 FIELD2("trivial", hasTrivialDestructor);
498 FIELD2("nonTrivial", hasNonTrivialDestructor);
499 FIELD2("userDeclared", hasUserDeclaredDestructor);
500 FIELD2("needsImplicit", needsImplicitDestructor);
501 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
503 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
504
505 return Ret;
506}
507
508llvm::json::Object
509JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
510 llvm::json::Object Ret;
511
512 // This data is common to all C++ classes.
513 FIELD1(isGenericLambda);
514 FIELD1(isLambda);
515 FIELD1(isEmpty);
516 FIELD1(isAggregate);
517 FIELD1(isStandardLayout);
518 FIELD1(isTriviallyCopyable);
519 FIELD1(isPOD);
521 FIELD1(isPolymorphic);
522 FIELD1(isAbstract);
523 FIELD1(isLiteral);
525 FIELD1(hasUserDeclaredConstructor);
526 FIELD1(hasConstexprNonCopyMoveConstructor);
527 FIELD1(hasMutableFields);
528 FIELD1(hasVariantMembers);
529 FIELD2("canConstDefaultInit", allowConstDefaultInit);
530
531 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
534 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
535 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
537
538 return Ret;
539}
540
541#undef FIELD1
542#undef FIELD2
543
544std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
545 const auto AccessSpelling = getAccessSpelling(AS);
546 if (AccessSpelling.empty())
547 return "none";
548 return AccessSpelling.str();
549}
550
551llvm::json::Object
552JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
553 llvm::json::Object Ret;
554
555 Ret["type"] = createQualType(BS.getType());
556 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
557 Ret["writtenAccess"] =
558 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
559 if (BS.isVirtual())
560 Ret["isVirtual"] = true;
561 if (BS.isPackExpansion())
562 Ret["isPackExpansion"] = true;
563
564 return Ret;
565}
566
567void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
568 JOS.attribute("aliasee", AA->getAliasee());
569}
570
571void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
572 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
573}
574
575void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
576 if (!DA->getMessage().empty())
577 JOS.attribute("message", DA->getMessage());
578 if (!DA->getReplacement().empty())
579 JOS.attribute("replacement", DA->getReplacement());
580}
581
582void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
583 if (!UA->getMessage().empty())
584 JOS.attribute("message", UA->getMessage());
585}
586
587void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
588 JOS.attribute("section_name", SA->getName());
589}
590
591void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
592 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
593 VA->getVisibility()));
594}
595
596void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
597 JOS.attribute("tls_model", TA->getModel());
598}
599
600void JSONNodeDumper::VisitAvailabilityAttr(const AvailabilityAttr *AA) {
601 if (const IdentifierInfo *Platform = AA->getPlatform())
602 JOS.attribute("platform", Platform->getName());
603 if (!AA->getIntroduced().empty())
604 JOS.attribute("introduced", AA->getIntroduced().getAsString());
605 if (!AA->getDeprecated().empty())
606 JOS.attribute("deprecated", AA->getDeprecated().getAsString());
607 if (!AA->getObsoleted().empty())
608 JOS.attribute("obsoleted", AA->getObsoleted().getAsString());
609 attributeOnlyIfTrue("unavailable", AA->getUnavailable());
610 if (!AA->getMessage().empty())
611 JOS.attribute("message", AA->getMessage());
612 attributeOnlyIfTrue("strict", AA->getStrict());
613 if (!AA->getReplacement().empty())
614 JOS.attribute("replacement", AA->getReplacement());
615 if (AA->getPriority() != 0)
616 JOS.attribute("priority", AA->getPriority());
617 if (const IdentifierInfo *Env = AA->getEnvironment())
618 JOS.attribute("environment", Env->getName());
619}
620
622 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
623 if (!TT->typeMatchesDecl())
624 JOS.attribute("type", createQualType(TT->desugar()));
625}
626
628 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
629 JOS.attribute("type", createQualType(TT->desugar()));
630}
631
633 FunctionType::ExtInfo E = T->getExtInfo();
634 attributeOnlyIfTrue("noreturn", E.getNoReturn());
635 attributeOnlyIfTrue("producesResult", E.getProducesResult());
636 if (E.getHasRegParm())
637 JOS.attribute("regParm", E.getRegParm());
638 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
639}
640
642 FunctionProtoType::ExtProtoInfo E = T->getExtProtoInfo();
643 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
644 attributeOnlyIfTrue("const", T->isConst());
645 attributeOnlyIfTrue("volatile", T->isVolatile());
646 attributeOnlyIfTrue("restrict", T->isRestrict());
647 attributeOnlyIfTrue("variadic", E.Variadic);
648 switch (E.RefQualifier) {
649 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
650 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
651 case RQ_None: break;
652 }
653 switch (E.ExceptionSpec.Type) {
654 case EST_DynamicNone:
655 case EST_Dynamic: {
656 JOS.attribute("exceptionSpec", "throw");
657 llvm::json::Array Types;
659 Types.push_back(createQualType(QT));
660 JOS.attribute("exceptionTypes", std::move(Types));
661 } break;
662 case EST_MSAny:
663 JOS.attribute("exceptionSpec", "throw");
664 JOS.attribute("throwsAny", true);
665 break;
667 JOS.attribute("exceptionSpec", "noexcept");
668 break;
669 case EST_NoexceptTrue:
671 JOS.attribute("exceptionSpec", "noexcept");
672 JOS.attribute("conditionEvaluatesTo",
674 //JOS.attributeWithCall("exceptionSpecExpr",
675 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
676 break;
677 case EST_NoThrow:
678 JOS.attribute("exceptionSpec", "nothrow");
679 break;
680 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
681 // suspect you can only run into them when executing an AST dump from within
682 // the debugger, which is not a use case we worry about for the JSON dumping
683 // feature.
685 case EST_Unevaluated:
687 case EST_Unparsed:
688 case EST_None: break;
689 }
691}
692
694 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
695}
696
698 switch (AT->getSizeModifier()) {
700 JOS.attribute("sizeModifier", "*");
701 break;
703 JOS.attribute("sizeModifier", "static");
704 break;
706 break;
707 }
708
709 std::string Str = AT->getIndexTypeQualifiers().getAsString();
710 if (!Str.empty())
711 JOS.attribute("indexTypeQualifiers", Str);
712}
713
715 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
716 // narrowing conversion to int64_t so it cannot be expressed.
717 JOS.attribute("size", CAT->getSExtSize());
718 VisitArrayType(CAT);
719}
720
722 const DependentSizedExtVectorType *VT) {
723 JOS.attributeObject(
724 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
725}
726
728 JOS.attribute("numElements", VT->getNumElements());
729 switch (VT->getVectorKind()) {
731 break;
733 JOS.attribute("vectorKind", "altivec");
734 break;
736 JOS.attribute("vectorKind", "altivec pixel");
737 break;
739 JOS.attribute("vectorKind", "altivec bool");
740 break;
741 case VectorKind::Neon:
742 JOS.attribute("vectorKind", "neon");
743 break;
745 JOS.attribute("vectorKind", "neon poly");
746 break;
748 JOS.attribute("vectorKind", "fixed-length sve data vector");
749 break;
751 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
752 break;
754 JOS.attribute("vectorKind", "fixed-length rvv data vector");
755 break;
760 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
761 break;
762 }
763}
764
766 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
767}
768
769void JSONNodeDumper::VisitUnaryTransformType(const UnaryTransformType *UTT) {
770 switch (UTT->getUTTKind()) {
771#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
772 case UnaryTransformType::Enum: \
773 JOS.attribute("transformKind", #Trait); \
774 break;
775#include "clang/Basic/BuiltinTraits.inc"
776 }
777}
778
779void JSONNodeDumper::VisitTagType(const TagType *TT) {
780 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
781 std::string Str;
782 llvm::raw_string_ostream OS(Str);
783 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
784 JOS.attribute("qualifier", Str);
785 }
786 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
787 if (TT->isTagOwned())
788 JOS.attribute("isTagOwned", true);
789}
790
792 const TemplateTypeParmType *TTPT) {
793 JOS.attribute("depth", TTPT->getDepth());
794 JOS.attribute("index", TTPT->getIndex());
795 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
796 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
797}
798
800 const SubstTemplateTypeParmType *STTPT) {
801 JOS.attribute("index", STTPT->getIndex());
802 if (auto PackIndex = STTPT->getPackIndex())
803 JOS.attribute("pack_index", *PackIndex);
804}
805
807 const SubstTemplateTypeParmPackType *T) {
808 JOS.attribute("index", T->getIndex());
809}
810
811void JSONNodeDumper::VisitAutoType(const AutoType *AT) {
812 JOS.attribute("undeduced", !AT->isDeduced());
813 switch (AT->getKeyword()) {
815 JOS.attribute("typeKeyword", "auto");
816 break;
818 JOS.attribute("typeKeyword", "decltype(auto)");
819 break;
821 JOS.attribute("typeKeyword", "__auto_type");
822 break;
823 }
824}
825
827 const TemplateSpecializationType *TST) {
828 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
829
830 std::string Str;
831 llvm::raw_string_ostream OS(Str);
832 TST->getTemplateName().print(OS, PrintPolicy);
833 JOS.attribute("templateName", Str);
834}
835
837 const InjectedClassNameType *ICNT) {
838 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
839}
840
842 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
843}
844
845void JSONNodeDumper::VisitPackExpansionType(const PackExpansionType *PET) {
846 if (UnsignedOrNone N = PET->getNumExpansions())
847 JOS.attribute("numExpansions", *N);
848}
849
851 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
852}
853
855 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
856 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
857}
858
860 if (ND && ND->getDeclName()) {
861 JOS.attribute("name", ND->getNameAsString());
862 // FIXME: There are likely other contexts in which it makes no sense to ask
863 // for a mangled name.
865 return;
866
867 // If the declaration is dependent or is in a dependent context, then the
868 // mangling is unlikely to be meaningful (and in some cases may cause
869 // "don't know how to mangle this" assertion failures.
870 if (ND->isTemplated())
871 return;
872
873 // Mangled names are not meaningful for locals, and may not be well-defined
874 // in the case of VLAs.
875 auto *VD = dyn_cast<VarDecl>(ND);
876 if (VD && VD->hasLocalStorage())
877 return;
878
879 // Do not mangle template deduction guides.
881 return;
882
883 std::string MangledName = ASTNameGen.getName(ND);
884 if (!MangledName.empty())
885 JOS.attribute("mangledName", MangledName);
886 }
887}
888
890 VisitNamedDecl(TD);
891 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
892}
893
895 VisitNamedDecl(TAD);
896 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
897}
898
900 VisitNamedDecl(ND);
901 attributeOnlyIfTrue("isInline", ND->isInline());
902 attributeOnlyIfTrue("isNested", ND->isNested());
903 if (!ND->isFirstDecl())
904 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
905}
906
908 JOS.attribute("nominatedNamespace",
909 createBareDeclRef(UDD->getNominatedNamespace()));
910}
911
913 VisitNamedDecl(NAD);
914 JOS.attribute("aliasedNamespace",
915 createBareDeclRef(NAD->getAliasedNamespace()));
916}
917
919 std::string Name;
920 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
921 llvm::raw_string_ostream SOS(Name);
922 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
923 }
924 Name += UD->getNameAsString();
925 JOS.attribute("name", Name);
926}
927
929 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
930}
931
933 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
934}
935
937 VisitNamedDecl(VD);
938 JOS.attribute("type", createQualType(VD->getType()));
939 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
940 attributeOnlyIfTrue("explicitObjectParameter",
941 P->isExplicitObjectParameter());
942
943 StorageClass SC = VD->getStorageClass();
944 if (SC != SC_None)
945 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
946 switch (VD->getTLSKind()) {
947 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
948 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
949 case VarDecl::TLS_None: break;
950 }
951 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
952 attributeOnlyIfTrue("inline", VD->isInline());
953 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
954 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
955 if (VD->hasInit()) {
956 switch (VD->getInitStyle()) {
957 case VarDecl::CInit: JOS.attribute("init", "c"); break;
958 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
959 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
961 JOS.attribute("init", "paren-list");
962 break;
963 }
964 }
965 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
966 if (const auto *Instance = VD->getTemplateInstantiationPattern())
967 JOS.attribute("TemplateInstantiationPattern",
968 createPointerRepresentation(Instance));
969}
970
972 VisitNamedDecl(FD);
973 JOS.attribute("type", createQualType(FD->getType()));
974 attributeOnlyIfTrue("mutable", FD->isMutable());
975 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
976 attributeOnlyIfTrue("isBitfield", FD->isBitField());
977 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
978}
979
981 VisitNamedDecl(FD);
982 JOS.attribute("type", createQualType(FD->getType()));
983 StorageClass SC = FD->getStorageClass();
984 if (SC != SC_None)
985 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
986 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
987 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
988 attributeOnlyIfTrue("pure", FD->isPureVirtual());
989 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
990 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
991 attributeOnlyIfTrue("variadic", FD->isVariadic());
992 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
993
994 if (FD->isDefaulted())
995 JOS.attribute("explicitlyDefaulted",
996 FD->isDeleted() ? "deleted" : "default");
997
998 if (StringLiteral *Msg = FD->getDeletedMessage())
999 JOS.attribute("deletedMessage", Msg->getString());
1000
1001 if (const auto *Instance = FD->getTemplateInstantiationPattern())
1002 JOS.attribute("TemplateInstantiationPattern",
1003 createPointerRepresentation(Instance));
1004}
1005
1007 VisitNamedDecl(ED);
1008 if (ED->isFixed())
1009 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
1010 if (ED->isScoped())
1011 JOS.attribute("scopedEnumTag",
1012 ED->isScopedUsingClassTag() ? "class" : "struct");
1013 if (const auto *Instance = ED->getTemplateInstantiationPattern())
1014 JOS.attribute("TemplateInstantiationPattern",
1015 createPointerRepresentation(Instance));
1016}
1018 VisitNamedDecl(ECD);
1019 JOS.attribute("type", createQualType(ECD->getType()));
1020}
1021
1023 VisitNamedDecl(RD);
1024 JOS.attribute("tagUsed", RD->getKindName());
1025 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1026}
1028 VisitRecordDecl(RD);
1029
1030 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1031 if (CTSD->hasStrictPackMatch())
1032 JOS.attribute("strict-pack-match", true);
1033 }
1034
1035 if (const auto *Instance = RD->getTemplateInstantiationPattern())
1036 JOS.attribute("TemplateInstantiationPattern",
1037 createPointerRepresentation(Instance));
1038
1039 // All other information requires a complete definition.
1040 if (!RD->isCompleteDefinition())
1041 return;
1042
1043 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1044 if (RD->getNumBases()) {
1045 JOS.attributeArray("bases", [this, RD] {
1046 for (const auto &Spec : RD->bases())
1047 JOS.value(createCXXBaseSpecifier(Spec));
1048 });
1049 }
1050}
1051
1053 VisitNamedDecl(D);
1054 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1055}
1056
1058 VisitNamedDecl(D);
1059 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1060 JOS.attribute("depth", D->getDepth());
1061 JOS.attribute("index", D->getIndex());
1062 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1063
1064 if (D->hasDefaultArgument())
1065 JOS.attributeObject("defaultArg", [=] {
1068 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1069 });
1070}
1071
1073 const NonTypeTemplateParmDecl *D) {
1074 VisitNamedDecl(D);
1075 JOS.attribute("type", createQualType(D->getType()));
1076 JOS.attribute("depth", D->getDepth());
1077 JOS.attribute("index", D->getIndex());
1078 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1079
1080 if (D->hasDefaultArgument())
1081 JOS.attributeObject("defaultArg", [=] {
1084 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1085 });
1086}
1087
1089 const TemplateTemplateParmDecl *D) {
1090 VisitNamedDecl(D);
1091 JOS.attribute("depth", D->getDepth());
1092 JOS.attribute("index", D->getIndex());
1093 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1094
1095 if (D->hasDefaultArgument())
1096 JOS.attributeObject("defaultArg", [=] {
1097 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1099 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1100 InheritedFrom,
1101 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1102 });
1103}
1104
1106 StringRef Lang;
1107 switch (LSD->getLanguage()) {
1109 Lang = "C";
1110 break;
1112 Lang = "C++";
1113 break;
1114 }
1115 JOS.attribute("language", Lang);
1116 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1117}
1118
1120 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1121}
1122
1124 const ExplicitInstantiationDecl *D) {
1125 attributeOnlyIfTrue("isExternTemplate", D->isExternTemplate());
1126 if (D->getSpecialization())
1127 JOS.attribute("specializationDeclId",
1128 createPointerRepresentation(D->getSpecialization()));
1129 switch (D->getTemplateSpecializationKind()) {
1130 case TSK_Undeclared:
1131 break;
1133 JOS.attribute("templateSpecializationKind", "implicit_instantiation");
1134 break;
1136 JOS.attribute("templateSpecializationKind", "explicit_specialization");
1137 break;
1139 JOS.attribute("templateSpecializationKind",
1140 "explicit_instantiation_declaration");
1141 break;
1143 JOS.attribute("templateSpecializationKind",
1144 "explicit_instantiation_definition");
1145 break;
1146 }
1147}
1148
1150 if (const TypeSourceInfo *T = FD->getFriendType())
1151 JOS.attribute("type", createQualType(T->getType()));
1152 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1153}
1154
1156 if (FD->getFriendKind() !=
1158 VisitFriendDecl(FD);
1159 return;
1160 }
1161
1163 llvm::raw_svector_ostream OS(Str);
1164 FD->getFriendTemplateName().print(OS, PrintPolicy);
1165 JOS.attribute("templateName", Str);
1166 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1167}
1168
1170 VisitNamedDecl(D);
1171 JOS.attribute("type", createQualType(D->getType()));
1172 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1173 switch (D->getAccessControl()) {
1174 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1175 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1176 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1177 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1178 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1179 }
1180}
1181
1183 VisitNamedDecl(D);
1184 JOS.attribute("returnType", createQualType(D->getReturnType()));
1185 JOS.attribute("instance", D->isInstanceMethod());
1186 attributeOnlyIfTrue("variadic", D->isVariadic());
1187}
1188
1190 VisitNamedDecl(D);
1191 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1192 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1193 switch (D->getVariance()) {
1195 break;
1197 JOS.attribute("variance", "covariant");
1198 break;
1200 JOS.attribute("variance", "contravariant");
1201 break;
1202 }
1203}
1204
1206 VisitNamedDecl(D);
1207 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1208 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1209
1210 llvm::json::Array Protocols;
1211 for (const auto* P : D->protocols())
1212 Protocols.push_back(createBareDeclRef(P));
1213 if (!Protocols.empty())
1214 JOS.attribute("protocols", std::move(Protocols));
1215}
1216
1218 VisitNamedDecl(D);
1219 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1220 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1221}
1222
1224 VisitNamedDecl(D);
1225
1226 llvm::json::Array Protocols;
1227 for (const auto *P : D->protocols())
1228 Protocols.push_back(createBareDeclRef(P));
1229 if (!Protocols.empty())
1230 JOS.attribute("protocols", std::move(Protocols));
1231}
1232
1234 VisitNamedDecl(D);
1235 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1236 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1237
1238 llvm::json::Array Protocols;
1239 for (const auto* P : D->protocols())
1240 Protocols.push_back(createBareDeclRef(P));
1241 if (!Protocols.empty())
1242 JOS.attribute("protocols", std::move(Protocols));
1243}
1244
1246 const ObjCImplementationDecl *D) {
1247 VisitNamedDecl(D);
1248 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1249 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1250}
1251
1253 const ObjCCompatibleAliasDecl *D) {
1254 VisitNamedDecl(D);
1255 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1256}
1257
1259 VisitNamedDecl(D);
1260 JOS.attribute("type", createQualType(D->getType()));
1261
1262 switch (D->getPropertyImplementation()) {
1263 case ObjCPropertyDecl::None: break;
1264 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1265 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1266 }
1267
1271 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1273 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1274 attributeOnlyIfTrue("readonly",
1276 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1277 attributeOnlyIfTrue("readwrite",
1279 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1280 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1281 attributeOnlyIfTrue("nonatomic",
1283 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1284 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1285 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1286 attributeOnlyIfTrue("unsafe_unretained",
1288 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1289 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1290 attributeOnlyIfTrue("nullability",
1292 attributeOnlyIfTrue("null_resettable",
1294 }
1295}
1296
1299 JOS.attribute("implKind", D->getPropertyImplementation() ==
1301 ? "synthesize"
1302 : "dynamic");
1303 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1304 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1305}
1306
1308 attributeOnlyIfTrue("variadic", D->isVariadic());
1309 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1310}
1311
1313 JOS.attribute("name", AE->getOpAsString());
1314}
1315
1317 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1318}
1319
1321 std::string Str;
1322 llvm::raw_string_ostream OS(Str);
1323
1324 OME->getSelector().print(OS);
1325 JOS.attribute("selector", Str);
1326
1327 switch (OME->getReceiverKind()) {
1329 JOS.attribute("receiverKind", "instance");
1330 break;
1332 JOS.attribute("receiverKind", "class");
1333 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1334 break;
1336 JOS.attribute("receiverKind", "super (instance)");
1337 JOS.attribute("superType", createQualType(OME->getSuperType()));
1338 break;
1340 JOS.attribute("receiverKind", "super (class)");
1341 JOS.attribute("superType", createQualType(OME->getSuperType()));
1342 break;
1343 }
1344
1345 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1346 if (OME->getType() != CallReturnTy)
1347 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1348}
1349
1351 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1352 std::string Str;
1353 llvm::raw_string_ostream OS(Str);
1354
1355 MD->getSelector().print(OS);
1356 JOS.attribute("selector", Str);
1357 }
1358}
1359
1361 std::string Str;
1362 llvm::raw_string_ostream OS(Str);
1363
1364 OSE->getSelector().print(OS);
1365 JOS.attribute("selector", Str);
1366}
1367
1369 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1370}
1371
1373 if (OPRE->isImplicitProperty()) {
1374 JOS.attribute("propertyKind", "implicit");
1375 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1376 JOS.attribute("getter", createBareDeclRef(MD));
1377 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1378 JOS.attribute("setter", createBareDeclRef(MD));
1379 } else {
1380 JOS.attribute("propertyKind", "explicit");
1381 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1382 }
1383
1384 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1385 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1386 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1387}
1388
1390 const ObjCSubscriptRefExpr *OSRE) {
1391 JOS.attribute("subscriptKind",
1392 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1393
1394 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1395 JOS.attribute("getter", createBareDeclRef(MD));
1396 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1397 JOS.attribute("setter", createBareDeclRef(MD));
1398}
1399
1401 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1402 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1403 JOS.attribute("isArrow", OIRE->isArrow());
1404}
1405
1407 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1408}
1409
1411 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1412 if (DRE->getDecl() != DRE->getFoundDecl())
1413 JOS.attribute("foundReferencedDecl",
1414 createBareDeclRef(DRE->getFoundDecl()));
1415 switch (DRE->isNonOdrUse()) {
1416 case NOUR_None: break;
1417 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1418 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1419 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1420 }
1421 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1422}
1423
1425 const SYCLUniqueStableNameExpr *E) {
1426 JOS.attribute("typeSourceInfo",
1427 createQualType(E->getTypeSourceInfo()->getType()));
1428}
1429
1432
1435
1439
1441 JOS.attribute("isPostfix", UO->isPostfix());
1442 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1443 if (!UO->canOverflow())
1444 JOS.attribute("canOverflow", false);
1445}
1446
1448 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1449}
1450
1452 const CompoundAssignOperator *CAO) {
1454 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1455 JOS.attribute("computeResultType",
1456 createQualType(CAO->getComputationResultType()));
1457}
1458
1460 // Note, we always write this Boolean field because the information it conveys
1461 // is critical to understanding the AST node.
1462 ValueDecl *VD = ME->getMemberDecl();
1463 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1464 JOS.attribute("isArrow", ME->isArrow());
1465 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1466 switch (ME->isNonOdrUse()) {
1467 case NOUR_None: break;
1468 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1469 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1470 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1471 }
1472}
1473
1475 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1476 attributeOnlyIfTrue("isArray", NE->isArray());
1477 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1478 switch (NE->getInitializationStyle()) {
1480 break;
1482 JOS.attribute("initStyle", "call");
1483 break;
1485 JOS.attribute("initStyle", "list");
1486 break;
1487 }
1488 if (const FunctionDecl *FD = NE->getOperatorNew())
1489 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1490 if (const FunctionDecl *FD = NE->getOperatorDelete())
1491 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1492}
1494 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1495 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1496 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1497 if (const FunctionDecl *FD = DE->getOperatorDelete())
1498 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1499}
1500
1502 attributeOnlyIfTrue("implicit", TE->isImplicit());
1503}
1504
1506 JOS.attribute("castKind", CE->getCastKindName());
1507 llvm::json::Array Path = createCastPath(CE);
1508 if (!Path.empty())
1509 JOS.attribute("path", std::move(Path));
1510 // FIXME: This may not be useful information as it can be obtusely gleaned
1511 // from the inner[] array.
1512 if (const NamedDecl *ND = CE->getConversionFunction())
1513 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1514}
1515
1517 VisitCastExpr(ICE);
1518 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1519}
1520
1522 attributeOnlyIfTrue("adl", CE->usesADL());
1523}
1524
1526 const UnaryExprOrTypeTraitExpr *TTE) {
1527 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1528 if (TTE->isArgumentType())
1529 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1530}
1531
1535
1537 const UnresolvedLookupExpr *ULE) {
1538 JOS.attribute("usesADL", ULE->requiresADL());
1539 JOS.attribute("name", ULE->getName().getAsString());
1540
1541 JOS.attributeArray("lookups", [this, ULE] {
1542 for (const NamedDecl *D : ULE->decls())
1543 JOS.value(createBareDeclRef(D));
1544 });
1545}
1546
1548 JOS.attribute("name", ALE->getLabel()->getName());
1549 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1550}
1551
1553 if (CTE->isTypeOperand()) {
1554 QualType Adjusted = CTE->getTypeOperand(Ctx);
1555 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1556 JOS.attribute("typeArg", createQualType(Unadjusted));
1557 if (Adjusted != Unadjusted)
1558 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1559 }
1560}
1561
1566
1568 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1569 JOS.attribute("field", createBareDeclRef(FD));
1570}
1571
1573 const GenericSelectionExpr *GSE) {
1574 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1575}
1576
1578 const CXXUnresolvedConstructExpr *UCE) {
1579 if (UCE->getType() != UCE->getTypeAsWritten())
1580 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1581 attributeOnlyIfTrue("list", UCE->isListInitialization());
1582}
1583
1585 CXXConstructorDecl *Ctor = CE->getConstructor();
1586 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1587 attributeOnlyIfTrue("elidable", CE->isElidable());
1588 attributeOnlyIfTrue("list", CE->isListInitialization());
1589 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1590 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1591 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1592 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1593
1594 switch (CE->getConstructionKind()) {
1596 JOS.attribute("constructionKind", "complete");
1597 break;
1599 JOS.attribute("constructionKind", "delegating");
1600 break;
1602 JOS.attribute("constructionKind", "non-virtual base");
1603 break;
1605 JOS.attribute("constructionKind", "virtual base");
1606 break;
1607 }
1608}
1609
1611 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1613 if (EWC->getNumObjects()) {
1614 JOS.attributeArray("cleanups", [this, EWC] {
1615 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1616 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1617 JOS.value(createBareDeclRef(BD));
1618 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1619 llvm::json::Object Obj;
1620 Obj["id"] = createPointerRepresentation(CLE);
1621 Obj["kind"] = CLE->getStmtClassName();
1622 JOS.value(std::move(Obj));
1623 } else {
1624 llvm_unreachable("unexpected cleanup object type");
1625 }
1626 });
1627 }
1628}
1629
1631 const CXXBindTemporaryExpr *BTE) {
1632 const CXXTemporary *Temp = BTE->getTemporary();
1633 JOS.attribute("temp", createPointerRepresentation(Temp));
1634 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1635 JOS.attribute("dtor", createBareDeclRef(Dtor));
1636}
1637
1639 const MaterializeTemporaryExpr *MTE) {
1640 if (const ValueDecl *VD = MTE->getExtendingDecl())
1641 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1642
1643 switch (MTE->getStorageDuration()) {
1644 case SD_Automatic:
1645 JOS.attribute("storageDuration", "automatic");
1646 break;
1647 case SD_Dynamic:
1648 JOS.attribute("storageDuration", "dynamic");
1649 break;
1650 case SD_FullExpression:
1651 JOS.attribute("storageDuration", "full expression");
1652 break;
1653 case SD_Static:
1654 JOS.attribute("storageDuration", "static");
1655 break;
1656 case SD_Thread:
1657 JOS.attribute("storageDuration", "thread");
1658 break;
1659 }
1660
1661 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1662}
1663
1665 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1666}
1667
1669 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1670}
1671
1673 JOS.attribute("hasExplicitParameters", LE->hasExplicitParameters());
1674}
1675
1677 const CXXDependentScopeMemberExpr *DSME) {
1678 JOS.attribute("isArrow", DSME->isArrow());
1679 JOS.attribute("member", DSME->getMember().getAsString());
1680 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1681 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1682 DSME->hasExplicitTemplateArgs());
1683
1684 if (DSME->getNumTemplateArgs()) {
1685 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1686 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1687 JOS.object(
1688 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1689 });
1690 }
1691}
1692
1694 if (!RE->isValueDependent())
1695 JOS.attribute("satisfied", RE->isSatisfied());
1696}
1697
1699 llvm::SmallString<16> Buffer;
1700 IL->getValue().toString(Buffer,
1701 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1702 JOS.attribute("value", Buffer);
1703}
1705 // FIXME: This should probably print the character literal as a string,
1706 // rather than as a numerical value. It would be nice if the behavior matched
1707 // what we do to print a string literal; right now, it is impossible to tell
1708 // the difference between 'a' and L'a' in C from the JSON output.
1709 JOS.attribute("value", CL->getValue());
1710}
1712 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1713}
1715 llvm::SmallString<16> Buffer;
1716 FL->getValue().toString(Buffer);
1717 JOS.attribute("value", Buffer);
1718}
1720 std::string Buffer;
1721 llvm::raw_string_ostream SS(Buffer);
1722 SL->outputString(SS);
1723 JOS.attribute("value", Buffer);
1724}
1726 JOS.attribute("value", BLE->getValue());
1727}
1728
1730 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1731 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1732 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1733 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1734 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1735 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1736}
1737
1739 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1740 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1741}
1743 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1744}
1745
1747 JOS.attribute("name", LS->getName());
1748 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1749 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1750}
1751
1753 if (LS->hasLabelTarget())
1754 JOS.attribute("targetLabelDeclId",
1755 createPointerRepresentation(LS->getLabelDecl()));
1756}
1757
1759 JOS.attribute("targetLabelDeclId",
1760 createPointerRepresentation(GS->getLabel()));
1761}
1762
1764 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1765}
1766
1768 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1769 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1770 // null child node and ObjC gets no child node.
1771 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1772}
1773
1775 JOS.attribute("isNull", true);
1776}
1778 JOS.attribute("type", createQualType(TA.getAsType()));
1779}
1781 const TemplateArgument &TA) {
1782 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1783}
1785 JOS.attribute("isNullptr", true);
1786}
1788 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1789}
1795 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1796 // the output format.
1797}
1799 const TemplateArgument &TA) {
1800 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1801 // the output format.
1802}
1804 const TemplateArgument &TA) {
1805 JOS.attribute("isExpr", true);
1806 if (TA.isCanonicalExpr())
1807 JOS.attribute("isCanonical", true);
1808}
1810 JOS.attribute("isPack", true);
1811}
1812
1813StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1814 if (Traits)
1815 return Traits->getCommandInfo(CommandID)->Name;
1816 if (const comments::CommandInfo *Info =
1818 return Info->Name;
1819 return "<invalid>";
1820}
1821
1823 const comments::FullComment *) {
1824 JOS.attribute("text", C->getText());
1825}
1826
1829 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1830
1831 switch (C->getRenderKind()) {
1833 JOS.attribute("renderKind", "normal");
1834 break;
1836 JOS.attribute("renderKind", "bold");
1837 break;
1839 JOS.attribute("renderKind", "emphasized");
1840 break;
1842 JOS.attribute("renderKind", "monospaced");
1843 break;
1845 JOS.attribute("renderKind", "anchor");
1846 break;
1847 }
1848
1849 llvm::json::Array Args;
1850 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1851 Args.push_back(C->getArgText(I));
1852
1853 if (!Args.empty())
1854 JOS.attribute("args", std::move(Args));
1855}
1856
1859 JOS.attribute("name", C->getTagName());
1860 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1861 attributeOnlyIfTrue("malformed", C->isMalformed());
1862
1863 llvm::json::Array Attrs;
1864 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1865 Attrs.push_back(
1866 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1867
1868 if (!Attrs.empty())
1869 JOS.attribute("attrs", std::move(Attrs));
1870}
1871
1874 JOS.attribute("name", C->getTagName());
1875}
1876
1879 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1880
1881 llvm::json::Array Args;
1882 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1883 Args.push_back(C->getArgText(I));
1884
1885 if (!Args.empty())
1886 JOS.attribute("args", std::move(Args));
1887}
1888
1891 switch (C->getDirection()) {
1893 JOS.attribute("direction", "in");
1894 break;
1896 JOS.attribute("direction", "out");
1897 break;
1899 JOS.attribute("direction", "in,out");
1900 break;
1901 }
1902 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1903
1904 if (C->hasParamName())
1905 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1906 : C->getParamNameAsWritten());
1907
1908 if (C->isParamIndexValid() && !C->isVarArgParam())
1909 JOS.attribute("paramIdx", C->getParamIndex());
1910}
1911
1914 if (C->hasParamName())
1915 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1916 : C->getParamNameAsWritten());
1917 if (C->isPositionValid()) {
1918 llvm::json::Array Positions;
1919 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1920 Positions.push_back(C->getIndex(I));
1921
1922 if (!Positions.empty())
1923 JOS.attribute("positions", std::move(Positions));
1924 }
1925}
1926
1929 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1930 JOS.attribute("closeName", C->getCloseName());
1931}
1932
1935 const comments::FullComment *) {
1936 JOS.attribute("text", C->getText());
1937}
1938
1941 JOS.attribute("text", C->getText());
1942}
1943
1944llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1945 llvm::json::Object Ret;
1946#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1947 if (FPO.has##NAME##Override()) \
1948 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1949#include "clang/Basic/FPOptions.def"
1950 return Ret;
1951}
1952
1954 VisitStmt(S);
1955 if (S->hasStoredFPFeatures())
1956 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1957}
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:881
Represents an access specifier followed by colon ':'.
Definition DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4594
LabelDecl * getLabel() const
Definition Expr.h:4617
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:6978
StringRef getOpAsString() const
Definition Expr.h:7042
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:4082
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:2164
Opcode getOpcode() const
Definition Expr.h:4127
A class which contains all the information about a particular captured value.
Definition Decl.h:4813
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4807
bool capturesCXXThis() const
Definition Decl.h:4939
bool isVariadic() const
Definition Decl.h:4882
Represents a base class of a C++ class.
Definition DeclCXX.h:146
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
Definition DeclCXX.h:242
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition DeclCXX.h:203
QualType getType() const
Retrieves the type of the base class.
Definition DeclCXX.h:249
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
Definition DeclCXX.h:210
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
Definition DeclCXX.h:230
Represents binding an expression to a temporary.
Definition ExprCXX.h:1497
CXXTemporary * getTemporary()
Definition ExprCXX.h:1515
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:727
bool getValue() const
Definition ExprCXX.h:744
Represents a call to a C++ constructor.
Definition ExprCXX.h:1552
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1621
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1626
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1645
bool isImmediateEscalating() const
Definition ExprCXX.h:1710
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1654
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1615
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1634
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1663
Represents a C++ constructor within a class.
Definition DeclCXX.h:2641
Represents a C++ base or member initializer.
Definition DeclCXX.h:2406
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1274
bool hasRewrittenInit() const
Definition ExprCXX.h:1319
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1381
bool hasRewrittenInit() const
Definition ExprCXX.h:1410
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2630
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2669
bool isArrayForm() const
Definition ExprCXX.h:2656
bool isGlobalDelete() const
Definition ExprCXX.h:2655
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2657
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3923
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:4022
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4117
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4096
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4061
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4092
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4124
Represents a C++ destructor within a class.
Definition DeclCXX.h:2906
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2359
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
base_class_range bases()
Definition DeclCXX.h:608
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition DeclCXX.h:602
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
Definition DeclCXX.cpp:2087
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition DeclCXX.h:909
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition DeclCXX.h:1022
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition DeclCXX.h:811
Represents a C++ temporary.
Definition ExprCXX.h:1463
const CXXDestructorDecl * getDestructor() const
Definition ExprCXX.h:1474
Represents the this expression in C++.
Definition ExprCXX.h:1158
bool isImplicit() const
Definition ExprCXX.h:1181
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:852
bool isTypeOperand() const
Definition ExprCXX.h:888
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition ExprCXX.cpp:167
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:895
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3797
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3852
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3831
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2987
bool usesADL() const
Definition Expr.h:3144
CaseStmt - Represent a case statement.
Definition Stmt.h:1932
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1995
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3720
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition Expr.cpp:2032
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1981
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4344
QualType getComputationLHSType() const
Definition Expr.h:4378
QualType getComputationResultType() const
Definition Expr.h:4381
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1752
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1802
bool hasStoredFPFeatures() const
Definition Stmt.h:1799
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
TemplateName 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:1102
APValue getAPValueResult() const
Definition Expr.cpp:419
APValue::ValueKind getResultAPValueKind() const
Definition Expr.h:1168
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1290
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1401
ValueDecl * getDecl()
Definition Expr.h:1358
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1488
bool isImmediateEscalating() const
Definition Expr.h:1498
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:3558
Represents an enum.
Definition Decl.h:4146
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4364
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4367
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4373
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4319
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5203
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:3714
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3749
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3738
unsigned getNumObjects() const
Definition ExprCXX.h:3742
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3720
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:178
QualType getType() const
Definition Expr.h:145
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
Definition Decl.h:3295
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3395
bool isBitField() const
Determines whether this field is a bitfield.
Definition Decl.h:3398
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition Decl.h:3475
std::string getValueAsString(unsigned Radix) const
Definition Expr.cpp:1016
llvm::APFloat getValue() const
Definition Expr.h:1686
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:2059
bool isImmediateFunction() const
Definition Decl.cpp:3384
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2889
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:4305
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3121
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2667
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:3019
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition Decl.h:2597
bool isDeletedAsWritten() const
Definition Decl.h:2671
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2480
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2512
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2471
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:3030
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:3740
Represents a C11 generic selection.
Definition Expr.h:6232
AssociationTy< true > ConstAssociation
Definition Expr.h:6466
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6486
GotoStmt - This represents a direct goto.
Definition Stmt.h:2981
LabelDecl * getLabel() const
Definition Stmt.h:2994
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5329
bool isCBuffer() const
Definition Decl.h:5373
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:2271
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2346
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2343
bool isConstexpr() const
Definition Stmt.h:2464
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2340
bool isNegatedConsteval() const
Definition Stmt.h:2460
bool isConsteval() const
Definition Stmt.h:2451
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3897
bool isPartOfExplicitCast() const
Definition Expr.h:3928
Describes an C or C++ initializer list.
Definition Expr.h:5352
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5479
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:2158
LabelDecl * getDecl() const
Definition Stmt.h:2176
bool isSideEntry() const
Definition Stmt.h:2205
const char * getName() const
Definition Stmt.cpp:437
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1972
static unsigned MeasureTokenLength(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
MeasureTokenLength - Relex the token at the specified location and return its length in bytes in the ...
Definition Lexer.cpp:509
Represents a linkage specification.
Definition DeclCXX.h:3044
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3067
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition DeclCXX.h:3078
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3069
LabelDecl * getLabelDecl()
Definition Stmt.h:3107
bool hasLabelTarget() const
Definition Stmt.h:3102
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6299
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6314
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4973
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4998
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:5042
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:5023
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3408
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3491
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3632
bool isArrow() const
Definition Expr.h:3592
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:275
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:302
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:341
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:318
Represents a C++ namespace alias.
Definition DeclCXX.h:3230
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3323
Represent a C++ namespace.
Definition Decl.h:593
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:649
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition Decl.h:658
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:118
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:158
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:180
ObjCCategoryDecl - Represents a category declaration.
Definition DeclObjC.h:2335
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
Definition DeclObjC.h:2378
protocol_range protocols() const
Definition DeclObjC.h:2409
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition DeclObjC.h:2551
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition DeclObjC.h:2781
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2799
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:440
QualType getEncodedType() const
Definition ExprObjC.h:459
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2492
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition DeclObjC.h:2603
const ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.h:2741
Represents an ObjC class declaration.
Definition DeclObjC.h:1160
protocol_range protocols() const
Definition DeclObjC.h:1365
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.cpp:349
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
Definition TypeBase.h:8063
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:581
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:611
bool isArrow() const
Definition ExprObjC.h:619
bool isFreeIvar() const
Definition ExprObjC.h:620
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:972
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:986
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:980
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:983
@ Class
The receiver is a class.
Definition ExprObjC.h:977
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1319
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1376
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1261
ObjCMethodDecl - Represents an instance or class method declaration.
Definition DeclObjC.h:140
bool isVariadic() const
Definition DeclObjC.h:434
bool isInstanceMethod() const
Definition DeclObjC.h:429
QualType getReturnType() const
Definition DeclObjC.h:332
Represents one property declaration in an Objective-C interface.
Definition DeclObjC.h:734
ObjCMethodDecl * getGetterMethodDecl() const
Definition DeclObjC.h:907
ObjCMethodDecl * getSetterMethodDecl() const
Definition DeclObjC.h:910
QualType getType() const
Definition DeclObjC.h:810
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition DeclObjC.h:821
PropertyControl getPropertyImplementation() const
Definition DeclObjC.h:918
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition DeclObjC.h:2811
ObjCIvarDecl * getPropertyIvarDecl() const
Definition DeclObjC.h:2885
Kind getPropertyImplementation() const
Definition DeclObjC.h:2881
ObjCPropertyDecl * getPropertyDecl() const
Definition DeclObjC.h:2876
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:649
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:768
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:738
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:775
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:743
bool isImplicitProperty() const
Definition ExprObjC.h:735
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:748
bool isSuperReceiver() const
Definition ExprObjC.h:803
Represents an Objective-C protocol declaration.
Definition DeclObjC.h:2090
protocol_range protocols() const
Definition DeclObjC.h:2167
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:537
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:554
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:485
Selector getSelector() const
Definition ExprObjC.h:499
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:871
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:924
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:916
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:920
Represents the declaration of an Objective-C type parameter.
Definition DeclObjC.h:581
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition DeclObjC.h:643
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition DeclObjC.h:626
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2134
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3241
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3252
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2049
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2084
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:8522
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4460
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:2187
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:4494
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4562
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:1819
void outputString(raw_ostream &OS) const
Prints the contents of the string to OS.
Definition Expr.cpp:1215
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2521
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2582
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2579
StringRef getKindName() const
Definition Decl.h:4048
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3953
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.
TemplateDecl * getAsTemplateDecl(bool IgnoreDeduced=false) const
Retrieve the underlying template declaration that this template name refers to, if known.
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:3823
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:8472
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8483
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:3509
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9337
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3802
QualType getUnderlyingType() const
Definition Decl.h:3752
TypedefNameDecl * getDecl() const
Definition TypeBase.h:6265
QualType desugar() const
Definition Type.cpp:4209
bool typeMatchesDecl() const
Definition TypeBase.h:6273
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2669
QualType getArgumentType() const
Definition Expr.h:2712
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2701
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2288
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2358
Opcode getOpcode() const
Definition Expr.h:2324
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1434
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2342
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3372
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3441
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:6136
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6168
Represents a C++ using-declaration.
Definition DeclCXX.h:3620
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3657
Represents C++ using-directive.
Definition DeclCXX.h:3125
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3357
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3821
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3863
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3428
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3492
UsingShadowDecl * getDecl() const
Definition TypeBase.h:6208
QualType desugar() const
Definition TypeBase.h:6210
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:713
QualType getType() const
Definition Decl.h:724
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition Decl.cpp:5657
Represents a variable declaration or definition.
Definition Decl.h:933
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1594
TLSKind getTLSKind() const
Definition Decl.cpp:2150
bool hasInit() const
Definition Decl.cpp:2380
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition Decl.h:1491
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition Decl.cpp:2103
@ ListInit
Direct list-initialization (C++11)
Definition Decl.h:944
@ CInit
C-style initialization with assignment.
Definition Decl.h:938
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:947
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:941
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
Definition Decl.cpp:2699
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition Decl.h:1537
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1576
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:956
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:959
@ TLS_None
Not a TLS variable.
Definition Decl.h:953
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1175
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:2709
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2759
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:288
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:845
@ Parens
New-expression has a C++98 paren-delimited initializer.
Definition ExprCXX.h:2249
@ None
New-expression has no initializer as written.
Definition ExprCXX.h:2246
@ Braces
New-expression has a C++11 list-initializer.
Definition ExprCXX.h:2252
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition Specifiers.h:184
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition Specifiers.h:178
@ NOUR_None
This is an odr-use.
Definition Specifiers.h:176
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition Specifiers.h:181
unsigned long uint64_t
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition TypeBase.h: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.