clang 19.0.0git
Go to the documentation of this file.
2#include "clang/AST/Type.h"
5#include "clang/Lex/Lexer.h"
6#include "llvm/ADT/StringExtras.h"
7#include <optional>
9using namespace clang;
11void JSONNodeDumper::addPreviousDeclaration(const Decl *D) {
12 switch (D->getKind()) {
13#define DECL(DERIVED, BASE) \
14 case Decl::DERIVED: \
15 return writePreviousDeclImpl(cast<DERIVED##Decl>(D));
17#include "clang/AST/"
19#undef DECL
20 }
21 llvm_unreachable("Decl that isn't part of!");
25 const char *AttrName = nullptr;
26 switch (A->getKind()) {
27#define ATTR(X) \
28 case attr::X: \
29 AttrName = #X"Attr"; \
30 break;
31#include "clang/Basic/"
32#undef ATTR
33 }
34 JOS.attribute("id", createPointerRepresentation(A));
35 JOS.attribute("kind", AttrName);
36 JOS.attributeObject("range", [A, this] { writeSourceRange(A->getRange()); });
37 attributeOnlyIfTrue("inherited", A->isInherited());
38 attributeOnlyIfTrue("implicit", A->isImplicit());
40 // FIXME: it would be useful for us to output the spelling kind as well as
41 // the actual spelling. This would allow us to distinguish between the
42 // various attribute syntaxes, but we don't currently track that information
43 // within the AST.
44 //JOS.attribute("spelling", A->getSpelling());
50 if (!S)
51 return;
53 JOS.attribute("id", createPointerRepresentation(S));
54 JOS.attribute("kind", S->getStmtClassName());
55 JOS.attributeObject("range",
56 [S, this] { writeSourceRange(S->getSourceRange()); });
58 if (const auto *E = dyn_cast<Expr>(S)) {
59 JOS.attribute("type", createQualType(E->getType()));
60 const char *Category = nullptr;
61 switch (E->getValueKind()) {
62 case VK_LValue: Category = "lvalue"; break;
63 case VK_XValue: Category = "xvalue"; break;
64 case VK_PRValue:
65 Category = "prvalue";
66 break;
67 }
68 JOS.attribute("valueCategory", Category);
69 }
74 JOS.attribute("id", createPointerRepresentation(T));
76 if (!T)
77 return;
79 JOS.attribute("kind", (llvm::Twine(T->getTypeClassName()) + "Type").str());
80 JOS.attribute("type", createQualType(QualType(T, 0), /*Desugar=*/false));
81 attributeOnlyIfTrue("containsErrors", T->containsErrors());
82 attributeOnlyIfTrue("isDependent", T->isDependentType());
83 attributeOnlyIfTrue("isInstantiationDependent",
85 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
86 attributeOnlyIfTrue("containsUnexpandedPack",
88 attributeOnlyIfTrue("isImported", T->isFromAST());
93 JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
94 JOS.attribute("kind", "QualType");
95 JOS.attribute("type", createQualType(T));
96 JOS.attribute("qualifiers", T.split().Quals.getAsString());
100 if (TL.isNull())
101 return;
102 JOS.attribute("kind",
103 (llvm::Twine(TL.getTypeLocClass() == TypeLoc::Qualified
104 ? "Qualified"
105 : TL.getTypePtr()->getTypeClassName()) +
106 "TypeLoc")
107 .str());
108 JOS.attribute("type",
109 createQualType(QualType(TL.getType()), /*Desugar=*/false));
110 JOS.attributeObject("range",
111 [TL, this] { writeSourceRange(TL.getSourceRange()); });
115 JOS.attribute("id", createPointerRepresentation(D));
117 if (!D)
118 return;
120 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
121 JOS.attributeObject("loc",
122 [D, this] { writeSourceLocation(D->getLocation()); });
123 JOS.attributeObject("range",
124 [D, this] { writeSourceRange(D->getSourceRange()); });
125 attributeOnlyIfTrue("isImplicit", D->isImplicit());
126 attributeOnlyIfTrue("isInvalid", D->isInvalidDecl());
128 if (D->isUsed())
129 JOS.attribute("isUsed", true);
130 else if (D->isThisDeclarationReferenced())
131 JOS.attribute("isReferenced", true);
133 if (const auto *ND = dyn_cast<NamedDecl>(D))
134 attributeOnlyIfTrue("isHidden", !ND->isUnconditionallyVisible());
136 if (D->getLexicalDeclContext() != D->getDeclContext()) {
137 // Because of multiple inheritance, a DeclContext pointer does not produce
138 // the same pointer representation as a Decl pointer that references the
139 // same AST Node.
140 const auto *ParentDeclContextDecl = dyn_cast<Decl>(D->getDeclContext());
141 JOS.attribute("parentDeclContextId",
142 createPointerRepresentation(ParentDeclContextDecl));
143 }
145 addPreviousDeclaration(D);
150 const comments::FullComment *FC) {
151 if (!C)
152 return;
154 JOS.attribute("id", createPointerRepresentation(C));
155 JOS.attribute("kind", C->getCommentKindName());
156 JOS.attributeObject("loc",
157 [C, this] { writeSourceLocation(C->getLocation()); });
158 JOS.attributeObject("range",
159 [C, this] { writeSourceRange(C->getSourceRange()); });
165 const Decl *From, StringRef Label) {
166 JOS.attribute("kind", "TemplateArgument");
167 if (R.isValid())
168 JOS.attributeObject("range", [R, this] { writeSourceRange(R); });
170 if (From)
171 JOS.attribute(Label.empty() ? "fromDecl" : Label, createBareDeclRef(From));
177 JOS.attribute("kind", "CXXCtorInitializer");
178 if (Init->isAnyMemberInitializer())
179 JOS.attribute("anyInit", createBareDeclRef(Init->getAnyMember()));
180 else if (Init->isBaseInitializer())
181 JOS.attribute("baseInit",
182 createQualType(QualType(Init->getBaseClass(), 0)));
183 else if (Init->isDelegatingInitializer())
184 JOS.attribute("delegatingInit",
185 createQualType(Init->getTypeSourceInfo()->getType()));
186 else
187 llvm_unreachable("Unknown initializer type");
193 JOS.attribute("kind", "Capture");
194 attributeOnlyIfTrue("byref", C.isByRef());
195 attributeOnlyIfTrue("nested", C.isNested());
196 if (C.getVariable())
197 JOS.attribute("var", createBareDeclRef(C.getVariable()));
201 JOS.attribute("associationKind", A.getTypeSourceInfo() ? "case" : "default");
202 attributeOnlyIfTrue("selected", A.isSelected());
206 if (!R)
207 return;
209 switch (R->getKind()) {
211 JOS.attribute("kind", "TypeRequirement");
212 break;
214 JOS.attribute("kind", "SimpleRequirement");
215 break;
217 JOS.attribute("kind", "CompoundRequirement");
218 break;
220 JOS.attribute("kind", "NestedRequirement");
221 break;
222 }
224 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R))
225 attributeOnlyIfTrue("noexcept", ER->hasNoexceptRequirement());
227 attributeOnlyIfTrue("isDependent", R->isDependent());
228 if (!R->isDependent())
229 JOS.attribute("satisfied", R->isSatisfied());
230 attributeOnlyIfTrue("containsUnexpandedPack",
235 std::string Str;
236 llvm::raw_string_ostream OS(Str);
237 Value.printPretty(OS, Ctx, Ty);
238 JOS.attribute("value", OS.str());
242 JOS.attribute("kind", "ConceptReference");
243 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
244 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
245 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
246 for (const TemplateArgumentLoc &TAL : Args->arguments())
247 JOS.object(
248 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
249 });
250 }
251 JOS.attributeObject("loc",
252 [CR, this] { writeSourceLocation(CR->getLocation()); });
253 JOS.attributeObject("range",
254 [CR, this] { writeSourceRange(CR->getSourceRange()); });
257void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
258 if (Loc.isInvalid())
259 return;
261 JOS.attributeBegin("includedFrom");
262 JOS.objectBegin();
264 if (!JustFirst) {
265 // Walk the stack recursively, then print out the presumed location.
266 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
267 }
269 JOS.attribute("file", Loc.getFilename());
270 JOS.objectEnd();
271 JOS.attributeEnd();
274void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc,
275 bool IsSpelling) {
276 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
277 unsigned ActualLine = IsSpelling ? SM.getSpellingLineNumber(Loc)
278 : SM.getExpansionLineNumber(Loc);
279 StringRef ActualFile = SM.getBufferName(Loc);
281 if (Presumed.isValid()) {
282 JOS.attribute("offset", SM.getDecomposedLoc(Loc).second);
283 if (LastLocFilename != ActualFile) {
284 JOS.attribute("file", ActualFile);
285 JOS.attribute("line", ActualLine);
286 } else if (LastLocLine != ActualLine)
287 JOS.attribute("line", ActualLine);
289 StringRef PresumedFile = Presumed.getFilename();
290 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
291 JOS.attribute("presumedFile", PresumedFile);
293 unsigned PresumedLine = Presumed.getLine();
294 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
295 JOS.attribute("presumedLine", PresumedLine);
297 JOS.attribute("col", Presumed.getColumn());
298 JOS.attribute("tokLen",
299 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
300 LastLocFilename = ActualFile;
301 LastLocPresumedFilename = PresumedFile;
302 LastLocPresumedLine = PresumedLine;
303 LastLocLine = ActualLine;
305 // Orthogonal to the file, line, and column de-duplication is whether the
306 // given location was a result of an include. If so, print where the
307 // include location came from.
308 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
309 /*JustFirst*/ true);
310 }
313void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
314 SourceLocation Spelling = SM.getSpellingLoc(Loc);
315 SourceLocation Expansion = SM.getExpansionLoc(Loc);
317 if (Expansion != Spelling) {
318 // If the expansion and the spelling are different, output subobjects
319 // describing both locations.
320 JOS.attributeObject("spellingLoc", [Spelling, this] {
321 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
322 });
323 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
324 writeBareSourceLocation(Expansion, /*IsSpelling*/ false);
325 // If there is a macro expansion, add extra information if the interesting
326 // bit is the macro arg expansion.
327 if (SM.isMacroArgExpansion(Loc))
328 JOS.attribute("isMacroArgExpansion", true);
329 });
330 } else
331 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
334void JSONNodeDumper::writeSourceRange(SourceRange R) {
335 JOS.attributeObject("begin",
336 [R, this] { writeSourceLocation(R.getBegin()); });
337 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
340std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
341 // Because JSON stores integer values as signed 64-bit integers, trying to
342 // represent them as such makes for very ugly pointer values in the resulting
343 // output. Instead, we convert the value to hex and treat it as a string.
344 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
347llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
348 SplitQualType SQT = QT.split();
349 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
350 llvm::json::Object Ret{{"qualType", SQTS}};
352 if (Desugar && !QT.isNull()) {
354 if (DSQT != SQT) {
355 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
356 if (DSQTS != SQTS)
357 Ret["desugaredQualType"] = DSQTS;
358 }
359 if (const auto *TT = QT->getAs<TypedefType>())
360 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
361 }
362 return Ret;
365void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
366 JOS.attribute("id", createPointerRepresentation(D));
367 if (!D)
368 return;
370 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
371 if (const auto *ND = dyn_cast<NamedDecl>(D))
372 JOS.attribute("name", ND->getDeclName().getAsString());
373 if (const auto *VD = dyn_cast<ValueDecl>(D))
374 JOS.attribute("type", createQualType(VD->getType()));
377llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
378 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
379 if (!D)
380 return Ret;
382 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
383 if (const auto *ND = dyn_cast<NamedDecl>(D))
384 Ret["name"] = ND->getDeclName().getAsString();
385 if (const auto *VD = dyn_cast<ValueDecl>(D))
386 Ret["type"] = createQualType(VD->getType());
387 return Ret;
390llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
391 llvm::json::Array Ret;
392 if (C->path_empty())
393 return Ret;
395 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
396 const CXXBaseSpecifier *Base = *I;
397 const auto *RD =
398 cast<CXXRecordDecl>(Base->getType()->castAs<RecordType>()->getDecl());
400 llvm::json::Object Val{{"name", RD->getName()}};
401 if (Base->isVirtual())
402 Val["isVirtual"] = true;
403 Ret.push_back(std::move(Val));
404 }
405 return Ret;
408#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
409#define FIELD1(Flag) FIELD2(#Flag, Flag)
411static llvm::json::Object
413 llvm::json::Object Ret;
415 FIELD2("exists", hasDefaultConstructor);
416 FIELD2("trivial", hasTrivialDefaultConstructor);
417 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
418 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
419 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
420 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
421 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
423 return Ret;
426static llvm::json::Object
428 llvm::json::Object Ret;
430 FIELD2("simple", hasSimpleCopyConstructor);
431 FIELD2("trivial", hasTrivialCopyConstructor);
432 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
433 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
434 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
435 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
436 FIELD2("needsImplicit", needsImplicitCopyConstructor);
437 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
439 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
441 return Ret;
444static llvm::json::Object
446 llvm::json::Object Ret;
448 FIELD2("exists", hasMoveConstructor);
449 FIELD2("simple", hasSimpleMoveConstructor);
450 FIELD2("trivial", hasTrivialMoveConstructor);
451 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
452 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
453 FIELD2("needsImplicit", needsImplicitMoveConstructor);
454 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
456 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
458 return Ret;
461static llvm::json::Object
463 llvm::json::Object Ret;
465 FIELD2("simple", hasSimpleCopyAssignment);
466 FIELD2("trivial", hasTrivialCopyAssignment);
467 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
468 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
469 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
470 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
471 FIELD2("needsImplicit", needsImplicitCopyAssignment);
472 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
474 return Ret;
477static llvm::json::Object
479 llvm::json::Object Ret;
481 FIELD2("exists", hasMoveAssignment);
482 FIELD2("simple", hasSimpleMoveAssignment);
483 FIELD2("trivial", hasTrivialMoveAssignment);
484 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
485 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
486 FIELD2("needsImplicit", needsImplicitMoveAssignment);
487 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
489 return Ret;
492static llvm::json::Object
494 llvm::json::Object Ret;
496 FIELD2("simple", hasSimpleDestructor);
497 FIELD2("irrelevant", hasIrrelevantDestructor);
498 FIELD2("trivial", hasTrivialDestructor);
499 FIELD2("nonTrivial", hasNonTrivialDestructor);
500 FIELD2("userDeclared", hasUserDeclaredDestructor);
501 FIELD2("needsImplicit", needsImplicitDestructor);
502 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
504 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
506 return Ret;
510JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
511 llvm::json::Object Ret;
513 // This data is common to all C++ classes.
514 FIELD1(isGenericLambda);
515 FIELD1(isLambda);
516 FIELD1(isEmpty);
517 FIELD1(isAggregate);
518 FIELD1(isStandardLayout);
519 FIELD1(isTriviallyCopyable);
520 FIELD1(isPOD);
522 FIELD1(isPolymorphic);
523 FIELD1(isAbstract);
524 FIELD1(isLiteral);
526 FIELD1(hasUserDeclaredConstructor);
527 FIELD1(hasConstexprNonCopyMoveConstructor);
528 FIELD1(hasMutableFields);
529 FIELD1(hasVariantMembers);
530 FIELD2("canConstDefaultInit", allowConstDefaultInit);
532 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
535 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
536 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
539 return Ret;
542#undef FIELD1
543#undef FIELD2
545std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
546 const auto AccessSpelling = getAccessSpelling(AS);
547 if (AccessSpelling.empty())
548 return "none";
549 return AccessSpelling.str();
553JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
554 llvm::json::Object Ret;
556 Ret["type"] = createQualType(BS.getType());
557 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
558 Ret["writtenAccess"] =
559 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
560 if (BS.isVirtual())
561 Ret["isVirtual"] = true;
562 if (BS.isPackExpansion())
563 Ret["isPackExpansion"] = true;
565 return Ret;
568void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
569 JOS.attribute("aliasee", AA->getAliasee());
572void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
573 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
576void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
577 if (!DA->getMessage().empty())
578 JOS.attribute("message", DA->getMessage());
579 if (!DA->getReplacement().empty())
580 JOS.attribute("replacement", DA->getReplacement());
583void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
584 if (!UA->getMessage().empty())
585 JOS.attribute("message", UA->getMessage());
588void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
589 JOS.attribute("section_name", SA->getName());
592void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
593 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
594 VA->getVisibility()));
597void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
598 JOS.attribute("tls_model", TA->getModel());
602 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
603 if (!TT->typeMatchesDecl())
604 JOS.attribute("type", createQualType(TT->desugar()));
608 JOS.attribute("decl", createBareDeclRef(TT->getFoundDecl()));
609 if (!TT->typeMatchesDecl())
610 JOS.attribute("type", createQualType(TT->desugar()));
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()));
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;
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",
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 }
675 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
679 switch (AT->getSizeModifier()) {
681 JOS.attribute("sizeModifier", "*");
682 break;
684 JOS.attribute("sizeModifier", "static");
685 break;
687 break;
688 }
690 std::string Str = AT->getIndexTypeQualifiers().getAsString();
691 if (!Str.empty())
692 JOS.attribute("indexTypeQualifiers", Str);
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->getSize().getSExtValue());
699 VisitArrayType(CAT);
703 const DependentSizedExtVectorType *VT) {
704 JOS.attributeObject(
705 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
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;
738 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
739 break;
740 }
744 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
748 switch (UTT->getUTTKind()) {
749#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
750 case UnaryTransformType::Enum: \
751 JOS.attribute("transformKind", #Trait); \
752 break;
753#include "clang/Basic/TransformTypeTraits.def"
754 }
758 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
762 const TemplateTypeParmType *TTPT) {
763 JOS.attribute("depth", TTPT->getDepth());
764 JOS.attribute("index", TTPT->getIndex());
765 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
766 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
770 const SubstTemplateTypeParmType *STTPT) {
771 JOS.attribute("index", STTPT->getIndex());
772 if (auto PackIndex = STTPT->getPackIndex())
773 JOS.attribute("pack_index", *PackIndex);
778 JOS.attribute("index", T->getIndex());
782 JOS.attribute("undeduced", !AT->isDeduced());
783 switch (AT->getKeyword()) {
785 JOS.attribute("typeKeyword", "auto");
786 break;
788 JOS.attribute("typeKeyword", "decltype(auto)");
789 break;
791 JOS.attribute("typeKeyword", "__auto_type");
792 break;
793 }
797 const TemplateSpecializationType *TST) {
798 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
800 std::string Str;
801 llvm::raw_string_ostream OS(Str);
802 TST->getTemplateName().print(OS, PrintPolicy);
803 JOS.attribute("templateName", OS.str());
807 const InjectedClassNameType *ICNT) {
808 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
812 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
816 if (std::optional<unsigned> N = PET->getNumExpansions())
817 JOS.attribute("numExpansions", *N);
821 if (const NestedNameSpecifier *NNS = ET->getQualifier()) {
822 std::string Str;
823 llvm::raw_string_ostream OS(Str);
824 NNS->print(OS, PrintPolicy, /*ResolveTemplateArgs*/ true);
825 JOS.attribute("qualifier", OS.str());
826 }
827 if (const TagDecl *TD = ET->getOwnedTagDecl())
828 JOS.attribute("ownedTagDecl", createBareDeclRef(TD));
832 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
836 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
837 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
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;
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;
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;
860 // Do not mangle template deduction guides.
861 if (isa<CXXDeductionGuideDecl>(ND))
862 return;
864 std::string MangledName = ASTNameGen.getName(ND);
865 if (!MangledName.empty())
866 JOS.attribute("mangledName", MangledName);
867 }
871 VisitNamedDecl(TD);
872 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
876 VisitNamedDecl(TAD);
877 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
881 VisitNamedDecl(ND);
882 attributeOnlyIfTrue("isInline", ND->isInline());
883 attributeOnlyIfTrue("isNested", ND->isNested());
884 if (!ND->isOriginalNamespace())
885 JOS.attribute("originalNamespace",
886 createBareDeclRef(ND->getOriginalNamespace()));
890 JOS.attribute("nominatedNamespace",
891 createBareDeclRef(UDD->getNominatedNamespace()));
895 VisitNamedDecl(NAD);
896 JOS.attribute("aliasedNamespace",
897 createBareDeclRef(NAD->getAliasedNamespace()));
901 std::string Name;
902 if (const NestedNameSpecifier *NNS = UD->getQualifier()) {
903 llvm::raw_string_ostream SOS(Name);
904 NNS->print(SOS, UD->getASTContext().getPrintingPolicy());
905 }
906 Name += UD->getNameAsString();
907 JOS.attribute("name", Name);
911 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
915 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
919 VisitNamedDecl(VD);
920 JOS.attribute("type", createQualType(VD->getType()));
921 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
922 attributeOnlyIfTrue("explicitObjectParameter",
923 P->isExplicitObjectParameter());
925 StorageClass SC = VD->getStorageClass();
926 if (SC != SC_None)
927 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
928 switch (VD->getTLSKind()) {
929 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
930 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
931 case VarDecl::TLS_None: break;
932 }
933 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
934 attributeOnlyIfTrue("inline", VD->isInline());
935 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
936 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
937 if (VD->hasInit()) {
938 switch (VD->getInitStyle()) {
939 case VarDecl::CInit: JOS.attribute("init", "c"); break;
940 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
941 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
943 JOS.attribute("init", "paren-list");
944 break;
945 }
946 }
947 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
951 VisitNamedDecl(FD);
952 JOS.attribute("type", createQualType(FD->getType()));
953 attributeOnlyIfTrue("mutable", FD->isMutable());
954 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
955 attributeOnlyIfTrue("isBitfield", FD->isBitField());
956 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
960 VisitNamedDecl(FD);
961 JOS.attribute("type", createQualType(FD->getType()));
962 StorageClass SC = FD->getStorageClass();
963 if (SC != SC_None)
964 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
965 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
966 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
967 attributeOnlyIfTrue("pure", FD->isPureVirtual());
968 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
969 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
970 attributeOnlyIfTrue("variadic", FD->isVariadic());
971 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
973 if (FD->isDefaulted())
974 JOS.attribute("explicitlyDefaulted",
975 FD->isDeleted() ? "deleted" : "default");
979 VisitNamedDecl(ED);
980 if (ED->isFixed())
981 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
982 if (ED->isScoped())
983 JOS.attribute("scopedEnumTag",
984 ED->isScopedUsingClassTag() ? "class" : "struct");
987 VisitNamedDecl(ECD);
988 JOS.attribute("type", createQualType(ECD->getType()));
992 VisitNamedDecl(RD);
993 JOS.attribute("tagUsed", RD->getKindName());
994 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
997 VisitRecordDecl(RD);
999 // All other information requires a complete definition.
1000 if (!RD->isCompleteDefinition())
1001 return;
1003 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1004 if (RD->getNumBases()) {
1005 JOS.attributeArray("bases", [this, RD] {
1006 for (const auto &Spec : RD->bases())
1007 JOS.value(createCXXBaseSpecifier(Spec));
1008 });
1009 }
1013 VisitNamedDecl(D);
1014 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1018 VisitNamedDecl(D);
1019 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1020 JOS.attribute("depth", D->getDepth());
1021 JOS.attribute("index", D->getIndex());
1022 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1024 if (D->hasDefaultArgument())
1025 JOS.attributeObject("defaultArg", [=] {
1028 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1029 });
1033 const NonTypeTemplateParmDecl *D) {
1034 VisitNamedDecl(D);
1035 JOS.attribute("type", createQualType(D->getType()));
1036 JOS.attribute("depth", D->getDepth());
1037 JOS.attribute("index", D->getIndex());
1038 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1040 if (D->hasDefaultArgument())
1041 JOS.attributeObject("defaultArg", [=] {
1044 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1045 });
1049 const TemplateTemplateParmDecl *D) {
1050 VisitNamedDecl(D);
1051 JOS.attribute("depth", D->getDepth());
1052 JOS.attribute("index", D->getIndex());
1053 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1055 if (D->hasDefaultArgument())
1056 JOS.attributeObject("defaultArg", [=] {
1057 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1059 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1060 InheritedFrom,
1061 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1062 });
1066 StringRef Lang;
1067 switch (LSD->getLanguage()) {
1069 Lang = "C";
1070 break;
1072 Lang = "C++";
1073 break;
1074 }
1075 JOS.attribute("language", Lang);
1076 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1080 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1084 if (const TypeSourceInfo *T = FD->getFriendType())
1085 JOS.attribute("type", createQualType(T->getType()));
1089 VisitNamedDecl(D);
1090 JOS.attribute("type", createQualType(D->getType()));
1091 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1092 switch (D->getAccessControl()) {
1093 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1094 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1095 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1096 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1097 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1098 }
1102 VisitNamedDecl(D);
1103 JOS.attribute("returnType", createQualType(D->getReturnType()));
1104 JOS.attribute("instance", D->isInstanceMethod());
1105 attributeOnlyIfTrue("variadic", D->isVariadic());
1109 VisitNamedDecl(D);
1110 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1111 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1112 switch (D->getVariance()) {
1114 break;
1116 JOS.attribute("variance", "covariant");
1117 break;
1119 JOS.attribute("variance", "contravariant");
1120 break;
1121 }
1125 VisitNamedDecl(D);
1126 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1127 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1129 llvm::json::Array Protocols;
1130 for (const auto* P : D->protocols())
1131 Protocols.push_back(createBareDeclRef(P));
1132 if (!Protocols.empty())
1133 JOS.attribute("protocols", std::move(Protocols));
1137 VisitNamedDecl(D);
1138 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1139 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1143 VisitNamedDecl(D);
1145 llvm::json::Array Protocols;
1146 for (const auto *P : D->protocols())
1147 Protocols.push_back(createBareDeclRef(P));
1148 if (!Protocols.empty())
1149 JOS.attribute("protocols", std::move(Protocols));
1153 VisitNamedDecl(D);
1154 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1155 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1157 llvm::json::Array Protocols;
1158 for (const auto* P : D->protocols())
1159 Protocols.push_back(createBareDeclRef(P));
1160 if (!Protocols.empty())
1161 JOS.attribute("protocols", std::move(Protocols));
1165 const ObjCImplementationDecl *D) {
1166 VisitNamedDecl(D);
1167 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1168 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1172 const ObjCCompatibleAliasDecl *D) {
1173 VisitNamedDecl(D);
1174 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1178 VisitNamedDecl(D);
1179 JOS.attribute("type", createQualType(D->getType()));
1181 switch (D->getPropertyImplementation()) {
1182 case ObjCPropertyDecl::None: break;
1183 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1184 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1185 }
1190 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1192 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1193 attributeOnlyIfTrue("readonly",
1195 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1196 attributeOnlyIfTrue("readwrite",
1198 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1199 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1200 attributeOnlyIfTrue("nonatomic",
1202 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1203 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1204 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1205 attributeOnlyIfTrue("unsafe_unretained",
1207 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1208 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1209 attributeOnlyIfTrue("nullability",
1211 attributeOnlyIfTrue("null_resettable",
1213 }
1218 JOS.attribute("implKind", D->getPropertyImplementation() ==
1220 ? "synthesize"
1221 : "dynamic");
1222 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1223 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1227 attributeOnlyIfTrue("variadic", D->isVariadic());
1228 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1232 JOS.attribute("name", AE->getOpAsString());
1236 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1240 std::string Str;
1241 llvm::raw_string_ostream OS(Str);
1243 OME->getSelector().print(OS);
1244 JOS.attribute("selector", OS.str());
1246 switch (OME->getReceiverKind()) {
1248 JOS.attribute("receiverKind", "instance");
1249 break;
1251 JOS.attribute("receiverKind", "class");
1252 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1253 break;
1255 JOS.attribute("receiverKind", "super (instance)");
1256 JOS.attribute("superType", createQualType(OME->getSuperType()));
1257 break;
1259 JOS.attribute("receiverKind", "super (class)");
1260 JOS.attribute("superType", createQualType(OME->getSuperType()));
1261 break;
1262 }
1264 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1265 if (OME->getType() != CallReturnTy)
1266 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1270 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1271 std::string Str;
1272 llvm::raw_string_ostream OS(Str);
1274 MD->getSelector().print(OS);
1275 JOS.attribute("selector", OS.str());
1276 }
1280 std::string Str;
1281 llvm::raw_string_ostream OS(Str);
1283 OSE->getSelector().print(OS);
1284 JOS.attribute("selector", OS.str());
1288 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1292 if (OPRE->isImplicitProperty()) {
1293 JOS.attribute("propertyKind", "implicit");
1294 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1295 JOS.attribute("getter", createBareDeclRef(MD));
1296 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1297 JOS.attribute("setter", createBareDeclRef(MD));
1298 } else {
1299 JOS.attribute("propertyKind", "explicit");
1300 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1301 }
1303 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1304 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1305 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1309 const ObjCSubscriptRefExpr *OSRE) {
1310 JOS.attribute("subscriptKind",
1311 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1313 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1314 JOS.attribute("getter", createBareDeclRef(MD));
1315 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1316 JOS.attribute("setter", createBareDeclRef(MD));
1320 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1321 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1322 JOS.attribute("isArrow", OIRE->isArrow());
1326 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1330 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1331 if (DRE->getDecl() != DRE->getFoundDecl())
1332 JOS.attribute("foundReferencedDecl",
1333 createBareDeclRef(DRE->getFoundDecl()));
1334 switch (DRE->isNonOdrUse()) {
1335 case NOUR_None: break;
1336 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1337 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1338 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1339 }
1340 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1344 const SYCLUniqueStableNameExpr *E) {
1345 JOS.attribute("typeSourceInfo",
1346 createQualType(E->getTypeSourceInfo()->getType()));
1350 JOS.attribute("name", PredefinedExpr::getIdentKindName(PE->getIdentKind()));
1354 JOS.attribute("isPostfix", UO->isPostfix());
1355 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1356 if (!UO->canOverflow())
1357 JOS.attribute("canOverflow", false);
1361 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1365 const CompoundAssignOperator *CAO) {
1367 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1368 JOS.attribute("computeResultType",
1369 createQualType(CAO->getComputationResultType()));
1373 // Note, we always write this Boolean field because the information it conveys
1374 // is critical to understanding the AST node.
1375 ValueDecl *VD = ME->getMemberDecl();
1376 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1377 JOS.attribute("isArrow", ME->isArrow());
1378 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1379 switch (ME->isNonOdrUse()) {
1380 case NOUR_None: break;
1381 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1382 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1383 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1384 }
1388 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1389 attributeOnlyIfTrue("isArray", NE->isArray());
1390 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1391 switch (NE->getInitializationStyle()) {
1393 break;
1395 JOS.attribute("initStyle", "call");
1396 break;
1398 JOS.attribute("initStyle", "list");
1399 break;
1400 }
1401 if (const FunctionDecl *FD = NE->getOperatorNew())
1402 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1403 if (const FunctionDecl *FD = NE->getOperatorDelete())
1404 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1407 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1408 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1409 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1410 if (const FunctionDecl *FD = DE->getOperatorDelete())
1411 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1415 attributeOnlyIfTrue("implicit", TE->isImplicit());
1419 JOS.attribute("castKind", CE->getCastKindName());
1420 llvm::json::Array Path = createCastPath(CE);
1421 if (!Path.empty())
1422 JOS.attribute("path", std::move(Path));
1423 // FIXME: This may not be useful information as it can be obtusely gleaned
1424 // from the inner[] array.
1425 if (const NamedDecl *ND = CE->getConversionFunction())
1426 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1430 VisitCastExpr(ICE);
1431 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1435 attributeOnlyIfTrue("adl", CE->usesADL());
1439 const UnaryExprOrTypeTraitExpr *TTE) {
1440 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1441 if (TTE->isArgumentType())
1442 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1446 VisitNamedDecl(SOPE->getPack());
1450 const UnresolvedLookupExpr *ULE) {
1451 JOS.attribute("usesADL", ULE->requiresADL());
1452 JOS.attribute("name", ULE->getName().getAsString());
1454 JOS.attributeArray("lookups", [this, ULE] {
1455 for (const NamedDecl *D : ULE->decls())
1456 JOS.value(createBareDeclRef(D));
1457 });
1461 JOS.attribute("name", ALE->getLabel()->getName());
1462 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1466 if (CTE->isTypeOperand()) {
1467 QualType Adjusted = CTE->getTypeOperand(Ctx);
1468 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1469 JOS.attribute("typeArg", createQualType(Unadjusted));
1470 if (Adjusted != Unadjusted)
1471 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1472 }
1477 Visit(CE->getAPValueResult(), CE->getType());
1481 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1482 JOS.attribute("field", createBareDeclRef(FD));
1486 const GenericSelectionExpr *GSE) {
1487 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1491 const CXXUnresolvedConstructExpr *UCE) {
1492 if (UCE->getType() != UCE->getTypeAsWritten())
1493 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1494 attributeOnlyIfTrue("list", UCE->isListInitialization());
1498 CXXConstructorDecl *Ctor = CE->getConstructor();
1499 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1500 attributeOnlyIfTrue("elidable", CE->isElidable());
1501 attributeOnlyIfTrue("list", CE->isListInitialization());
1502 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1503 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1504 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1505 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1507 switch (CE->getConstructionKind()) {
1509 JOS.attribute("constructionKind", "complete");
1510 break;
1512 JOS.attribute("constructionKind", "delegating");
1513 break;
1515 JOS.attribute("constructionKind", "non-virtual base");
1516 break;
1518 JOS.attribute("constructionKind", "virtual base");
1519 break;
1520 }
1524 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1526 if (EWC->getNumObjects()) {
1527 JOS.attributeArray("cleanups", [this, EWC] {
1528 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1529 if (auto *BD = CO.dyn_cast<BlockDecl *>()) {
1530 JOS.value(createBareDeclRef(BD));
1531 } else if (auto *CLE = CO.dyn_cast<CompoundLiteralExpr *>()) {
1532 llvm::json::Object Obj;
1533 Obj["id"] = createPointerRepresentation(CLE);
1534 Obj["kind"] = CLE->getStmtClassName();
1535 JOS.value(std::move(Obj));
1536 } else {
1537 llvm_unreachable("unexpected cleanup object type");
1538 }
1539 });
1540 }
1544 const CXXBindTemporaryExpr *BTE) {
1545 const CXXTemporary *Temp = BTE->getTemporary();
1546 JOS.attribute("temp", createPointerRepresentation(Temp));
1547 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1548 JOS.attribute("dtor", createBareDeclRef(Dtor));
1552 const MaterializeTemporaryExpr *MTE) {
1553 if (const ValueDecl *VD = MTE->getExtendingDecl())
1554 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1556 switch (MTE->getStorageDuration()) {
1557 case SD_Automatic:
1558 JOS.attribute("storageDuration", "automatic");
1559 break;
1560 case SD_Dynamic:
1561 JOS.attribute("storageDuration", "dynamic");
1562 break;
1563 case SD_FullExpression:
1564 JOS.attribute("storageDuration", "full expression");
1565 break;
1566 case SD_Static:
1567 JOS.attribute("storageDuration", "static");
1568 break;
1569 case SD_Thread:
1570 JOS.attribute("storageDuration", "thread");
1571 break;
1572 }
1574 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1578 const CXXDependentScopeMemberExpr *DSME) {
1579 JOS.attribute("isArrow", DSME->isArrow());
1580 JOS.attribute("member", DSME->getMember().getAsString());
1581 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1582 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1583 DSME->hasExplicitTemplateArgs());
1585 if (DSME->getNumTemplateArgs()) {
1586 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1587 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1588 JOS.object(
1589 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1590 });
1591 }
1595 if (!RE->isValueDependent())
1596 JOS.attribute("satisfied", RE->isSatisfied());
1600 llvm::SmallString<16> Buffer;
1601 IL->getValue().toString(Buffer,
1602 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1603 JOS.attribute("value", Buffer);
1606 // FIXME: This should probably print the character literal as a string,
1607 // rather than as a numerical value. It would be nice if the behavior matched
1608 // what we do to print a string literal; right now, it is impossible to tell
1609 // the difference between 'a' and L'a' in C from the JSON output.
1610 JOS.attribute("value", CL->getValue());
1613 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1616 llvm::SmallString<16> Buffer;
1617 FL->getValue().toString(Buffer);
1618 JOS.attribute("value", Buffer);
1621 std::string Buffer;
1622 llvm::raw_string_ostream SS(Buffer);
1623 SL->outputString(SS);
1624 JOS.attribute("value", SS.str());
1627 JOS.attribute("value", BLE->getValue());
1631 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1632 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1633 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1634 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1635 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1636 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1640 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1641 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1644 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1648 JOS.attribute("name", LS->getName());
1649 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1650 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1653 JOS.attribute("targetLabelDeclId",
1654 createPointerRepresentation(GS->getLabel()));
1658 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1662 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1663 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1664 // null child node and ObjC gets no child node.
1665 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1669 JOS.attribute("isNull", true);
1672 JOS.attribute("type", createQualType(TA.getAsType()));
1675 const TemplateArgument &TA) {
1676 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1679 JOS.attribute("isNullptr", true);
1682 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1685 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1686 // the output format.
1689 const TemplateArgument &TA) {
1690 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1691 // the output format.
1694 const TemplateArgument &TA) {
1695 JOS.attribute("isExpr", true);
1698 JOS.attribute("isPack", true);
1701StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1702 if (Traits)
1703 return Traits->getCommandInfo(CommandID)->Name;
1704 if (const comments::CommandInfo *Info =
1706 return Info->Name;
1707 return "<invalid>";
1711 const comments::FullComment *) {
1712 JOS.attribute("text", C->getText());
1717 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1719 switch (C->getRenderKind()) {
1721 JOS.attribute("renderKind", "normal");
1722 break;
1724 JOS.attribute("renderKind", "bold");
1725 break;
1727 JOS.attribute("renderKind", "emphasized");
1728 break;
1730 JOS.attribute("renderKind", "monospaced");
1731 break;
1733 JOS.attribute("renderKind", "anchor");
1734 break;
1735 }
1737 llvm::json::Array Args;
1738 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1739 Args.push_back(C->getArgText(I));
1741 if (!Args.empty())
1742 JOS.attribute("args", std::move(Args));
1747 JOS.attribute("name", C->getTagName());
1748 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1749 attributeOnlyIfTrue("malformed", C->isMalformed());
1751 llvm::json::Array Attrs;
1752 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1753 Attrs.push_back(
1754 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1756 if (!Attrs.empty())
1757 JOS.attribute("attrs", std::move(Attrs));
1762 JOS.attribute("name", C->getTagName());
1767 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1769 llvm::json::Array Args;
1770 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1771 Args.push_back(C->getArgText(I));
1773 if (!Args.empty())
1774 JOS.attribute("args", std::move(Args));
1779 switch (C->getDirection()) {
1781 JOS.attribute("direction", "in");
1782 break;
1784 JOS.attribute("direction", "out");
1785 break;
1787 JOS.attribute("direction", "in,out");
1788 break;
1789 }
1790 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1792 if (C->hasParamName())
1793 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1794 : C->getParamNameAsWritten());
1796 if (C->isParamIndexValid() && !C->isVarArgParam())
1797 JOS.attribute("paramIdx", C->getParamIndex());
1802 if (C->hasParamName())
1803 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1804 : C->getParamNameAsWritten());
1805 if (C->isPositionValid()) {
1806 llvm::json::Array Positions;
1807 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1808 Positions.push_back(C->getIndex(I));
1810 if (!Positions.empty())
1811 JOS.attribute("positions", std::move(Positions));
1812 }
1817 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1818 JOS.attribute("closeName", C->getCloseName());
1823 const comments::FullComment *) {
1824 JOS.attribute("text", C->getText());
1829 JOS.attribute("text", C->getText());
1832llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1833 llvm::json::Object Ret;
1835 if (FPO.has##NAME##Override()) \
1836 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1837#include "clang/Basic/FPOptions.def"
1838 return Ret;
1842 VisitStmt(S);
1843 if (S->hasStoredFPFeatures())
1844 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
int Category
Definition: Format.cpp:2965
#define FIELD1(Flag)
static llvm::json::Object createMoveAssignmentDefinitionData(const CXXRecordDecl *RD)
#define FIELD2(Name, Flag)
static llvm::json::Object createCopyAssignmentDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createCopyConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDestructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDefaultConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createMoveConstructorDefinitionData(const CXXRecordDecl *RD)
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class....
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
std::string Label
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition: APValue.h:122
@ None
There is no such object (it's outside its lifetime).
Definition: APValue.h:129
const LangOptions & getLangOpts() const
Definition: ASTContext.h:770
const clang::PrintingPolicy & getPrintingPolicy() const
Definition: ASTContext.h:692
std::string getName(const Decl *D)
Definition: Mangle.cpp:597
Represents an access specifier followed by colon ':'.
Definition: DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition: Expr.h:4308
LabelDecl * getLabel() const
Definition: Expr.h:4331
Represents an array type, per C99 - Array Declarators.
Definition: Type.h:3146
ArraySizeModifier getSizeModifier() const
Definition: Type.h:3160
Qualifiers getIndexTypeQualifiers() const
Definition: Type.h:3164
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition: Expr.h:6407
StringRef getOpAsString() const
Definition: Expr.h:6472
Attr - This represents one attribute.
Definition: Attr.h:42
attr::Kind getKind() const
Definition: Attr.h:88
bool isInherited() const
Definition: Attr.h:97
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition: Attr.h:101
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
Definition: Type.h:5523
AutoTypeKeyword getKeyword() const
Definition: Type.h:5554
A builtin binary operation expression such as "x + y" or "x <= y".
Definition: Expr.h:3810
StringRef getOpcodeStr() const
Definition: Expr.h:3875
Opcode getOpcode() const
Definition: Expr.h:3854
A class which contains all the information about a particular captured value.
Definition: Decl.h:4461
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition: Decl.h:4455
bool capturesCXXThis() const
Definition: Decl.h:4587
bool isVariadic() const
Definition: Decl.h:4530
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:1475
CXXTemporary * getTemporary()
Definition: ExprCXX.h:1493
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition: ExprCXX.h:720
bool getValue() const
Definition: ExprCXX.h:737
Represents a call to a C++ constructor.
Definition: ExprCXX.h:1530
bool isElidable() const
Whether this construction is elidable.
Definition: ExprCXX.h:1599
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition: ExprCXX.h:1604
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition: ExprCXX.h:1623
bool isImmediateEscalating() const
Definition: ExprCXX.h:1688
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition: ExprCXX.h:1632
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition: ExprCXX.h:1593
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition: ExprCXX.h:1612
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition: ExprCXX.h:1641
Represents a C++ constructor within a class.
Definition: DeclCXX.h:2528
Represents a C++ base or member initializer.
Definition: DeclCXX.h:2293
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition: ExprCXX.h:2481
FunctionDecl * getOperatorDelete() const
Definition: ExprCXX.h:2520
bool isArrayForm() const
Definition: ExprCXX.h:2507
bool isGlobalDelete() const
Definition: ExprCXX.h:2506
bool isArrayFormAsWritten() const
Definition: ExprCXX.h:2508
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition: ExprCXX.h:3645
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition: ExprCXX.h:3748
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition: ExprCXX.h:3843
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition: ExprCXX.h:3822
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition: ExprCXX.h:3787
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition: ExprCXX.h:3818
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition: ExprCXX.h:3850
Represents a C++ destructor within a class.
Definition: DeclCXX.h:2792
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition: ExprCXX.h:2224
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
base_class_range bases()
Definition: DeclCXX.h:618
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition: DeclCXX.h:612
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition: DeclCXX.h:905
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition: DeclCXX.h:1016
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition: DeclCXX.h:815
Represents a C++ temporary.
Definition: ExprCXX.h:1443
const CXXDestructorDecl * getDestructor() const
Definition: ExprCXX.h:1454
Represents the this expression in C++.
Definition: ExprCXX.h:1148
bool isImplicit() const
Definition: ExprCXX.h:1170
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition: ExprCXX.h:845
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition: ExprCXX.cpp:162
bool isTypeOperand() const
Definition: ExprCXX.h:881
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition: ExprCXX.h:888
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition: ExprCXX.h:3519
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition: ExprCXX.h:3574
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition: ExprCXX.h:3553
CallExpr - Represents a function call (C99, C++ []).
Definition: Expr.h:2795
bool usesADL() const
Definition: Expr.h:2955
CaseStmt - Represent a case statement.
Definition: Stmt.h:1799
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition: Stmt.h:1866
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition: Expr.h:3465
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition: Expr.cpp:1978
static const char * getCastKindName(CastKind CK)
Definition: Expr.cpp:1927
unsigned getValue() const
Definition: Expr.h:1597
CompoundAssignOperator - For compound assignments (e.g.
Definition: Expr.h:4058
QualType getComputationLHSType() const
Definition: Expr.h:4092
QualType getComputationResultType() const
Definition: Expr.h:4095
CompoundLiteralExpr - [C99].
Definition: Expr.h:3395
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition: Stmt.h:1604
A reference to a concept and its template args, as it appears in the code.
Definition: ASTConcept.h:128
SourceRange getSourceRange() const LLVM_READONLY
Definition: ASTConcept.h:195
ConceptDecl * getNamedConcept() const
Definition: ASTConcept.h:203
SourceLocation getLocation() const
Definition: ASTConcept.h:179
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition: ASTConcept.h:207
Represents the canonical version of C arrays with a specified constant size.
Definition: Type.h:3185
const llvm::APInt & getSize() const
Definition: Type.h:3206
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition: Expr.h:1059
APValue getAPValueResult() const
Definition: Expr.cpp:402
APValue::ValueKind getResultAPValueKind() const
Definition: Expr.h:1125
A reference to a declared variable, function, enum, etc.
Definition: Expr.h:1247
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition: Expr.h:1352
ValueDecl * getDecl()
Definition: Expr.h:1315
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition: Expr.h:1439
bool isImmediateEscalating() const
Definition: Expr.h:1449
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:85
ASTContext & getASTContext() const LLVM_READONLY
Definition: DeclBase.cpp:501
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition: DeclBase.h:598
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
Definition: DeclBase.cpp:262
bool isInvalidDecl() const
Definition: DeclBase.h:593
SourceLocation getLocation() const
Definition: DeclBase.h:444
const char * getDeclKindName() const
Definition: DeclBase.cpp:123
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition: DeclBase.h:626
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition: DeclBase.cpp:530
DeclContext * getDeclContext()
Definition: DeclBase.h:453
AccessSpecifier getAccess() const
Definition: DeclBase.h:512
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition: DeclBase.h:908
Kind getKind() const
Definition: DeclBase.h:447
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition: DeclBase.h:432
std::string getAsString() const
Retrieve the human-readable string for this name.
bool isDeduced() const
Definition: Type.h:5511
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Definition: DeclTemplate.h:345
Represents an extended vector type where either the type or size is dependent.
Definition: Type.h:3441
SourceLocation getAttributeLoc() const
Definition: Type.h:3457
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
Definition: Type.h:5913
TagDecl * getOwnedTagDecl() const
Return the (re)declaration of this type owned by this occurrence of this type, or nullptr if there is...
Definition: Type.h:5961
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
Definition: Type.h:5948
An instance of this object exists for each enum constant that is defined.
Definition: Decl.h:3265
Represents an enum.
Definition: Decl.h:3832
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4037
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition: Decl.h:4040
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition: Decl.h:4046
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition: Decl.h:3992
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition: ExprCXX.h:3436
bool cleanupsHaveSideEffects() const
Definition: ExprCXX.h:3471
ArrayRef< CleanupObject > getObjects() const
Definition: ExprCXX.h:3460
unsigned getNumObjects() const
Definition: ExprCXX.h:3464
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition: ExprCXX.h:3442
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition: Expr.h:169
QualType getType() const
Definition: Expr.h:142
Represents difference between two FPOptions values.
Definition: LangOptions.h:875
Represents a member of a struct/union/class.
Definition: Decl.h:3025
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition: Decl.h:3113
bool isBitField() const
Determines whether this field is a bitfield.
Definition: Decl.h:3116
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition: Decl.h:3186
std::string getValueAsString(unsigned Radix) const
Definition: Expr.cpp:981
llvm::APFloat getValue() const
Definition: Expr.h:1634
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition: DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition: DeclFriend.h:122
Represents a function declaration or definition.
Definition: Decl.h:1959
bool isImmediateFunction() const
Definition: Decl.cpp:3243
bool isVariadic() const
Whether this function is variadic.
Definition: Decl.cpp:3079
bool isDeleted() const
Whether this function has been deleted.
Definition: Decl.h:2477
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:2765
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition: Decl.h:2407
bool isDeletedAsWritten() const
Definition: Decl.h:2481
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition: Decl.h:2297
bool isDefaulted() const
Whether this function is defaulted.
Definition: Decl.h:2322
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition: Decl.h:2288
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition: Decl.h:2776
Represents a prototype with parameter type info, e.g.
Definition: Type.h:4198
ExtProtoInfo getExtProtoInfo() const
Definition: Type.h:4442
A class which abstracts out some details necessary for making a call.
Definition: Type.h:3909
CallingConv getCC() const
Definition: Type.h:3971
unsigned getRegParm() const
Definition: Type.h:3964
bool getHasRegParm() const
Definition: Type.h:3962
bool getNoReturn() const
Definition: Type.h:3957
bool getProducesResult() const
Definition: Type.h:3958
FunctionType - C99 - Function Declarators.
Definition: Type.h:3798
ExtInfo getExtInfo() const
Definition: Type.h:4127
static StringRef getNameForCallConv(CallingConv CC)
Definition: Type.cpp:3417
bool isConst() const
Definition: Type.h:4133
bool isRestrict() const
Definition: Type.h:4135
bool isVolatile() const
Definition: Type.h:4134
Represents a C11 generic selection.
Definition: Expr.h:5695
AssociationTy< true > ConstAssociation
Definition: Expr.h:5927
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition: Expr.h:5947
GotoStmt - This represents a direct goto.
Definition: Stmt.h:2860
LabelDecl * getLabel() const
Definition: Stmt.h:2873
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition: Decl.h:4901
bool isCBuffer() const
Definition: Decl.h:4929
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition: Stmt.h:2136
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition: Stmt.h:2211
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition: Stmt.h:2208
bool isConstexpr() const
Definition: Stmt.h:2329
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition: Stmt.h:2205
bool isNegatedConsteval() const
Definition: Stmt.h:2325
bool isConsteval() const
Definition: Stmt.h:2316
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition: Expr.h:3625
bool isPartOfExplicitCast() const
Definition: Expr.h:3656
Describes an C or C++ initializer list.
Definition: Expr.h:4817
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition: Expr.h:4936
The injected class name of a C++ class template or class template partial specialization.
Definition: Type.h:5763
CXXRecordDecl * getDecl() const
Definition: Type.cpp:4000
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void VisitUsingDecl(const UsingDecl *UD)
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void VisitConstantExpr(const ConstantExpr *CE)
void VisitRequiresExpr(const RequiresExpr *RE)
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
void VisitTagType(const TagType *TT)
void Visit(const Attr *A)
void VisitLabelStmt(const LabelStmt *LS)
void VisitRValueReferenceType(const ReferenceType *RT)
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
void VisitStringLiteral(const StringLiteral *SL)
void VisitBlockDecl(const BlockDecl *D)
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
void VisitDeprecatedAttr(const DeprecatedAttr *DA)
void VisitMemberPointerType(const MemberPointerType *MPT)
void VisitMemberExpr(const MemberExpr *ME)
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitSwitchStmt(const SwitchStmt *SS)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitBinaryOperator(const BinaryOperator *BO)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
void VisitTypedefDecl(const TypedefDecl *TD)
void VisitTypedefType(const TypedefType *TT)
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitElaboratedType(const ElaboratedType *ET)
void VisitUnaryTransformType(const UnaryTransformType *UTT)
void VisitCallExpr(const CallExpr *CE)
void VisitVisibilityAttr(const VisibilityAttr *VA)
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void VisitAtomicExpr(const AtomicExpr *AE)
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
void VisitFloatingLiteral(const FloatingLiteral *FL)
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
void VisitWhileStmt(const WhileStmt *WS)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitVarDecl(const VarDecl *VD)
void VisitEnumDecl(const EnumDecl *ED)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitFieldDecl(const FieldDecl *FD)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
void VisitDeclRefExpr(const DeclRefExpr *DRE)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitNamespaceDecl(const NamespaceDecl *ND)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitAutoType(const AutoType *AT)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitUnavailableAttr(const UnavailableAttr *UA)
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
void VisitPredefinedExpr(const PredefinedExpr *PE)
void VisitAliasAttr(const AliasAttr *AA)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitPackExpansionType(const PackExpansionType *PET)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitSectionAttr(const SectionAttr *SA)
void VisitUsingType(const UsingType *TT)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT)
void VisitArrayType(const ArrayType *AT)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
void VisitGotoStmt(const GotoStmt *GS)
void VisitCharacterLiteral(const CharacterLiteral *CL)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitTLSModelAttr(const TLSModelAttr *TA)
void VisitCompoundStmt(const CompoundStmt *IS)
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
void VisitCXXThisExpr(const CXXThisExpr *TE)
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
void VisitConstantArrayType(const ConstantArrayType *CAT)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *NE)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitCastExpr(const CastExpr *CE)
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
void VisitIfStmt(const IfStmt *IS)
void VisitUnaryOperator(const UnaryOperator *UO)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
void VisitIntegerLiteral(const IntegerLiteral *IL)
void VisitUsingEnumDecl(const UsingEnumDecl *UED)
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
void VisitFunctionType(const FunctionType *T)
void VisitRecordDecl(const RecordDecl *RD)
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitNamedDecl(const NamedDecl *ND)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitFriendDecl(const FriendDecl *FD)
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
LabelStmt - Represents a label, which has a substatement.
Definition: Stmt.h:2029
LabelDecl * getDecl() const
Definition: Stmt.h:2047
bool isSideEntry() const
Definition: Stmt.h:2068
const char * getName() const
Definition: Stmt.cpp:421
static unsigned MeasureTokenLength(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
MeasureTokenLength - Relex the token at the specified location and return its length in bytes in the ...
Definition: Lexer.cpp:499
Represents a linkage specification.
Definition: DeclCXX.h:2927
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition: DeclCXX.h:2950
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition: DeclCXX.h:2961
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition: Type.h:4784
const IdentifierInfo * getMacroIdentifier() const
Definition: Type.h:4799
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition: ExprCXX.h:4679
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition: ExprCXX.h:4704
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition: ExprCXX.h:4748
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition: ExprCXX.h:4729
MemberExpr - [C99] Structure and Union Members.
Definition: Expr.h:3158
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition: Expr.h:3237
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:3378
bool isArrow() const
Definition: Expr.h:3338
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition: Type.h:3088
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition: Type.h:3108
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition: Type.h:3114
This represents a decl that may have a name.
Definition: Decl.h:249
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition: DeclBase.h:647
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition: Decl.h:276
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition: Decl.h:315
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
Definition: Decl.h:292
Represents a C++ namespace alias.
Definition: DeclCXX.h:3113
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition: DeclCXX.h:3208
Represent a C++ namespace.
Definition: Decl.h:547
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
Definition: DeclCXX.cpp:2994
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition: Decl.h:610
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
Definition: DeclCXX.cpp:2980
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition: Decl.h:627
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
llvm::json::OStream JOS
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
const DefArgStorage & getDefaultArgStorage() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
Expr * getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getDepth() const
Get the nesting depth of the template parameter.
This is a basic class for representing single OpenMP clause.
Definition: OpenMPClause.h:55
Represents Objective-C's @catch statement.
Definition: StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition: StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition: ExprObjC.h:87
ObjCBoxedExpr - used for generalized expression boxing.
Definition: ExprObjC.h:127
ObjCMethodDecl * getBoxingMethod() const
Definition: ExprObjC.h:146
ObjCCategoryDecl - Represents a category declaration.
Definition: DeclObjC.h:2323
ObjCCategoryImplDecl * getImplementation() const
Definition: DeclObjC.cpp:2169
ObjCInterfaceDecl * getClassInterface()
Definition: DeclObjC.h:2368
protocol_range protocols() const
Definition: DeclObjC.h:2399
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition: DeclObjC.h:2542
ObjCCategoryDecl * getCategoryDecl() const
Definition: DeclObjC.cpp:2213
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition: DeclObjC.h:2772
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2790
ObjCEncodeExpr, used for @encode in Objective-C.
Definition: ExprObjC.h:410
QualType getEncodedType() const
Definition: ExprObjC.h:429
const ObjCInterfaceDecl * getClassInterface() const
Definition: DeclObjC.h:2483
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition: DeclObjC.h:2595
const ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.h:2732
Represents an ObjC class declaration.
Definition: DeclObjC.h:1150
protocol_range protocols() const
Definition: DeclObjC.h:1355
ObjCImplementationDecl * getImplementation() const
Definition: DeclObjC.cpp:1635
ObjCInterfaceDecl * getSuperClass() const
Definition: DeclObjC.cpp:351
Interfaces are the core concept in Objective-C for object oriented design.
Definition: Type.h:6494
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition: Type.cpp:849
ObjCIvarDecl - Represents an ObjC instance variable.
Definition: DeclObjC.h:1947
AccessControl getAccessControl() const
Definition: DeclObjC.h:1996
bool getSynthesize() const
Definition: DeclObjC.h:2003
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition: ExprObjC.h:549
ObjCIvarDecl * getDecl()
Definition: ExprObjC.h:579
bool isArrow() const
Definition: ExprObjC.h:587
bool isFreeIvar() const
Definition: ExprObjC.h:588
An expression that sends a message to the given Objective-C object or class.
Definition: ExprObjC.h:945
QualType getCallReturnType(ASTContext &Ctx) const
Definition: ExprObjC.cpp:265
Selector getSelector() const
Definition: ExprObjC.cpp:293
@ SuperInstance
The receiver is the instance of the superclass object.
Definition: ExprObjC.h:959
@ Instance
The receiver is an object instance.
Definition: ExprObjC.h:953
@ SuperClass
The receiver is a superclass.
Definition: ExprObjC.h:956
@ Class
The receiver is a class.
Definition: ExprObjC.h:950
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition: ExprObjC.h:1279
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition: ExprObjC.h:1336
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition: ExprObjC.h:1234
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:140
bool isVariadic() const
Definition: DeclObjC.h:431
bool isInstanceMethod() const
Definition: DeclObjC.h:426
QualType getReturnType() const
Definition: DeclObjC.h:329
Represents one property declaration in an Objective-C interface.
Definition: DeclObjC.h:729
ObjCMethodDecl * getGetterMethodDecl() const
Definition: DeclObjC.h:897
ObjCMethodDecl * getSetterMethodDecl() const
Definition: DeclObjC.h:900
QualType getType() const
Definition: DeclObjC.h:800
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition: DeclObjC.h:811
PropertyControl getPropertyImplementation() const
Definition: DeclObjC.h:908
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition: DeclObjC.h:2802
ObjCIvarDecl * getPropertyIvarDecl() const
Definition: DeclObjC.h:2875
Kind getPropertyImplementation() const
Definition: DeclObjC.h:2871
ObjCPropertyDecl * getPropertyDecl() const
Definition: DeclObjC.h:2866
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition: ExprObjC.h:617
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition: ExprObjC.h:736
ObjCPropertyDecl * getExplicitProperty() const
Definition: ExprObjC.h:706
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition: ExprObjC.h:743
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition: ExprObjC.h:711
bool isImplicitProperty() const
Definition: ExprObjC.h:703
ObjCMethodDecl * getImplicitPropertySetter() const
Definition: ExprObjC.h:716
bool isSuperReceiver() const
Definition: ExprObjC.h:775
Represents an Objective-C protocol declaration.
Definition: DeclObjC.h:2079
protocol_range protocols() const
Definition: DeclObjC.h:2155
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition: ExprObjC.h:505
ObjCProtocolDecl * getProtocol() const
Definition: ExprObjC.h:522
ObjCSelectorExpr used for @selector in Objective-C.
Definition: ExprObjC.h:455
Selector getSelector() const
Definition: ExprObjC.h:469
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition: ExprObjC.h:844
bool isArraySubscriptRefExpr() const
Definition: ExprObjC.h:897
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition: ExprObjC.h:889
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition: ExprObjC.h:893
Represents the declaration of an Objective-C type parameter.
Definition: DeclObjC.h:578
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition: DeclObjC.h:639
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition: DeclObjC.h:622
llvm::iterator_range< decls_iterator > decls() const
Definition: ExprCXX.h:3064
DeclarationName getName() const
Gets the name looked up.
Definition: ExprCXX.h:3075
Represents a pack expansion of types.
Definition: Type.h:6111
std::optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
Definition: Type.h:6136
[C99] - A predefined identifier such as func.
Definition: Expr.h:1962
StringRef getIdentKindName() const
Definition: Expr.h:2019
PredefinedIdentKind getIdentKind() const
Definition: Expr.h:1997
Represents an unpacked "presumed" location which can be presented to the user.
unsigned getColumn() const
Return the presumed column number of this location.
const char * getFilename() const
Return the presumed filename of this location.
bool isValid() const
unsigned getLine() const
Return the presumed line number of this location.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
A (possibly-)qualified type.
Definition: Type.h:737
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition: Type.h:804
SplitQualType getSplitDesugaredType() const
Definition: Type.h:1092
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition: Type.h:6922
std::string getAsString() const
void * getAsOpaquePtr() const
Definition: Type.h:784
std::string getAsString() const
Represents a struct/union/class.
Definition: Decl.h:4133
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Definition: Type.h:5091
RecordDecl * getDecl() const
Definition: Type.h:5101
Base for LValueReferenceType and RValueReferenceType.
Definition: Type.h:3008
bool isSpelledAsLValue() const
Definition: Type.h:3021
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
Definition: ExprConcepts.h:510
bool isSatisfied() const
Whether or not the requires clause is satisfied.
Definition: ExprConcepts.h:562
TypeSourceInfo * getTypeSourceInfo()
Definition: Expr.h:2066
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:4220
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition: ExprCXX.h:4289
Encodes a location in the source.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
StringRef getBufferName(SourceLocation Loc, bool *Invalid=nullptr) const
Return the filename or buffer identifier of the buffer the location is in.
bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc=nullptr) const
Tests whether the given source location represents a macro argument's expansion into the function-lik...
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID.
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
bool isValid() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition: StmtVisitor.h:44
Stmt - This represents one statement.
Definition: Stmt.h:84
StringLiteral - This represents a string literal expression, e.g.
Definition: Expr.h:1760
void outputString(raw_ostream &OS) const
Definition: Expr.cpp:1182
Represents the result of substituting a set of types for a template type parameter pack.
Definition: Type.h:5431
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: Type.h:5457
Represents the result of substituting a type for a template type parameter.
Definition: Type.h:5361
std::optional< unsigned > getPackIndex() const
Definition: Type.h:5391
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
Definition: Type.h:5389
SwitchStmt - This represents a 'switch' stmt.
Definition: Stmt.h:2386
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition: Stmt.h:2447
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition: Stmt.h:2444
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3549
StringRef getKindName() const
Definition: Decl.h:3740
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition: Decl.h:3652
TagDecl * getDecl() const
Definition: Type.cpp:3900
Location wrapper for a TemplateArgument.
Definition: TemplateBase.h:524
const TemplateArgument & getArgument() const
Definition: TemplateBase.h:574
Represents a template argument.
Definition: TemplateBase.h:61
QualType getAsType() const
Retrieve the type for a type template argument.
Definition: TemplateBase.h:319
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
Definition: TemplateBase.h:363
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
Definition: TemplateBase.h:326
void print(raw_ostream &OS, const PrintingPolicy &Policy, Qualified Qual=Qualified::AsWritten) const
Print the template name.
Represents a type template specialization; the template must be a class template, a type alias templa...
Definition: Type.h:5631
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
Definition: Type.h:5697
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
Definition: Type.h:5690
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const DefArgStorage & getDefaultArgStorage() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
QualType getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getIndex() const
Retrieve the index of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template parameter.
const DefArgStorage & getDefaultArgStorage() const
TemplateTypeParmDecl * getDecl() const
Definition: Type.h:5324
bool isParameterPack() const
Definition: Type.h:5322
unsigned getIndex() const
Definition: Type.h:5321
unsigned getDepth() const
Definition: Type.h:5320
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition: Decl.h:3521
Base wrapper for a particular "section" of type source info.
Definition: TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition: TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition: TypeLoc.h:153
TypeLocClass getTypeLocClass() const
Definition: TypeLoc.h:116
bool isNull() const
Definition: TypeLoc.h:121
const Type * getTypePtr() const
Definition: TypeLoc.h:137
A container of type source information.
Definition: Type.h:6872
QualType getType() const
Return the type wrapped by this type source info.
Definition: Type.h:6883
void Visit(const Type *T)
Performs the operation associated with this visitor object.
Definition: TypeVisitor.h:68
The base class of the type hierarchy.
Definition: Type.h:1606
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition: Type.cpp:2083
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
Definition: Type.h:2427
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
Definition: Type.h:2419
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
Definition: Type.h:2094
const char * getTypeClassName() const
Definition: Type.cpp:3208
bool containsErrors() const
Whether this type is an error type.
Definition: Type.h:2413
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
Definition: Type.h:2437
bool isFromAST() const
Whether this type comes from an AST file.
Definition: Type.h:2077
const T * getAs() const
Member-template getAs<specific type>'.
Definition: Type.h:7652
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition: Decl.h:3501
QualType getUnderlyingType() const
Definition: Decl.h:3454
TypedefNameDecl * getDecl() const
Definition: Type.h:4759
QualType desugar() const
Definition: Type.cpp:3720
bool typeMatchesDecl() const
Definition: Type.h:4767
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition: Expr.h:2543
QualType getArgumentType() const
Definition: Expr.h:2586
bool isArgumentType() const
Definition: Expr.h:2585
UnaryExprOrTypeTrait getKind() const
Definition: Expr.h:2575
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition: Expr.h:2158
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition: Expr.h:2232
Opcode getOpcode() const
Definition: Expr.h:2198
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition: Expr.cpp:1374
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition: Expr.h:2216
A unary type transform, which is a type constructed from another.
Definition: Type.h:5008
UTTKind getUTTKind() const
Definition: Type.h:5037
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition: ExprCXX.h:3163
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition: ExprCXX.h:3231
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition: Type.h:4686
UnresolvedUsingTypenameDecl * getDecl() const
Definition: Type.h:4697
Represents a C++ using-declaration.
Definition: DeclCXX.h:3505
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition: DeclCXX.h:3542
Represents C++ using-directive.
Definition: DeclCXX.h:3008
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition: DeclCXX.cpp:2943
Represents a C++ using-enum-declaration.
Definition: DeclCXX.h:3706
EnumDecl * getEnumDecl() const
Definition: DeclCXX.h:3750
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition: DeclCXX.h:3313
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition: DeclCXX.h:3377
QualType desugar() const
Definition: Type.h:4732
UsingShadowDecl * getFoundDecl() const
Definition: Type.h:4726
bool typeMatchesDecl() const
Definition: Type.h:4735
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition: Decl.h:706
QualType getType() const
Definition: Decl.h:717
Represents a variable declaration or definition.
Definition: Decl.h:918
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition: Decl.h:1546
TLSKind getTLSKind() const
Definition: Decl.cpp:2165
bool hasInit() const
Definition: Decl.cpp:2395
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition: Decl.h:1443
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition: Decl.cpp:2118
@ ListInit
Direct list-initialization (C++11)
Definition: Decl.h:929
@ CInit
C-style initialization with assignment.
Definition: Decl.h:923
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition: Decl.h:932
@ CallInit
Call-style initialization (C++98)
Definition: Decl.h:926
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition: Decl.h:1489
bool isInline() const
Whether this variable is (C++1z) inline.
Definition: Decl.h:1528
@ TLS_Static
TLS with a known-constant initializer.
Definition: Decl.h:941
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition: Decl.h:944
@ TLS_None
Not a TLS variable.
Definition: Decl.h:938
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition: Decl.h:1152
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack.
Definition: Decl.cpp:2653
Represents a GCC generic vector type.
Definition: Type.h:3511
unsigned getNumElements() const
Definition: Type.h:3526
VectorKind getVectorKind() const
Definition: Type.h:3531
WhileStmt - This represents a 'while' stmt.
Definition: Stmt.h:2582
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition: Stmt.h:2632
RetTy Visit(PTR(Attr) A)
Definition: AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition: Comment.h:604
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
const CommandInfo * getCommandInfo(StringRef Name) const
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition: Comment.h:65
A full comment attached to a declaration, contains block content.
Definition: Comment.h:1083
An opening HTML tag with attributes.
Definition: Comment.h:433
A command with word-like arguments that is considered inline content.
Definition: Comment.h:335
Doxygen \param command.
Definition: Comment.h:711
Doxygen \tparam command, describes a template parameter.
Definition: Comment.h:793
A verbatim block command (e.
Definition: Comment.h:879
A line of text contained in a verbatim block.
Definition: Comment.h:854
A verbatim line command.
Definition: Comment.h:930
A static requirement that can be used in a requires-expression to check properties of types and expre...
Definition: ExprConcepts.h:168
RequirementKind getKind() const
Definition: ExprConcepts.h:198
bool containsUnexpandedParameterPack() const
Definition: ExprConcepts.h:218
RetTy Visit(PTR(Decl) D)
Definition: DeclVisitor.h:37
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
@ kind_nullability
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
bool Ret(InterpState &S, CodePtr &PC, APValue &Result)
Definition: Interp.h:207
@ GNUAutoType
__auto_type (GNU extension)
@ DecltypeAuto
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition: Specifiers.h:397
@ RQ_None
No ref-qualifier was provided.
Definition: Type.h:1555
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition: Type.h:1558
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition: Type.h:1561
Storage classes.
Definition: Specifiers.h:245
@ SC_None
Definition: Specifiers.h:247
@ SD_Thread
Thread storage duration.
Definition: Specifiers.h:326
@ SD_Static
Static storage duration.
Definition: Specifiers.h:327
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition: Specifiers.h:324
@ SD_Automatic
Automatic storage duration (most local variables).
Definition: Specifiers.h:325
@ SD_Dynamic
Dynamic storage duration.
Definition: Specifiers.h:328
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition: Specifiers.h:132
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition: Specifiers.h:141
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition: Specifiers.h:136
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T -> getSizeExpr()))
@ 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
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
Microsoft throw(...) extension.
@ EST_BasicNoexcept
@ 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)
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition: Specifiers.h:120
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition: Specifiers.h:180
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition: Specifiers.h:174
@ NOUR_None
This is an odr-use.
Definition: Specifiers.h:172
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition: Specifiers.h:177
unsigned long uint64_t
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition: Type.h:4251
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition: Type.h:4254
Extra information about a function prototype.
Definition: Type.h:4277
ExceptionSpecInfo ExceptionSpec
Definition: Type.h:4284
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
Definition: Type.h:670
Qualifiers Quals
The local qualifiers.
Definition: Type.h:675
Information about a single command.