clang 22.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",
84 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
85 attributeOnlyIfTrue("containsUnexpandedPack",
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
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",
233}
234
236 std::string Str;
237 llvm::raw_string_ostream OS(Str);
238 Value.printPretty(OS, Ctx, Ty);
239 JOS.attribute("value", Str);
240}
241
243 JOS.attribute("kind", "ConceptReference");
244 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
245 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
246 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
247 for (const TemplateArgumentLoc &TAL : Args->arguments())
248 JOS.object(
249 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
250 });
251 }
252 JOS.attributeObject("loc",
253 [CR, this] { writeSourceLocation(CR->getLocation()); });
254 JOS.attributeObject("range",
255 [CR, this] { writeSourceRange(CR->getSourceRange()); });
256}
257
258void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
259 if (Loc.isInvalid())
260 return;
261
262 JOS.attributeBegin("includedFrom");
263 JOS.objectBegin();
264
265 if (!JustFirst) {
266 // Walk the stack recursively, then print out the presumed location.
267 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
268 }
269
270 JOS.attribute("file", Loc.getFilename());
271 JOS.objectEnd();
272 JOS.attributeEnd();
273}
274
275void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc,
276 bool IsSpelling) {
277 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
278 unsigned ActualLine = IsSpelling ? SM.getSpellingLineNumber(Loc)
280 StringRef ActualFile = SM.getBufferName(Loc);
281
282 if (Presumed.isValid()) {
283 JOS.attribute("offset", SM.getDecomposedLoc(Loc).second);
284 if (LastLocFilename != ActualFile) {
285 JOS.attribute("file", ActualFile);
286 JOS.attribute("line", ActualLine);
287 } else if (LastLocLine != ActualLine)
288 JOS.attribute("line", ActualLine);
289
290 StringRef PresumedFile = Presumed.getFilename();
291 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
292 JOS.attribute("presumedFile", PresumedFile);
293
294 unsigned PresumedLine = Presumed.getLine();
295 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
296 JOS.attribute("presumedLine", PresumedLine);
297
298 JOS.attribute("col", Presumed.getColumn());
299 JOS.attribute("tokLen",
301 LastLocFilename = ActualFile;
302 LastLocPresumedFilename = PresumedFile;
303 LastLocPresumedLine = PresumedLine;
304 LastLocLine = ActualLine;
305
306 // Orthogonal to the file, line, and column de-duplication is whether the
307 // given location was a result of an include. If so, print where the
308 // include location came from.
309 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
310 /*JustFirst*/ true);
311 }
312}
313
314void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
315 SourceLocation Spelling = SM.getSpellingLoc(Loc);
316 SourceLocation Expansion = SM.getExpansionLoc(Loc);
317
318 if (Expansion != Spelling) {
319 // If the expansion and the spelling are different, output subobjects
320 // describing both locations.
321 JOS.attributeObject("spellingLoc", [Spelling, this] {
322 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
323 });
324 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
325 writeBareSourceLocation(Expansion, /*IsSpelling*/ false);
326 // If there is a macro expansion, add extra information if the interesting
327 // bit is the macro arg expansion.
328 if (SM.isMacroArgExpansion(Loc))
329 JOS.attribute("isMacroArgExpansion", true);
330 });
331 } else
332 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
333}
334
335void JSONNodeDumper::writeSourceRange(SourceRange R) {
336 JOS.attributeObject("begin",
337 [R, this] { writeSourceLocation(R.getBegin()); });
338 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
339}
340
341std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
342 // Because JSON stores integer values as signed 64-bit integers, trying to
343 // represent them as such makes for very ugly pointer values in the resulting
344 // output. Instead, we convert the value to hex and treat it as a string.
345 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
346}
347
348llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
349 SplitQualType SQT = QT.split();
350 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
351 llvm::json::Object Ret{{"qualType", SQTS}};
352
353 if (Desugar && !QT.isNull()) {
355 if (DSQT != SQT) {
356 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
357 if (DSQTS != SQTS)
358 Ret["desugaredQualType"] = DSQTS;
359 }
360 if (const auto *TT = QT->getAs<TypedefType>())
361 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
362 }
363 return Ret;
364}
365
366void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
367 JOS.attribute("id", createPointerRepresentation(D));
368 if (!D)
369 return;
370
371 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
372 if (const auto *ND = dyn_cast<NamedDecl>(D))
373 JOS.attribute("name", ND->getDeclName().getAsString());
374 if (const auto *VD = dyn_cast<ValueDecl>(D))
375 JOS.attribute("type", createQualType(VD->getType()));
376}
377
378llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
379 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
380 if (!D)
381 return Ret;
382
383 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
384 if (const auto *ND = dyn_cast<NamedDecl>(D))
385 Ret["name"] = ND->getDeclName().getAsString();
386 if (const auto *VD = dyn_cast<ValueDecl>(D))
387 Ret["type"] = createQualType(VD->getType());
388 return Ret;
389}
390
391llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
392 llvm::json::Array Ret;
393 if (C->path_empty())
394 return Ret;
395
396 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
397 const CXXBaseSpecifier *Base = *I;
398 const auto *RD = cast<CXXRecordDecl>(
399 Base->getType()->castAsCanonical<RecordType>()->getOriginalDecl());
400
401 llvm::json::Object Val{{"name", RD->getName()}};
402 if (Base->isVirtual())
403 Val["isVirtual"] = true;
404 Ret.push_back(std::move(Val));
405 }
406 return Ret;
407}
408
409#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
410#define FIELD1(Flag) FIELD2(#Flag, Flag)
411
412static llvm::json::Object
414 llvm::json::Object Ret;
415
416 FIELD2("exists", hasDefaultConstructor);
417 FIELD2("trivial", hasTrivialDefaultConstructor);
418 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
419 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
420 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
421 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
422 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
423
424 return Ret;
425}
426
427static llvm::json::Object
429 llvm::json::Object Ret;
430
431 FIELD2("simple", hasSimpleCopyConstructor);
432 FIELD2("trivial", hasTrivialCopyConstructor);
433 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
434 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
435 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
436 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
437 FIELD2("needsImplicit", needsImplicitCopyConstructor);
438 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
440 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
441
442 return Ret;
443}
444
445static llvm::json::Object
447 llvm::json::Object Ret;
448
449 FIELD2("exists", hasMoveConstructor);
450 FIELD2("simple", hasSimpleMoveConstructor);
451 FIELD2("trivial", hasTrivialMoveConstructor);
452 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
453 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
454 FIELD2("needsImplicit", needsImplicitMoveConstructor);
455 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
457 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
458
459 return Ret;
460}
461
462static llvm::json::Object
464 llvm::json::Object Ret;
465
466 FIELD2("simple", hasSimpleCopyAssignment);
467 FIELD2("trivial", hasTrivialCopyAssignment);
468 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
469 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
470 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
471 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
472 FIELD2("needsImplicit", needsImplicitCopyAssignment);
473 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
474
475 return Ret;
476}
477
478static llvm::json::Object
480 llvm::json::Object Ret;
481
482 FIELD2("exists", hasMoveAssignment);
483 FIELD2("simple", hasSimpleMoveAssignment);
484 FIELD2("trivial", hasTrivialMoveAssignment);
485 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
486 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
487 FIELD2("needsImplicit", needsImplicitMoveAssignment);
488 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
489
490 return Ret;
491}
492
493static llvm::json::Object
495 llvm::json::Object Ret;
496
497 FIELD2("simple", hasSimpleDestructor);
498 FIELD2("irrelevant", hasIrrelevantDestructor);
499 FIELD2("trivial", hasTrivialDestructor);
500 FIELD2("nonTrivial", hasNonTrivialDestructor);
501 FIELD2("userDeclared", hasUserDeclaredDestructor);
502 FIELD2("needsImplicit", needsImplicitDestructor);
503 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
505 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
506
507 return Ret;
508}
509
510llvm::json::Object
511JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
512 llvm::json::Object Ret;
513
514 // This data is common to all C++ classes.
515 FIELD1(isGenericLambda);
516 FIELD1(isLambda);
517 FIELD1(isEmpty);
518 FIELD1(isAggregate);
519 FIELD1(isStandardLayout);
520 FIELD1(isTriviallyCopyable);
521 FIELD1(isPOD);
523 FIELD1(isPolymorphic);
524 FIELD1(isAbstract);
525 FIELD1(isLiteral);
527 FIELD1(hasUserDeclaredConstructor);
528 FIELD1(hasConstexprNonCopyMoveConstructor);
529 FIELD1(hasMutableFields);
530 FIELD1(hasVariantMembers);
531 FIELD2("canConstDefaultInit", allowConstDefaultInit);
532
533 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
536 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
537 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
539
540 return Ret;
541}
542
543#undef FIELD1
544#undef FIELD2
545
546std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
547 const auto AccessSpelling = getAccessSpelling(AS);
548 if (AccessSpelling.empty())
549 return "none";
550 return AccessSpelling.str();
551}
552
553llvm::json::Object
554JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
555 llvm::json::Object Ret;
556
557 Ret["type"] = createQualType(BS.getType());
558 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
559 Ret["writtenAccess"] =
560 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
561 if (BS.isVirtual())
562 Ret["isVirtual"] = true;
563 if (BS.isPackExpansion())
564 Ret["isPackExpansion"] = true;
565
566 return Ret;
567}
568
569void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
570 JOS.attribute("aliasee", AA->getAliasee());
571}
572
573void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
574 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
575}
576
577void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
578 if (!DA->getMessage().empty())
579 JOS.attribute("message", DA->getMessage());
580 if (!DA->getReplacement().empty())
581 JOS.attribute("replacement", DA->getReplacement());
582}
583
584void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
585 if (!UA->getMessage().empty())
586 JOS.attribute("message", UA->getMessage());
587}
588
589void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
590 JOS.attribute("section_name", SA->getName());
591}
592
593void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
594 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
595 VA->getVisibility()));
596}
597
598void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
599 JOS.attribute("tls_model", TA->getModel());
600}
601
603 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
604 if (!TT->typeMatchesDecl())
605 JOS.attribute("type", createQualType(TT->desugar()));
606}
607
609 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
610 JOS.attribute("type", createQualType(TT->desugar()));
611}
612
615 attributeOnlyIfTrue("noreturn", E.getNoReturn());
616 attributeOnlyIfTrue("producesResult", E.getProducesResult());
617 if (E.getHasRegParm())
618 JOS.attribute("regParm", E.getRegParm());
619 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
620}
621
624 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
625 attributeOnlyIfTrue("const", T->isConst());
626 attributeOnlyIfTrue("volatile", T->isVolatile());
627 attributeOnlyIfTrue("restrict", T->isRestrict());
628 attributeOnlyIfTrue("variadic", E.Variadic);
629 switch (E.RefQualifier) {
630 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
631 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
632 case RQ_None: break;
633 }
634 switch (E.ExceptionSpec.Type) {
635 case EST_DynamicNone:
636 case EST_Dynamic: {
637 JOS.attribute("exceptionSpec", "throw");
638 llvm::json::Array Types;
639 for (QualType QT : E.ExceptionSpec.Exceptions)
640 Types.push_back(createQualType(QT));
641 JOS.attribute("exceptionTypes", std::move(Types));
642 } break;
643 case EST_MSAny:
644 JOS.attribute("exceptionSpec", "throw");
645 JOS.attribute("throwsAny", true);
646 break;
648 JOS.attribute("exceptionSpec", "noexcept");
649 break;
650 case EST_NoexceptTrue:
652 JOS.attribute("exceptionSpec", "noexcept");
653 JOS.attribute("conditionEvaluatesTo",
654 E.ExceptionSpec.Type == EST_NoexceptTrue);
655 //JOS.attributeWithCall("exceptionSpecExpr",
656 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
657 break;
658 case EST_NoThrow:
659 JOS.attribute("exceptionSpec", "nothrow");
660 break;
661 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
662 // suspect you can only run into them when executing an AST dump from within
663 // the debugger, which is not a use case we worry about for the JSON dumping
664 // feature.
666 case EST_Unevaluated:
668 case EST_Unparsed:
669 case EST_None: break;
670 }
672}
673
675 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
676}
677
679 switch (AT->getSizeModifier()) {
681 JOS.attribute("sizeModifier", "*");
682 break;
684 JOS.attribute("sizeModifier", "static");
685 break;
687 break;
688 }
689
690 std::string Str = AT->getIndexTypeQualifiers().getAsString();
691 if (!Str.empty())
692 JOS.attribute("indexTypeQualifiers", Str);
693}
694
696 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
697 // narrowing conversion to int64_t so it cannot be expressed.
698 JOS.attribute("size", CAT->getSExtSize());
699 VisitArrayType(CAT);
700}
701
703 const DependentSizedExtVectorType *VT) {
704 JOS.attributeObject(
705 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
706}
707
709 JOS.attribute("numElements", VT->getNumElements());
710 switch (VT->getVectorKind()) {
712 break;
714 JOS.attribute("vectorKind", "altivec");
715 break;
717 JOS.attribute("vectorKind", "altivec pixel");
718 break;
720 JOS.attribute("vectorKind", "altivec bool");
721 break;
722 case VectorKind::Neon:
723 JOS.attribute("vectorKind", "neon");
724 break;
726 JOS.attribute("vectorKind", "neon poly");
727 break;
729 JOS.attribute("vectorKind", "fixed-length sve data vector");
730 break;
732 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
733 break;
735 JOS.attribute("vectorKind", "fixed-length rvv data vector");
736 break;
741 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
742 break;
743 }
744}
745
747 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
748}
749
751 switch (UTT->getUTTKind()) {
752#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
753 case UnaryTransformType::Enum: \
754 JOS.attribute("transformKind", #Trait); \
755 break;
756#include "clang/Basic/TransformTypeTraits.def"
757 }
758}
759
761 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
762 std::string Str;
763 llvm::raw_string_ostream OS(Str);
764 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
765 JOS.attribute("qualifier", Str);
766 }
767 JOS.attribute("decl", createBareDeclRef(TT->getOriginalDecl()));
768 if (TT->isTagOwned())
769 JOS.attribute("isTagOwned", true);
770}
771
773 const TemplateTypeParmType *TTPT) {
774 JOS.attribute("depth", TTPT->getDepth());
775 JOS.attribute("index", TTPT->getIndex());
776 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
777 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
778}
779
781 const SubstTemplateTypeParmType *STTPT) {
782 JOS.attribute("index", STTPT->getIndex());
783 if (auto PackIndex = STTPT->getPackIndex())
784 JOS.attribute("pack_index", *PackIndex);
785}
786
789 JOS.attribute("index", T->getIndex());
790}
791
793 JOS.attribute("undeduced", !AT->isDeduced());
794 switch (AT->getKeyword()) {
796 JOS.attribute("typeKeyword", "auto");
797 break;
799 JOS.attribute("typeKeyword", "decltype(auto)");
800 break;
802 JOS.attribute("typeKeyword", "__auto_type");
803 break;
804 }
805}
806
808 const TemplateSpecializationType *TST) {
809 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
810
811 std::string Str;
812 llvm::raw_string_ostream OS(Str);
813 TST->getTemplateName().print(OS, PrintPolicy);
814 JOS.attribute("templateName", Str);
815}
816
818 const InjectedClassNameType *ICNT) {
819 JOS.attribute("decl", createBareDeclRef(ICNT->getOriginalDecl()));
820}
821
823 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
824}
825
827 if (UnsignedOrNone N = PET->getNumExpansions())
828 JOS.attribute("numExpansions", *N);
829}
830
832 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
833}
834
836 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
837 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
838}
839
841 if (ND && ND->getDeclName()) {
842 JOS.attribute("name", ND->getNameAsString());
843 // FIXME: There are likely other contexts in which it makes no sense to ask
844 // for a mangled name.
845 if (isa<RequiresExprBodyDecl>(ND->getDeclContext()))
846 return;
847
848 // If the declaration is dependent or is in a dependent context, then the
849 // mangling is unlikely to be meaningful (and in some cases may cause
850 // "don't know how to mangle this" assertion failures.
851 if (ND->isTemplated())
852 return;
853
854 // Mangled names are not meaningful for locals, and may not be well-defined
855 // in the case of VLAs.
856 auto *VD = dyn_cast<VarDecl>(ND);
857 if (VD && VD->hasLocalStorage())
858 return;
859
860 // Do not mangle template deduction guides.
861 if (isa<CXXDeductionGuideDecl>(ND))
862 return;
863
864 std::string MangledName = ASTNameGen.getName(ND);
865 if (!MangledName.empty())
866 JOS.attribute("mangledName", MangledName);
867 }
868}
869
871 VisitNamedDecl(TD);
872 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
873}
874
876 VisitNamedDecl(TAD);
877 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
878}
879
881 VisitNamedDecl(ND);
882 attributeOnlyIfTrue("isInline", ND->isInline());
883 attributeOnlyIfTrue("isNested", ND->isNested());
884 if (!ND->isFirstDecl())
885 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
886}
887
889 JOS.attribute("nominatedNamespace",
890 createBareDeclRef(UDD->getNominatedNamespace()));
891}
892
894 VisitNamedDecl(NAD);
895 JOS.attribute("aliasedNamespace",
896 createBareDeclRef(NAD->getAliasedNamespace()));
897}
898
900 std::string Name;
901 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
902 llvm::raw_string_ostream SOS(Name);
903 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
904 }
905 Name += UD->getNameAsString();
906 JOS.attribute("name", Name);
907}
908
910 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
911}
912
914 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
915}
916
918 VisitNamedDecl(VD);
919 JOS.attribute("type", createQualType(VD->getType()));
920 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
921 attributeOnlyIfTrue("explicitObjectParameter",
922 P->isExplicitObjectParameter());
923
924 StorageClass SC = VD->getStorageClass();
925 if (SC != SC_None)
926 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
927 switch (VD->getTLSKind()) {
928 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
929 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
930 case VarDecl::TLS_None: break;
931 }
932 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
933 attributeOnlyIfTrue("inline", VD->isInline());
934 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
935 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
936 if (VD->hasInit()) {
937 switch (VD->getInitStyle()) {
938 case VarDecl::CInit: JOS.attribute("init", "c"); break;
939 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
940 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
942 JOS.attribute("init", "paren-list");
943 break;
944 }
945 }
946 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
947}
948
950 VisitNamedDecl(FD);
951 JOS.attribute("type", createQualType(FD->getType()));
952 attributeOnlyIfTrue("mutable", FD->isMutable());
953 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
954 attributeOnlyIfTrue("isBitfield", FD->isBitField());
955 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
956}
957
959 VisitNamedDecl(FD);
960 JOS.attribute("type", createQualType(FD->getType()));
961 StorageClass SC = FD->getStorageClass();
962 if (SC != SC_None)
963 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
964 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
965 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
966 attributeOnlyIfTrue("pure", FD->isPureVirtual());
967 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
968 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
969 attributeOnlyIfTrue("variadic", FD->isVariadic());
970 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
971
972 if (FD->isDefaulted())
973 JOS.attribute("explicitlyDefaulted",
974 FD->isDeleted() ? "deleted" : "default");
975
976 if (StringLiteral *Msg = FD->getDeletedMessage())
977 JOS.attribute("deletedMessage", Msg->getString());
978}
979
981 VisitNamedDecl(ED);
982 if (ED->isFixed())
983 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
984 if (ED->isScoped())
985 JOS.attribute("scopedEnumTag",
986 ED->isScopedUsingClassTag() ? "class" : "struct");
987}
989 VisitNamedDecl(ECD);
990 JOS.attribute("type", createQualType(ECD->getType()));
991}
992
994 VisitNamedDecl(RD);
995 JOS.attribute("tagUsed", RD->getKindName());
996 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
997}
999 VisitRecordDecl(RD);
1000
1001 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1002 if (CTSD->hasStrictPackMatch())
1003 JOS.attribute("strict-pack-match", true);
1004 }
1005
1006 // All other information requires a complete definition.
1007 if (!RD->isCompleteDefinition())
1008 return;
1009
1010 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1011 if (RD->getNumBases()) {
1012 JOS.attributeArray("bases", [this, RD] {
1013 for (const auto &Spec : RD->bases())
1014 JOS.value(createCXXBaseSpecifier(Spec));
1015 });
1016 }
1017}
1018
1021 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1022}
1023
1026 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1027 JOS.attribute("depth", D->getDepth());
1028 JOS.attribute("index", D->getIndex());
1029 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1030
1031 if (D->hasDefaultArgument())
1032 JOS.attributeObject("defaultArg", [=] {
1033 Visit(D->getDefaultArgument().getArgument(), SourceRange(),
1034 D->getDefaultArgStorage().getInheritedFrom(),
1035 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1036 });
1037}
1038
1040 const NonTypeTemplateParmDecl *D) {
1042 JOS.attribute("type", createQualType(D->getType()));
1043 JOS.attribute("depth", D->getDepth());
1044 JOS.attribute("index", D->getIndex());
1045 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1046
1047 if (D->hasDefaultArgument())
1048 JOS.attributeObject("defaultArg", [=] {
1049 Visit(D->getDefaultArgument().getArgument(), SourceRange(),
1050 D->getDefaultArgStorage().getInheritedFrom(),
1051 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1052 });
1053}
1054
1056 const TemplateTemplateParmDecl *D) {
1058 JOS.attribute("depth", D->getDepth());
1059 JOS.attribute("index", D->getIndex());
1060 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1061
1062 if (D->hasDefaultArgument())
1063 JOS.attributeObject("defaultArg", [=] {
1064 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1065 Visit(D->getDefaultArgument().getArgument(),
1066 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1067 InheritedFrom,
1068 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1069 });
1070}
1071
1073 StringRef Lang;
1074 switch (LSD->getLanguage()) {
1076 Lang = "C";
1077 break;
1079 Lang = "C++";
1080 break;
1081 }
1082 JOS.attribute("language", Lang);
1083 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1084}
1085
1087 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1088}
1089
1091 if (const TypeSourceInfo *T = FD->getFriendType())
1092 JOS.attribute("type", createQualType(T->getType()));
1093 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1094}
1095
1098 JOS.attribute("type", createQualType(D->getType()));
1099 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1100 switch (D->getAccessControl()) {
1101 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1102 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1103 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1104 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1105 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1106 }
1107}
1108
1111 JOS.attribute("returnType", createQualType(D->getReturnType()));
1112 JOS.attribute("instance", D->isInstanceMethod());
1113 attributeOnlyIfTrue("variadic", D->isVariadic());
1114}
1115
1118 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1119 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1120 switch (D->getVariance()) {
1122 break;
1124 JOS.attribute("variance", "covariant");
1125 break;
1127 JOS.attribute("variance", "contravariant");
1128 break;
1129 }
1130}
1131
1134 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1135 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1136
1137 llvm::json::Array Protocols;
1138 for (const auto* P : D->protocols())
1139 Protocols.push_back(createBareDeclRef(P));
1140 if (!Protocols.empty())
1141 JOS.attribute("protocols", std::move(Protocols));
1142}
1143
1146 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1147 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1148}
1149
1152
1153 llvm::json::Array Protocols;
1154 for (const auto *P : D->protocols())
1155 Protocols.push_back(createBareDeclRef(P));
1156 if (!Protocols.empty())
1157 JOS.attribute("protocols", std::move(Protocols));
1158}
1159
1162 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1163 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1164
1165 llvm::json::Array Protocols;
1166 for (const auto* P : D->protocols())
1167 Protocols.push_back(createBareDeclRef(P));
1168 if (!Protocols.empty())
1169 JOS.attribute("protocols", std::move(Protocols));
1170}
1171
1173 const ObjCImplementationDecl *D) {
1175 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1176 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1177}
1178
1180 const ObjCCompatibleAliasDecl *D) {
1182 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1183}
1184
1187 JOS.attribute("type", createQualType(D->getType()));
1188
1189 switch (D->getPropertyImplementation()) {
1190 case ObjCPropertyDecl::None: break;
1191 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1192 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1193 }
1194
1195 ObjCPropertyAttribute::Kind Attrs = D->getPropertyAttributes();
1198 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1200 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1201 attributeOnlyIfTrue("readonly",
1203 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1204 attributeOnlyIfTrue("readwrite",
1206 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1207 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1208 attributeOnlyIfTrue("nonatomic",
1210 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1211 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1212 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1213 attributeOnlyIfTrue("unsafe_unretained",
1215 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1216 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1217 attributeOnlyIfTrue("nullability",
1219 attributeOnlyIfTrue("null_resettable",
1221 }
1222}
1223
1225 VisitNamedDecl(D->getPropertyDecl());
1226 JOS.attribute("implKind", D->getPropertyImplementation() ==
1228 ? "synthesize"
1229 : "dynamic");
1230 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1231 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1232}
1233
1235 attributeOnlyIfTrue("variadic", D->isVariadic());
1236 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1237}
1238
1240 JOS.attribute("name", AE->getOpAsString());
1241}
1242
1244 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1245}
1246
1248 std::string Str;
1249 llvm::raw_string_ostream OS(Str);
1250
1251 OME->getSelector().print(OS);
1252 JOS.attribute("selector", Str);
1253
1254 switch (OME->getReceiverKind()) {
1256 JOS.attribute("receiverKind", "instance");
1257 break;
1259 JOS.attribute("receiverKind", "class");
1260 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1261 break;
1263 JOS.attribute("receiverKind", "super (instance)");
1264 JOS.attribute("superType", createQualType(OME->getSuperType()));
1265 break;
1267 JOS.attribute("receiverKind", "super (class)");
1268 JOS.attribute("superType", createQualType(OME->getSuperType()));
1269 break;
1270 }
1271
1272 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1273 if (OME->getType() != CallReturnTy)
1274 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1275}
1276
1278 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1279 std::string Str;
1280 llvm::raw_string_ostream OS(Str);
1281
1282 MD->getSelector().print(OS);
1283 JOS.attribute("selector", Str);
1284 }
1285}
1286
1288 std::string Str;
1289 llvm::raw_string_ostream OS(Str);
1290
1291 OSE->getSelector().print(OS);
1292 JOS.attribute("selector", Str);
1293}
1294
1296 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1297}
1298
1300 if (OPRE->isImplicitProperty()) {
1301 JOS.attribute("propertyKind", "implicit");
1302 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1303 JOS.attribute("getter", createBareDeclRef(MD));
1304 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1305 JOS.attribute("setter", createBareDeclRef(MD));
1306 } else {
1307 JOS.attribute("propertyKind", "explicit");
1308 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1309 }
1310
1311 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1312 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1313 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1314}
1315
1317 const ObjCSubscriptRefExpr *OSRE) {
1318 JOS.attribute("subscriptKind",
1319 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1320
1321 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1322 JOS.attribute("getter", createBareDeclRef(MD));
1323 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1324 JOS.attribute("setter", createBareDeclRef(MD));
1325}
1326
1328 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1329 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1330 JOS.attribute("isArrow", OIRE->isArrow());
1331}
1332
1334 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1335}
1336
1338 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1339 if (DRE->getDecl() != DRE->getFoundDecl())
1340 JOS.attribute("foundReferencedDecl",
1341 createBareDeclRef(DRE->getFoundDecl()));
1342 switch (DRE->isNonOdrUse()) {
1343 case NOUR_None: break;
1344 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1345 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1346 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1347 }
1348 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1349}
1350
1352 const SYCLUniqueStableNameExpr *E) {
1353 JOS.attribute("typeSourceInfo",
1354 createQualType(E->getTypeSourceInfo()->getType()));
1355}
1356
1358 const OpenACCAsteriskSizeExpr *E) {}
1359
1362
1364 JOS.attribute("name", PredefinedExpr::getIdentKindName(PE->getIdentKind()));
1365}
1366
1368 JOS.attribute("isPostfix", UO->isPostfix());
1369 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1370 if (!UO->canOverflow())
1371 JOS.attribute("canOverflow", false);
1372}
1373
1375 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1376}
1377
1379 const CompoundAssignOperator *CAO) {
1381 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1382 JOS.attribute("computeResultType",
1383 createQualType(CAO->getComputationResultType()));
1384}
1385
1387 // Note, we always write this Boolean field because the information it conveys
1388 // is critical to understanding the AST node.
1389 ValueDecl *VD = ME->getMemberDecl();
1390 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1391 JOS.attribute("isArrow", ME->isArrow());
1392 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1393 switch (ME->isNonOdrUse()) {
1394 case NOUR_None: break;
1395 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1396 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1397 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1398 }
1399}
1400
1402 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1403 attributeOnlyIfTrue("isArray", NE->isArray());
1404 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1405 switch (NE->getInitializationStyle()) {
1407 break;
1409 JOS.attribute("initStyle", "call");
1410 break;
1412 JOS.attribute("initStyle", "list");
1413 break;
1414 }
1415 if (const FunctionDecl *FD = NE->getOperatorNew())
1416 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1417 if (const FunctionDecl *FD = NE->getOperatorDelete())
1418 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1419}
1421 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1422 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1423 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1424 if (const FunctionDecl *FD = DE->getOperatorDelete())
1425 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1426}
1427
1429 attributeOnlyIfTrue("implicit", TE->isImplicit());
1430}
1431
1433 JOS.attribute("castKind", CE->getCastKindName());
1434 llvm::json::Array Path = createCastPath(CE);
1435 if (!Path.empty())
1436 JOS.attribute("path", std::move(Path));
1437 // FIXME: This may not be useful information as it can be obtusely gleaned
1438 // from the inner[] array.
1439 if (const NamedDecl *ND = CE->getConversionFunction())
1440 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1441}
1442
1444 VisitCastExpr(ICE);
1445 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1446}
1447
1449 attributeOnlyIfTrue("adl", CE->usesADL());
1450}
1451
1453 const UnaryExprOrTypeTraitExpr *TTE) {
1454 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1455 if (TTE->isArgumentType())
1456 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1457}
1458
1460 VisitNamedDecl(SOPE->getPack());
1461}
1462
1464 const UnresolvedLookupExpr *ULE) {
1465 JOS.attribute("usesADL", ULE->requiresADL());
1466 JOS.attribute("name", ULE->getName().getAsString());
1467
1468 JOS.attributeArray("lookups", [this, ULE] {
1469 for (const NamedDecl *D : ULE->decls())
1470 JOS.value(createBareDeclRef(D));
1471 });
1472}
1473
1475 JOS.attribute("name", ALE->getLabel()->getName());
1476 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1477}
1478
1480 if (CTE->isTypeOperand()) {
1481 QualType Adjusted = CTE->getTypeOperand(Ctx);
1482 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1483 JOS.attribute("typeArg", createQualType(Unadjusted));
1484 if (Adjusted != Unadjusted)
1485 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1486 }
1487}
1488
1491 Visit(CE->getAPValueResult(), CE->getType());
1492}
1493
1495 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1496 JOS.attribute("field", createBareDeclRef(FD));
1497}
1498
1500 const GenericSelectionExpr *GSE) {
1501 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1502}
1503
1505 const CXXUnresolvedConstructExpr *UCE) {
1506 if (UCE->getType() != UCE->getTypeAsWritten())
1507 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1508 attributeOnlyIfTrue("list", UCE->isListInitialization());
1509}
1510
1512 CXXConstructorDecl *Ctor = CE->getConstructor();
1513 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1514 attributeOnlyIfTrue("elidable", CE->isElidable());
1515 attributeOnlyIfTrue("list", CE->isListInitialization());
1516 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1517 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1518 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1519 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1520
1521 switch (CE->getConstructionKind()) {
1523 JOS.attribute("constructionKind", "complete");
1524 break;
1526 JOS.attribute("constructionKind", "delegating");
1527 break;
1529 JOS.attribute("constructionKind", "non-virtual base");
1530 break;
1532 JOS.attribute("constructionKind", "virtual base");
1533 break;
1534 }
1535}
1536
1538 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1540 if (EWC->getNumObjects()) {
1541 JOS.attributeArray("cleanups", [this, EWC] {
1542 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1543 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1544 JOS.value(createBareDeclRef(BD));
1545 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1546 llvm::json::Object Obj;
1547 Obj["id"] = createPointerRepresentation(CLE);
1548 Obj["kind"] = CLE->getStmtClassName();
1549 JOS.value(std::move(Obj));
1550 } else {
1551 llvm_unreachable("unexpected cleanup object type");
1552 }
1553 });
1554 }
1555}
1556
1558 const CXXBindTemporaryExpr *BTE) {
1559 const CXXTemporary *Temp = BTE->getTemporary();
1560 JOS.attribute("temp", createPointerRepresentation(Temp));
1561 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1562 JOS.attribute("dtor", createBareDeclRef(Dtor));
1563}
1564
1566 const MaterializeTemporaryExpr *MTE) {
1567 if (const ValueDecl *VD = MTE->getExtendingDecl())
1568 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1569
1570 switch (MTE->getStorageDuration()) {
1571 case SD_Automatic:
1572 JOS.attribute("storageDuration", "automatic");
1573 break;
1574 case SD_Dynamic:
1575 JOS.attribute("storageDuration", "dynamic");
1576 break;
1577 case SD_FullExpression:
1578 JOS.attribute("storageDuration", "full expression");
1579 break;
1580 case SD_Static:
1581 JOS.attribute("storageDuration", "static");
1582 break;
1583 case SD_Thread:
1584 JOS.attribute("storageDuration", "thread");
1585 break;
1586 }
1587
1588 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1589}
1590
1592 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1593}
1594
1596 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1597}
1598
1600 const CXXDependentScopeMemberExpr *DSME) {
1601 JOS.attribute("isArrow", DSME->isArrow());
1602 JOS.attribute("member", DSME->getMember().getAsString());
1603 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1604 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1605 DSME->hasExplicitTemplateArgs());
1606
1607 if (DSME->getNumTemplateArgs()) {
1608 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1609 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1610 JOS.object(
1611 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1612 });
1613 }
1614}
1615
1617 if (!RE->isValueDependent())
1618 JOS.attribute("satisfied", RE->isSatisfied());
1619}
1620
1622 llvm::SmallString<16> Buffer;
1623 IL->getValue().toString(Buffer,
1624 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1625 JOS.attribute("value", Buffer);
1626}
1628 // FIXME: This should probably print the character literal as a string,
1629 // rather than as a numerical value. It would be nice if the behavior matched
1630 // what we do to print a string literal; right now, it is impossible to tell
1631 // the difference between 'a' and L'a' in C from the JSON output.
1632 JOS.attribute("value", CL->getValue());
1633}
1635 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1636}
1638 llvm::SmallString<16> Buffer;
1639 FL->getValue().toString(Buffer);
1640 JOS.attribute("value", Buffer);
1641}
1643 std::string Buffer;
1644 llvm::raw_string_ostream SS(Buffer);
1645 SL->outputString(SS);
1646 JOS.attribute("value", Buffer);
1647}
1649 JOS.attribute("value", BLE->getValue());
1650}
1651
1653 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1654 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1655 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1656 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1657 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1658 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1659}
1660
1662 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1663 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1664}
1666 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1667}
1668
1670 JOS.attribute("name", LS->getName());
1671 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1672 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1673}
1674
1676 if (LS->hasLabelTarget())
1677 JOS.attribute("targetLabelDeclId",
1678 createPointerRepresentation(LS->getLabelDecl()));
1679}
1680
1682 JOS.attribute("targetLabelDeclId",
1683 createPointerRepresentation(GS->getLabel()));
1684}
1685
1687 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1688}
1689
1691 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1692 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1693 // null child node and ObjC gets no child node.
1694 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1695}
1696
1698 JOS.attribute("isNull", true);
1699}
1701 JOS.attribute("type", createQualType(TA.getAsType()));
1702}
1704 const TemplateArgument &TA) {
1705 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1706}
1708 JOS.attribute("isNullptr", true);
1709}
1711 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1712}
1714 const TemplateArgument &TA) {
1716}
1718 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1719 // the output format.
1720}
1722 const TemplateArgument &TA) {
1723 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1724 // the output format.
1725}
1727 const TemplateArgument &TA) {
1728 JOS.attribute("isExpr", true);
1729 if (TA.isCanonicalExpr())
1730 JOS.attribute("isCanonical", true);
1731}
1733 JOS.attribute("isPack", true);
1734}
1735
1736StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1737 if (Traits)
1738 return Traits->getCommandInfo(CommandID)->Name;
1739 if (const comments::CommandInfo *Info =
1741 return Info->Name;
1742 return "<invalid>";
1743}
1744
1746 const comments::FullComment *) {
1747 JOS.attribute("text", C->getText());
1748}
1749
1752 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1753
1754 switch (C->getRenderKind()) {
1756 JOS.attribute("renderKind", "normal");
1757 break;
1759 JOS.attribute("renderKind", "bold");
1760 break;
1762 JOS.attribute("renderKind", "emphasized");
1763 break;
1765 JOS.attribute("renderKind", "monospaced");
1766 break;
1768 JOS.attribute("renderKind", "anchor");
1769 break;
1770 }
1771
1772 llvm::json::Array Args;
1773 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1774 Args.push_back(C->getArgText(I));
1775
1776 if (!Args.empty())
1777 JOS.attribute("args", std::move(Args));
1778}
1779
1782 JOS.attribute("name", C->getTagName());
1783 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1784 attributeOnlyIfTrue("malformed", C->isMalformed());
1785
1786 llvm::json::Array Attrs;
1787 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1788 Attrs.push_back(
1789 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1790
1791 if (!Attrs.empty())
1792 JOS.attribute("attrs", std::move(Attrs));
1793}
1794
1797 JOS.attribute("name", C->getTagName());
1798}
1799
1802 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1803
1804 llvm::json::Array Args;
1805 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1806 Args.push_back(C->getArgText(I));
1807
1808 if (!Args.empty())
1809 JOS.attribute("args", std::move(Args));
1810}
1811
1814 switch (C->getDirection()) {
1816 JOS.attribute("direction", "in");
1817 break;
1819 JOS.attribute("direction", "out");
1820 break;
1822 JOS.attribute("direction", "in,out");
1823 break;
1824 }
1825 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1826
1827 if (C->hasParamName())
1828 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1829 : C->getParamNameAsWritten());
1830
1831 if (C->isParamIndexValid() && !C->isVarArgParam())
1832 JOS.attribute("paramIdx", C->getParamIndex());
1833}
1834
1837 if (C->hasParamName())
1838 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1839 : C->getParamNameAsWritten());
1840 if (C->isPositionValid()) {
1841 llvm::json::Array Positions;
1842 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1843 Positions.push_back(C->getIndex(I));
1844
1845 if (!Positions.empty())
1846 JOS.attribute("positions", std::move(Positions));
1847 }
1848}
1849
1852 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1853 JOS.attribute("closeName", C->getCloseName());
1854}
1855
1858 const comments::FullComment *) {
1859 JOS.attribute("text", C->getText());
1860}
1861
1864 JOS.attribute("text", C->getText());
1865}
1866
1867llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1868 llvm::json::Object Ret;
1869#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1870 if (FPO.has##NAME##Override()) \
1871 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1872#include "clang/Basic/FPOptions.def"
1873 return Ret;
1874}
1875
1877 VisitStmt(S);
1878 if (S->hasStoredFPFeatures())
1879 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1880}
DynTypedNode Node
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
const Decl * D
IndirectLocalPath & Path
Expr * E
int Category
Definition: Format.cpp:3180
#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....
SourceLocation Loc
Definition: SemaObjC.cpp:754
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
std::string Label
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
@ None
There is no such object (it's outside its lifetime).
Definition: APValue.h:129
const LangOptions & getLangOpts() const
Definition: ASTContext.h:894
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:793
std::string getName(const Decl *D)
Definition: Mangle.cpp:626
Represents an access specifier followed by colon ':'.
Definition: DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4486
LabelDecl * getLabel() const
Definition: Expr.h:4509
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition: TypeBase.h:3738
ArraySizeModifier getSizeModifier() const
Definition: TypeBase.h:3752
Qualifiers getIndexTypeQualifiers() const
Definition: TypeBase.h:3756
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6816
StringRef getOpAsString() const
Definition: Expr.h:6880
Attr - This represents one attribute.
Definition: Attr.h:44
attr::Kind getKind() const
Definition: Attr.h:90
bool isInherited() const
Definition: Attr.h:99
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:103
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: TypeBase.h:7180
AutoTypeKeyword getKeyword() const
Definition: TypeBase.h:7211
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3974
StringRef getOpcodeStr() const
Definition: Expr.h:4040
Opcode getOpcode() const
Definition: Expr.h:4019
A class which contains all the information about a particular captured value.
Definition: Decl.h:4640
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4634
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:1494
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1512
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:723
bool getValue() const
Definition: ExprCXX.h:740
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1549
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1618
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition: ExprCXX.h:1623
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1642
bool isImmediateEscalating() const
Definition: ExprCXX.h:1707
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition: ExprCXX.h:1651
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1612
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1631
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1660
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2604
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2369
A default argument (C++ [dcl.fct.default]).
Definition: ExprCXX.h:1271
A use of a default initializer in a constructor or in aggregate initialization.
Definition: ExprCXX.h:1378
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2620
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2659
bool isArrayForm() const
Definition: ExprCXX.h:2646
bool isGlobalDelete() const
Definition: ExprCXX.h:2645
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2647
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3864
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition: ExprCXX.h:3963
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:4058
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition: ExprCXX.h:4037
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:4002
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition: ExprCXX.h:4033
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:4065
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2869
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2349
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
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:902
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1013
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:805
Represents a C++ temporary.
Definition: ExprCXX.h:1460
const CXXDestructorDecl * getDestructor() const
Definition: ExprCXX.h:1471
Represents the this expression in C++.
Definition: ExprCXX.h:1155
bool isImplicit() const
Definition: ExprCXX.h:1178
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:848
bool isTypeOperand() const
Definition: ExprCXX.h:884
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition: ExprCXX.cpp:161
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:891
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3738
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3793
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3772
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2879
bool usesADL() const
Definition: Expr.h:3036
CaseStmt - Represent a case statement.
Definition: Stmt.h:1920
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition: Stmt.h:1983
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3612
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition: Expr.cpp:1997
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1946
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4236
QualType getComputationLHSType() const
Definition: Expr.h:4270
QualType getComputationResultType() const
Definition: Expr.h:4273
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1720
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:126
SourceRange getSourceRange() const LLVM_READONLY
Definition: ASTConcept.h:189
SourceLocation getLocation() const
Definition: ASTConcept.h:178
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:199
TemplateDecl * getNamedConcept() const
Definition: ASTConcept.h:197
Represents the canonical version of C arrays with a specified constant size.
Definition: TypeBase.h:3776
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition: TypeBase.h:3858
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1084
APValue getAPValueResult() const
Definition: Expr.cpp:409
APValue::ValueKind getResultAPValueKind() const
Definition: Expr.h:1150
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1272
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1383
ValueDecl * getDecl()
Definition: Expr.h:1340
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1470
bool isImmediateEscalating() const
Definition: Expr.h:1480
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:524
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:593
bool isParameterPack() const
Whether this declaration is a parameter pack.
Definition: DeclBase.cpp:244
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
Definition: DeclBase.cpp:286
bool isInvalidDecl() const
Definition: DeclBase.h:588
SourceLocation getLocation() const
Definition: DeclBase.h:439
const char * getDeclKindName() const
Definition: DeclBase.cpp:147
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:621
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:553
DeclContext * getDeclContext()
Definition: DeclBase.h:448
AccessSpecifier getAccess() const
Definition: DeclBase.h:507
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:918
Kind getKind() const
Definition: DeclBase.h:442
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:427
std::string getAsString() const
Retrieve the human-readable string for this name.
bool isDeduced() const
Definition: TypeBase.h:7168
Represents an extended vector type where either the type or size is dependent.
Definition: TypeBase.h:4117
SourceLocation getAttributeLoc() const
Definition: TypeBase.h:4133
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3420
Represents an enum.
Definition: Decl.h:4004
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4213
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4216
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4222
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:4168
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3655
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3690
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3679
unsigned getNumObjects() const
Definition: ExprCXX.h:3683
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3661
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:177
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
Definition: Expr.h:444
QualType getType() const
Definition: Expr.h:144
Represents difference between two FPOptions values.
Definition: LangOptions.h:919
Represents a member of a struct/union/class.
Definition: Decl.h:3157
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3257
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3260
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition: Decl.h:3337
std::string getValueAsString(unsigned Radix) const
Definition: Expr.cpp:1006
llvm::APFloat getValue() const
Definition: Expr.h:1668
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:125
bool isPackExpansion() const
Definition: DeclFriend.h:190
Represents a function declaration or definition.
Definition: Decl.h:1999
bool isImmediateFunction() const
Definition: Decl.cpp:3328
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition: Decl.h:2755
bool isVariadic() const
Whether this function is variadic.
Definition: Decl.cpp:3125
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2539
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2885
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition: Decl.h:2469
bool isDeletedAsWritten() const
Definition: Decl.h:2543
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2352
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2384
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2343
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2896
Represents a prototype with parameter type info, e.g.
Definition: TypeBase.h:5282
ExtProtoInfo getExtProtoInfo() const
Definition: TypeBase.h:5571
A class which abstracts out some details necessary for making a call.
Definition: TypeBase.h:4589
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition: TypeBase.h:4478
ExtInfo getExtInfo() const
Definition: TypeBase.h:4834
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3613
bool isConst() const
Definition: TypeBase.h:4840
bool isRestrict() const
Definition: TypeBase.h:4842
bool isVolatile() const
Definition: TypeBase.h:4841
Represents a C11 generic selection.
Definition: Expr.h:6114
AssociationTy< true > ConstAssociation
Definition: Expr.h:6346
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:6366
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2969
LabelDecl * getLabel() const
Definition: Stmt.h:2982
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:5156
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2259
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition: Stmt.h:2334
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition: Stmt.h:2331
bool isConstexpr() const
Definition: Stmt.h:2452
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:2328
bool isNegatedConsteval() const
Definition: Stmt.h:2448
bool isConsteval() const
Definition: Stmt.h:2439
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3789
bool isPartOfExplicitCast() const
Definition: Expr.h:3820
Describes an C or C++ initializer list.
Definition: Expr.h:5235
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:5361
The injected class name of a C++ class template or class template partial specialization.
Definition: TypeBase.h:6553
CXXRecordDecl * getOriginalDecl() const
Definition: TypeBase.h:6564
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void VisitUsingDecl(const UsingDecl *UD)
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void 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 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 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:2146
LabelDecl * getDecl() const
Definition: Stmt.h:2164
bool isSideEntry() const
Definition: Stmt.h:2193
const char * getName() const
Definition: Stmt.cpp:428
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:498
Represents a linkage specification.
Definition: DeclCXX.h:3009
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:3032
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition: DeclCXX.h:3043
Base class for BreakStmt and ContinueStmt.
Definition: Stmt.h:3057
LabelDecl * getLabelDecl()
Definition: Stmt.h:3095
bool hasLabelTarget() const
Definition: Stmt.h:3090
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition: TypeBase.h:6161
const IdentifierInfo * getMacroIdentifier() const
Definition: TypeBase.h:6176
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4914
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition: ExprCXX.h:4939
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition: ExprCXX.h:4983
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4964
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition: Expr.h:3300
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3383
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
Definition: Expr.h:3524
bool isArrow() const
Definition: Expr.h:3484
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: TypeBase.h:3669
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition: TypeBase.h:3691
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition: TypeBase.h:3697
This represents a decl that may have a name.
Definition: Decl.h:273
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:648
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition: Decl.h:300
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:339
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:316
Represents a C++ namespace alias.
Definition: DeclCXX.h:3195
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3288
Represent a C++ namespace.
Definition: Decl.h:591
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:647
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:656
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.
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:88
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:128
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:147
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2329
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2545
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2775
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:409
QualType getEncodedType() const
Definition: ExprObjC.h:428
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2597
Represents an ObjC class declaration.
Definition: DeclObjC.h:1154
Interfaces are the core concept in Objective-C for object oriented design.
Definition: TypeBase.h:7905
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:951
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1952
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:548
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:578
bool isArrow() const
Definition: ExprObjC.h:586
bool isFreeIvar() const
Definition: ExprObjC.h:587
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:940
QualType getCallReturnType(ASTContext &Ctx) const
Definition: ExprObjC.cpp:261
Selector getSelector() const
Definition: ExprObjC.cpp:289
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:954
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:948
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:951
@ Class
The receiver is a class.
Definition: ExprObjC.h:945
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition: ExprObjC.h:1287
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition: ExprObjC.h:1344
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1229
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:731
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2805
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:616
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition: ExprObjC.h:735
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:705
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition: ExprObjC.h:742
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:710
bool isImplicitProperty() const
Definition: ExprObjC.h:702
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:715
bool isSuperReceiver() const
Definition: ExprObjC.h:770
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2084
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:504
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:521
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:454
Selector getSelector() const
Definition: ExprObjC.h:468
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:839
bool isArraySubscriptRefExpr() const
Definition: ExprObjC.h:892
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:884
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:888
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition: Expr.h:2092
This is the base type for all OpenACC Clauses.
Definition: OpenACCClause.h:27
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:3221
DeclarationName getName() const
Gets the name looked up.
Definition: ExprCXX.h:3232
Represents a pack expansion of types.
Definition: TypeBase.h:7524
UnsignedOrNone getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: TypeBase.h:7549
[C99 6.4.2.2] - A predefined identifier such as func.
Definition: Expr.h:2007
StringRef getIdentKindName() const
Definition: Expr.h:2064
PredefinedIdentKind getIdentKind() const
Definition: Expr.h:2042
Represents an unpacked "presumed" location which can be presented to the user.
unsigned getColumn() const
Return the presumed column number of this location.
const char * getFilename() const
Return the presumed filename of this location.
bool isValid() const
unsigned getLine() const
Return the presumed line number of this location.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
A (possibly-)qualified type.
Definition: TypeBase.h:937
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: TypeBase.h:1004
SplitQualType getSplitDesugaredType() const
Definition: TypeBase.h:1300
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: TypeBase.h:8364
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4309
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: TypeBase.h:6502
RecordDecl * getOriginalDecl() const
Definition: TypeBase.h:6509
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Definition: Redeclarable.h:213
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
Definition: Redeclarable.h:220
Base for LValueReferenceType and RValueReferenceType.
Definition: TypeBase.h:3589
bool isSpelledAsLValue() const
Definition: TypeBase.h:3602
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:505
bool isSatisfied() const
Whether or not the requires clause is satisfied.
Definition: ExprConcepts.h:553
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:4435
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4503
Encodes a location in the source.
FileIDAndOffset getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
StringRef getBufferName(SourceLocation Loc, bool *Invalid=nullptr) const
Return the filename or buffer identifier of the buffer the location is in.
bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc=nullptr) const
Tests whether the given source location represents a macro argument's expansion into the function-lik...
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID.
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
bool isValid() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:45
Stmt - This represents one statement.
Definition: Stmt.h:85
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1801
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1205
Represents the result of substituting a set of types for a template type parameter pack.
Definition: TypeBase.h:7091
Represents the result of substituting a type for a template type parameter.
Definition: TypeBase.h:6972
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: TypeBase.h:7001
UnsignedOrNone getPackIndex() const
Definition: TypeBase.h:7007
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2509
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition: Stmt.h:2570
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition: Stmt.h:2567
StringRef getKindName() const
Definition: Decl.h:3904
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3809
NestedNameSpecifier getQualifier() const
Definition: Type.cpp:4316
TagDecl * getOriginalDecl() const
Definition: TypeBase.h:6441
bool isTagOwned() const
Does the TagType own this declaration of the Tag?
Definition: TypeBase.h:6446
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:528
Represents a template argument.
Definition: TemplateBase.h:61
QualType getStructuralValueType() const
Get the type of a StructuralValue.
Definition: TemplateBase.h:402
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:322
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:366
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:329
bool isCanonicalExpr() const
Definition: TemplateBase.h:416
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
Definition: TemplateBase.h:399
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: TypeBase.h:7290
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: TypeBase.h:7355
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: TypeBase.h:7348
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
Declaration of a template type parameter.
TemplateTypeParmDecl * getDecl() const
Definition: TypeBase.h:6937
bool isParameterPack() const
Definition: TypeBase.h:6933
unsigned getIndex() const
Definition: TypeBase.h:6932
unsigned getDepth() const
Definition: TypeBase.h:6931
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3685
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:8314
QualType getType() const
Return the type wrapped by this type source info.
Definition: TypeBase.h:8325
void Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
The base class of the type hierarchy.
Definition: TypeBase.h:1833
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition: Type.cpp:2209
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: TypeBase.h:2808
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: TypeBase.h:2800
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: TypeBase.h:2423
const char * getTypeClassName() const
Definition: Type.cpp:3386
bool containsErrors() const
Whether this type is an error type.
Definition: TypeBase.h:2794
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: TypeBase.h:2818
bool isFromAST() const
Whether this type comes from an AST file.
Definition: TypeBase.h:2406
const T * getAs() const
Member-template getAs<specific type>'.
Definition: TypeBase.h:9159
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3664
QualType getUnderlyingType() const
Definition: Decl.h:3614
TypedefNameDecl * getDecl() const
Definition: TypeBase.h:6127
QualType desugar() const
Definition: Type.cpp:4076
bool typeMatchesDecl() const
Definition: TypeBase.h:6135
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2627
QualType getArgumentType() const
Definition: Expr.h:2670
bool isArgumentType() const
Definition: Expr.h:2669
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2659
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2246
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:2316
Opcode getOpcode() const
Definition: Expr.h:2282
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1402
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2300
A unary type transform, which is a type constructed from another.
Definition: TypeBase.h:6375
UTTKind getUTTKind() const
Definition: TypeBase.h:6404
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3384
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3453
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: TypeBase.h:5998
UnresolvedUsingTypenameDecl * getDecl() const
Definition: TypeBase.h:6030
Represents a C++ using-declaration.
Definition: DeclCXX.h:3585
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3622
Represents C++ using-directive.
Definition: DeclCXX.h:3090
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:3228
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3786
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3828
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3393
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3457
UsingShadowDecl * getDecl() const
Definition: TypeBase.h:6070
QualType desugar() const
Definition: TypeBase.h:6072
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:711
QualType getType() const
Definition: Decl.h:722
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition: Decl.cpp:5461
Represents a variable declaration or definition.
Definition: Decl.h:925
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1568
TLSKind getTLSKind() const
Definition: Decl.cpp:2168
bool hasInit() const
Definition: Decl.cpp:2398
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1465
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2121
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:936
@ CInit
C-style initialization with assignment.
Definition: Decl.h:930
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:939
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:933
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1511
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1550
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:948
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:951
@ TLS_None
Not a TLS variable.
Definition: Decl.h:945
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1167
Represents a GCC generic vector type.
Definition: TypeBase.h:4191
unsigned getNumElements() const
Definition: TypeBase.h:4206
VectorKind getVectorKind() const
Definition: TypeBase.h:4211
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2697
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2747
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:625
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
const CommandInfo * getCommandInfo(StringRef Name) const
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:66
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1104
An opening HTML tag with attributes.
Definition: Comment.h:454
A command with word-like arguments that is considered inline content.
Definition: Comment.h:341
Doxygen \param command.
Definition: Comment.h:732
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:814
A verbatim block command (e.
Definition: Comment.h:900
A line of text contained in a verbatim block.
Definition: Comment.h:875
A verbatim line command.
Definition: Comment.h:951
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:170
RequirementKind getKind() const
Definition: ExprConcepts.h:200
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:220
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...
bool Ret(InterpState &S, CodePtr &PC)
Definition: Interp.h:312
The JSON file list parser is used to communicate input to InstallAPI.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
@ GNUAutoType
__auto_type (GNU extension)
@ DecltypeAuto
decltype(auto)
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:419
@ RQ_None
No ref-qualifier was provided.
Definition: TypeBase.h:1782
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: TypeBase.h:1785
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: TypeBase.h:1788
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:123
StorageClass
Storage classes.
Definition: Specifiers.h:248
@ SC_None
Definition: Specifiers.h:250
@ SD_Thread
Thread storage duration.
Definition: Specifiers.h:342
@ SD_Static
Static storage duration.
Definition: Specifiers.h:343
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition: Specifiers.h:340
@ SD_Automatic
Automatic storage duration (most local variables).
Definition: Specifiers.h:341
@ SD_Dynamic
Dynamic storage duration.
Definition: Specifiers.h:344
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:135
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:144
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:139
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
const FunctionProtoType * T
@ Invariant
The parameter is invariant: must match exactly.
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
@ AltiVecBool
is AltiVec 'vector bool ...'
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
@ AltiVecVector
is AltiVec vector
@ AltiVecPixel
is AltiVec 'vector Pixel'
@ Neon
is ARM Neon vector
@ Generic
not a target-specific vector type
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
@ NeonPoly
is ARM Neon polynomial vector
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
@ Parens
New-expression has a C++98 paren-delimited initializer.
@ None
New-expression has no initializer as written.
@ Braces
New-expression has a C++11 list-initializer.
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_DynamicNone
throw()
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:183
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:177
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:175
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:180
unsigned long uint64_t
Extra information about a function prototype.
Definition: TypeBase.h:5367
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: TypeBase.h:870
Information about a single command.