Thanks to visit codestin.com
Credit goes to clang.llvm.org

clang 22.0.0git
JSONNodeDumper.cpp
Go to the documentation of this file.
2#include "clang/AST/Type.h"
5#include "clang/Lex/Lexer.h"
6#include "llvm/ADT/StringExtras.h"
7
8using namespace clang;
9
10void JSONNodeDumper::addPreviousDeclaration(const Decl *D) {
11 switch (D->getKind()) {
12#define DECL(DERIVED, BASE) \
13 case Decl::DERIVED: \
14 return writePreviousDeclImpl(cast<DERIVED##Decl>(D));
15#define ABSTRACT_DECL(DECL)
16#include "clang/AST/DeclNodes.inc"
17#undef ABSTRACT_DECL
18#undef DECL
19 }
20 llvm_unreachable("Decl that isn't part of DeclNodes.inc!");
21}
22
24 const char *AttrName = nullptr;
25 switch (A->getKind()) {
26#define ATTR(X) \
27 case attr::X: \
28 AttrName = #X"Attr"; \
29 break;
30#include "clang/Basic/AttrList.inc"
31#undef ATTR
32 }
33 JOS.attribute("id", createPointerRepresentation(A));
34 JOS.attribute("kind", AttrName);
35 JOS.attributeObject("range", [A, this] { writeSourceRange(A->getRange()); });
36 attributeOnlyIfTrue("inherited", A->isInherited());
37 attributeOnlyIfTrue("implicit", A->isImplicit());
38
39 // FIXME: it would be useful for us to output the spelling kind as well as
40 // the actual spelling. This would allow us to distinguish between the
41 // various attribute syntaxes, but we don't currently track that information
42 // within the AST.
43 //JOS.attribute("spelling", A->getSpelling());
44
46}
47
49 if (!S)
50 return;
51
52 JOS.attribute("id", createPointerRepresentation(S));
53 JOS.attribute("kind", S->getStmtClassName());
54 JOS.attributeObject("range",
55 [S, this] { writeSourceRange(S->getSourceRange()); });
56
57 if (const auto *E = dyn_cast<Expr>(S)) {
58 JOS.attribute("type", createQualType(E->getType()));
59 const char *Category = nullptr;
60 switch (E->getValueKind()) {
61 case VK_LValue: Category = "lvalue"; break;
62 case VK_XValue: Category = "xvalue"; break;
63 case VK_PRValue:
64 Category = "prvalue";
65 break;
66 }
67 JOS.attribute("valueCategory", Category);
68 }
70}
71
73 JOS.attribute("id", createPointerRepresentation(T));
74
75 if (!T)
76 return;
77
78 JOS.attribute("kind", (llvm::Twine(T->getTypeClassName()) + "Type").str());
79 JOS.attribute("type", createQualType(QualType(T, 0), /*Desugar=*/false));
80 attributeOnlyIfTrue("containsErrors", T->containsErrors());
81 attributeOnlyIfTrue("isDependent", T->isDependentType());
82 attributeOnlyIfTrue("isInstantiationDependent",
83 T->isInstantiationDependentType());
84 attributeOnlyIfTrue("isVariablyModified", T->isVariablyModifiedType());
85 attributeOnlyIfTrue("containsUnexpandedPack",
86 T->containsUnexpandedParameterPack());
87 attributeOnlyIfTrue("isImported", T->isFromAST());
89}
90
92 JOS.attribute("id", createPointerRepresentation(T.getAsOpaquePtr()));
93 JOS.attribute("kind", "QualType");
94 JOS.attribute("type", createQualType(T));
95 JOS.attribute("qualifiers", T.split().Quals.getAsString());
96}
97
99 if (TL.isNull())
100 return;
101 JOS.attribute("kind",
102 (llvm::Twine(TL.getTypeLocClass() == TypeLoc::Qualified
103 ? "Qualified"
104 : TL.getTypePtr()->getTypeClassName()) +
105 "TypeLoc")
106 .str());
107 JOS.attribute("type",
108 createQualType(QualType(TL.getType()), /*Desugar=*/false));
109 JOS.attributeObject("range",
110 [TL, this] { writeSourceRange(TL.getSourceRange()); });
111}
112
114 JOS.attribute("id", createPointerRepresentation(D));
115
116 if (!D)
117 return;
118
119 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
120 JOS.attributeObject("loc",
121 [D, this] { writeSourceLocation(D->getLocation()); });
122 JOS.attributeObject("range",
123 [D, this] { writeSourceRange(D->getSourceRange()); });
124 attributeOnlyIfTrue("isImplicit", D->isImplicit());
125 attributeOnlyIfTrue("isInvalid", D->isInvalidDecl());
126
127 if (D->isUsed())
128 JOS.attribute("isUsed", true);
129 else if (D->isThisDeclarationReferenced())
130 JOS.attribute("isReferenced", true);
131
132 if (const auto *ND = dyn_cast<NamedDecl>(D))
133 attributeOnlyIfTrue("isHidden", !ND->isUnconditionallyVisible());
134
135 if (D->getLexicalDeclContext() != D->getDeclContext()) {
136 // Because of multiple inheritance, a DeclContext pointer does not produce
137 // the same pointer representation as a Decl pointer that references the
138 // same AST Node.
139 const auto *ParentDeclContextDecl = dyn_cast<Decl>(D->getDeclContext());
140 JOS.attribute("parentDeclContextId",
141 createPointerRepresentation(ParentDeclContextDecl));
142 }
143
144 addPreviousDeclaration(D);
146}
147
149 const comments::FullComment *FC) {
150 if (!C)
151 return;
152
153 JOS.attribute("id", createPointerRepresentation(C));
154 JOS.attribute("kind", C->getCommentKindName());
155 JOS.attributeObject("loc",
156 [C, this] { writeSourceLocation(C->getLocation()); });
157 JOS.attributeObject("range",
158 [C, this] { writeSourceRange(C->getSourceRange()); });
159
161}
162
164 const Decl *From, StringRef Label) {
165 JOS.attribute("kind", "TemplateArgument");
166 if (R.isValid())
167 JOS.attributeObject("range", [R, this] { writeSourceRange(R); });
168
169 if (From)
170 JOS.attribute(Label.empty() ? "fromDecl" : Label, createBareDeclRef(From));
171
173}
174
176 JOS.attribute("kind", "CXXCtorInitializer");
177 if (Init->isAnyMemberInitializer())
178 JOS.attribute("anyInit", createBareDeclRef(Init->getAnyMember()));
179 else if (Init->isBaseInitializer())
180 JOS.attribute("baseInit",
181 createQualType(QualType(Init->getBaseClass(), 0)));
182 else if (Init->isDelegatingInitializer())
183 JOS.attribute("delegatingInit",
184 createQualType(Init->getTypeSourceInfo()->getType()));
185 else
186 llvm_unreachable("Unknown initializer type");
187}
188
190
192
194 JOS.attribute("kind", "Capture");
195 attributeOnlyIfTrue("byref", C.isByRef());
196 attributeOnlyIfTrue("nested", C.isNested());
197 if (C.getVariable())
198 JOS.attribute("var", createBareDeclRef(C.getVariable()));
199}
200
202 JOS.attribute("associationKind", A.getTypeSourceInfo() ? "case" : "default");
203 attributeOnlyIfTrue("selected", A.isSelected());
204}
205
207 if (!R)
208 return;
209
210 switch (R->getKind()) {
212 JOS.attribute("kind", "TypeRequirement");
213 break;
215 JOS.attribute("kind", "SimpleRequirement");
216 break;
218 JOS.attribute("kind", "CompoundRequirement");
219 break;
221 JOS.attribute("kind", "NestedRequirement");
222 break;
223 }
224
225 if (auto *ER = dyn_cast<concepts::ExprRequirement>(R))
226 attributeOnlyIfTrue("noexcept", ER->hasNoexceptRequirement());
227
228 attributeOnlyIfTrue("isDependent", R->isDependent());
229 if (!R->isDependent())
230 JOS.attribute("satisfied", R->isSatisfied());
231 attributeOnlyIfTrue("containsUnexpandedPack",
233}
234
236 std::string Str;
237 llvm::raw_string_ostream OS(Str);
238 Value.printPretty(OS, Ctx, Ty);
239 JOS.attribute("value", Str);
240}
241
243 JOS.attribute("kind", "ConceptReference");
244 JOS.attribute("id", createPointerRepresentation(CR->getNamedConcept()));
245 if (const auto *Args = CR->getTemplateArgsAsWritten()) {
246 JOS.attributeArray("templateArgsAsWritten", [Args, this] {
247 for (const TemplateArgumentLoc &TAL : Args->arguments())
248 JOS.object(
249 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
250 });
251 }
252 JOS.attributeObject("loc",
253 [CR, this] { writeSourceLocation(CR->getLocation()); });
254 JOS.attributeObject("range",
255 [CR, this] { writeSourceRange(CR->getSourceRange()); });
256}
257
258void JSONNodeDumper::writeIncludeStack(PresumedLoc Loc, bool JustFirst) {
259 if (Loc.isInvalid())
260 return;
261
262 JOS.attributeBegin("includedFrom");
263 JOS.objectBegin();
264
265 if (!JustFirst) {
266 // Walk the stack recursively, then print out the presumed location.
267 writeIncludeStack(SM.getPresumedLoc(Loc.getIncludeLoc()));
268 }
269
270 JOS.attribute("file", Loc.getFilename());
271 JOS.objectEnd();
272 JOS.attributeEnd();
273}
274
275void JSONNodeDumper::writeBareSourceLocation(SourceLocation Loc,
276 bool IsSpelling) {
277 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
278 unsigned ActualLine = IsSpelling ? SM.getSpellingLineNumber(Loc)
279 : SM.getExpansionLineNumber(Loc);
280 StringRef ActualFile = SM.getBufferName(Loc);
281
282 if (Presumed.isValid()) {
283 JOS.attribute("offset", SM.getDecomposedLoc(Loc).second);
284 if (LastLocFilename != ActualFile) {
285 JOS.attribute("file", ActualFile);
286 JOS.attribute("line", ActualLine);
287 } else if (LastLocLine != ActualLine)
288 JOS.attribute("line", ActualLine);
289
290 StringRef PresumedFile = Presumed.getFilename();
291 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
292 JOS.attribute("presumedFile", PresumedFile);
293
294 unsigned PresumedLine = Presumed.getLine();
295 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
296 JOS.attribute("presumedLine", PresumedLine);
297
298 JOS.attribute("col", Presumed.getColumn());
299 JOS.attribute("tokLen",
300 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
301 LastLocFilename = ActualFile;
302 LastLocPresumedFilename = PresumedFile;
303 LastLocPresumedLine = PresumedLine;
304 LastLocLine = ActualLine;
305
306 // Orthogonal to the file, line, and column de-duplication is whether the
307 // given location was a result of an include. If so, print where the
308 // include location came from.
309 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
310 /*JustFirst*/ true);
311 }
312}
313
314void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
315 SourceLocation Spelling = SM.getSpellingLoc(Loc);
316 SourceLocation Expansion = SM.getExpansionLoc(Loc);
317
318 if (Expansion != Spelling) {
319 // If the expansion and the spelling are different, output subobjects
320 // describing both locations.
321 JOS.attributeObject("spellingLoc", [Spelling, this] {
322 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
323 });
324 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
325 writeBareSourceLocation(Expansion, /*IsSpelling*/ false);
326 // If there is a macro expansion, add extra information if the interesting
327 // bit is the macro arg expansion.
328 if (SM.isMacroArgExpansion(Loc))
329 JOS.attribute("isMacroArgExpansion", true);
330 });
331 } else
332 writeBareSourceLocation(Spelling, /*IsSpelling*/ true);
333}
334
335void JSONNodeDumper::writeSourceRange(SourceRange R) {
336 JOS.attributeObject("begin",
337 [R, this] { writeSourceLocation(R.getBegin()); });
338 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
339}
340
341std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
342 // Because JSON stores integer values as signed 64-bit integers, trying to
343 // represent them as such makes for very ugly pointer values in the resulting
344 // output. Instead, we convert the value to hex and treat it as a string.
345 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
346}
347
348llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
349 SplitQualType SQT = QT.split();
350 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
351 llvm::json::Object Ret{{"qualType", SQTS}};
352
353 if (Desugar && !QT.isNull()) {
354 SplitQualType DSQT = QT.getSplitDesugaredType();
355 if (DSQT != SQT) {
356 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
357 if (DSQTS != SQTS)
358 Ret["desugaredQualType"] = DSQTS;
359 }
360 if (const auto *TT = QT->getAs<TypedefType>())
361 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
362 }
363 return Ret;
364}
365
366void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
367 JOS.attribute("id", createPointerRepresentation(D));
368 if (!D)
369 return;
370
371 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
372 if (const auto *ND = dyn_cast<NamedDecl>(D))
373 JOS.attribute("name", ND->getDeclName().getAsString());
374 if (const auto *VD = dyn_cast<ValueDecl>(D))
375 JOS.attribute("type", createQualType(VD->getType()));
376}
377
378llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
379 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
380 if (!D)
381 return Ret;
382
383 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
384 if (const auto *ND = dyn_cast<NamedDecl>(D))
385 Ret["name"] = ND->getDeclName().getAsString();
386 if (const auto *VD = dyn_cast<ValueDecl>(D))
387 Ret["type"] = createQualType(VD->getType());
388 return Ret;
389}
390
391llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
392 llvm::json::Array Ret;
393 if (C->path_empty())
394 return Ret;
395
396 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
397 const CXXBaseSpecifier *Base = *I;
398 const auto *RD = cast<CXXRecordDecl>(
399 Base->getType()->castAsCanonical<RecordType>()->getOriginalDecl());
400
401 llvm::json::Object Val{{"name", RD->getName()}};
402 if (Base->isVirtual())
403 Val["isVirtual"] = true;
404 Ret.push_back(std::move(Val));
405 }
406 return Ret;
407}
408
409#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
410#define FIELD1(Flag) FIELD2(#Flag, Flag)
411
412static llvm::json::Object
414 llvm::json::Object Ret;
415
416 FIELD2("exists", hasDefaultConstructor);
417 FIELD2("trivial", hasTrivialDefaultConstructor);
418 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
419 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
420 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
421 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
422 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
423
424 return Ret;
425}
426
427static llvm::json::Object
429 llvm::json::Object Ret;
430
431 FIELD2("simple", hasSimpleCopyConstructor);
432 FIELD2("trivial", hasTrivialCopyConstructor);
433 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
434 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
435 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
436 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
437 FIELD2("needsImplicit", needsImplicitCopyConstructor);
438 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
440 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
441
442 return Ret;
443}
444
445static llvm::json::Object
447 llvm::json::Object Ret;
448
449 FIELD2("exists", hasMoveConstructor);
450 FIELD2("simple", hasSimpleMoveConstructor);
451 FIELD2("trivial", hasTrivialMoveConstructor);
452 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
453 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
454 FIELD2("needsImplicit", needsImplicitMoveConstructor);
455 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
457 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
458
459 return Ret;
460}
461
462static llvm::json::Object
464 llvm::json::Object Ret;
465
466 FIELD2("simple", hasSimpleCopyAssignment);
467 FIELD2("trivial", hasTrivialCopyAssignment);
468 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
469 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
470 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
471 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
472 FIELD2("needsImplicit", needsImplicitCopyAssignment);
473 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
474
475 return Ret;
476}
477
478static llvm::json::Object
480 llvm::json::Object Ret;
481
482 FIELD2("exists", hasMoveAssignment);
483 FIELD2("simple", hasSimpleMoveAssignment);
484 FIELD2("trivial", hasTrivialMoveAssignment);
485 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
486 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
487 FIELD2("needsImplicit", needsImplicitMoveAssignment);
488 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
489
490 return Ret;
491}
492
493static llvm::json::Object
495 llvm::json::Object Ret;
496
497 FIELD2("simple", hasSimpleDestructor);
498 FIELD2("irrelevant", hasIrrelevantDestructor);
499 FIELD2("trivial", hasTrivialDestructor);
500 FIELD2("nonTrivial", hasNonTrivialDestructor);
501 FIELD2("userDeclared", hasUserDeclaredDestructor);
502 FIELD2("needsImplicit", needsImplicitDestructor);
503 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
505 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
506
507 return Ret;
508}
509
510llvm::json::Object
511JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
512 llvm::json::Object Ret;
513
514 // This data is common to all C++ classes.
515 FIELD1(isGenericLambda);
516 FIELD1(isLambda);
517 FIELD1(isEmpty);
518 FIELD1(isAggregate);
519 FIELD1(isStandardLayout);
520 FIELD1(isTriviallyCopyable);
521 FIELD1(isPOD);
523 FIELD1(isPolymorphic);
524 FIELD1(isAbstract);
525 FIELD1(isLiteral);
527 FIELD1(hasUserDeclaredConstructor);
528 FIELD1(hasConstexprNonCopyMoveConstructor);
529 FIELD1(hasMutableFields);
530 FIELD1(hasVariantMembers);
531 FIELD2("canConstDefaultInit", allowConstDefaultInit);
532
533 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
536 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
537 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
539
540 return Ret;
541}
542
543#undef FIELD1
544#undef FIELD2
545
546std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
547 const auto AccessSpelling = getAccessSpelling(AS);
548 if (AccessSpelling.empty())
549 return "none";
550 return AccessSpelling.str();
551}
552
553llvm::json::Object
554JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
555 llvm::json::Object Ret;
556
557 Ret["type"] = createQualType(BS.getType());
558 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
559 Ret["writtenAccess"] =
560 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
561 if (BS.isVirtual())
562 Ret["isVirtual"] = true;
563 if (BS.isPackExpansion())
564 Ret["isPackExpansion"] = true;
565
566 return Ret;
567}
568
569void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
570 JOS.attribute("aliasee", AA->getAliasee());
571}
572
573void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
574 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
575}
576
577void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
578 if (!DA->getMessage().empty())
579 JOS.attribute("message", DA->getMessage());
580 if (!DA->getReplacement().empty())
581 JOS.attribute("replacement", DA->getReplacement());
582}
583
584void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
585 if (!UA->getMessage().empty())
586 JOS.attribute("message", UA->getMessage());
587}
588
589void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
590 JOS.attribute("section_name", SA->getName());
591}
592
593void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
594 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
595 VA->getVisibility()));
596}
597
598void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
599 JOS.attribute("tls_model", TA->getModel());
600}
601
603 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
604 if (!TT->typeMatchesDecl())
605 JOS.attribute("type", createQualType(TT->desugar()));
606}
607
609 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
610 JOS.attribute("type", createQualType(TT->desugar()));
611}
612
614 FunctionType::ExtInfo E = T->getExtInfo();
615 attributeOnlyIfTrue("noreturn", E.getNoReturn());
616 attributeOnlyIfTrue("producesResult", E.getProducesResult());
617 if (E.getHasRegParm())
618 JOS.attribute("regParm", E.getRegParm());
619 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
620}
621
623 FunctionProtoType::ExtProtoInfo E = T->getExtProtoInfo();
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 }
672}
673
675 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
676}
677
679 switch (AT->getSizeModifier()) {
681 JOS.attribute("sizeModifier", "*");
682 break;
684 JOS.attribute("sizeModifier", "static");
685 break;
687 break;
688 }
689
690 std::string Str = AT->getIndexTypeQualifiers().getAsString();
691 if (!Str.empty())
692 JOS.attribute("indexTypeQualifiers", Str);
693}
694
696 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
697 // narrowing conversion to int64_t so it cannot be expressed.
698 JOS.attribute("size", CAT->getSExtSize());
699 VisitArrayType(CAT);
700}
701
703 const DependentSizedExtVectorType *VT) {
704 JOS.attributeObject(
705 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
706}
707
709 JOS.attribute("numElements", VT->getNumElements());
710 switch (VT->getVectorKind()) {
712 break;
714 JOS.attribute("vectorKind", "altivec");
715 break;
717 JOS.attribute("vectorKind", "altivec pixel");
718 break;
720 JOS.attribute("vectorKind", "altivec bool");
721 break;
722 case VectorKind::Neon:
723 JOS.attribute("vectorKind", "neon");
724 break;
726 JOS.attribute("vectorKind", "neon poly");
727 break;
729 JOS.attribute("vectorKind", "fixed-length sve data vector");
730 break;
732 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
733 break;
735 JOS.attribute("vectorKind", "fixed-length rvv data vector");
736 break;
741 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
742 break;
743 }
744}
745
747 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
748}
749
750void JSONNodeDumper::VisitUnaryTransformType(const UnaryTransformType *UTT) {
751 switch (UTT->getUTTKind()) {
752#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
753 case UnaryTransformType::Enum: \
754 JOS.attribute("transformKind", #Trait); \
755 break;
756#include "clang/Basic/TransformTypeTraits.def"
757 }
758}
759
760void JSONNodeDumper::VisitTagType(const TagType *TT) {
761 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
762 std::string Str;
763 llvm::raw_string_ostream OS(Str);
764 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
765 JOS.attribute("qualifier", Str);
766 }
767 JOS.attribute("decl", createBareDeclRef(TT->getOriginalDecl()));
768 if (TT->isTagOwned())
769 JOS.attribute("isTagOwned", true);
770}
771
773 const TemplateTypeParmType *TTPT) {
774 JOS.attribute("depth", TTPT->getDepth());
775 JOS.attribute("index", TTPT->getIndex());
776 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
777 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
778}
779
781 const SubstTemplateTypeParmType *STTPT) {
782 JOS.attribute("index", STTPT->getIndex());
783 if (auto PackIndex = STTPT->getPackIndex())
784 JOS.attribute("pack_index", *PackIndex);
785}
786
788 const SubstTemplateTypeParmPackType *T) {
789 JOS.attribute("index", T->getIndex());
790}
791
792void JSONNodeDumper::VisitAutoType(const AutoType *AT) {
793 JOS.attribute("undeduced", !AT->isDeduced());
794 switch (AT->getKeyword()) {
796 JOS.attribute("typeKeyword", "auto");
797 break;
799 JOS.attribute("typeKeyword", "decltype(auto)");
800 break;
802 JOS.attribute("typeKeyword", "__auto_type");
803 break;
804 }
805}
806
808 const TemplateSpecializationType *TST) {
809 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
810
811 std::string Str;
812 llvm::raw_string_ostream OS(Str);
813 TST->getTemplateName().print(OS, PrintPolicy);
814 JOS.attribute("templateName", Str);
815}
816
818 const InjectedClassNameType *ICNT) {
819 JOS.attribute("decl", createBareDeclRef(ICNT->getOriginalDecl()));
820}
821
823 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
824}
825
826void JSONNodeDumper::VisitPackExpansionType(const PackExpansionType *PET) {
827 if (UnsignedOrNone N = PET->getNumExpansions())
828 JOS.attribute("numExpansions", *N);
829}
830
832 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
833}
834
836 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
837 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
838}
839
841 if (ND && ND->getDeclName()) {
842 JOS.attribute("name", ND->getNameAsString());
843 // FIXME: There are likely other contexts in which it makes no sense to ask
844 // for a mangled name.
846 return;
847
848 // If the declaration is dependent or is in a dependent context, then the
849 // mangling is unlikely to be meaningful (and in some cases may cause
850 // "don't know how to mangle this" assertion failures.
851 if (ND->isTemplated())
852 return;
853
854 // Mangled names are not meaningful for locals, and may not be well-defined
855 // in the case of VLAs.
856 auto *VD = dyn_cast<VarDecl>(ND);
857 if (VD && VD->hasLocalStorage())
858 return;
859
860 // Do not mangle template deduction guides.
862 return;
863
864 std::string MangledName = ASTNameGen.getName(ND);
865 if (!MangledName.empty())
866 JOS.attribute("mangledName", MangledName);
867 }
868}
869
871 VisitNamedDecl(TD);
872 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
873}
874
876 VisitNamedDecl(TAD);
877 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
878}
879
881 VisitNamedDecl(ND);
882 attributeOnlyIfTrue("isInline", ND->isInline());
883 attributeOnlyIfTrue("isNested", ND->isNested());
884 if (!ND->isFirstDecl())
885 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
886}
887
889 JOS.attribute("nominatedNamespace",
890 createBareDeclRef(UDD->getNominatedNamespace()));
891}
892
894 VisitNamedDecl(NAD);
895 JOS.attribute("aliasedNamespace",
896 createBareDeclRef(NAD->getAliasedNamespace()));
897}
898
900 std::string Name;
901 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
902 llvm::raw_string_ostream SOS(Name);
903 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
904 }
905 Name += UD->getNameAsString();
906 JOS.attribute("name", Name);
907}
908
910 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
911}
912
914 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
915}
916
918 VisitNamedDecl(VD);
919 JOS.attribute("type", createQualType(VD->getType()));
920 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
921 attributeOnlyIfTrue("explicitObjectParameter",
922 P->isExplicitObjectParameter());
923
924 StorageClass SC = VD->getStorageClass();
925 if (SC != SC_None)
926 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
927 switch (VD->getTLSKind()) {
928 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
929 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
930 case VarDecl::TLS_None: break;
931 }
932 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
933 attributeOnlyIfTrue("inline", VD->isInline());
934 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
935 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
936 if (VD->hasInit()) {
937 switch (VD->getInitStyle()) {
938 case VarDecl::CInit: JOS.attribute("init", "c"); break;
939 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
940 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
942 JOS.attribute("init", "paren-list");
943 break;
944 }
945 }
946 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
947 if (const auto *Instance = VD->getTemplateInstantiationPattern())
948 JOS.attribute("TemplateInstantiationPattern",
949 createPointerRepresentation(Instance));
950}
951
953 VisitNamedDecl(FD);
954 JOS.attribute("type", createQualType(FD->getType()));
955 attributeOnlyIfTrue("mutable", FD->isMutable());
956 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
957 attributeOnlyIfTrue("isBitfield", FD->isBitField());
958 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
959}
960
962 VisitNamedDecl(FD);
963 JOS.attribute("type", createQualType(FD->getType()));
964 StorageClass SC = FD->getStorageClass();
965 if (SC != SC_None)
966 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
967 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
968 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
969 attributeOnlyIfTrue("pure", FD->isPureVirtual());
970 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
971 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
972 attributeOnlyIfTrue("variadic", FD->isVariadic());
973 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
974
975 if (FD->isDefaulted())
976 JOS.attribute("explicitlyDefaulted",
977 FD->isDeleted() ? "deleted" : "default");
978
979 if (StringLiteral *Msg = FD->getDeletedMessage())
980 JOS.attribute("deletedMessage", Msg->getString());
981
982 if (const auto *Instance = FD->getTemplateInstantiationPattern())
983 JOS.attribute("TemplateInstantiationPattern",
984 createPointerRepresentation(Instance));
985}
986
988 VisitNamedDecl(ED);
989 if (ED->isFixed())
990 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
991 if (ED->isScoped())
992 JOS.attribute("scopedEnumTag",
993 ED->isScopedUsingClassTag() ? "class" : "struct");
994 if (const auto *Instance = ED->getTemplateInstantiationPattern())
995 JOS.attribute("TemplateInstantiationPattern",
996 createPointerRepresentation(Instance));
997}
999 VisitNamedDecl(ECD);
1000 JOS.attribute("type", createQualType(ECD->getType()));
1001}
1002
1004 VisitNamedDecl(RD);
1005 JOS.attribute("tagUsed", RD->getKindName());
1006 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1007}
1009 VisitRecordDecl(RD);
1010
1011 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1012 if (CTSD->hasStrictPackMatch())
1013 JOS.attribute("strict-pack-match", true);
1014 }
1015
1016 if (const auto *Instance = RD->getTemplateInstantiationPattern())
1017 JOS.attribute("TemplateInstantiationPattern",
1018 createPointerRepresentation(Instance));
1019
1020 // All other information requires a complete definition.
1021 if (!RD->isCompleteDefinition())
1022 return;
1023
1024 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1025 if (RD->getNumBases()) {
1026 JOS.attributeArray("bases", [this, RD] {
1027 for (const auto &Spec : RD->bases())
1028 JOS.value(createCXXBaseSpecifier(Spec));
1029 });
1030 }
1031}
1032
1034 VisitNamedDecl(D);
1035 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1036}
1037
1039 VisitNamedDecl(D);
1040 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1041 JOS.attribute("depth", D->getDepth());
1042 JOS.attribute("index", D->getIndex());
1043 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1044
1045 if (D->hasDefaultArgument())
1046 JOS.attributeObject("defaultArg", [=] {
1049 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1050 });
1051}
1052
1054 const NonTypeTemplateParmDecl *D) {
1055 VisitNamedDecl(D);
1056 JOS.attribute("type", createQualType(D->getType()));
1057 JOS.attribute("depth", D->getDepth());
1058 JOS.attribute("index", D->getIndex());
1059 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1060
1061 if (D->hasDefaultArgument())
1062 JOS.attributeObject("defaultArg", [=] {
1065 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1066 });
1067}
1068
1070 const TemplateTemplateParmDecl *D) {
1071 VisitNamedDecl(D);
1072 JOS.attribute("depth", D->getDepth());
1073 JOS.attribute("index", D->getIndex());
1074 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1075
1076 if (D->hasDefaultArgument())
1077 JOS.attributeObject("defaultArg", [=] {
1078 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1080 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1081 InheritedFrom,
1082 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1083 });
1084}
1085
1087 StringRef Lang;
1088 switch (LSD->getLanguage()) {
1090 Lang = "C";
1091 break;
1093 Lang = "C++";
1094 break;
1095 }
1096 JOS.attribute("language", Lang);
1097 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1098}
1099
1101 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1102}
1103
1105 if (const TypeSourceInfo *T = FD->getFriendType())
1106 JOS.attribute("type", createQualType(T->getType()));
1107 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1108}
1109
1111 VisitNamedDecl(D);
1112 JOS.attribute("type", createQualType(D->getType()));
1113 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1114 switch (D->getAccessControl()) {
1115 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1116 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1117 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1118 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1119 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1120 }
1121}
1122
1124 VisitNamedDecl(D);
1125 JOS.attribute("returnType", createQualType(D->getReturnType()));
1126 JOS.attribute("instance", D->isInstanceMethod());
1127 attributeOnlyIfTrue("variadic", D->isVariadic());
1128}
1129
1131 VisitNamedDecl(D);
1132 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1133 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1134 switch (D->getVariance()) {
1136 break;
1138 JOS.attribute("variance", "covariant");
1139 break;
1141 JOS.attribute("variance", "contravariant");
1142 break;
1143 }
1144}
1145
1147 VisitNamedDecl(D);
1148 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1149 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1150
1151 llvm::json::Array Protocols;
1152 for (const auto* P : D->protocols())
1153 Protocols.push_back(createBareDeclRef(P));
1154 if (!Protocols.empty())
1155 JOS.attribute("protocols", std::move(Protocols));
1156}
1157
1159 VisitNamedDecl(D);
1160 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1161 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1162}
1163
1165 VisitNamedDecl(D);
1166
1167 llvm::json::Array Protocols;
1168 for (const auto *P : D->protocols())
1169 Protocols.push_back(createBareDeclRef(P));
1170 if (!Protocols.empty())
1171 JOS.attribute("protocols", std::move(Protocols));
1172}
1173
1175 VisitNamedDecl(D);
1176 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1177 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1178
1179 llvm::json::Array Protocols;
1180 for (const auto* P : D->protocols())
1181 Protocols.push_back(createBareDeclRef(P));
1182 if (!Protocols.empty())
1183 JOS.attribute("protocols", std::move(Protocols));
1184}
1185
1187 const ObjCImplementationDecl *D) {
1188 VisitNamedDecl(D);
1189 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1190 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1191}
1192
1194 const ObjCCompatibleAliasDecl *D) {
1195 VisitNamedDecl(D);
1196 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1197}
1198
1200 VisitNamedDecl(D);
1201 JOS.attribute("type", createQualType(D->getType()));
1202
1203 switch (D->getPropertyImplementation()) {
1204 case ObjCPropertyDecl::None: break;
1205 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1206 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1207 }
1208
1212 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1214 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1215 attributeOnlyIfTrue("readonly",
1217 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1218 attributeOnlyIfTrue("readwrite",
1220 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1221 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1222 attributeOnlyIfTrue("nonatomic",
1224 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1225 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1226 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1227 attributeOnlyIfTrue("unsafe_unretained",
1229 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1230 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1231 attributeOnlyIfTrue("nullability",
1233 attributeOnlyIfTrue("null_resettable",
1235 }
1236}
1237
1240 JOS.attribute("implKind", D->getPropertyImplementation() ==
1242 ? "synthesize"
1243 : "dynamic");
1244 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1245 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1246}
1247
1249 attributeOnlyIfTrue("variadic", D->isVariadic());
1250 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1251}
1252
1254 JOS.attribute("name", AE->getOpAsString());
1255}
1256
1258 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1259}
1260
1262 std::string Str;
1263 llvm::raw_string_ostream OS(Str);
1264
1265 OME->getSelector().print(OS);
1266 JOS.attribute("selector", Str);
1267
1268 switch (OME->getReceiverKind()) {
1270 JOS.attribute("receiverKind", "instance");
1271 break;
1273 JOS.attribute("receiverKind", "class");
1274 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1275 break;
1277 JOS.attribute("receiverKind", "super (instance)");
1278 JOS.attribute("superType", createQualType(OME->getSuperType()));
1279 break;
1281 JOS.attribute("receiverKind", "super (class)");
1282 JOS.attribute("superType", createQualType(OME->getSuperType()));
1283 break;
1284 }
1285
1286 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1287 if (OME->getType() != CallReturnTy)
1288 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1289}
1290
1292 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1293 std::string Str;
1294 llvm::raw_string_ostream OS(Str);
1295
1296 MD->getSelector().print(OS);
1297 JOS.attribute("selector", Str);
1298 }
1299}
1300
1302 std::string Str;
1303 llvm::raw_string_ostream OS(Str);
1304
1305 OSE->getSelector().print(OS);
1306 JOS.attribute("selector", Str);
1307}
1308
1310 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1311}
1312
1314 if (OPRE->isImplicitProperty()) {
1315 JOS.attribute("propertyKind", "implicit");
1316 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1317 JOS.attribute("getter", createBareDeclRef(MD));
1318 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1319 JOS.attribute("setter", createBareDeclRef(MD));
1320 } else {
1321 JOS.attribute("propertyKind", "explicit");
1322 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1323 }
1324
1325 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1326 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1327 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1328}
1329
1331 const ObjCSubscriptRefExpr *OSRE) {
1332 JOS.attribute("subscriptKind",
1333 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1334
1335 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1336 JOS.attribute("getter", createBareDeclRef(MD));
1337 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1338 JOS.attribute("setter", createBareDeclRef(MD));
1339}
1340
1342 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1343 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1344 JOS.attribute("isArrow", OIRE->isArrow());
1345}
1346
1348 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1349}
1350
1352 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1353 if (DRE->getDecl() != DRE->getFoundDecl())
1354 JOS.attribute("foundReferencedDecl",
1355 createBareDeclRef(DRE->getFoundDecl()));
1356 switch (DRE->isNonOdrUse()) {
1357 case NOUR_None: break;
1358 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1359 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1360 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1361 }
1362 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1363}
1364
1366 const SYCLUniqueStableNameExpr *E) {
1367 JOS.attribute("typeSourceInfo",
1368 createQualType(E->getTypeSourceInfo()->getType()));
1369}
1370
1373
1376
1380
1382 JOS.attribute("isPostfix", UO->isPostfix());
1383 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1384 if (!UO->canOverflow())
1385 JOS.attribute("canOverflow", false);
1386}
1387
1389 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1390}
1391
1393 const CompoundAssignOperator *CAO) {
1395 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1396 JOS.attribute("computeResultType",
1397 createQualType(CAO->getComputationResultType()));
1398}
1399
1401 // Note, we always write this Boolean field because the information it conveys
1402 // is critical to understanding the AST node.
1403 ValueDecl *VD = ME->getMemberDecl();
1404 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1405 JOS.attribute("isArrow", ME->isArrow());
1406 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1407 switch (ME->isNonOdrUse()) {
1408 case NOUR_None: break;
1409 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1410 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1411 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1412 }
1413}
1414
1416 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1417 attributeOnlyIfTrue("isArray", NE->isArray());
1418 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1419 switch (NE->getInitializationStyle()) {
1421 break;
1423 JOS.attribute("initStyle", "call");
1424 break;
1426 JOS.attribute("initStyle", "list");
1427 break;
1428 }
1429 if (const FunctionDecl *FD = NE->getOperatorNew())
1430 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1431 if (const FunctionDecl *FD = NE->getOperatorDelete())
1432 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1433}
1435 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1436 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1437 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1438 if (const FunctionDecl *FD = DE->getOperatorDelete())
1439 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1440}
1441
1443 attributeOnlyIfTrue("implicit", TE->isImplicit());
1444}
1445
1447 JOS.attribute("castKind", CE->getCastKindName());
1448 llvm::json::Array Path = createCastPath(CE);
1449 if (!Path.empty())
1450 JOS.attribute("path", std::move(Path));
1451 // FIXME: This may not be useful information as it can be obtusely gleaned
1452 // from the inner[] array.
1453 if (const NamedDecl *ND = CE->getConversionFunction())
1454 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1455}
1456
1458 VisitCastExpr(ICE);
1459 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1460}
1461
1463 attributeOnlyIfTrue("adl", CE->usesADL());
1464}
1465
1467 const UnaryExprOrTypeTraitExpr *TTE) {
1468 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1469 if (TTE->isArgumentType())
1470 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1471}
1472
1476
1478 const UnresolvedLookupExpr *ULE) {
1479 JOS.attribute("usesADL", ULE->requiresADL());
1480 JOS.attribute("name", ULE->getName().getAsString());
1481
1482 JOS.attributeArray("lookups", [this, ULE] {
1483 for (const NamedDecl *D : ULE->decls())
1484 JOS.value(createBareDeclRef(D));
1485 });
1486}
1487
1489 JOS.attribute("name", ALE->getLabel()->getName());
1490 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1491}
1492
1494 if (CTE->isTypeOperand()) {
1495 QualType Adjusted = CTE->getTypeOperand(Ctx);
1496 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1497 JOS.attribute("typeArg", createQualType(Unadjusted));
1498 if (Adjusted != Unadjusted)
1499 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1500 }
1501}
1502
1507
1509 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1510 JOS.attribute("field", createBareDeclRef(FD));
1511}
1512
1514 const GenericSelectionExpr *GSE) {
1515 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1516}
1517
1519 const CXXUnresolvedConstructExpr *UCE) {
1520 if (UCE->getType() != UCE->getTypeAsWritten())
1521 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1522 attributeOnlyIfTrue("list", UCE->isListInitialization());
1523}
1524
1526 CXXConstructorDecl *Ctor = CE->getConstructor();
1527 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1528 attributeOnlyIfTrue("elidable", CE->isElidable());
1529 attributeOnlyIfTrue("list", CE->isListInitialization());
1530 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1531 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1532 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1533 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1534
1535 switch (CE->getConstructionKind()) {
1537 JOS.attribute("constructionKind", "complete");
1538 break;
1540 JOS.attribute("constructionKind", "delegating");
1541 break;
1543 JOS.attribute("constructionKind", "non-virtual base");
1544 break;
1546 JOS.attribute("constructionKind", "virtual base");
1547 break;
1548 }
1549}
1550
1552 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1554 if (EWC->getNumObjects()) {
1555 JOS.attributeArray("cleanups", [this, EWC] {
1556 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1557 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1558 JOS.value(createBareDeclRef(BD));
1559 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1560 llvm::json::Object Obj;
1561 Obj["id"] = createPointerRepresentation(CLE);
1562 Obj["kind"] = CLE->getStmtClassName();
1563 JOS.value(std::move(Obj));
1564 } else {
1565 llvm_unreachable("unexpected cleanup object type");
1566 }
1567 });
1568 }
1569}
1570
1572 const CXXBindTemporaryExpr *BTE) {
1573 const CXXTemporary *Temp = BTE->getTemporary();
1574 JOS.attribute("temp", createPointerRepresentation(Temp));
1575 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1576 JOS.attribute("dtor", createBareDeclRef(Dtor));
1577}
1578
1580 const MaterializeTemporaryExpr *MTE) {
1581 if (const ValueDecl *VD = MTE->getExtendingDecl())
1582 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1583
1584 switch (MTE->getStorageDuration()) {
1585 case SD_Automatic:
1586 JOS.attribute("storageDuration", "automatic");
1587 break;
1588 case SD_Dynamic:
1589 JOS.attribute("storageDuration", "dynamic");
1590 break;
1591 case SD_FullExpression:
1592 JOS.attribute("storageDuration", "full expression");
1593 break;
1594 case SD_Static:
1595 JOS.attribute("storageDuration", "static");
1596 break;
1597 case SD_Thread:
1598 JOS.attribute("storageDuration", "thread");
1599 break;
1600 }
1601
1602 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1603}
1604
1606 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1607}
1608
1610 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1611}
1612
1614 const CXXDependentScopeMemberExpr *DSME) {
1615 JOS.attribute("isArrow", DSME->isArrow());
1616 JOS.attribute("member", DSME->getMember().getAsString());
1617 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1618 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1619 DSME->hasExplicitTemplateArgs());
1620
1621 if (DSME->getNumTemplateArgs()) {
1622 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1623 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1624 JOS.object(
1625 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1626 });
1627 }
1628}
1629
1631 if (!RE->isValueDependent())
1632 JOS.attribute("satisfied", RE->isSatisfied());
1633}
1634
1636 llvm::SmallString<16> Buffer;
1637 IL->getValue().toString(Buffer,
1638 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1639 JOS.attribute("value", Buffer);
1640}
1642 // FIXME: This should probably print the character literal as a string,
1643 // rather than as a numerical value. It would be nice if the behavior matched
1644 // what we do to print a string literal; right now, it is impossible to tell
1645 // the difference between 'a' and L'a' in C from the JSON output.
1646 JOS.attribute("value", CL->getValue());
1647}
1649 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1650}
1652 llvm::SmallString<16> Buffer;
1653 FL->getValue().toString(Buffer);
1654 JOS.attribute("value", Buffer);
1655}
1657 std::string Buffer;
1658 llvm::raw_string_ostream SS(Buffer);
1659 SL->outputString(SS);
1660 JOS.attribute("value", Buffer);
1661}
1663 JOS.attribute("value", BLE->getValue());
1664}
1665
1667 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1668 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1669 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1670 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1671 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1672 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1673}
1674
1676 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1677 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1678}
1680 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1681}
1682
1684 JOS.attribute("name", LS->getName());
1685 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1686 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1687}
1688
1690 if (LS->hasLabelTarget())
1691 JOS.attribute("targetLabelDeclId",
1692 createPointerRepresentation(LS->getLabelDecl()));
1693}
1694
1696 JOS.attribute("targetLabelDeclId",
1697 createPointerRepresentation(GS->getLabel()));
1698}
1699
1701 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1702}
1703
1705 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1706 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1707 // null child node and ObjC gets no child node.
1708 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1709}
1710
1712 JOS.attribute("isNull", true);
1713}
1715 JOS.attribute("type", createQualType(TA.getAsType()));
1716}
1718 const TemplateArgument &TA) {
1719 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1720}
1722 JOS.attribute("isNullptr", true);
1723}
1725 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1726}
1732 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1733 // the output format.
1734}
1736 const TemplateArgument &TA) {
1737 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1738 // the output format.
1739}
1741 const TemplateArgument &TA) {
1742 JOS.attribute("isExpr", true);
1743 if (TA.isCanonicalExpr())
1744 JOS.attribute("isCanonical", true);
1745}
1747 JOS.attribute("isPack", true);
1748}
1749
1750StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1751 if (Traits)
1752 return Traits->getCommandInfo(CommandID)->Name;
1753 if (const comments::CommandInfo *Info =
1755 return Info->Name;
1756 return "<invalid>";
1757}
1758
1760 const comments::FullComment *) {
1761 JOS.attribute("text", C->getText());
1762}
1763
1766 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1767
1768 switch (C->getRenderKind()) {
1770 JOS.attribute("renderKind", "normal");
1771 break;
1773 JOS.attribute("renderKind", "bold");
1774 break;
1776 JOS.attribute("renderKind", "emphasized");
1777 break;
1779 JOS.attribute("renderKind", "monospaced");
1780 break;
1782 JOS.attribute("renderKind", "anchor");
1783 break;
1784 }
1785
1786 llvm::json::Array Args;
1787 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1788 Args.push_back(C->getArgText(I));
1789
1790 if (!Args.empty())
1791 JOS.attribute("args", std::move(Args));
1792}
1793
1796 JOS.attribute("name", C->getTagName());
1797 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1798 attributeOnlyIfTrue("malformed", C->isMalformed());
1799
1800 llvm::json::Array Attrs;
1801 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1802 Attrs.push_back(
1803 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1804
1805 if (!Attrs.empty())
1806 JOS.attribute("attrs", std::move(Attrs));
1807}
1808
1811 JOS.attribute("name", C->getTagName());
1812}
1813
1816 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1817
1818 llvm::json::Array Args;
1819 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1820 Args.push_back(C->getArgText(I));
1821
1822 if (!Args.empty())
1823 JOS.attribute("args", std::move(Args));
1824}
1825
1828 switch (C->getDirection()) {
1830 JOS.attribute("direction", "in");
1831 break;
1833 JOS.attribute("direction", "out");
1834 break;
1836 JOS.attribute("direction", "in,out");
1837 break;
1838 }
1839 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1840
1841 if (C->hasParamName())
1842 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1843 : C->getParamNameAsWritten());
1844
1845 if (C->isParamIndexValid() && !C->isVarArgParam())
1846 JOS.attribute("paramIdx", C->getParamIndex());
1847}
1848
1851 if (C->hasParamName())
1852 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1853 : C->getParamNameAsWritten());
1854 if (C->isPositionValid()) {
1855 llvm::json::Array Positions;
1856 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1857 Positions.push_back(C->getIndex(I));
1858
1859 if (!Positions.empty())
1860 JOS.attribute("positions", std::move(Positions));
1861 }
1862}
1863
1866 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1867 JOS.attribute("closeName", C->getCloseName());
1868}
1869
1872 const comments::FullComment *) {
1873 JOS.attribute("text", C->getText());
1874}
1875
1878 JOS.attribute("text", C->getText());
1879}
1880
1881llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1882 llvm::json::Object Ret;
1883#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1884 if (FPO.has##NAME##Override()) \
1885 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1886#include "clang/Basic/FPOptions.def"
1887 return Ret;
1888}
1889
1891 VisitStmt(S);
1892 if (S->hasStoredFPFeatures())
1893 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1894}
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls.
#define FIELD1(Flag)
static llvm::json::Object createMoveAssignmentDefinitionData(const CXXRecordDecl *RD)
#define FIELD2(Name, Flag)
static llvm::json::Object createCopyAssignmentDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createCopyConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDestructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createDefaultConstructorDefinitionData(const CXXRecordDecl *RD)
static llvm::json::Object createMoveConstructorDefinitionData(const CXXRecordDecl *RD)
#define SM(sm)
static bool canPassInRegisters(Sema &S, CXXRecordDecl *D, TargetInfo::CallingConvKind CCK)
Determine whether a type is permitted to be passed or returned in registers, per C++ [class....
Defines the SourceManager interface.
Defines various enumerations that describe declaration and type specifiers.
C Language Family Type Representation.
llvm::APInt getValue() const
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
Definition APValue.h:122
@ None
There is no such object (it's outside its lifetime).
Definition APValue.h:129
const clang::PrintingPolicy & getPrintingPolicy() const
Definition ASTContext.h:790
Represents an access specifier followed by colon ':'.
Definition DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4484
LabelDecl * getLabel() const
Definition Expr.h:4507
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition TypeBase.h:3720
ArraySizeModifier getSizeModifier() const
Definition TypeBase.h:3734
Qualifiers getIndexTypeQualifiers() const
Definition TypeBase.h:3738
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6814
StringRef getOpAsString() const
Definition Expr.h:6878
Attr - This represents one attribute.
Definition Attr.h:44
attr::Kind getKind() const
Definition Attr.h:90
bool isInherited() const
Definition Attr.h:99
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition Attr.h:103
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:3972
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:2128
Opcode getOpcode() const
Definition Expr.h:4017
A class which contains all the information about a particular captured value.
Definition Decl.h:4657
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4651
bool capturesCXXThis() const
Definition Decl.h:4783
bool isVariadic() const
Definition Decl.h:4726
Represents a base class of a C++ class.
Definition DeclCXX.h:146
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
Definition DeclCXX.h:242
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
Definition DeclCXX.h:203
QualType getType() const
Retrieves the type of the base class.
Definition DeclCXX.h:249
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
Definition DeclCXX.h:210
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
Definition DeclCXX.h:230
Represents binding an expression to a temporary.
Definition ExprCXX.h:1494
CXXTemporary * getTemporary()
Definition ExprCXX.h:1512
A boolean literal, per ([C++ lex.bool] Boolean literals).
Definition ExprCXX.h:723
bool getValue() const
Definition ExprCXX.h:740
Represents a call to a C++ constructor.
Definition ExprCXX.h:1549
bool isElidable() const
Whether this construction is elidable.
Definition ExprCXX.h:1618
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1.
Definition ExprCXX.h:1623
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Definition ExprCXX.h:1642
bool isImmediateEscalating() const
Definition ExprCXX.h:1707
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called.
Definition ExprCXX.h:1651
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
Definition ExprCXX.h:1612
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
Definition ExprCXX.h:1631
CXXConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
Definition ExprCXX.h:1660
Represents a C++ constructor within a class.
Definition DeclCXX.h:2604
Represents a C++ base or member initializer.
Definition DeclCXX.h:2369
A default argument (C++ [dcl.fct.default]).
Definition ExprCXX.h:1271
bool hasRewrittenInit() const
Definition ExprCXX.h:1316
A use of a default initializer in a constructor or in aggregate initialization.
Definition ExprCXX.h:1378
bool hasRewrittenInit() const
Definition ExprCXX.h:1407
Represents a delete expression for memory deallocation and destructor calls, e.g.
Definition ExprCXX.h:2620
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2659
bool isArrayForm() const
Definition ExprCXX.h:2646
bool isGlobalDelete() const
Definition ExprCXX.h:2645
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2647
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3864
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3963
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4058
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4037
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4002
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4033
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4065
Represents a C++ destructor within a class.
Definition DeclCXX.h:2869
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2349
Represents a C++ struct/union/class.
Definition DeclCXX.h:258
base_class_range bases()
Definition DeclCXX.h:608
unsigned getNumBases() const
Retrieves the number of base classes of this class.
Definition DeclCXX.h:602
const CXXRecordDecl * getTemplateInstantiationPattern() const
Retrieve the record declaration from which this record could be instantiated.
Definition DeclCXX.cpp:2075
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class.
Definition DeclCXX.h:902
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
Definition DeclCXX.h:1013
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class.
Definition DeclCXX.h:805
Represents a C++ temporary.
Definition ExprCXX.h:1460
const CXXDestructorDecl * getDestructor() const
Definition ExprCXX.h:1471
Represents the this expression in C++.
Definition ExprCXX.h:1155
bool isImplicit() const
Definition ExprCXX.h:1178
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Definition ExprCXX.h:848
bool isTypeOperand() const
Definition ExprCXX.h:884
QualType getTypeOperand(const ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
Definition ExprCXX.cpp:161
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
Definition ExprCXX.h:891
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3738
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3793
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3772
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2877
bool usesADL() const
Definition Expr.h:3034
CaseStmt - Represent a case statement.
Definition Stmt.h:1920
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1983
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3610
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition Expr.cpp:1997
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1946
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4234
QualType getComputationLHSType() const
Definition Expr.h:4268
QualType getComputationResultType() const
Definition Expr.h:4271
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1720
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1770
bool hasStoredFPFeatures() const
Definition Stmt.h:1767
A reference to a concept and its template args, as it appears in the code.
Definition ASTConcept.h:126
SourceRange getSourceRange() const LLVM_READONLY
Definition ASTConcept.h:189
SourceLocation getLocation() const
Definition ASTConcept.h:178
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition ASTConcept.h:199
TemplateDecl * getNamedConcept() const
Definition ASTConcept.h:197
Represents the canonical version of C arrays with a specified constant size.
Definition TypeBase.h:3758
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition TypeBase.h:3840
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1082
APValue getAPValueResult() const
Definition Expr.cpp:409
APValue::ValueKind getResultAPValueKind() const
Definition Expr.h:1148
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1270
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1381
ValueDecl * getDecl()
Definition Expr.h:1338
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1468
bool isImmediateEscalating() const
Definition Expr.h:1478
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
ASTContext & getASTContext() const LLVM_READONLY
Definition DeclBase.cpp:524
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
Definition DeclBase.h:593
bool isTemplated() const
Determine whether this declaration is a templated entity (whether it is.
Definition DeclBase.cpp:286
bool isInvalidDecl() const
Definition DeclBase.h:588
SourceLocation getLocation() const
Definition DeclBase.h:439
const char * getDeclKindName() const
Definition DeclBase.cpp:147
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
Definition DeclBase.h:621
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required.
Definition DeclBase.cpp:553
DeclContext * getDeclContext()
Definition DeclBase.h:448
AccessSpecifier getAccess() const
Definition DeclBase.h:507
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC).
Definition DeclBase.h:918
Kind getKind() const
Definition DeclBase.h:442
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
Definition DeclBase.h:427
std::string getAsString() const
Retrieve the human-readable string for this name.
const ParmDecl * getInheritedFrom() const
Get the parameter from which we inherit the default argument, if any.
Represents an extended vector type where either the type or size is dependent.
Definition TypeBase.h:4099
SourceLocation getAttributeLoc() const
Definition TypeBase.h:4115
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3420
Represents an enum.
Definition Decl.h:4004
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4213
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4216
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4222
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4168
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5018
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3655
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3690
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3679
unsigned getNumObjects() const
Definition ExprCXX.h:3683
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3661
bool isValueDependent() const
Determines whether the value of this expression depends on.
Definition Expr.h:177
QualType getType() const
Definition Expr.h:144
Represents difference between two FPOptions values.
Represents a member of a struct/union/class.
Definition Decl.h:3157
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3257
bool isBitField() const
Determines whether this field is a bitfield.
Definition Decl.h:3260
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition Decl.h:3337
std::string getValueAsString(unsigned Radix) const
Definition Expr.cpp:1006
llvm::APFloat getValue() const
Definition Expr.h:1666
FriendDecl - Represents the declaration of a friend entity, which can be a function,...
Definition DeclFriend.h:54
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
Definition DeclFriend.h:125
bool isPackExpansion() const
Definition DeclFriend.h:190
Represents a function declaration or definition.
Definition Decl.h:1999
bool isImmediateFunction() const
Definition Decl.cpp:3328
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2755
FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition=true) const
Retrieve the function declaration from which this function could be instantiated, if it is an instant...
Definition Decl.cpp:4205
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3125
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2539
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:2885
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition Decl.h:2469
bool isDeletedAsWritten() const
Definition Decl.h:2543
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2352
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2384
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2343
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:2896
Represents a prototype with parameter type info, e.g.
Definition TypeBase.h:5264
A class which abstracts out some details necessary for making a call.
Definition TypeBase.h:4571
CallingConv getCC() const
Definition TypeBase.h:4630
unsigned getRegParm() const
Definition TypeBase.h:4623
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4460
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3578
Represents a C11 generic selection.
Definition Expr.h:6112
AssociationTy< true > ConstAssociation
Definition Expr.h:6344
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6364
GotoStmt - This represents a direct goto.
Definition Stmt.h:2969
LabelDecl * getLabel() const
Definition Stmt.h:2982
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5173
bool isCBuffer() const
Definition Decl.h:5217
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition Stmt.h:2259
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2334
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2331
bool isConstexpr() const
Definition Stmt.h:2452
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2328
bool isNegatedConsteval() const
Definition Stmt.h:2448
bool isConsteval() const
Definition Stmt.h:2439
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3787
bool isPartOfExplicitCast() const
Definition Expr.h:3818
Describes an C or C++ initializer list.
Definition Expr.h:5233
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5359
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void VisitUsingDecl(const UsingDecl *UD)
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void VisitOpenACCRoutineDecl(const OpenACCRoutineDecl *D)
void VisitConstantExpr(const ConstantExpr *CE)
void VisitRequiresExpr(const RequiresExpr *RE)
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
void VisitTagType(const TagType *TT)
void Visit(const Attr *A)
void VisitLabelStmt(const LabelStmt *LS)
void VisitRValueReferenceType(const ReferenceType *RT)
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
void VisitStringLiteral(const StringLiteral *SL)
void VisitBlockDecl(const BlockDecl *D)
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
void VisitDeprecatedAttr(const DeprecatedAttr *DA)
void VisitMemberPointerType(const MemberPointerType *MPT)
void VisitMemberExpr(const MemberExpr *ME)
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitSwitchStmt(const SwitchStmt *SS)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitBinaryOperator(const BinaryOperator *BO)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
void VisitTypedefDecl(const TypedefDecl *TD)
void VisitTypedefType(const TypedefType *TT)
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitUnaryTransformType(const UnaryTransformType *UTT)
void VisitCallExpr(const CallExpr *CE)
void VisitVisibilityAttr(const VisibilityAttr *VA)
void VisitOpenACCDeclareDecl(const OpenACCDeclareDecl *D)
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void VisitAtomicExpr(const AtomicExpr *AE)
void VisitLoopControlStmt(const LoopControlStmt *LS)
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
void VisitFloatingLiteral(const FloatingLiteral *FL)
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
void VisitWhileStmt(const WhileStmt *WS)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitVarDecl(const VarDecl *VD)
void VisitEnumDecl(const EnumDecl *ED)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitFieldDecl(const FieldDecl *FD)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
void VisitDeclRefExpr(const DeclRefExpr *DRE)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitNamespaceDecl(const NamespaceDecl *ND)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitAutoType(const AutoType *AT)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitUnavailableAttr(const UnavailableAttr *UA)
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void VisitStructuralValueTemplateArgument(const TemplateArgument &TA)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
void VisitPredefinedExpr(const PredefinedExpr *PE)
void VisitAliasAttr(const AliasAttr *AA)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitPackExpansionType(const PackExpansionType *PET)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitSectionAttr(const SectionAttr *SA)
void VisitUsingType(const UsingType *TT)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT)
void VisitArrayType(const ArrayType *AT)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
void VisitGotoStmt(const GotoStmt *GS)
void VisitCharacterLiteral(const CharacterLiteral *CL)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitTLSModelAttr(const TLSModelAttr *TA)
void VisitCompoundStmt(const CompoundStmt *IS)
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
void VisitCXXThisExpr(const CXXThisExpr *TE)
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
void VisitConstantArrayType(const ConstantArrayType *CAT)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *NE)
void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *E)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitCastExpr(const CastExpr *CE)
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
void VisitIfStmt(const IfStmt *IS)
void VisitUnaryOperator(const UnaryOperator *UO)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
void VisitIntegerLiteral(const IntegerLiteral *IL)
void VisitUsingEnumDecl(const UsingEnumDecl *UED)
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
void VisitFunctionType(const FunctionType *T)
void VisitRecordDecl(const RecordDecl *RD)
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitNamedDecl(const NamedDecl *ND)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitFriendDecl(const FriendDecl *FD)
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2146
LabelDecl * getDecl() const
Definition Stmt.h:2164
bool isSideEntry() const
Definition Stmt.h:2193
const char * getName() const
Definition Stmt.cpp:428
static unsigned MeasureTokenLength(SourceLocation Loc, const SourceManager &SM, const LangOptions &LangOpts)
MeasureTokenLength - Relex the token at the specified location and return its length in bytes in the ...
Definition Lexer.cpp:498
Represents a linkage specification.
Definition DeclCXX.h:3015
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3038
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition DeclCXX.h:3049
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3057
LabelDecl * getLabelDecl()
Definition Stmt.h:3095
bool hasLabelTarget() const
Definition Stmt.h:3090
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6143
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6158
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4914
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4939
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:4983
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:4964
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3298
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3381
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3522
bool isArrow() const
Definition Expr.h:3482
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition TypeBase.h:3651
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3673
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3679
This represents a decl that may have a name.
Definition Decl.h:273
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:648
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition Decl.h:300
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:339
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
Definition Decl.h:316
Represents a C++ namespace alias.
Definition DeclCXX.h:3201
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3294
Represent a C++ namespace.
Definition Decl.h:591
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition Decl.h:647
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition Decl.h:656
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
llvm::json::OStream JOS
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
const DefArgStorage & getDefaultArgStorage() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
This is a basic class for representing single OpenMP clause.
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h:88
ObjCBoxedExpr - used for generalized expression boxing.
Definition ExprObjC.h:128
ObjCMethodDecl * getBoxingMethod() const
Definition ExprObjC.h:147
ObjCCategoryDecl - Represents a category declaration.
Definition DeclObjC.h:2329
ObjCCategoryImplDecl * getImplementation() const
ObjCInterfaceDecl * getClassInterface()
Definition DeclObjC.h:2372
protocol_range protocols() const
Definition DeclObjC.h:2403
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
Definition DeclObjC.h:2545
ObjCCategoryDecl * getCategoryDecl() const
ObjCCompatibleAliasDecl - Represents alias of a class.
Definition DeclObjC.h:2775
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2793
ObjCEncodeExpr, used for @encode in Objective-C.
Definition ExprObjC.h:409
QualType getEncodedType() const
Definition ExprObjC.h:428
const ObjCInterfaceDecl * getClassInterface() const
Definition DeclObjC.h:2486
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
Definition DeclObjC.h:2597
const ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.h:2735
Represents an ObjC class declaration.
Definition DeclObjC.h:1154
protocol_range protocols() const
Definition DeclObjC.h:1359
ObjCImplementationDecl * getImplementation() const
ObjCInterfaceDecl * getSuperClass() const
Definition DeclObjC.cpp:349
Represents typeof(type), a C23 feature and GCC extension, or `typeof_unqual(type),...
Definition TypeBase.h:7847
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition Type.cpp:951
ObjCIvarDecl - Represents an ObjC instance variable.
Definition DeclObjC.h:1952
AccessControl getAccessControl() const
Definition DeclObjC.h:2000
bool getSynthesize() const
Definition DeclObjC.h:2007
ObjCIvarRefExpr - A reference to an ObjC instance variable.
Definition ExprObjC.h:548
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:578
bool isArrow() const
Definition ExprObjC.h:586
bool isFreeIvar() const
Definition ExprObjC.h:587
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:940
QualType getCallReturnType(ASTContext &Ctx) const
Definition ExprObjC.cpp:261
Selector getSelector() const
Definition ExprObjC.cpp:289
@ SuperInstance
The receiver is the instance of the superclass object.
Definition ExprObjC.h:954
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:948
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:951
@ Class
The receiver is a class.
Definition ExprObjC.h:945
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1287
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1344
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1229
ObjCMethodDecl - Represents an instance or class method declaration.
Definition DeclObjC.h:140
bool isVariadic() const
Definition DeclObjC.h:431
bool isInstanceMethod() const
Definition DeclObjC.h:426
QualType getReturnType() const
Definition DeclObjC.h:329
Represents one property declaration in an Objective-C interface.
Definition DeclObjC.h:731
ObjCMethodDecl * getGetterMethodDecl() const
Definition DeclObjC.h:901
ObjCMethodDecl * getSetterMethodDecl() const
Definition DeclObjC.h:904
QualType getType() const
Definition DeclObjC.h:804
ObjCPropertyAttribute::Kind getPropertyAttributes() const
Definition DeclObjC.h:815
PropertyControl getPropertyImplementation() const
Definition DeclObjC.h:912
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
Definition DeclObjC.h:2805
ObjCIvarDecl * getPropertyIvarDecl() const
Definition DeclObjC.h:2879
Kind getPropertyImplementation() const
Definition DeclObjC.h:2875
ObjCPropertyDecl * getPropertyDecl() const
Definition DeclObjC.h:2870
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
Definition ExprObjC.h:616
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:735
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:705
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:742
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:710
bool isImplicitProperty() const
Definition ExprObjC.h:702
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:715
bool isSuperReceiver() const
Definition ExprObjC.h:770
Represents an Objective-C protocol declaration.
Definition DeclObjC.h:2084
protocol_range protocols() const
Definition DeclObjC.h:2161
ObjCProtocolExpr used for protocol expression in Objective-C.
Definition ExprObjC.h:504
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:521
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:454
Selector getSelector() const
Definition ExprObjC.h:468
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:839
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:892
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:884
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:888
Represents the declaration of an Objective-C type parameter.
Definition DeclObjC.h:578
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Definition DeclObjC.h:640
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
Definition DeclObjC.h:623
This expression type represents an asterisk in an OpenACC Size-Expr, used in the 'tile' and 'gang' cl...
Definition Expr.h:2090
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3221
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3232
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2005
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2040
static StringRef getIdentKindName(PredefinedIdentKind IK)
Definition Expr.cpp:645
Represents an unpacked "presumed" location which can be presented to the user.
unsigned getColumn() const
Return the presumed column number of this location.
const char * getFilename() const
Return the presumed filename of this location.
unsigned getLine() const
Return the presumed line number of this location.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
A (possibly-)qualified type.
Definition TypeBase.h:937
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Definition TypeBase.h:1004
SplitQualType getSplitDesugaredType() const
Definition TypeBase.h:1300
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition TypeBase.h:8306
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4309
decl_type * getFirstDecl()
Return the first declaration of this declaration or itself if this is the only declaration.
Base for LValueReferenceType and RValueReferenceType.
Definition TypeBase.h:3571
bool isSpelledAsLValue() const
Definition TypeBase.h:3584
C++2a [expr.prim.req]: A requires-expression provides a concise way to express requirements on templa...
bool isSatisfied() const
Whether or not the requires clause is satisfied.
TypeSourceInfo * getTypeSourceInfo()
Definition Expr.h:2143
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
Represents an expression that computes the length of a parameter pack.
Definition ExprCXX.h:4435
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4503
Encodes a location in the source.
A trivial tuple used to represent a source range.
SourceLocation getEnd() const
SourceLocation getBegin() const
RetTy Visit(PTR(Stmt) S, ParamTys... P)
Definition StmtVisitor.h:45
Stmt - This represents one statement.
Definition Stmt.h:85
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:334
const char * getStmtClassName() const
Definition Stmt.cpp:87
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1799
void outputString(raw_ostream &OS) const
Definition Expr.cpp:1205
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2509
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2570
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2567
StringRef getKindName() const
Definition Decl.h:3904
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3809
Location wrapper for a TemplateArgument.
const TemplateArgument & getArgument() const
Represents a template argument.
QualType getStructuralValueType() const
Get the type of a StructuralValue.
QualType getAsType() const
Retrieve the type for a type template argument.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
bool isCanonicalExpr() const
const APValue & getAsStructuralValue() const
Get the value of a StructuralValue.
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
const DefArgStorage & getDefaultArgStorage() const
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
unsigned getDepth() const
Get the nesting depth of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Declaration of a template type parameter.
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
unsigned getIndex() const
Retrieve the index of the template parameter.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
bool isParameterPack() const
Returns whether this is a parameter pack.
unsigned getDepth() const
Retrieve the depth of the template parameter.
const DefArgStorage & getDefaultArgStorage() const
Represents the declaration of a typedef-name via a C++11 alias-declaration.
Definition Decl.h:3685
Base wrapper for a particular "section" of type source info.
Definition TypeLoc.h:59
QualType getType() const
Get the type for which this source info wrapper provides information.
Definition TypeLoc.h:133
SourceRange getSourceRange() const LLVM_READONLY
Get the full source range.
Definition TypeLoc.h:154
TypeLocClass getTypeLocClass() const
Definition TypeLoc.h:116
bool isNull() const
Definition TypeLoc.h:121
const Type * getTypePtr() const
Definition TypeLoc.h:137
A container of type source information.
Definition TypeBase.h:8256
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8267
The base class of the type hierarchy.
Definition TypeBase.h:1833
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2205
const char * getTypeClassName() const
Definition Type.cpp:3351
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9098
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3664
QualType getUnderlyingType() const
Definition Decl.h:3614
TypedefNameDecl * getDecl() const
Definition TypeBase.h:6109
QualType desugar() const
Definition Type.cpp:4041
bool typeMatchesDecl() const
Definition TypeBase.h:6117
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2625
QualType getArgumentType() const
Definition Expr.h:2668
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2657
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2244
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2314
Opcode getOpcode() const
Definition Expr.h:2280
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1402
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2298
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3384
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3453
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:5980
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6012
Represents a C++ using-declaration.
Definition DeclCXX.h:3591
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3628
Represents C++ using-directive.
Definition DeclCXX.h:3096
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3244
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3792
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3834
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3399
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3463
UsingShadowDecl * getDecl() const
Definition TypeBase.h:6052
QualType desugar() const
Definition TypeBase.h:6054
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:711
QualType getType() const
Definition Decl.h:722
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition Decl.cpp:5465
Represents a variable declaration or definition.
Definition Decl.h:925
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1568
TLSKind getTLSKind() const
Definition Decl.cpp:2168
bool hasInit() const
Definition Decl.cpp:2398
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
Definition Decl.h:1465
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Definition Decl.cpp:2121
@ ListInit
Direct list-initialization (C++11)
Definition Decl.h:936
@ CInit
C-style initialization with assignment.
Definition Decl.h:930
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:939
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:933
VarDecl * getTemplateInstantiationPattern() const
Retrieve the variable declaration from which this variable could be instantiated, if it is an instant...
Definition Decl.cpp:2714
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO).
Definition Decl.h:1511
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1550
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:948
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:951
@ TLS_None
Not a TLS variable.
Definition Decl.h:945
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1167
Represents a GCC generic vector type.
Definition TypeBase.h:4173
unsigned getNumElements() const
Definition TypeBase.h:4188
VectorKind getVectorKind() const
Definition TypeBase.h:4193
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2697
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2747
RetTy Visit(PTR(Attr) A)
Definition AttrVisitor.h:31
A command that has zero or more word-like arguments (number of word-like arguments depends on command...
Definition Comment.h:625
static const CommandInfo * getBuiltinCommandInfo(StringRef Name)
RetTy visit(PTR(Comment) C, ParamTys... P)
Any part of the comment.
Definition Comment.h:66
A full comment attached to a declaration, contains block content.
Definition Comment.h:1104
An opening HTML tag with attributes.
Definition Comment.h:454
A command with word-like arguments that is considered inline content.
Definition Comment.h:341
Doxygen \param command.
Definition Comment.h:732
Doxygen \tparam command, describes a template parameter.
Definition Comment.h:814
A verbatim block command (e.
Definition Comment.h:900
A line of text contained in a verbatim block.
Definition Comment.h:875
A verbatim line command.
Definition Comment.h:951
A static requirement that can be used in a requires-expression to check properties of types and expre...
RequirementKind getKind() const
bool containsUnexpandedParameterPack() const
RetTy Visit(PTR(Decl) D)
Definition DeclVisitor.h:38
RetTy Visit(REF(TemplateArgument) TA, ParamTys... P)
Definition SPIR.cpp:35
@ kind_nullability
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
bool Ret(InterpState &S, CodePtr &PC)
Definition Interp.h:312
The JSON file list parser is used to communicate input to InstallAPI.
bool isa(CodeGen::Address addr)
Definition Address.h:330
@ GNUAutoType
__auto_type (GNU extension)
Definition TypeBase.h:1800
@ DecltypeAuto
decltype(auto)
Definition TypeBase.h:1797
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition Specifiers.h:419
@ RQ_None
No ref-qualifier was provided.
Definition TypeBase.h:1782
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition TypeBase.h:1785
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition TypeBase.h:1788
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:123
StorageClass
Storage classes.
Definition Specifiers.h:248
@ SC_None
Definition Specifiers.h:250
@ SD_Thread
Thread storage duration.
Definition Specifiers.h:342
@ SD_Static
Static storage duration.
Definition Specifiers.h:343
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition Specifiers.h:340
@ SD_Automatic
Automatic storage duration (most local variables).
Definition Specifiers.h:341
@ SD_Dynamic
Dynamic storage duration.
Definition Specifiers.h:344
const FunctionProtoType * T
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:135
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition Specifiers.h:144
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition Specifiers.h:139
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
@ Invariant
The parameter is invariant: must match exactly.
Definition DeclObjC.h:555
@ Contravariant
The parameter is contravariant, e.g., X<T> is a subtype of X when the type parameter is covariant and...
Definition DeclObjC.h:563
@ Covariant
The parameter is covariant, e.g., X<T> is a subtype of X when the type parameter is covariant and T i...
Definition DeclObjC.h:559
@ AltiVecBool
is AltiVec 'vector bool ...'
Definition TypeBase.h:4143
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4152
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4137
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4140
@ Neon
is ARM Neon vector
Definition TypeBase.h:4146
@ Generic
not a target-specific vector type
Definition TypeBase.h:4134
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
Definition TypeBase.h:4158
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
Definition TypeBase.h:4161
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4149
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4155
U cast(CodeGen::Address addr)
Definition Address.h:327
@ Parens
New-expression has a C++98 paren-delimited initializer.
Definition ExprCXX.h:2247
@ None
New-expression has no initializer as written.
Definition ExprCXX.h:2244
@ Braces
New-expression has a C++11 list-initializer.
Definition ExprCXX.h:2250
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
@ NOUR_Discarded
This name appears as a potential result of a discarded value expression.
Definition Specifiers.h:183
@ NOUR_Unevaluated
This name appears in an unevaluated operand.
Definition Specifiers.h:177
@ NOUR_None
This is an odr-use.
Definition Specifiers.h:175
@ NOUR_Constant
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Definition Specifiers.h:180
unsigned long uint64_t
ExceptionSpecificationType Type
The kind of exception specification this is.
Definition TypeBase.h:5323
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition TypeBase.h:5326
Extra information about a function prototype.
Definition TypeBase.h:5349
Information about a single command.