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 PresumedLoc Presumed = SM.getPresumedLoc(Loc);
277 if (Presumed.isValid()) {
278 StringRef ActualFile = SM.getBufferName(Loc);
279 auto [FID, FilePos] = SM.getDecomposedLoc(Loc);
280 unsigned ActualLine = SM.getLineNumber(FID, FilePos);
281 JOS.attribute("offset", FilePos);
282 if (LastLocFilename != ActualFile) {
283 JOS.attribute("file", ActualFile);
284 JOS.attribute("line", ActualLine);
285 } else if (LastLocLine != ActualLine)
286 JOS.attribute("line", ActualLine);
287
288 StringRef PresumedFile = Presumed.getFilename();
289 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
290 JOS.attribute("presumedFile", PresumedFile);
291
292 unsigned PresumedLine = Presumed.getLine();
293 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
294 JOS.attribute("presumedLine", PresumedLine);
295
296 JOS.attribute("col", Presumed.getColumn());
297 JOS.attribute("tokLen",
298 Lexer::MeasureTokenLength(Loc, SM, Ctx.getLangOpts()));
299 LastLocFilename = ActualFile;
300 LastLocPresumedFilename = PresumedFile;
301 LastLocPresumedLine = PresumedLine;
302 LastLocLine = ActualLine;
303
304 // Orthogonal to the file, line, and column de-duplication is whether the
305 // given location was a result of an include. If so, print where the
306 // include location came from.
307 writeIncludeStack(SM.getPresumedLoc(Presumed.getIncludeLoc()),
308 /*JustFirst*/ true);
309 }
310}
311
312void JSONNodeDumper::writeSourceLocation(SourceLocation Loc) {
313 SourceLocation Spelling = SM.getSpellingLoc(Loc);
314 SourceLocation Expansion = SM.getExpansionLoc(Loc);
315
316 if (Expansion != Spelling) {
317 // If the expansion and the spelling are different, output subobjects
318 // describing both locations.
319 JOS.attributeObject(
320 "spellingLoc", [Spelling, this] { writeBareSourceLocation(Spelling); });
321 JOS.attributeObject("expansionLoc", [Expansion, Loc, this] {
322 writeBareSourceLocation(Expansion);
323 // If there is a macro expansion, add extra information if the interesting
324 // bit is the macro arg expansion.
325 if (SM.isMacroArgExpansion(Loc))
326 JOS.attribute("isMacroArgExpansion", true);
327 });
328 } else
329 writeBareSourceLocation(Spelling);
330}
331
332void JSONNodeDumper::writeSourceRange(SourceRange R) {
333 JOS.attributeObject("begin",
334 [R, this] { writeSourceLocation(R.getBegin()); });
335 JOS.attributeObject("end", [R, this] { writeSourceLocation(R.getEnd()); });
336}
337
338std::string JSONNodeDumper::createPointerRepresentation(const void *Ptr) {
339 // Because JSON stores integer values as signed 64-bit integers, trying to
340 // represent them as such makes for very ugly pointer values in the resulting
341 // output. Instead, we convert the value to hex and treat it as a string.
342 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr), true);
343}
344
345llvm::json::Object JSONNodeDumper::createQualType(QualType QT, bool Desugar) {
346 SplitQualType SQT = QT.split();
347 std::string SQTS = QualType::getAsString(SQT, PrintPolicy);
348 llvm::json::Object Ret{{"qualType", SQTS}};
349
350 if (Desugar && !QT.isNull()) {
351 SplitQualType DSQT = QT.getSplitDesugaredType();
352 if (DSQT != SQT) {
353 std::string DSQTS = QualType::getAsString(DSQT, PrintPolicy);
354 if (DSQTS != SQTS)
355 Ret["desugaredQualType"] = DSQTS;
356 }
357 if (const auto *TT = QT->getAs<TypedefType>())
358 Ret["typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
359 }
360 return Ret;
361}
362
363void JSONNodeDumper::writeBareDeclRef(const Decl *D) {
364 JOS.attribute("id", createPointerRepresentation(D));
365 if (!D)
366 return;
367
368 JOS.attribute("kind", (llvm::Twine(D->getDeclKindName()) + "Decl").str());
369 if (const auto *ND = dyn_cast<NamedDecl>(D))
370 JOS.attribute("name", ND->getDeclName().getAsString());
371 if (const auto *VD = dyn_cast<ValueDecl>(D))
372 JOS.attribute("type", createQualType(VD->getType()));
373}
374
375llvm::json::Object JSONNodeDumper::createBareDeclRef(const Decl *D) {
376 llvm::json::Object Ret{{"id", createPointerRepresentation(D)}};
377 if (!D)
378 return Ret;
379
380 Ret["kind"] = (llvm::Twine(D->getDeclKindName()) + "Decl").str();
381 if (const auto *ND = dyn_cast<NamedDecl>(D))
382 Ret["name"] = ND->getDeclName().getAsString();
383 if (const auto *VD = dyn_cast<ValueDecl>(D))
384 Ret["type"] = createQualType(VD->getType());
385 return Ret;
386}
387
388llvm::json::Array JSONNodeDumper::createCastPath(const CastExpr *C) {
389 llvm::json::Array Ret;
390 if (C->path_empty())
391 return Ret;
392
393 for (auto I = C->path_begin(), E = C->path_end(); I != E; ++I) {
394 const CXXBaseSpecifier *Base = *I;
395 const auto *RD = cast<CXXRecordDecl>(
396 Base->getType()->castAsCanonical<RecordType>()->getDecl());
397
398 llvm::json::Object Val{{"name", RD->getName()}};
399 if (Base->isVirtual())
400 Val["isVirtual"] = true;
401 Ret.push_back(std::move(Val));
402 }
403 return Ret;
404}
405
406#define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true
407#define FIELD1(Flag) FIELD2(#Flag, Flag)
408
409static llvm::json::Object
411 llvm::json::Object Ret;
412
413 FIELD2("exists", hasDefaultConstructor);
414 FIELD2("trivial", hasTrivialDefaultConstructor);
415 FIELD2("nonTrivial", hasNonTrivialDefaultConstructor);
416 FIELD2("userProvided", hasUserProvidedDefaultConstructor);
417 FIELD2("isConstexpr", hasConstexprDefaultConstructor);
418 FIELD2("needsImplicit", needsImplicitDefaultConstructor);
419 FIELD2("defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
420
421 return Ret;
422}
423
424static llvm::json::Object
426 llvm::json::Object Ret;
427
428 FIELD2("simple", hasSimpleCopyConstructor);
429 FIELD2("trivial", hasTrivialCopyConstructor);
430 FIELD2("nonTrivial", hasNonTrivialCopyConstructor);
431 FIELD2("userDeclared", hasUserDeclaredCopyConstructor);
432 FIELD2("hasConstParam", hasCopyConstructorWithConstParam);
433 FIELD2("implicitHasConstParam", implicitCopyConstructorHasConstParam);
434 FIELD2("needsImplicit", needsImplicitCopyConstructor);
435 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
437 FIELD2("defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
438
439 return Ret;
440}
441
442static llvm::json::Object
444 llvm::json::Object Ret;
445
446 FIELD2("exists", hasMoveConstructor);
447 FIELD2("simple", hasSimpleMoveConstructor);
448 FIELD2("trivial", hasTrivialMoveConstructor);
449 FIELD2("nonTrivial", hasNonTrivialMoveConstructor);
450 FIELD2("userDeclared", hasUserDeclaredMoveConstructor);
451 FIELD2("needsImplicit", needsImplicitMoveConstructor);
452 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
454 FIELD2("defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
455
456 return Ret;
457}
458
459static llvm::json::Object
461 llvm::json::Object Ret;
462
463 FIELD2("simple", hasSimpleCopyAssignment);
464 FIELD2("trivial", hasTrivialCopyAssignment);
465 FIELD2("nonTrivial", hasNonTrivialCopyAssignment);
466 FIELD2("hasConstParam", hasCopyAssignmentWithConstParam);
467 FIELD2("implicitHasConstParam", implicitCopyAssignmentHasConstParam);
468 FIELD2("userDeclared", hasUserDeclaredCopyAssignment);
469 FIELD2("needsImplicit", needsImplicitCopyAssignment);
470 FIELD2("needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
471
472 return Ret;
473}
474
475static llvm::json::Object
477 llvm::json::Object Ret;
478
479 FIELD2("exists", hasMoveAssignment);
480 FIELD2("simple", hasSimpleMoveAssignment);
481 FIELD2("trivial", hasTrivialMoveAssignment);
482 FIELD2("nonTrivial", hasNonTrivialMoveAssignment);
483 FIELD2("userDeclared", hasUserDeclaredMoveAssignment);
484 FIELD2("needsImplicit", needsImplicitMoveAssignment);
485 FIELD2("needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
486
487 return Ret;
488}
489
490static llvm::json::Object
492 llvm::json::Object Ret;
493
494 FIELD2("simple", hasSimpleDestructor);
495 FIELD2("irrelevant", hasIrrelevantDestructor);
496 FIELD2("trivial", hasTrivialDestructor);
497 FIELD2("nonTrivial", hasNonTrivialDestructor);
498 FIELD2("userDeclared", hasUserDeclaredDestructor);
499 FIELD2("needsImplicit", needsImplicitDestructor);
500 FIELD2("needsOverloadResolution", needsOverloadResolutionForDestructor);
502 FIELD2("defaultedIsDeleted", defaultedDestructorIsDeleted);
503
504 return Ret;
505}
506
507llvm::json::Object
508JSONNodeDumper::createCXXRecordDefinitionData(const CXXRecordDecl *RD) {
509 llvm::json::Object Ret;
510
511 // This data is common to all C++ classes.
512 FIELD1(isGenericLambda);
513 FIELD1(isLambda);
514 FIELD1(isEmpty);
515 FIELD1(isAggregate);
516 FIELD1(isStandardLayout);
517 FIELD1(isTriviallyCopyable);
518 FIELD1(isPOD);
520 FIELD1(isPolymorphic);
521 FIELD1(isAbstract);
522 FIELD1(isLiteral);
524 FIELD1(hasUserDeclaredConstructor);
525 FIELD1(hasConstexprNonCopyMoveConstructor);
526 FIELD1(hasMutableFields);
527 FIELD1(hasVariantMembers);
528 FIELD2("canConstDefaultInit", allowConstDefaultInit);
529
530 Ret["defaultCtor"] = createDefaultConstructorDefinitionData(RD);
533 Ret["copyAssign"] = createCopyAssignmentDefinitionData(RD);
534 Ret["moveAssign"] = createMoveAssignmentDefinitionData(RD);
536
537 return Ret;
538}
539
540#undef FIELD1
541#undef FIELD2
542
543std::string JSONNodeDumper::createAccessSpecifier(AccessSpecifier AS) {
544 const auto AccessSpelling = getAccessSpelling(AS);
545 if (AccessSpelling.empty())
546 return "none";
547 return AccessSpelling.str();
548}
549
550llvm::json::Object
551JSONNodeDumper::createCXXBaseSpecifier(const CXXBaseSpecifier &BS) {
552 llvm::json::Object Ret;
553
554 Ret["type"] = createQualType(BS.getType());
555 Ret["access"] = createAccessSpecifier(BS.getAccessSpecifier());
556 Ret["writtenAccess"] =
557 createAccessSpecifier(BS.getAccessSpecifierAsWritten());
558 if (BS.isVirtual())
559 Ret["isVirtual"] = true;
560 if (BS.isPackExpansion())
561 Ret["isPackExpansion"] = true;
562
563 return Ret;
564}
565
566void JSONNodeDumper::VisitAliasAttr(const AliasAttr *AA) {
567 JOS.attribute("aliasee", AA->getAliasee());
568}
569
570void JSONNodeDumper::VisitCleanupAttr(const CleanupAttr *CA) {
571 JOS.attribute("cleanup_function", createBareDeclRef(CA->getFunctionDecl()));
572}
573
574void JSONNodeDumper::VisitDeprecatedAttr(const DeprecatedAttr *DA) {
575 if (!DA->getMessage().empty())
576 JOS.attribute("message", DA->getMessage());
577 if (!DA->getReplacement().empty())
578 JOS.attribute("replacement", DA->getReplacement());
579}
580
581void JSONNodeDumper::VisitUnavailableAttr(const UnavailableAttr *UA) {
582 if (!UA->getMessage().empty())
583 JOS.attribute("message", UA->getMessage());
584}
585
586void JSONNodeDumper::VisitSectionAttr(const SectionAttr *SA) {
587 JOS.attribute("section_name", SA->getName());
588}
589
590void JSONNodeDumper::VisitVisibilityAttr(const VisibilityAttr *VA) {
591 JOS.attribute("visibility", VisibilityAttr::ConvertVisibilityTypeToStr(
592 VA->getVisibility()));
593}
594
595void JSONNodeDumper::VisitTLSModelAttr(const TLSModelAttr *TA) {
596 JOS.attribute("tls_model", TA->getModel());
597}
598
600 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
601 if (!TT->typeMatchesDecl())
602 JOS.attribute("type", createQualType(TT->desugar()));
603}
604
606 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
607 JOS.attribute("type", createQualType(TT->desugar()));
608}
609
611 FunctionType::ExtInfo E = T->getExtInfo();
612 attributeOnlyIfTrue("noreturn", E.getNoReturn());
613 attributeOnlyIfTrue("producesResult", E.getProducesResult());
614 if (E.getHasRegParm())
615 JOS.attribute("regParm", E.getRegParm());
616 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
617}
618
620 FunctionProtoType::ExtProtoInfo E = T->getExtProtoInfo();
621 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
622 attributeOnlyIfTrue("const", T->isConst());
623 attributeOnlyIfTrue("volatile", T->isVolatile());
624 attributeOnlyIfTrue("restrict", T->isRestrict());
625 attributeOnlyIfTrue("variadic", E.Variadic);
626 switch (E.RefQualifier) {
627 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
628 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
629 case RQ_None: break;
630 }
631 switch (E.ExceptionSpec.Type) {
632 case EST_DynamicNone:
633 case EST_Dynamic: {
634 JOS.attribute("exceptionSpec", "throw");
635 llvm::json::Array Types;
637 Types.push_back(createQualType(QT));
638 JOS.attribute("exceptionTypes", std::move(Types));
639 } break;
640 case EST_MSAny:
641 JOS.attribute("exceptionSpec", "throw");
642 JOS.attribute("throwsAny", true);
643 break;
645 JOS.attribute("exceptionSpec", "noexcept");
646 break;
647 case EST_NoexceptTrue:
649 JOS.attribute("exceptionSpec", "noexcept");
650 JOS.attribute("conditionEvaluatesTo",
652 //JOS.attributeWithCall("exceptionSpecExpr",
653 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
654 break;
655 case EST_NoThrow:
656 JOS.attribute("exceptionSpec", "nothrow");
657 break;
658 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
659 // suspect you can only run into them when executing an AST dump from within
660 // the debugger, which is not a use case we worry about for the JSON dumping
661 // feature.
663 case EST_Unevaluated:
665 case EST_Unparsed:
666 case EST_None: break;
667 }
669}
670
672 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
673}
674
676 switch (AT->getSizeModifier()) {
678 JOS.attribute("sizeModifier", "*");
679 break;
681 JOS.attribute("sizeModifier", "static");
682 break;
684 break;
685 }
686
687 std::string Str = AT->getIndexTypeQualifiers().getAsString();
688 if (!Str.empty())
689 JOS.attribute("indexTypeQualifiers", Str);
690}
691
693 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
694 // narrowing conversion to int64_t so it cannot be expressed.
695 JOS.attribute("size", CAT->getSExtSize());
696 VisitArrayType(CAT);
697}
698
700 const DependentSizedExtVectorType *VT) {
701 JOS.attributeObject(
702 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
703}
704
706 JOS.attribute("numElements", VT->getNumElements());
707 switch (VT->getVectorKind()) {
709 break;
711 JOS.attribute("vectorKind", "altivec");
712 break;
714 JOS.attribute("vectorKind", "altivec pixel");
715 break;
717 JOS.attribute("vectorKind", "altivec bool");
718 break;
719 case VectorKind::Neon:
720 JOS.attribute("vectorKind", "neon");
721 break;
723 JOS.attribute("vectorKind", "neon poly");
724 break;
726 JOS.attribute("vectorKind", "fixed-length sve data vector");
727 break;
729 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
730 break;
732 JOS.attribute("vectorKind", "fixed-length rvv data vector");
733 break;
738 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
739 break;
740 }
741}
742
744 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
745}
746
747void JSONNodeDumper::VisitUnaryTransformType(const UnaryTransformType *UTT) {
748 switch (UTT->getUTTKind()) {
749#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
750 case UnaryTransformType::Enum: \
751 JOS.attribute("transformKind", #Trait); \
752 break;
753#include "clang/Basic/TransformTypeTraits.def"
754 }
755}
756
757void JSONNodeDumper::VisitTagType(const TagType *TT) {
758 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
759 std::string Str;
760 llvm::raw_string_ostream OS(Str);
761 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
762 JOS.attribute("qualifier", Str);
763 }
764 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
765 if (TT->isTagOwned())
766 JOS.attribute("isTagOwned", true);
767}
768
770 const TemplateTypeParmType *TTPT) {
771 JOS.attribute("depth", TTPT->getDepth());
772 JOS.attribute("index", TTPT->getIndex());
773 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
774 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
775}
776
778 const SubstTemplateTypeParmType *STTPT) {
779 JOS.attribute("index", STTPT->getIndex());
780 if (auto PackIndex = STTPT->getPackIndex())
781 JOS.attribute("pack_index", *PackIndex);
782}
783
785 const SubstTemplateTypeParmPackType *T) {
786 JOS.attribute("index", T->getIndex());
787}
788
789void JSONNodeDumper::VisitAutoType(const AutoType *AT) {
790 JOS.attribute("undeduced", !AT->isDeduced());
791 switch (AT->getKeyword()) {
793 JOS.attribute("typeKeyword", "auto");
794 break;
796 JOS.attribute("typeKeyword", "decltype(auto)");
797 break;
799 JOS.attribute("typeKeyword", "__auto_type");
800 break;
801 }
802}
803
805 const TemplateSpecializationType *TST) {
806 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
807
808 std::string Str;
809 llvm::raw_string_ostream OS(Str);
810 TST->getTemplateName().print(OS, PrintPolicy);
811 JOS.attribute("templateName", Str);
812}
813
815 const InjectedClassNameType *ICNT) {
816 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
817}
818
820 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
821}
822
823void JSONNodeDumper::VisitPackExpansionType(const PackExpansionType *PET) {
824 if (UnsignedOrNone N = PET->getNumExpansions())
825 JOS.attribute("numExpansions", *N);
826}
827
829 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
830}
831
833 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
834 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
835}
836
838 if (ND && ND->getDeclName()) {
839 JOS.attribute("name", ND->getNameAsString());
840 // FIXME: There are likely other contexts in which it makes no sense to ask
841 // for a mangled name.
843 return;
844
845 // If the declaration is dependent or is in a dependent context, then the
846 // mangling is unlikely to be meaningful (and in some cases may cause
847 // "don't know how to mangle this" assertion failures.
848 if (ND->isTemplated())
849 return;
850
851 // Mangled names are not meaningful for locals, and may not be well-defined
852 // in the case of VLAs.
853 auto *VD = dyn_cast<VarDecl>(ND);
854 if (VD && VD->hasLocalStorage())
855 return;
856
857 // Do not mangle template deduction guides.
859 return;
860
861 std::string MangledName = ASTNameGen.getName(ND);
862 if (!MangledName.empty())
863 JOS.attribute("mangledName", MangledName);
864 }
865}
866
868 VisitNamedDecl(TD);
869 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
870}
871
873 VisitNamedDecl(TAD);
874 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
875}
876
878 VisitNamedDecl(ND);
879 attributeOnlyIfTrue("isInline", ND->isInline());
880 attributeOnlyIfTrue("isNested", ND->isNested());
881 if (!ND->isFirstDecl())
882 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
883}
884
886 JOS.attribute("nominatedNamespace",
887 createBareDeclRef(UDD->getNominatedNamespace()));
888}
889
891 VisitNamedDecl(NAD);
892 JOS.attribute("aliasedNamespace",
893 createBareDeclRef(NAD->getAliasedNamespace()));
894}
895
897 std::string Name;
898 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
899 llvm::raw_string_ostream SOS(Name);
900 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
901 }
902 Name += UD->getNameAsString();
903 JOS.attribute("name", Name);
904}
905
907 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
908}
909
911 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
912}
913
915 VisitNamedDecl(VD);
916 JOS.attribute("type", createQualType(VD->getType()));
917 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
918 attributeOnlyIfTrue("explicitObjectParameter",
919 P->isExplicitObjectParameter());
920
921 StorageClass SC = VD->getStorageClass();
922 if (SC != SC_None)
923 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
924 switch (VD->getTLSKind()) {
925 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
926 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
927 case VarDecl::TLS_None: break;
928 }
929 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
930 attributeOnlyIfTrue("inline", VD->isInline());
931 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
932 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
933 if (VD->hasInit()) {
934 switch (VD->getInitStyle()) {
935 case VarDecl::CInit: JOS.attribute("init", "c"); break;
936 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
937 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
939 JOS.attribute("init", "paren-list");
940 break;
941 }
942 }
943 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
944 if (const auto *Instance = VD->getTemplateInstantiationPattern())
945 JOS.attribute("TemplateInstantiationPattern",
946 createPointerRepresentation(Instance));
947}
948
950 VisitNamedDecl(FD);
951 JOS.attribute("type", createQualType(FD->getType()));
952 attributeOnlyIfTrue("mutable", FD->isMutable());
953 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
954 attributeOnlyIfTrue("isBitfield", FD->isBitField());
955 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
956}
957
959 VisitNamedDecl(FD);
960 JOS.attribute("type", createQualType(FD->getType()));
961 StorageClass SC = FD->getStorageClass();
962 if (SC != SC_None)
963 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
964 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
965 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
966 attributeOnlyIfTrue("pure", FD->isPureVirtual());
967 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
968 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
969 attributeOnlyIfTrue("variadic", FD->isVariadic());
970 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
971
972 if (FD->isDefaulted())
973 JOS.attribute("explicitlyDefaulted",
974 FD->isDeleted() ? "deleted" : "default");
975
976 if (StringLiteral *Msg = FD->getDeletedMessage())
977 JOS.attribute("deletedMessage", Msg->getString());
978
979 if (const auto *Instance = FD->getTemplateInstantiationPattern())
980 JOS.attribute("TemplateInstantiationPattern",
981 createPointerRepresentation(Instance));
982}
983
985 VisitNamedDecl(ED);
986 if (ED->isFixed())
987 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
988 if (ED->isScoped())
989 JOS.attribute("scopedEnumTag",
990 ED->isScopedUsingClassTag() ? "class" : "struct");
991 if (const auto *Instance = ED->getTemplateInstantiationPattern())
992 JOS.attribute("TemplateInstantiationPattern",
993 createPointerRepresentation(Instance));
994}
996 VisitNamedDecl(ECD);
997 JOS.attribute("type", createQualType(ECD->getType()));
998}
999
1001 VisitNamedDecl(RD);
1002 JOS.attribute("tagUsed", RD->getKindName());
1003 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1004}
1006 VisitRecordDecl(RD);
1007
1008 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1009 if (CTSD->hasStrictPackMatch())
1010 JOS.attribute("strict-pack-match", true);
1011 }
1012
1013 if (const auto *Instance = RD->getTemplateInstantiationPattern())
1014 JOS.attribute("TemplateInstantiationPattern",
1015 createPointerRepresentation(Instance));
1016
1017 // All other information requires a complete definition.
1018 if (!RD->isCompleteDefinition())
1019 return;
1020
1021 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1022 if (RD->getNumBases()) {
1023 JOS.attributeArray("bases", [this, RD] {
1024 for (const auto &Spec : RD->bases())
1025 JOS.value(createCXXBaseSpecifier(Spec));
1026 });
1027 }
1028}
1029
1031 VisitNamedDecl(D);
1032 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1033}
1034
1036 VisitNamedDecl(D);
1037 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1038 JOS.attribute("depth", D->getDepth());
1039 JOS.attribute("index", D->getIndex());
1040 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1041
1042 if (D->hasDefaultArgument())
1043 JOS.attributeObject("defaultArg", [=] {
1046 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1047 });
1048}
1049
1051 const NonTypeTemplateParmDecl *D) {
1052 VisitNamedDecl(D);
1053 JOS.attribute("type", createQualType(D->getType()));
1054 JOS.attribute("depth", D->getDepth());
1055 JOS.attribute("index", D->getIndex());
1056 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1057
1058 if (D->hasDefaultArgument())
1059 JOS.attributeObject("defaultArg", [=] {
1062 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1063 });
1064}
1065
1067 const TemplateTemplateParmDecl *D) {
1068 VisitNamedDecl(D);
1069 JOS.attribute("depth", D->getDepth());
1070 JOS.attribute("index", D->getIndex());
1071 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1072
1073 if (D->hasDefaultArgument())
1074 JOS.attributeObject("defaultArg", [=] {
1075 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1077 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1078 InheritedFrom,
1079 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1080 });
1081}
1082
1084 StringRef Lang;
1085 switch (LSD->getLanguage()) {
1087 Lang = "C";
1088 break;
1090 Lang = "C++";
1091 break;
1092 }
1093 JOS.attribute("language", Lang);
1094 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1095}
1096
1098 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1099}
1100
1102 if (const TypeSourceInfo *T = FD->getFriendType())
1103 JOS.attribute("type", createQualType(T->getType()));
1104 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1105}
1106
1108 VisitNamedDecl(D);
1109 JOS.attribute("type", createQualType(D->getType()));
1110 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1111 switch (D->getAccessControl()) {
1112 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1113 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1114 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1115 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1116 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1117 }
1118}
1119
1121 VisitNamedDecl(D);
1122 JOS.attribute("returnType", createQualType(D->getReturnType()));
1123 JOS.attribute("instance", D->isInstanceMethod());
1124 attributeOnlyIfTrue("variadic", D->isVariadic());
1125}
1126
1128 VisitNamedDecl(D);
1129 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1130 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1131 switch (D->getVariance()) {
1133 break;
1135 JOS.attribute("variance", "covariant");
1136 break;
1138 JOS.attribute("variance", "contravariant");
1139 break;
1140 }
1141}
1142
1144 VisitNamedDecl(D);
1145 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1146 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1147
1148 llvm::json::Array Protocols;
1149 for (const auto* P : D->protocols())
1150 Protocols.push_back(createBareDeclRef(P));
1151 if (!Protocols.empty())
1152 JOS.attribute("protocols", std::move(Protocols));
1153}
1154
1156 VisitNamedDecl(D);
1157 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1158 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1159}
1160
1162 VisitNamedDecl(D);
1163
1164 llvm::json::Array Protocols;
1165 for (const auto *P : D->protocols())
1166 Protocols.push_back(createBareDeclRef(P));
1167 if (!Protocols.empty())
1168 JOS.attribute("protocols", std::move(Protocols));
1169}
1170
1172 VisitNamedDecl(D);
1173 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1174 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1175
1176 llvm::json::Array Protocols;
1177 for (const auto* P : D->protocols())
1178 Protocols.push_back(createBareDeclRef(P));
1179 if (!Protocols.empty())
1180 JOS.attribute("protocols", std::move(Protocols));
1181}
1182
1184 const ObjCImplementationDecl *D) {
1185 VisitNamedDecl(D);
1186 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1187 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1188}
1189
1191 const ObjCCompatibleAliasDecl *D) {
1192 VisitNamedDecl(D);
1193 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1194}
1195
1197 VisitNamedDecl(D);
1198 JOS.attribute("type", createQualType(D->getType()));
1199
1200 switch (D->getPropertyImplementation()) {
1201 case ObjCPropertyDecl::None: break;
1202 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1203 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1204 }
1205
1209 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1211 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1212 attributeOnlyIfTrue("readonly",
1214 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1215 attributeOnlyIfTrue("readwrite",
1217 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1218 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1219 attributeOnlyIfTrue("nonatomic",
1221 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1222 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1223 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1224 attributeOnlyIfTrue("unsafe_unretained",
1226 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1227 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1228 attributeOnlyIfTrue("nullability",
1230 attributeOnlyIfTrue("null_resettable",
1232 }
1233}
1234
1237 JOS.attribute("implKind", D->getPropertyImplementation() ==
1239 ? "synthesize"
1240 : "dynamic");
1241 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1242 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1243}
1244
1246 attributeOnlyIfTrue("variadic", D->isVariadic());
1247 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1248}
1249
1251 JOS.attribute("name", AE->getOpAsString());
1252}
1253
1255 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1256}
1257
1259 std::string Str;
1260 llvm::raw_string_ostream OS(Str);
1261
1262 OME->getSelector().print(OS);
1263 JOS.attribute("selector", Str);
1264
1265 switch (OME->getReceiverKind()) {
1267 JOS.attribute("receiverKind", "instance");
1268 break;
1270 JOS.attribute("receiverKind", "class");
1271 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1272 break;
1274 JOS.attribute("receiverKind", "super (instance)");
1275 JOS.attribute("superType", createQualType(OME->getSuperType()));
1276 break;
1278 JOS.attribute("receiverKind", "super (class)");
1279 JOS.attribute("superType", createQualType(OME->getSuperType()));
1280 break;
1281 }
1282
1283 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1284 if (OME->getType() != CallReturnTy)
1285 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1286}
1287
1289 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1290 std::string Str;
1291 llvm::raw_string_ostream OS(Str);
1292
1293 MD->getSelector().print(OS);
1294 JOS.attribute("selector", Str);
1295 }
1296}
1297
1299 std::string Str;
1300 llvm::raw_string_ostream OS(Str);
1301
1302 OSE->getSelector().print(OS);
1303 JOS.attribute("selector", Str);
1304}
1305
1307 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1308}
1309
1311 if (OPRE->isImplicitProperty()) {
1312 JOS.attribute("propertyKind", "implicit");
1313 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1314 JOS.attribute("getter", createBareDeclRef(MD));
1315 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1316 JOS.attribute("setter", createBareDeclRef(MD));
1317 } else {
1318 JOS.attribute("propertyKind", "explicit");
1319 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1320 }
1321
1322 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1323 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1324 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1325}
1326
1328 const ObjCSubscriptRefExpr *OSRE) {
1329 JOS.attribute("subscriptKind",
1330 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1331
1332 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1333 JOS.attribute("getter", createBareDeclRef(MD));
1334 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1335 JOS.attribute("setter", createBareDeclRef(MD));
1336}
1337
1339 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1340 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1341 JOS.attribute("isArrow", OIRE->isArrow());
1342}
1343
1345 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1346}
1347
1349 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1350 if (DRE->getDecl() != DRE->getFoundDecl())
1351 JOS.attribute("foundReferencedDecl",
1352 createBareDeclRef(DRE->getFoundDecl()));
1353 switch (DRE->isNonOdrUse()) {
1354 case NOUR_None: break;
1355 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1356 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1357 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1358 }
1359 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1360}
1361
1363 const SYCLUniqueStableNameExpr *E) {
1364 JOS.attribute("typeSourceInfo",
1365 createQualType(E->getTypeSourceInfo()->getType()));
1366}
1367
1370
1373
1377
1379 JOS.attribute("isPostfix", UO->isPostfix());
1380 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1381 if (!UO->canOverflow())
1382 JOS.attribute("canOverflow", false);
1383}
1384
1386 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1387}
1388
1390 const CompoundAssignOperator *CAO) {
1392 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1393 JOS.attribute("computeResultType",
1394 createQualType(CAO->getComputationResultType()));
1395}
1396
1398 // Note, we always write this Boolean field because the information it conveys
1399 // is critical to understanding the AST node.
1400 ValueDecl *VD = ME->getMemberDecl();
1401 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1402 JOS.attribute("isArrow", ME->isArrow());
1403 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1404 switch (ME->isNonOdrUse()) {
1405 case NOUR_None: break;
1406 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1407 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1408 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1409 }
1410}
1411
1413 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1414 attributeOnlyIfTrue("isArray", NE->isArray());
1415 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1416 switch (NE->getInitializationStyle()) {
1418 break;
1420 JOS.attribute("initStyle", "call");
1421 break;
1423 JOS.attribute("initStyle", "list");
1424 break;
1425 }
1426 if (const FunctionDecl *FD = NE->getOperatorNew())
1427 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1428 if (const FunctionDecl *FD = NE->getOperatorDelete())
1429 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1430}
1432 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1433 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1434 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1435 if (const FunctionDecl *FD = DE->getOperatorDelete())
1436 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1437}
1438
1440 attributeOnlyIfTrue("implicit", TE->isImplicit());
1441}
1442
1444 JOS.attribute("castKind", CE->getCastKindName());
1445 llvm::json::Array Path = createCastPath(CE);
1446 if (!Path.empty())
1447 JOS.attribute("path", std::move(Path));
1448 // FIXME: This may not be useful information as it can be obtusely gleaned
1449 // from the inner[] array.
1450 if (const NamedDecl *ND = CE->getConversionFunction())
1451 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1452}
1453
1455 VisitCastExpr(ICE);
1456 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1457}
1458
1460 attributeOnlyIfTrue("adl", CE->usesADL());
1461}
1462
1464 const UnaryExprOrTypeTraitExpr *TTE) {
1465 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1466 if (TTE->isArgumentType())
1467 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1468}
1469
1473
1475 const UnresolvedLookupExpr *ULE) {
1476 JOS.attribute("usesADL", ULE->requiresADL());
1477 JOS.attribute("name", ULE->getName().getAsString());
1478
1479 JOS.attributeArray("lookups", [this, ULE] {
1480 for (const NamedDecl *D : ULE->decls())
1481 JOS.value(createBareDeclRef(D));
1482 });
1483}
1484
1486 JOS.attribute("name", ALE->getLabel()->getName());
1487 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1488}
1489
1491 if (CTE->isTypeOperand()) {
1492 QualType Adjusted = CTE->getTypeOperand(Ctx);
1493 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1494 JOS.attribute("typeArg", createQualType(Unadjusted));
1495 if (Adjusted != Unadjusted)
1496 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1497 }
1498}
1499
1504
1506 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1507 JOS.attribute("field", createBareDeclRef(FD));
1508}
1509
1511 const GenericSelectionExpr *GSE) {
1512 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1513}
1514
1516 const CXXUnresolvedConstructExpr *UCE) {
1517 if (UCE->getType() != UCE->getTypeAsWritten())
1518 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1519 attributeOnlyIfTrue("list", UCE->isListInitialization());
1520}
1521
1523 CXXConstructorDecl *Ctor = CE->getConstructor();
1524 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1525 attributeOnlyIfTrue("elidable", CE->isElidable());
1526 attributeOnlyIfTrue("list", CE->isListInitialization());
1527 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1528 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1529 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1530 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1531
1532 switch (CE->getConstructionKind()) {
1534 JOS.attribute("constructionKind", "complete");
1535 break;
1537 JOS.attribute("constructionKind", "delegating");
1538 break;
1540 JOS.attribute("constructionKind", "non-virtual base");
1541 break;
1543 JOS.attribute("constructionKind", "virtual base");
1544 break;
1545 }
1546}
1547
1549 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1551 if (EWC->getNumObjects()) {
1552 JOS.attributeArray("cleanups", [this, EWC] {
1553 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1554 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1555 JOS.value(createBareDeclRef(BD));
1556 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1557 llvm::json::Object Obj;
1558 Obj["id"] = createPointerRepresentation(CLE);
1559 Obj["kind"] = CLE->getStmtClassName();
1560 JOS.value(std::move(Obj));
1561 } else {
1562 llvm_unreachable("unexpected cleanup object type");
1563 }
1564 });
1565 }
1566}
1567
1569 const CXXBindTemporaryExpr *BTE) {
1570 const CXXTemporary *Temp = BTE->getTemporary();
1571 JOS.attribute("temp", createPointerRepresentation(Temp));
1572 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1573 JOS.attribute("dtor", createBareDeclRef(Dtor));
1574}
1575
1577 const MaterializeTemporaryExpr *MTE) {
1578 if (const ValueDecl *VD = MTE->getExtendingDecl())
1579 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1580
1581 switch (MTE->getStorageDuration()) {
1582 case SD_Automatic:
1583 JOS.attribute("storageDuration", "automatic");
1584 break;
1585 case SD_Dynamic:
1586 JOS.attribute("storageDuration", "dynamic");
1587 break;
1588 case SD_FullExpression:
1589 JOS.attribute("storageDuration", "full expression");
1590 break;
1591 case SD_Static:
1592 JOS.attribute("storageDuration", "static");
1593 break;
1594 case SD_Thread:
1595 JOS.attribute("storageDuration", "thread");
1596 break;
1597 }
1598
1599 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1600}
1601
1603 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1604}
1605
1607 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1608}
1609
1611 const CXXDependentScopeMemberExpr *DSME) {
1612 JOS.attribute("isArrow", DSME->isArrow());
1613 JOS.attribute("member", DSME->getMember().getAsString());
1614 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1615 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1616 DSME->hasExplicitTemplateArgs());
1617
1618 if (DSME->getNumTemplateArgs()) {
1619 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1620 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1621 JOS.object(
1622 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1623 });
1624 }
1625}
1626
1628 if (!RE->isValueDependent())
1629 JOS.attribute("satisfied", RE->isSatisfied());
1630}
1631
1633 llvm::SmallString<16> Buffer;
1634 IL->getValue().toString(Buffer,
1635 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1636 JOS.attribute("value", Buffer);
1637}
1639 // FIXME: This should probably print the character literal as a string,
1640 // rather than as a numerical value. It would be nice if the behavior matched
1641 // what we do to print a string literal; right now, it is impossible to tell
1642 // the difference between 'a' and L'a' in C from the JSON output.
1643 JOS.attribute("value", CL->getValue());
1644}
1646 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1647}
1649 llvm::SmallString<16> Buffer;
1650 FL->getValue().toString(Buffer);
1651 JOS.attribute("value", Buffer);
1652}
1654 std::string Buffer;
1655 llvm::raw_string_ostream SS(Buffer);
1656 SL->outputString(SS);
1657 JOS.attribute("value", Buffer);
1658}
1660 JOS.attribute("value", BLE->getValue());
1661}
1662
1664 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1665 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1666 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1667 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1668 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1669 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1670}
1671
1673 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1674 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1675}
1677 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1678}
1679
1681 JOS.attribute("name", LS->getName());
1682 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1683 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1684}
1685
1687 if (LS->hasLabelTarget())
1688 JOS.attribute("targetLabelDeclId",
1689 createPointerRepresentation(LS->getLabelDecl()));
1690}
1691
1693 JOS.attribute("targetLabelDeclId",
1694 createPointerRepresentation(GS->getLabel()));
1695}
1696
1698 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1699}
1700
1702 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1703 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1704 // null child node and ObjC gets no child node.
1705 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1706}
1707
1709 JOS.attribute("isNull", true);
1710}
1712 JOS.attribute("type", createQualType(TA.getAsType()));
1713}
1715 const TemplateArgument &TA) {
1716 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1717}
1719 JOS.attribute("isNullptr", true);
1720}
1722 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1723}
1729 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1730 // the output format.
1731}
1733 const TemplateArgument &TA) {
1734 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1735 // the output format.
1736}
1738 const TemplateArgument &TA) {
1739 JOS.attribute("isExpr", true);
1740 if (TA.isCanonicalExpr())
1741 JOS.attribute("isCanonical", true);
1742}
1744 JOS.attribute("isPack", true);
1745}
1746
1747StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1748 if (Traits)
1749 return Traits->getCommandInfo(CommandID)->Name;
1750 if (const comments::CommandInfo *Info =
1752 return Info->Name;
1753 return "<invalid>";
1754}
1755
1757 const comments::FullComment *) {
1758 JOS.attribute("text", C->getText());
1759}
1760
1763 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1764
1765 switch (C->getRenderKind()) {
1767 JOS.attribute("renderKind", "normal");
1768 break;
1770 JOS.attribute("renderKind", "bold");
1771 break;
1773 JOS.attribute("renderKind", "emphasized");
1774 break;
1776 JOS.attribute("renderKind", "monospaced");
1777 break;
1779 JOS.attribute("renderKind", "anchor");
1780 break;
1781 }
1782
1783 llvm::json::Array Args;
1784 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1785 Args.push_back(C->getArgText(I));
1786
1787 if (!Args.empty())
1788 JOS.attribute("args", std::move(Args));
1789}
1790
1793 JOS.attribute("name", C->getTagName());
1794 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1795 attributeOnlyIfTrue("malformed", C->isMalformed());
1796
1797 llvm::json::Array Attrs;
1798 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1799 Attrs.push_back(
1800 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1801
1802 if (!Attrs.empty())
1803 JOS.attribute("attrs", std::move(Attrs));
1804}
1805
1808 JOS.attribute("name", C->getTagName());
1809}
1810
1813 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1814
1815 llvm::json::Array Args;
1816 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1817 Args.push_back(C->getArgText(I));
1818
1819 if (!Args.empty())
1820 JOS.attribute("args", std::move(Args));
1821}
1822
1825 switch (C->getDirection()) {
1827 JOS.attribute("direction", "in");
1828 break;
1830 JOS.attribute("direction", "out");
1831 break;
1833 JOS.attribute("direction", "in,out");
1834 break;
1835 }
1836 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1837
1838 if (C->hasParamName())
1839 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1840 : C->getParamNameAsWritten());
1841
1842 if (C->isParamIndexValid() && !C->isVarArgParam())
1843 JOS.attribute("paramIdx", C->getParamIndex());
1844}
1845
1848 if (C->hasParamName())
1849 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1850 : C->getParamNameAsWritten());
1851 if (C->isPositionValid()) {
1852 llvm::json::Array Positions;
1853 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1854 Positions.push_back(C->getIndex(I));
1855
1856 if (!Positions.empty())
1857 JOS.attribute("positions", std::move(Positions));
1858 }
1859}
1860
1863 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1864 JOS.attribute("closeName", C->getCloseName());
1865}
1866
1869 const comments::FullComment *) {
1870 JOS.attribute("text", C->getText());
1871}
1872
1875 JOS.attribute("text", C->getText());
1876}
1877
1878llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1879 llvm::json::Object Ret;
1880#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1881 if (FPO.has##NAME##Override()) \
1882 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1883#include "clang/Basic/FPOptions.def"
1884 return Ret;
1885}
1886
1888 VisitStmt(S);
1889 if (S->hasStoredFPFeatures())
1890 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1891}
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:825
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:3722
ArraySizeModifier getSizeModifier() const
Definition TypeBase.h:3736
Qualifiers getIndexTypeQualifiers() const
Definition TypeBase.h:3740
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:45
attr::Kind getKind() const
Definition Attr.h:91
bool isInherited() const
Definition Attr.h:100
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition Attr.h:104
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:4660
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4654
bool capturesCXXThis() const
Definition Decl.h:4786
bool isVariadic() const
Definition Decl.h:4729
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:2628
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2667
bool isArrayForm() const
Definition ExprCXX.h:2654
bool isGlobalDelete() const
Definition ExprCXX.h:2653
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2655
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3872
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3971
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4066
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4045
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4010
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4041
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4073
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:2357
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:3746
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3801
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3780
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:1900
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1963
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:130
SourceRange getSourceRange() const LLVM_READONLY
Definition ASTConcept.h:193
SourceLocation getLocation() const
Definition ASTConcept.h:182
const ASTTemplateArgumentListInfo * getTemplateArgsAsWritten() const
Definition ASTConcept.h:203
TemplateDecl * getNamedConcept() const
Definition ASTConcept.h:201
Represents the canonical version of C arrays with a specified constant size.
Definition TypeBase.h:3760
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition TypeBase.h:3842
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:546
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:308
bool isInvalidDecl() const
Definition DeclBase.h:588
SourceLocation getLocation() const
Definition DeclBase.h:439
const char * getDeclKindName() const
Definition DeclBase.cpp:169
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:575
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:4101
SourceLocation getAttributeLoc() const
Definition TypeBase.h:4117
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3423
Represents an enum.
Definition Decl.h:4007
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4216
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4219
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4225
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4171
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5066
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3663
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3698
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3687
unsigned getNumObjects() const
Definition ExprCXX.h:3691
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3669
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:3160
bool isMutable() const
Determines whether this field is mutable (C++ only).
Definition Decl.h:3260
bool isBitField() const
Determines whether this field is a bitfield.
Definition Decl.h:3263
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
Definition Decl.h:3340
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:2000
bool isImmediateFunction() const
Definition Decl.cpp:3329
StringLiteral * getDeletedMessage() const
Get the message that indicates why this function was deleted.
Definition Decl.h:2758
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:4253
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3122
bool isDeleted() const
Whether this function has been deleted.
Definition Decl.h:2540
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:2888
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
Definition Decl.h:2470
bool isDeletedAsWritten() const
Definition Decl.h:2544
bool isPureVirtual() const
Whether this virtual function is pure, i.e.
Definition Decl.h:2353
bool isDefaulted() const
Whether this function is defaulted.
Definition Decl.h:2385
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
Definition Decl.h:2344
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
Definition Decl.h:2899
Represents a prototype with parameter type info, e.g.
Definition TypeBase.h:5254
A class which abstracts out some details necessary for making a call.
Definition TypeBase.h:4561
CallingConv getCC() const
Definition TypeBase.h:4620
unsigned getRegParm() const
Definition TypeBase.h:4613
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4450
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3577
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:2949
LabelDecl * getLabel() const
Definition Stmt.h:2962
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5176
bool isCBuffer() const
Definition Decl.h:5220
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition Stmt.h:2239
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2314
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2311
bool isConstexpr() const
Definition Stmt.h:2432
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2308
bool isNegatedConsteval() const
Definition Stmt.h:2428
bool isConsteval() const
Definition Stmt.h:2419
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:2126
LabelDecl * getDecl() const
Definition Stmt.h:2144
bool isSideEntry() const
Definition Stmt.h:2173
const char * getName() const
Definition Stmt.cpp:432
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:3037
LabelDecl * getLabelDecl()
Definition Stmt.h:3075
bool hasLabelTarget() const
Definition Stmt.h:3070
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6133
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6148
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4922
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4947
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:4991
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:4972
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:3653
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3675
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3681
This represents a decl that may have a name.
Definition Decl.h:274
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined.
Definition DeclBase.h:648
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
Definition Decl.h:301
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
Definition Decl.h:340
std::string getNameAsString() const
Get a human-readable name for the declaration, even if it is one of the special kinds of names (C++ c...
Definition Decl.h:317
Represents a C++ namespace alias.
Definition DeclCXX.h: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:592
bool isFirstDecl() const
True if this is the first declaration in its redeclaration chain.
bool isInline() const
Returns true if this is an inline namespace declaration.
Definition Decl.h:648
bool isNested() const
Returns true if this is a nested namespace declaration.
Definition Decl.h:657
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
llvm::json::OStream JOS
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
const DefArgStorage & getDefaultArgStorage() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
bool defaultArgumentWasInherited() const
Determines whether the default argument was inherited from a previous declaration of this template.
const TemplateArgumentLoc & getDefaultArgument() const
Retrieve the default argument, if any.
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
unsigned getDepth() const
Get the nesting depth of the template parameter.
This is a basic class for representing single OpenMP clause.
Represents Objective-C's @catch statement.
Definition StmtObjC.h:77
const VarDecl * getCatchParamDecl() const
Definition StmtObjC.h:97
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Definition ExprObjC.h: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:7840
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:3229
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3240
[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:8299
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4312
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:3573
bool isSpelledAsLValue() const
Definition TypeBase.h:3586
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:4443
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4511
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:338
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:2489
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2550
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2547
StringRef getKindName() const
Definition Decl.h:3907
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3812
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:3688
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:8249
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8260
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:3350
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9091
Represents the declaration of a typedef-name via the 'typedef' type specifier.
Definition Decl.h:3667
QualType getUnderlyingType() const
Definition Decl.h:3617
TypedefNameDecl * getDecl() const
Definition TypeBase.h:6099
QualType desugar() const
Definition Type.cpp:4040
bool typeMatchesDecl() const
Definition TypeBase.h:6107
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:3392
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3461
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:5970
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6002
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:6042
QualType desugar() const
Definition TypeBase.h:6044
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Definition Decl.h:712
QualType getType() const
Definition Decl.h:723
bool isParameterPack() const
Determine whether this value is actually a function parameter pack, init-capture pack,...
Definition Decl.cpp:5513
Represents a variable declaration or definition.
Definition Decl.h:926
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
Definition Decl.h:1569
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:1466
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:937
@ CInit
C-style initialization with assignment.
Definition Decl.h:931
@ ParenListInit
Parenthesized list-initialization (C++20)
Definition Decl.h:940
@ CallInit
Call-style initialization (C++98)
Definition Decl.h:934
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:1512
bool isInline() const
Whether this variable is (C++1z) inline.
Definition Decl.h:1551
@ TLS_Static
TLS with a known-constant initializer.
Definition Decl.h:949
@ TLS_Dynamic
TLS with a dynamic initializer.
Definition Decl.h:952
@ TLS_None
Not a TLS variable.
Definition Decl.h:946
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Definition Decl.h:1168
Represents a GCC generic vector type.
Definition TypeBase.h:4175
unsigned getNumElements() const
Definition TypeBase.h:4190
VectorKind getVectorKind() const
Definition TypeBase.h:4195
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2677
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2727
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:224
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:4145
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4154
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4139
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4142
@ Neon
is ARM Neon vector
Definition TypeBase.h:4148
@ Generic
not a target-specific vector type
Definition TypeBase.h:4136
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
Definition TypeBase.h:4160
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
Definition TypeBase.h:4163
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4151
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4157
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:5313
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition TypeBase.h:5316
Extra information about a function prototype.
Definition TypeBase.h:5339
Information about a single command.