clang 23.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
599void JSONNodeDumper::VisitAvailabilityAttr(const AvailabilityAttr *AA) {
600 if (const IdentifierInfo *Platform = AA->getPlatform())
601 JOS.attribute("platform", Platform->getName());
602 if (!AA->getIntroduced().empty())
603 JOS.attribute("introduced", AA->getIntroduced().getAsString());
604 if (!AA->getDeprecated().empty())
605 JOS.attribute("deprecated", AA->getDeprecated().getAsString());
606 if (!AA->getObsoleted().empty())
607 JOS.attribute("obsoleted", AA->getObsoleted().getAsString());
608 attributeOnlyIfTrue("unavailable", AA->getUnavailable());
609 if (!AA->getMessage().empty())
610 JOS.attribute("message", AA->getMessage());
611 attributeOnlyIfTrue("strict", AA->getStrict());
612 if (!AA->getReplacement().empty())
613 JOS.attribute("replacement", AA->getReplacement());
614 if (AA->getPriority() != 0)
615 JOS.attribute("priority", AA->getPriority());
616 if (const IdentifierInfo *Env = AA->getEnvironment())
617 JOS.attribute("environment", Env->getName());
618}
619
621 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
622 if (!TT->typeMatchesDecl())
623 JOS.attribute("type", createQualType(TT->desugar()));
624}
625
627 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
628 JOS.attribute("type", createQualType(TT->desugar()));
629}
630
632 FunctionType::ExtInfo E = T->getExtInfo();
633 attributeOnlyIfTrue("noreturn", E.getNoReturn());
634 attributeOnlyIfTrue("producesResult", E.getProducesResult());
635 if (E.getHasRegParm())
636 JOS.attribute("regParm", E.getRegParm());
637 JOS.attribute("cc", FunctionType::getNameForCallConv(E.getCC()));
638}
639
641 FunctionProtoType::ExtProtoInfo E = T->getExtProtoInfo();
642 attributeOnlyIfTrue("trailingReturn", E.HasTrailingReturn);
643 attributeOnlyIfTrue("const", T->isConst());
644 attributeOnlyIfTrue("volatile", T->isVolatile());
645 attributeOnlyIfTrue("restrict", T->isRestrict());
646 attributeOnlyIfTrue("variadic", E.Variadic);
647 switch (E.RefQualifier) {
648 case RQ_LValue: JOS.attribute("refQualifier", "&"); break;
649 case RQ_RValue: JOS.attribute("refQualifier", "&&"); break;
650 case RQ_None: break;
651 }
652 switch (E.ExceptionSpec.Type) {
653 case EST_DynamicNone:
654 case EST_Dynamic: {
655 JOS.attribute("exceptionSpec", "throw");
656 llvm::json::Array Types;
658 Types.push_back(createQualType(QT));
659 JOS.attribute("exceptionTypes", std::move(Types));
660 } break;
661 case EST_MSAny:
662 JOS.attribute("exceptionSpec", "throw");
663 JOS.attribute("throwsAny", true);
664 break;
666 JOS.attribute("exceptionSpec", "noexcept");
667 break;
668 case EST_NoexceptTrue:
670 JOS.attribute("exceptionSpec", "noexcept");
671 JOS.attribute("conditionEvaluatesTo",
673 //JOS.attributeWithCall("exceptionSpecExpr",
674 // [this, E]() { Visit(E.ExceptionSpec.NoexceptExpr); });
675 break;
676 case EST_NoThrow:
677 JOS.attribute("exceptionSpec", "nothrow");
678 break;
679 // FIXME: I cannot find a way to trigger these cases while dumping the AST. I
680 // suspect you can only run into them when executing an AST dump from within
681 // the debugger, which is not a use case we worry about for the JSON dumping
682 // feature.
684 case EST_Unevaluated:
686 case EST_Unparsed:
687 case EST_None: break;
688 }
690}
691
693 attributeOnlyIfTrue("spelledAsLValue", RT->isSpelledAsLValue());
694}
695
697 switch (AT->getSizeModifier()) {
699 JOS.attribute("sizeModifier", "*");
700 break;
702 JOS.attribute("sizeModifier", "static");
703 break;
705 break;
706 }
707
708 std::string Str = AT->getIndexTypeQualifiers().getAsString();
709 if (!Str.empty())
710 JOS.attribute("indexTypeQualifiers", Str);
711}
712
714 // FIXME: this should use ZExt instead of SExt, but JSON doesn't allow a
715 // narrowing conversion to int64_t so it cannot be expressed.
716 JOS.attribute("size", CAT->getSExtSize());
717 VisitArrayType(CAT);
718}
719
721 const DependentSizedExtVectorType *VT) {
722 JOS.attributeObject(
723 "attrLoc", [VT, this] { writeSourceLocation(VT->getAttributeLoc()); });
724}
725
727 JOS.attribute("numElements", VT->getNumElements());
728 switch (VT->getVectorKind()) {
730 break;
732 JOS.attribute("vectorKind", "altivec");
733 break;
735 JOS.attribute("vectorKind", "altivec pixel");
736 break;
738 JOS.attribute("vectorKind", "altivec bool");
739 break;
740 case VectorKind::Neon:
741 JOS.attribute("vectorKind", "neon");
742 break;
744 JOS.attribute("vectorKind", "neon poly");
745 break;
747 JOS.attribute("vectorKind", "fixed-length sve data vector");
748 break;
750 JOS.attribute("vectorKind", "fixed-length sve predicate vector");
751 break;
753 JOS.attribute("vectorKind", "fixed-length rvv data vector");
754 break;
759 JOS.attribute("vectorKind", "fixed-length rvv mask vector");
760 break;
761 }
762}
763
765 JOS.attribute("decl", createBareDeclRef(UUT->getDecl()));
766}
767
768void JSONNodeDumper::VisitUnaryTransformType(const UnaryTransformType *UTT) {
769 switch (UTT->getUTTKind()) {
770#define TRANSFORM_TYPE_TRAIT_DEF(Enum, Trait) \
771 case UnaryTransformType::Enum: \
772 JOS.attribute("transformKind", #Trait); \
773 break;
774#include "clang/Basic/TransformTypeTraits.def"
775 }
776}
777
778void JSONNodeDumper::VisitTagType(const TagType *TT) {
779 if (NestedNameSpecifier Qualifier = TT->getQualifier()) {
780 std::string Str;
781 llvm::raw_string_ostream OS(Str);
782 Qualifier.print(OS, PrintPolicy, /*ResolveTemplateArguments=*/true);
783 JOS.attribute("qualifier", Str);
784 }
785 JOS.attribute("decl", createBareDeclRef(TT->getDecl()));
786 if (TT->isTagOwned())
787 JOS.attribute("isTagOwned", true);
788}
789
791 const TemplateTypeParmType *TTPT) {
792 JOS.attribute("depth", TTPT->getDepth());
793 JOS.attribute("index", TTPT->getIndex());
794 attributeOnlyIfTrue("isPack", TTPT->isParameterPack());
795 JOS.attribute("decl", createBareDeclRef(TTPT->getDecl()));
796}
797
799 const SubstTemplateTypeParmType *STTPT) {
800 JOS.attribute("index", STTPT->getIndex());
801 if (auto PackIndex = STTPT->getPackIndex())
802 JOS.attribute("pack_index", *PackIndex);
803}
804
806 const SubstTemplateTypeParmPackType *T) {
807 JOS.attribute("index", T->getIndex());
808}
809
810void JSONNodeDumper::VisitAutoType(const AutoType *AT) {
811 JOS.attribute("undeduced", !AT->isDeduced());
812 switch (AT->getKeyword()) {
814 JOS.attribute("typeKeyword", "auto");
815 break;
817 JOS.attribute("typeKeyword", "decltype(auto)");
818 break;
820 JOS.attribute("typeKeyword", "__auto_type");
821 break;
822 }
823}
824
826 const TemplateSpecializationType *TST) {
827 attributeOnlyIfTrue("isAlias", TST->isTypeAlias());
828
829 std::string Str;
830 llvm::raw_string_ostream OS(Str);
831 TST->getTemplateName().print(OS, PrintPolicy);
832 JOS.attribute("templateName", Str);
833}
834
836 const InjectedClassNameType *ICNT) {
837 JOS.attribute("decl", createBareDeclRef(ICNT->getDecl()));
838}
839
841 JOS.attribute("decl", createBareDeclRef(OIT->getDecl()));
842}
843
844void JSONNodeDumper::VisitPackExpansionType(const PackExpansionType *PET) {
845 if (UnsignedOrNone N = PET->getNumExpansions())
846 JOS.attribute("numExpansions", *N);
847}
848
850 JOS.attribute("macroName", MQT->getMacroIdentifier()->getName());
851}
852
854 attributeOnlyIfTrue("isData", MPT->isMemberDataPointer());
855 attributeOnlyIfTrue("isFunction", MPT->isMemberFunctionPointer());
856}
857
859 if (ND && ND->getDeclName()) {
860 JOS.attribute("name", ND->getNameAsString());
861 // FIXME: There are likely other contexts in which it makes no sense to ask
862 // for a mangled name.
864 return;
865
866 // If the declaration is dependent or is in a dependent context, then the
867 // mangling is unlikely to be meaningful (and in some cases may cause
868 // "don't know how to mangle this" assertion failures.
869 if (ND->isTemplated())
870 return;
871
872 // Mangled names are not meaningful for locals, and may not be well-defined
873 // in the case of VLAs.
874 auto *VD = dyn_cast<VarDecl>(ND);
875 if (VD && VD->hasLocalStorage())
876 return;
877
878 // Do not mangle template deduction guides.
880 return;
881
882 std::string MangledName = ASTNameGen.getName(ND);
883 if (!MangledName.empty())
884 JOS.attribute("mangledName", MangledName);
885 }
886}
887
889 VisitNamedDecl(TD);
890 JOS.attribute("type", createQualType(TD->getUnderlyingType()));
891}
892
894 VisitNamedDecl(TAD);
895 JOS.attribute("type", createQualType(TAD->getUnderlyingType()));
896}
897
899 VisitNamedDecl(ND);
900 attributeOnlyIfTrue("isInline", ND->isInline());
901 attributeOnlyIfTrue("isNested", ND->isNested());
902 if (!ND->isFirstDecl())
903 JOS.attribute("originalNamespace", createBareDeclRef(ND->getFirstDecl()));
904}
905
907 JOS.attribute("nominatedNamespace",
908 createBareDeclRef(UDD->getNominatedNamespace()));
909}
910
912 VisitNamedDecl(NAD);
913 JOS.attribute("aliasedNamespace",
914 createBareDeclRef(NAD->getAliasedNamespace()));
915}
916
918 std::string Name;
919 if (NestedNameSpecifier Qualifier = UD->getQualifier()) {
920 llvm::raw_string_ostream SOS(Name);
921 Qualifier.print(SOS, UD->getASTContext().getPrintingPolicy());
922 }
923 Name += UD->getNameAsString();
924 JOS.attribute("name", Name);
925}
926
928 JOS.attribute("target", createBareDeclRef(UED->getEnumDecl()));
929}
930
932 JOS.attribute("target", createBareDeclRef(USD->getTargetDecl()));
933}
934
936 VisitNamedDecl(VD);
937 JOS.attribute("type", createQualType(VD->getType()));
938 if (const auto *P = dyn_cast<ParmVarDecl>(VD))
939 attributeOnlyIfTrue("explicitObjectParameter",
940 P->isExplicitObjectParameter());
941
942 StorageClass SC = VD->getStorageClass();
943 if (SC != SC_None)
944 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
945 switch (VD->getTLSKind()) {
946 case VarDecl::TLS_Dynamic: JOS.attribute("tls", "dynamic"); break;
947 case VarDecl::TLS_Static: JOS.attribute("tls", "static"); break;
948 case VarDecl::TLS_None: break;
949 }
950 attributeOnlyIfTrue("nrvo", VD->isNRVOVariable());
951 attributeOnlyIfTrue("inline", VD->isInline());
952 attributeOnlyIfTrue("constexpr", VD->isConstexpr());
953 attributeOnlyIfTrue("modulePrivate", VD->isModulePrivate());
954 if (VD->hasInit()) {
955 switch (VD->getInitStyle()) {
956 case VarDecl::CInit: JOS.attribute("init", "c"); break;
957 case VarDecl::CallInit: JOS.attribute("init", "call"); break;
958 case VarDecl::ListInit: JOS.attribute("init", "list"); break;
960 JOS.attribute("init", "paren-list");
961 break;
962 }
963 }
964 attributeOnlyIfTrue("isParameterPack", VD->isParameterPack());
965 if (const auto *Instance = VD->getTemplateInstantiationPattern())
966 JOS.attribute("TemplateInstantiationPattern",
967 createPointerRepresentation(Instance));
968}
969
971 VisitNamedDecl(FD);
972 JOS.attribute("type", createQualType(FD->getType()));
973 attributeOnlyIfTrue("mutable", FD->isMutable());
974 attributeOnlyIfTrue("modulePrivate", FD->isModulePrivate());
975 attributeOnlyIfTrue("isBitfield", FD->isBitField());
976 attributeOnlyIfTrue("hasInClassInitializer", FD->hasInClassInitializer());
977}
978
980 VisitNamedDecl(FD);
981 JOS.attribute("type", createQualType(FD->getType()));
982 StorageClass SC = FD->getStorageClass();
983 if (SC != SC_None)
984 JOS.attribute("storageClass", VarDecl::getStorageClassSpecifierString(SC));
985 attributeOnlyIfTrue("inline", FD->isInlineSpecified());
986 attributeOnlyIfTrue("virtual", FD->isVirtualAsWritten());
987 attributeOnlyIfTrue("pure", FD->isPureVirtual());
988 attributeOnlyIfTrue("explicitlyDeleted", FD->isDeletedAsWritten());
989 attributeOnlyIfTrue("constexpr", FD->isConstexpr());
990 attributeOnlyIfTrue("variadic", FD->isVariadic());
991 attributeOnlyIfTrue("immediate", FD->isImmediateFunction());
992
993 if (FD->isDefaulted())
994 JOS.attribute("explicitlyDefaulted",
995 FD->isDeleted() ? "deleted" : "default");
996
997 if (StringLiteral *Msg = FD->getDeletedMessage())
998 JOS.attribute("deletedMessage", Msg->getString());
999
1000 if (const auto *Instance = FD->getTemplateInstantiationPattern())
1001 JOS.attribute("TemplateInstantiationPattern",
1002 createPointerRepresentation(Instance));
1003}
1004
1006 VisitNamedDecl(ED);
1007 if (ED->isFixed())
1008 JOS.attribute("fixedUnderlyingType", createQualType(ED->getIntegerType()));
1009 if (ED->isScoped())
1010 JOS.attribute("scopedEnumTag",
1011 ED->isScopedUsingClassTag() ? "class" : "struct");
1012 if (const auto *Instance = ED->getTemplateInstantiationPattern())
1013 JOS.attribute("TemplateInstantiationPattern",
1014 createPointerRepresentation(Instance));
1015}
1017 VisitNamedDecl(ECD);
1018 JOS.attribute("type", createQualType(ECD->getType()));
1019}
1020
1022 VisitNamedDecl(RD);
1023 JOS.attribute("tagUsed", RD->getKindName());
1024 attributeOnlyIfTrue("completeDefinition", RD->isCompleteDefinition());
1025}
1027 VisitRecordDecl(RD);
1028
1029 if (const auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD)) {
1030 if (CTSD->hasStrictPackMatch())
1031 JOS.attribute("strict-pack-match", true);
1032 }
1033
1034 if (const auto *Instance = RD->getTemplateInstantiationPattern())
1035 JOS.attribute("TemplateInstantiationPattern",
1036 createPointerRepresentation(Instance));
1037
1038 // All other information requires a complete definition.
1039 if (!RD->isCompleteDefinition())
1040 return;
1041
1042 JOS.attribute("definitionData", createCXXRecordDefinitionData(RD));
1043 if (RD->getNumBases()) {
1044 JOS.attributeArray("bases", [this, RD] {
1045 for (const auto &Spec : RD->bases())
1046 JOS.value(createCXXBaseSpecifier(Spec));
1047 });
1048 }
1049}
1050
1052 VisitNamedDecl(D);
1053 JOS.attribute("bufferKind", D->isCBuffer() ? "cbuffer" : "tbuffer");
1054}
1055
1057 VisitNamedDecl(D);
1058 JOS.attribute("tagUsed", D->wasDeclaredWithTypename() ? "typename" : "class");
1059 JOS.attribute("depth", D->getDepth());
1060 JOS.attribute("index", D->getIndex());
1061 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1062
1063 if (D->hasDefaultArgument())
1064 JOS.attributeObject("defaultArg", [=] {
1067 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1068 });
1069}
1070
1072 const NonTypeTemplateParmDecl *D) {
1073 VisitNamedDecl(D);
1074 JOS.attribute("type", createQualType(D->getType()));
1075 JOS.attribute("depth", D->getDepth());
1076 JOS.attribute("index", D->getIndex());
1077 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1078
1079 if (D->hasDefaultArgument())
1080 JOS.attributeObject("defaultArg", [=] {
1083 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1084 });
1085}
1086
1088 const TemplateTemplateParmDecl *D) {
1089 VisitNamedDecl(D);
1090 JOS.attribute("depth", D->getDepth());
1091 JOS.attribute("index", D->getIndex());
1092 attributeOnlyIfTrue("isParameterPack", D->isParameterPack());
1093
1094 if (D->hasDefaultArgument())
1095 JOS.attributeObject("defaultArg", [=] {
1096 const auto *InheritedFrom = D->getDefaultArgStorage().getInheritedFrom();
1098 InheritedFrom ? InheritedFrom->getSourceRange() : SourceLocation{},
1099 InheritedFrom,
1100 D->defaultArgumentWasInherited() ? "inherited from" : "previous");
1101 });
1102}
1103
1105 StringRef Lang;
1106 switch (LSD->getLanguage()) {
1108 Lang = "C";
1109 break;
1111 Lang = "C++";
1112 break;
1113 }
1114 JOS.attribute("language", Lang);
1115 attributeOnlyIfTrue("hasBraces", LSD->hasBraces());
1116}
1117
1119 JOS.attribute("access", createAccessSpecifier(ASD->getAccess()));
1120}
1121
1123 if (const TypeSourceInfo *T = FD->getFriendType())
1124 JOS.attribute("type", createQualType(T->getType()));
1125 attributeOnlyIfTrue("isPackExpansion", FD->isPackExpansion());
1126}
1127
1129 VisitNamedDecl(D);
1130 JOS.attribute("type", createQualType(D->getType()));
1131 attributeOnlyIfTrue("synthesized", D->getSynthesize());
1132 switch (D->getAccessControl()) {
1133 case ObjCIvarDecl::None: JOS.attribute("access", "none"); break;
1134 case ObjCIvarDecl::Private: JOS.attribute("access", "private"); break;
1135 case ObjCIvarDecl::Protected: JOS.attribute("access", "protected"); break;
1136 case ObjCIvarDecl::Public: JOS.attribute("access", "public"); break;
1137 case ObjCIvarDecl::Package: JOS.attribute("access", "package"); break;
1138 }
1139}
1140
1142 VisitNamedDecl(D);
1143 JOS.attribute("returnType", createQualType(D->getReturnType()));
1144 JOS.attribute("instance", D->isInstanceMethod());
1145 attributeOnlyIfTrue("variadic", D->isVariadic());
1146}
1147
1149 VisitNamedDecl(D);
1150 JOS.attribute("type", createQualType(D->getUnderlyingType()));
1151 attributeOnlyIfTrue("bounded", D->hasExplicitBound());
1152 switch (D->getVariance()) {
1154 break;
1156 JOS.attribute("variance", "covariant");
1157 break;
1159 JOS.attribute("variance", "contravariant");
1160 break;
1161 }
1162}
1163
1165 VisitNamedDecl(D);
1166 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1167 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1168
1169 llvm::json::Array Protocols;
1170 for (const auto* P : D->protocols())
1171 Protocols.push_back(createBareDeclRef(P));
1172 if (!Protocols.empty())
1173 JOS.attribute("protocols", std::move(Protocols));
1174}
1175
1177 VisitNamedDecl(D);
1178 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1179 JOS.attribute("categoryDecl", createBareDeclRef(D->getCategoryDecl()));
1180}
1181
1183 VisitNamedDecl(D);
1184
1185 llvm::json::Array Protocols;
1186 for (const auto *P : D->protocols())
1187 Protocols.push_back(createBareDeclRef(P));
1188 if (!Protocols.empty())
1189 JOS.attribute("protocols", std::move(Protocols));
1190}
1191
1193 VisitNamedDecl(D);
1194 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1195 JOS.attribute("implementation", createBareDeclRef(D->getImplementation()));
1196
1197 llvm::json::Array Protocols;
1198 for (const auto* P : D->protocols())
1199 Protocols.push_back(createBareDeclRef(P));
1200 if (!Protocols.empty())
1201 JOS.attribute("protocols", std::move(Protocols));
1202}
1203
1205 const ObjCImplementationDecl *D) {
1206 VisitNamedDecl(D);
1207 JOS.attribute("super", createBareDeclRef(D->getSuperClass()));
1208 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1209}
1210
1212 const ObjCCompatibleAliasDecl *D) {
1213 VisitNamedDecl(D);
1214 JOS.attribute("interface", createBareDeclRef(D->getClassInterface()));
1215}
1216
1218 VisitNamedDecl(D);
1219 JOS.attribute("type", createQualType(D->getType()));
1220
1221 switch (D->getPropertyImplementation()) {
1222 case ObjCPropertyDecl::None: break;
1223 case ObjCPropertyDecl::Required: JOS.attribute("control", "required"); break;
1224 case ObjCPropertyDecl::Optional: JOS.attribute("control", "optional"); break;
1225 }
1226
1230 JOS.attribute("getter", createBareDeclRef(D->getGetterMethodDecl()));
1232 JOS.attribute("setter", createBareDeclRef(D->getSetterMethodDecl()));
1233 attributeOnlyIfTrue("readonly",
1235 attributeOnlyIfTrue("assign", Attrs & ObjCPropertyAttribute::kind_assign);
1236 attributeOnlyIfTrue("readwrite",
1238 attributeOnlyIfTrue("retain", Attrs & ObjCPropertyAttribute::kind_retain);
1239 attributeOnlyIfTrue("copy", Attrs & ObjCPropertyAttribute::kind_copy);
1240 attributeOnlyIfTrue("nonatomic",
1242 attributeOnlyIfTrue("atomic", Attrs & ObjCPropertyAttribute::kind_atomic);
1243 attributeOnlyIfTrue("weak", Attrs & ObjCPropertyAttribute::kind_weak);
1244 attributeOnlyIfTrue("strong", Attrs & ObjCPropertyAttribute::kind_strong);
1245 attributeOnlyIfTrue("unsafe_unretained",
1247 attributeOnlyIfTrue("class", Attrs & ObjCPropertyAttribute::kind_class);
1248 attributeOnlyIfTrue("direct", Attrs & ObjCPropertyAttribute::kind_direct);
1249 attributeOnlyIfTrue("nullability",
1251 attributeOnlyIfTrue("null_resettable",
1253 }
1254}
1255
1258 JOS.attribute("implKind", D->getPropertyImplementation() ==
1260 ? "synthesize"
1261 : "dynamic");
1262 JOS.attribute("propertyDecl", createBareDeclRef(D->getPropertyDecl()));
1263 JOS.attribute("ivarDecl", createBareDeclRef(D->getPropertyIvarDecl()));
1264}
1265
1267 attributeOnlyIfTrue("variadic", D->isVariadic());
1268 attributeOnlyIfTrue("capturesThis", D->capturesCXXThis());
1269}
1270
1272 JOS.attribute("name", AE->getOpAsString());
1273}
1274
1276 JOS.attribute("encodedType", createQualType(OEE->getEncodedType()));
1277}
1278
1280 std::string Str;
1281 llvm::raw_string_ostream OS(Str);
1282
1283 OME->getSelector().print(OS);
1284 JOS.attribute("selector", Str);
1285
1286 switch (OME->getReceiverKind()) {
1288 JOS.attribute("receiverKind", "instance");
1289 break;
1291 JOS.attribute("receiverKind", "class");
1292 JOS.attribute("classType", createQualType(OME->getClassReceiver()));
1293 break;
1295 JOS.attribute("receiverKind", "super (instance)");
1296 JOS.attribute("superType", createQualType(OME->getSuperType()));
1297 break;
1299 JOS.attribute("receiverKind", "super (class)");
1300 JOS.attribute("superType", createQualType(OME->getSuperType()));
1301 break;
1302 }
1303
1304 QualType CallReturnTy = OME->getCallReturnType(Ctx);
1305 if (OME->getType() != CallReturnTy)
1306 JOS.attribute("callReturnType", createQualType(CallReturnTy));
1307}
1308
1310 if (const ObjCMethodDecl *MD = OBE->getBoxingMethod()) {
1311 std::string Str;
1312 llvm::raw_string_ostream OS(Str);
1313
1314 MD->getSelector().print(OS);
1315 JOS.attribute("selector", Str);
1316 }
1317}
1318
1320 std::string Str;
1321 llvm::raw_string_ostream OS(Str);
1322
1323 OSE->getSelector().print(OS);
1324 JOS.attribute("selector", Str);
1325}
1326
1328 JOS.attribute("protocol", createBareDeclRef(OPE->getProtocol()));
1329}
1330
1332 if (OPRE->isImplicitProperty()) {
1333 JOS.attribute("propertyKind", "implicit");
1334 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertyGetter())
1335 JOS.attribute("getter", createBareDeclRef(MD));
1336 if (const ObjCMethodDecl *MD = OPRE->getImplicitPropertySetter())
1337 JOS.attribute("setter", createBareDeclRef(MD));
1338 } else {
1339 JOS.attribute("propertyKind", "explicit");
1340 JOS.attribute("property", createBareDeclRef(OPRE->getExplicitProperty()));
1341 }
1342
1343 attributeOnlyIfTrue("isSuperReceiver", OPRE->isSuperReceiver());
1344 attributeOnlyIfTrue("isMessagingGetter", OPRE->isMessagingGetter());
1345 attributeOnlyIfTrue("isMessagingSetter", OPRE->isMessagingSetter());
1346}
1347
1349 const ObjCSubscriptRefExpr *OSRE) {
1350 JOS.attribute("subscriptKind",
1351 OSRE->isArraySubscriptRefExpr() ? "array" : "dictionary");
1352
1353 if (const ObjCMethodDecl *MD = OSRE->getAtIndexMethodDecl())
1354 JOS.attribute("getter", createBareDeclRef(MD));
1355 if (const ObjCMethodDecl *MD = OSRE->setAtIndexMethodDecl())
1356 JOS.attribute("setter", createBareDeclRef(MD));
1357}
1358
1360 JOS.attribute("decl", createBareDeclRef(OIRE->getDecl()));
1361 attributeOnlyIfTrue("isFreeIvar", OIRE->isFreeIvar());
1362 JOS.attribute("isArrow", OIRE->isArrow());
1363}
1364
1366 JOS.attribute("value", OBLE->getValue() ? "__objc_yes" : "__objc_no");
1367}
1368
1370 JOS.attribute("referencedDecl", createBareDeclRef(DRE->getDecl()));
1371 if (DRE->getDecl() != DRE->getFoundDecl())
1372 JOS.attribute("foundReferencedDecl",
1373 createBareDeclRef(DRE->getFoundDecl()));
1374 switch (DRE->isNonOdrUse()) {
1375 case NOUR_None: break;
1376 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1377 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1378 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1379 }
1380 attributeOnlyIfTrue("isImmediateEscalating", DRE->isImmediateEscalating());
1381}
1382
1384 const SYCLUniqueStableNameExpr *E) {
1385 JOS.attribute("typeSourceInfo",
1386 createQualType(E->getTypeSourceInfo()->getType()));
1387}
1388
1391
1394
1398
1400 JOS.attribute("isPostfix", UO->isPostfix());
1401 JOS.attribute("opcode", UnaryOperator::getOpcodeStr(UO->getOpcode()));
1402 if (!UO->canOverflow())
1403 JOS.attribute("canOverflow", false);
1404}
1405
1407 JOS.attribute("opcode", BinaryOperator::getOpcodeStr(BO->getOpcode()));
1408}
1409
1411 const CompoundAssignOperator *CAO) {
1413 JOS.attribute("computeLHSType", createQualType(CAO->getComputationLHSType()));
1414 JOS.attribute("computeResultType",
1415 createQualType(CAO->getComputationResultType()));
1416}
1417
1419 // Note, we always write this Boolean field because the information it conveys
1420 // is critical to understanding the AST node.
1421 ValueDecl *VD = ME->getMemberDecl();
1422 JOS.attribute("name", VD && VD->getDeclName() ? VD->getNameAsString() : "");
1423 JOS.attribute("isArrow", ME->isArrow());
1424 JOS.attribute("referencedMemberDecl", createPointerRepresentation(VD));
1425 switch (ME->isNonOdrUse()) {
1426 case NOUR_None: break;
1427 case NOUR_Unevaluated: JOS.attribute("nonOdrUseReason", "unevaluated"); break;
1428 case NOUR_Constant: JOS.attribute("nonOdrUseReason", "constant"); break;
1429 case NOUR_Discarded: JOS.attribute("nonOdrUseReason", "discarded"); break;
1430 }
1431}
1432
1434 attributeOnlyIfTrue("isGlobal", NE->isGlobalNew());
1435 attributeOnlyIfTrue("isArray", NE->isArray());
1436 attributeOnlyIfTrue("isPlacement", NE->getNumPlacementArgs() != 0);
1437 switch (NE->getInitializationStyle()) {
1439 break;
1441 JOS.attribute("initStyle", "call");
1442 break;
1444 JOS.attribute("initStyle", "list");
1445 break;
1446 }
1447 if (const FunctionDecl *FD = NE->getOperatorNew())
1448 JOS.attribute("operatorNewDecl", createBareDeclRef(FD));
1449 if (const FunctionDecl *FD = NE->getOperatorDelete())
1450 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1451}
1453 attributeOnlyIfTrue("isGlobal", DE->isGlobalDelete());
1454 attributeOnlyIfTrue("isArray", DE->isArrayForm());
1455 attributeOnlyIfTrue("isArrayAsWritten", DE->isArrayFormAsWritten());
1456 if (const FunctionDecl *FD = DE->getOperatorDelete())
1457 JOS.attribute("operatorDeleteDecl", createBareDeclRef(FD));
1458}
1459
1461 attributeOnlyIfTrue("implicit", TE->isImplicit());
1462}
1463
1465 JOS.attribute("castKind", CE->getCastKindName());
1466 llvm::json::Array Path = createCastPath(CE);
1467 if (!Path.empty())
1468 JOS.attribute("path", std::move(Path));
1469 // FIXME: This may not be useful information as it can be obtusely gleaned
1470 // from the inner[] array.
1471 if (const NamedDecl *ND = CE->getConversionFunction())
1472 JOS.attribute("conversionFunc", createBareDeclRef(ND));
1473}
1474
1476 VisitCastExpr(ICE);
1477 attributeOnlyIfTrue("isPartOfExplicitCast", ICE->isPartOfExplicitCast());
1478}
1479
1481 attributeOnlyIfTrue("adl", CE->usesADL());
1482}
1483
1485 const UnaryExprOrTypeTraitExpr *TTE) {
1486 JOS.attribute("name", getTraitSpelling(TTE->getKind()));
1487 if (TTE->isArgumentType())
1488 JOS.attribute("argType", createQualType(TTE->getArgumentType()));
1489}
1490
1494
1496 const UnresolvedLookupExpr *ULE) {
1497 JOS.attribute("usesADL", ULE->requiresADL());
1498 JOS.attribute("name", ULE->getName().getAsString());
1499
1500 JOS.attributeArray("lookups", [this, ULE] {
1501 for (const NamedDecl *D : ULE->decls())
1502 JOS.value(createBareDeclRef(D));
1503 });
1504}
1505
1507 JOS.attribute("name", ALE->getLabel()->getName());
1508 JOS.attribute("labelDeclId", createPointerRepresentation(ALE->getLabel()));
1509}
1510
1512 if (CTE->isTypeOperand()) {
1513 QualType Adjusted = CTE->getTypeOperand(Ctx);
1514 QualType Unadjusted = CTE->getTypeOperandSourceInfo()->getType();
1515 JOS.attribute("typeArg", createQualType(Unadjusted));
1516 if (Adjusted != Unadjusted)
1517 JOS.attribute("adjustedTypeArg", createQualType(Adjusted));
1518 }
1519}
1520
1525
1527 if (const FieldDecl *FD = ILE->getInitializedFieldInUnion())
1528 JOS.attribute("field", createBareDeclRef(FD));
1529}
1530
1532 const GenericSelectionExpr *GSE) {
1533 attributeOnlyIfTrue("resultDependent", GSE->isResultDependent());
1534}
1535
1537 const CXXUnresolvedConstructExpr *UCE) {
1538 if (UCE->getType() != UCE->getTypeAsWritten())
1539 JOS.attribute("typeAsWritten", createQualType(UCE->getTypeAsWritten()));
1540 attributeOnlyIfTrue("list", UCE->isListInitialization());
1541}
1542
1544 CXXConstructorDecl *Ctor = CE->getConstructor();
1545 JOS.attribute("ctorType", createQualType(Ctor->getType()));
1546 attributeOnlyIfTrue("elidable", CE->isElidable());
1547 attributeOnlyIfTrue("list", CE->isListInitialization());
1548 attributeOnlyIfTrue("initializer_list", CE->isStdInitListInitialization());
1549 attributeOnlyIfTrue("zeroing", CE->requiresZeroInitialization());
1550 attributeOnlyIfTrue("hadMultipleCandidates", CE->hadMultipleCandidates());
1551 attributeOnlyIfTrue("isImmediateEscalating", CE->isImmediateEscalating());
1552
1553 switch (CE->getConstructionKind()) {
1555 JOS.attribute("constructionKind", "complete");
1556 break;
1558 JOS.attribute("constructionKind", "delegating");
1559 break;
1561 JOS.attribute("constructionKind", "non-virtual base");
1562 break;
1564 JOS.attribute("constructionKind", "virtual base");
1565 break;
1566 }
1567}
1568
1570 attributeOnlyIfTrue("cleanupsHaveSideEffects",
1572 if (EWC->getNumObjects()) {
1573 JOS.attributeArray("cleanups", [this, EWC] {
1574 for (const ExprWithCleanups::CleanupObject &CO : EWC->getObjects())
1575 if (auto *BD = dyn_cast<BlockDecl *>(CO)) {
1576 JOS.value(createBareDeclRef(BD));
1577 } else if (auto *CLE = dyn_cast<CompoundLiteralExpr *>(CO)) {
1578 llvm::json::Object Obj;
1579 Obj["id"] = createPointerRepresentation(CLE);
1580 Obj["kind"] = CLE->getStmtClassName();
1581 JOS.value(std::move(Obj));
1582 } else {
1583 llvm_unreachable("unexpected cleanup object type");
1584 }
1585 });
1586 }
1587}
1588
1590 const CXXBindTemporaryExpr *BTE) {
1591 const CXXTemporary *Temp = BTE->getTemporary();
1592 JOS.attribute("temp", createPointerRepresentation(Temp));
1593 if (const CXXDestructorDecl *Dtor = Temp->getDestructor())
1594 JOS.attribute("dtor", createBareDeclRef(Dtor));
1595}
1596
1598 const MaterializeTemporaryExpr *MTE) {
1599 if (const ValueDecl *VD = MTE->getExtendingDecl())
1600 JOS.attribute("extendingDecl", createBareDeclRef(VD));
1601
1602 switch (MTE->getStorageDuration()) {
1603 case SD_Automatic:
1604 JOS.attribute("storageDuration", "automatic");
1605 break;
1606 case SD_Dynamic:
1607 JOS.attribute("storageDuration", "dynamic");
1608 break;
1609 case SD_FullExpression:
1610 JOS.attribute("storageDuration", "full expression");
1611 break;
1612 case SD_Static:
1613 JOS.attribute("storageDuration", "static");
1614 break;
1615 case SD_Thread:
1616 JOS.attribute("storageDuration", "thread");
1617 break;
1618 }
1619
1620 attributeOnlyIfTrue("boundToLValueRef", MTE->isBoundToLvalueReference());
1621}
1622
1624 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1625}
1626
1628 attributeOnlyIfTrue("hasRewrittenInit", Node->hasRewrittenInit());
1629}
1630
1632 JOS.attribute("hasExplicitParameters", LE->hasExplicitParameters());
1633}
1634
1636 const CXXDependentScopeMemberExpr *DSME) {
1637 JOS.attribute("isArrow", DSME->isArrow());
1638 JOS.attribute("member", DSME->getMember().getAsString());
1639 attributeOnlyIfTrue("hasTemplateKeyword", DSME->hasTemplateKeyword());
1640 attributeOnlyIfTrue("hasExplicitTemplateArgs",
1641 DSME->hasExplicitTemplateArgs());
1642
1643 if (DSME->getNumTemplateArgs()) {
1644 JOS.attributeArray("explicitTemplateArgs", [DSME, this] {
1645 for (const TemplateArgumentLoc &TAL : DSME->template_arguments())
1646 JOS.object(
1647 [&TAL, this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1648 });
1649 }
1650}
1651
1653 if (!RE->isValueDependent())
1654 JOS.attribute("satisfied", RE->isSatisfied());
1655}
1656
1658 llvm::SmallString<16> Buffer;
1659 IL->getValue().toString(Buffer,
1660 /*Radix=*/10, IL->getType()->isSignedIntegerType());
1661 JOS.attribute("value", Buffer);
1662}
1664 // FIXME: This should probably print the character literal as a string,
1665 // rather than as a numerical value. It would be nice if the behavior matched
1666 // what we do to print a string literal; right now, it is impossible to tell
1667 // the difference between 'a' and L'a' in C from the JSON output.
1668 JOS.attribute("value", CL->getValue());
1669}
1671 JOS.attribute("value", FPL->getValueAsString(/*Radix=*/10));
1672}
1674 llvm::SmallString<16> Buffer;
1675 FL->getValue().toString(Buffer);
1676 JOS.attribute("value", Buffer);
1677}
1679 std::string Buffer;
1680 llvm::raw_string_ostream SS(Buffer);
1681 SL->outputString(SS);
1682 JOS.attribute("value", Buffer);
1683}
1685 JOS.attribute("value", BLE->getValue());
1686}
1687
1689 attributeOnlyIfTrue("hasInit", IS->hasInitStorage());
1690 attributeOnlyIfTrue("hasVar", IS->hasVarStorage());
1691 attributeOnlyIfTrue("hasElse", IS->hasElseStorage());
1692 attributeOnlyIfTrue("isConstexpr", IS->isConstexpr());
1693 attributeOnlyIfTrue("isConsteval", IS->isConsteval());
1694 attributeOnlyIfTrue("constevalIsNegated", IS->isNegatedConsteval());
1695}
1696
1698 attributeOnlyIfTrue("hasInit", SS->hasInitStorage());
1699 attributeOnlyIfTrue("hasVar", SS->hasVarStorage());
1700}
1702 attributeOnlyIfTrue("isGNURange", CS->caseStmtIsGNURange());
1703}
1704
1706 JOS.attribute("name", LS->getName());
1707 JOS.attribute("declId", createPointerRepresentation(LS->getDecl()));
1708 attributeOnlyIfTrue("sideEntry", LS->isSideEntry());
1709}
1710
1712 if (LS->hasLabelTarget())
1713 JOS.attribute("targetLabelDeclId",
1714 createPointerRepresentation(LS->getLabelDecl()));
1715}
1716
1718 JOS.attribute("targetLabelDeclId",
1719 createPointerRepresentation(GS->getLabel()));
1720}
1721
1723 attributeOnlyIfTrue("hasVar", WS->hasVarStorage());
1724}
1725
1727 // FIXME: it would be nice for the ASTNodeTraverser would handle the catch
1728 // parameter the same way for C++ and ObjC rather. In this case, C++ gets a
1729 // null child node and ObjC gets no child node.
1730 attributeOnlyIfTrue("isCatchAll", OACS->getCatchParamDecl() == nullptr);
1731}
1732
1734 JOS.attribute("isNull", true);
1735}
1737 JOS.attribute("type", createQualType(TA.getAsType()));
1738}
1740 const TemplateArgument &TA) {
1741 JOS.attribute("decl", createBareDeclRef(TA.getAsDecl()));
1742}
1744 JOS.attribute("isNullptr", true);
1745}
1747 JOS.attribute("value", TA.getAsIntegral().getSExtValue());
1748}
1754 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1755 // the output format.
1756}
1758 const TemplateArgument &TA) {
1759 // FIXME: cannot just call dump() on the argument, as that doesn't specify
1760 // the output format.
1761}
1763 const TemplateArgument &TA) {
1764 JOS.attribute("isExpr", true);
1765 if (TA.isCanonicalExpr())
1766 JOS.attribute("isCanonical", true);
1767}
1769 JOS.attribute("isPack", true);
1770}
1771
1772StringRef JSONNodeDumper::getCommentCommandName(unsigned CommandID) const {
1773 if (Traits)
1774 return Traits->getCommandInfo(CommandID)->Name;
1775 if (const comments::CommandInfo *Info =
1777 return Info->Name;
1778 return "<invalid>";
1779}
1780
1782 const comments::FullComment *) {
1783 JOS.attribute("text", C->getText());
1784}
1785
1788 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1789
1790 switch (C->getRenderKind()) {
1792 JOS.attribute("renderKind", "normal");
1793 break;
1795 JOS.attribute("renderKind", "bold");
1796 break;
1798 JOS.attribute("renderKind", "emphasized");
1799 break;
1801 JOS.attribute("renderKind", "monospaced");
1802 break;
1804 JOS.attribute("renderKind", "anchor");
1805 break;
1806 }
1807
1808 llvm::json::Array Args;
1809 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1810 Args.push_back(C->getArgText(I));
1811
1812 if (!Args.empty())
1813 JOS.attribute("args", std::move(Args));
1814}
1815
1818 JOS.attribute("name", C->getTagName());
1819 attributeOnlyIfTrue("selfClosing", C->isSelfClosing());
1820 attributeOnlyIfTrue("malformed", C->isMalformed());
1821
1822 llvm::json::Array Attrs;
1823 for (unsigned I = 0, E = C->getNumAttrs(); I < E; ++I)
1824 Attrs.push_back(
1825 {{"name", C->getAttr(I).Name}, {"value", C->getAttr(I).Value}});
1826
1827 if (!Attrs.empty())
1828 JOS.attribute("attrs", std::move(Attrs));
1829}
1830
1833 JOS.attribute("name", C->getTagName());
1834}
1835
1838 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1839
1840 llvm::json::Array Args;
1841 for (unsigned I = 0, E = C->getNumArgs(); I < E; ++I)
1842 Args.push_back(C->getArgText(I));
1843
1844 if (!Args.empty())
1845 JOS.attribute("args", std::move(Args));
1846}
1847
1850 switch (C->getDirection()) {
1852 JOS.attribute("direction", "in");
1853 break;
1855 JOS.attribute("direction", "out");
1856 break;
1858 JOS.attribute("direction", "in,out");
1859 break;
1860 }
1861 attributeOnlyIfTrue("explicit", C->isDirectionExplicit());
1862
1863 if (C->hasParamName())
1864 JOS.attribute("param", C->isParamIndexValid() ? C->getParamName(FC)
1865 : C->getParamNameAsWritten());
1866
1867 if (C->isParamIndexValid() && !C->isVarArgParam())
1868 JOS.attribute("paramIdx", C->getParamIndex());
1869}
1870
1873 if (C->hasParamName())
1874 JOS.attribute("param", C->isPositionValid() ? C->getParamName(FC)
1875 : C->getParamNameAsWritten());
1876 if (C->isPositionValid()) {
1877 llvm::json::Array Positions;
1878 for (unsigned I = 0, E = C->getDepth(); I < E; ++I)
1879 Positions.push_back(C->getIndex(I));
1880
1881 if (!Positions.empty())
1882 JOS.attribute("positions", std::move(Positions));
1883 }
1884}
1885
1888 JOS.attribute("name", getCommentCommandName(C->getCommandID()));
1889 JOS.attribute("closeName", C->getCloseName());
1890}
1891
1894 const comments::FullComment *) {
1895 JOS.attribute("text", C->getText());
1896}
1897
1900 JOS.attribute("text", C->getText());
1901}
1902
1903llvm::json::Object JSONNodeDumper::createFPOptions(FPOptionsOverride FPO) {
1904 llvm::json::Object Ret;
1905#define FP_OPTION(NAME, TYPE, WIDTH, PREVIOUS) \
1906 if (FPO.has##NAME##Override()) \
1907 Ret.try_emplace(#NAME, static_cast<unsigned>(FPO.get##NAME##Override()));
1908#include "clang/Basic/FPOptions.def"
1909 return Ret;
1910}
1911
1913 VisitStmt(S);
1914 if (S->hasStoredFPFeatures())
1915 JOS.attribute("fpoptions", createFPOptions(S->getStoredFPFeatures()));
1916}
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:850
Represents an access specifier followed by colon ':'.
Definition DeclCXX.h:86
AddrLabelExpr - The GNU address of label extension, representing &&label.
Definition Expr.h:4553
LabelDecl * getLabel() const
Definition Expr.h:4576
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Definition TypeBase.h:3730
ArraySizeModifier getSizeModifier() const
Definition TypeBase.h:3744
Qualifiers getIndexTypeQualifiers() const
Definition TypeBase.h:3748
AtomicExpr - Variadic atomic builtins: __atomic_exchange, __atomic_fetch_*, __atomic_load,...
Definition Expr.h:6927
StringRef getOpAsString() const
Definition Expr.h:6991
Attr - This represents one attribute.
Definition Attr.h:46
attr::Kind getKind() const
Definition Attr.h:92
bool isInherited() const
Definition Attr.h:101
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user.
Definition Attr.h:105
A builtin binary operation expression such as "x + y" or "x <= y".
Definition Expr.h:4041
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:2133
Opcode getOpcode() const
Definition Expr.h:4086
A class which contains all the information about a particular captured value.
Definition Decl.h:4680
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Definition Decl.h:4674
bool capturesCXXThis() const
Definition Decl.h:4806
bool isVariadic() const
Definition Decl.h:4749
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:724
bool getValue() const
Definition ExprCXX.h:741
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:2610
Represents a C++ base or member initializer.
Definition DeclCXX.h:2375
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:2627
FunctionDecl * getOperatorDelete() const
Definition ExprCXX.h:2666
bool isArrayForm() const
Definition ExprCXX.h:2653
bool isGlobalDelete() const
Definition ExprCXX.h:2652
bool isArrayFormAsWritten() const
Definition ExprCXX.h:2654
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Definition ExprCXX.h:3871
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '.
Definition ExprCXX.h:3970
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
Definition ExprCXX.h:4065
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Definition ExprCXX.h:4044
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
Definition ExprCXX.h:4009
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
Definition ExprCXX.h:4040
ArrayRef< TemplateArgumentLoc > template_arguments() const
Definition ExprCXX.h:4072
Represents a C++ destructor within a class.
Definition DeclCXX.h:2875
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)".
Definition ExprCXX.h:2356
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:2081
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:849
bool isTypeOperand() const
Definition ExprCXX.h:885
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:892
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
Definition ExprCXX.h:3745
bool isListInitialization() const
Determine whether this expression models list-initialization.
Definition ExprCXX.h:3800
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
Definition ExprCXX.h:3779
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition Expr.h:2946
bool usesADL() const
Definition Expr.h:3103
CaseStmt - Represent a case statement.
Definition Stmt.h:1912
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ... RHS, which is a GNU extension.
Definition Stmt.h:1975
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition Expr.h:3679
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes.
Definition Expr.cpp:2002
static const char * getCastKindName(CastKind CK)
Definition Expr.cpp:1951
CompoundAssignOperator - For compound assignments (e.g.
Definition Expr.h:4303
QualType getComputationLHSType() const
Definition Expr.h:4337
QualType getComputationResultType() const
Definition Expr.h:4340
CompoundStmt - This represents a group of statements like { stmt stmt }.
Definition Stmt.h:1732
FPOptionsOverride getStoredFPFeatures() const
Get FPOptionsOverride from trailing storage.
Definition Stmt.h:1782
bool hasStoredFPFeatures() const
Definition Stmt.h:1779
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:3768
int64_t getSExtSize() const
Return the size sign-extended as a uint64_t.
Definition TypeBase.h:3850
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
Definition Expr.h:1085
APValue getAPValueResult() const
Definition Expr.cpp:413
APValue::ValueKind getResultAPValueKind() const
Definition Expr.h:1151
A reference to a declared variable, function, enum, etc.
Definition Expr.h:1273
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
Definition Expr.h:1384
ValueDecl * getDecl()
Definition Expr.h:1341
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:1471
bool isImmediateEscalating() const
Definition Expr.h:1481
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:4109
SourceLocation getAttributeLoc() const
Definition TypeBase.h:4125
An instance of this object exists for each enum constant that is defined.
Definition Decl.h:3423
Represents an enum.
Definition Decl.h:4013
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4231
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
Definition Decl.h:4234
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
Definition Decl.h:4240
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
Definition Decl.h:4186
EnumDecl * getTemplateInstantiationPattern() const
Retrieve the enum definition from which this enumeration could be instantiated, if it is an instantia...
Definition Decl.cpp:5140
Represents an expression – generally a full-expression – that introduces cleanups to be run at the en...
Definition ExprCXX.h:3662
bool cleanupsHaveSideEffects() const
Definition ExprCXX.h:3697
ArrayRef< CleanupObject > getObjects() const
Definition ExprCXX.h:3686
unsigned getNumObjects() const
Definition ExprCXX.h:3690
llvm::PointerUnion< BlockDecl *, CompoundLiteralExpr * > CleanupObject
The type of objects that are kept in the cleanup.
Definition ExprCXX.h:3668
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:1010
llvm::APFloat getValue() const
Definition Expr.h:1669
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:3341
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:4265
bool isVariadic() const
Whether this function is variadic.
Definition Decl.cpp:3134
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:5276
A class which abstracts out some details necessary for making a call.
Definition TypeBase.h:4583
CallingConv getCC() const
Definition TypeBase.h:4642
unsigned getRegParm() const
Definition TypeBase.h:4635
FunctionType - C99 6.7.5.3 - Function Declarators.
Definition TypeBase.h:4472
static StringRef getNameForCallConv(CallingConv CC)
Definition Type.cpp:3642
Represents a C11 generic selection.
Definition Expr.h:6181
AssociationTy< true > ConstAssociation
Definition Expr.h:6415
bool isResultDependent() const
Whether this generic selection is result-dependent.
Definition Expr.h:6435
GotoStmt - This represents a direct goto.
Definition Stmt.h:2961
LabelDecl * getLabel() const
Definition Stmt.h:2974
HLSLBufferDecl - Represent a cbuffer or tbuffer declaration.
Definition Decl.h:5196
bool isCBuffer() const
Definition Decl.h:5240
One of these records is kept for each identifier that is lexed.
StringRef getName() const
Return the actual identifier string.
IfStmt - This represents an if/then/else.
Definition Stmt.h:2251
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
Definition Stmt.h:2326
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
Definition Stmt.h:2323
bool isConstexpr() const
Definition Stmt.h:2444
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
Definition Stmt.h:2320
bool isNegatedConsteval() const
Definition Stmt.h:2440
bool isConsteval() const
Definition Stmt.h:2431
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
Definition Expr.h:3856
bool isPartOfExplicitCast() const
Definition Expr.h:3887
Describes an C or C++ initializer list.
Definition Expr.h:5302
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
Definition Expr.h:5428
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitAvailabilityAttr(const AvailabilityAttr *AA)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void 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 VisitLambdaExpr(const LambdaExpr *LE)
void VisitFunctionType(const FunctionType *T)
void VisitRecordDecl(const RecordDecl *RD)
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitNamedDecl(const NamedDecl *ND)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitFriendDecl(const FriendDecl *FD)
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
LabelStmt - Represents a label, which has a substatement.
Definition Stmt.h:2138
LabelDecl * getDecl() const
Definition Stmt.h:2156
bool isSideEntry() const
Definition Stmt.h:2185
const char * getName() const
Definition Stmt.cpp:437
A C++ lambda expression, which produces a function object (of unspecified type) that can be invoked l...
Definition ExprCXX.h:1969
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:508
Represents a linkage specification.
Definition DeclCXX.h:3017
LinkageSpecLanguageIDs getLanguage() const
Return the language specified by this linkage specification.
Definition DeclCXX.h:3040
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
Definition DeclCXX.h:3051
Base class for BreakStmt and ContinueStmt.
Definition Stmt.h:3049
LabelDecl * getLabelDecl()
Definition Stmt.h:3087
bool hasLabelTarget() const
Definition Stmt.h:3082
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
Definition TypeBase.h:6155
const IdentifierInfo * getMacroIdentifier() const
Definition TypeBase.h:6170
Represents a prvalue temporary that is written into memory so that a reference can bind to it.
Definition ExprCXX.h:4921
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
Definition ExprCXX.h:4946
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise,...
Definition ExprCXX.h:4990
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
Definition ExprCXX.h:4971
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
Definition Expr.h:3367
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
Definition Expr.h:3450
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
Definition Expr.h:3591
bool isArrow() const
Definition Expr.h:3551
A pointer to member type per C++ 8.3.3 - Pointers to members.
Definition TypeBase.h:3661
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3683
bool isMemberDataPointer() const
Returns true if the member type (i.e.
Definition TypeBase.h:3689
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:3203
NamespaceBaseDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
Definition DeclCXX.h:3296
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:407
QualType getEncodedType() const
Definition ExprObjC.h:426
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:7911
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Definition Type.cpp:952
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:546
ObjCIvarDecl * getDecl()
Definition ExprObjC.h:576
bool isArrow() const
Definition ExprObjC.h:584
bool isFreeIvar() const
Definition ExprObjC.h:585
An expression that sends a message to the given Objective-C object or class.
Definition ExprObjC.h:937
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:951
@ Instance
The receiver is an object instance.
Definition ExprObjC.h:945
@ SuperClass
The receiver is a superclass.
Definition ExprObjC.h:948
@ Class
The receiver is a class.
Definition ExprObjC.h:942
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
Definition ExprObjC.h:1284
QualType getSuperType() const
Retrieve the type referred to by 'super'.
Definition ExprObjC.h:1341
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
Definition ExprObjC.h:1226
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:614
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
Definition ExprObjC.h:733
ObjCPropertyDecl * getExplicitProperty() const
Definition ExprObjC.h:703
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
Definition ExprObjC.h:740
ObjCMethodDecl * getImplicitPropertyGetter() const
Definition ExprObjC.h:708
bool isImplicitProperty() const
Definition ExprObjC.h:700
ObjCMethodDecl * getImplicitPropertySetter() const
Definition ExprObjC.h:713
bool isSuperReceiver() const
Definition ExprObjC.h:768
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:502
ObjCProtocolDecl * getProtocol() const
Definition ExprObjC.h:519
ObjCSelectorExpr used for @selector in Objective-C.
Definition ExprObjC.h:452
Selector getSelector() const
Definition ExprObjC.h:466
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
Definition ExprObjC.h:836
bool isArraySubscriptRefExpr() const
Definition ExprObjC.h:889
ObjCMethodDecl * getAtIndexMethodDecl() const
Definition ExprObjC.h:881
ObjCMethodDecl * setAtIndexMethodDecl() const
Definition ExprObjC.h:885
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:2093
This is the base type for all OpenACC Clauses.
llvm::iterator_range< decls_iterator > decls() const
Definition ExprCXX.h:3228
DeclarationName getName() const
Gets the name looked up.
Definition ExprCXX.h:3239
[C99 6.4.2.2] - A predefined identifier such as func.
Definition Expr.h:2008
PredefinedIdentKind getIdentKind() const
Definition Expr.h:2043
static StringRef getIdentKindName(PredefinedIdentKind IK)
Definition Expr.cpp:649
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:1306
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
Definition TypeBase.h:8370
std::string getAsString() const
std::string getAsString() const
Represents a struct/union/class.
Definition Decl.h:4327
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:3581
bool isSpelledAsLValue() const
Definition TypeBase.h:3594
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:2146
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:4442
NamedDecl * getPack() const
Retrieve the parameter pack.
Definition ExprCXX.h:4510
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:86
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Definition Stmt.cpp:343
const char * getStmtClassName() const
Definition Stmt.cpp:86
StringLiteral - This represents a string literal expression, e.g.
Definition Expr.h:1802
void outputString(raw_ostream &OS) const
Definition Expr.cpp:1209
SwitchStmt - This represents a 'switch' stmt.
Definition Stmt.h:2501
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
Definition Stmt.h:2562
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
Definition Stmt.h:2559
StringRef getKindName() const
Definition Decl.h:3913
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
Definition Decl.h:3818
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:8320
QualType getType() const
Return the type wrapped by this type source info.
Definition TypeBase.h:8331
The base class of the type hierarchy.
Definition TypeBase.h:1839
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
Definition Type.cpp:2230
const char * getTypeClassName() const
Definition Type.cpp:3415
const T * getAs() const
Member-template getAs<specific type>'.
Definition TypeBase.h:9179
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:6121
QualType desugar() const
Definition Type.cpp:4111
bool typeMatchesDecl() const
Definition TypeBase.h:6129
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand.
Definition Expr.h:2628
QualType getArgumentType() const
Definition Expr.h:2671
UnaryExprOrTypeTrait getKind() const
Definition Expr.h:2660
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
Definition Expr.h:2247
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
Definition Expr.h:2317
Opcode getOpcode() const
Definition Expr.h:2283
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to,...
Definition Expr.cpp:1406
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
Definition Expr.h:2301
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Definition ExprCXX.h:3391
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
Definition ExprCXX.h:3460
Represents the dependent type named by a dependently-scoped typename using declaration,...
Definition TypeBase.h:5992
UnresolvedUsingTypenameDecl * getDecl() const
Definition TypeBase.h:6024
Represents a C++ using-declaration.
Definition DeclCXX.h:3593
NestedNameSpecifier getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
Definition DeclCXX.h:3630
Represents C++ using-directive.
Definition DeclCXX.h:3098
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
Definition DeclCXX.cpp:3311
Represents a C++ using-enum-declaration.
Definition DeclCXX.h:3794
EnumDecl * getEnumDecl() const
Definition DeclCXX.h:3836
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
Definition DeclCXX.h:3401
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
Definition DeclCXX.h:3465
UsingShadowDecl * getDecl() const
Definition TypeBase.h:6064
QualType desugar() const
Definition TypeBase.h:6066
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:5594
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:2180
bool hasInit() const
Definition Decl.cpp:2410
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:2133
@ 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:2726
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:4183
unsigned getNumElements() const
Definition TypeBase.h:4198
VectorKind getVectorKind() const
Definition TypeBase.h:4203
WhileStmt - This represents a 'while' stmt.
Definition Stmt.h:2689
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
Definition Stmt.h:2739
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:236
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:1806
@ DecltypeAuto
decltype(auto)
Definition TypeBase.h:1803
llvm::StringRef getAccessSpelling(AccessSpecifier AS)
Definition Specifiers.h:419
@ RQ_None
No ref-qualifier was provided.
Definition TypeBase.h:1788
@ RQ_LValue
An lvalue ref-qualifier was provided (&).
Definition TypeBase.h:1791
@ RQ_RValue
An rvalue ref-qualifier was provided (&&).
Definition TypeBase.h:1794
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Definition Specifiers.h:123
StorageClass
Storage classes.
Definition Specifiers.h:248
@ SC_None
Definition Specifiers.h:250
@ SD_Thread
Thread storage duration.
Definition Specifiers.h:342
@ SD_Static
Static storage duration.
Definition Specifiers.h:343
@ SD_FullExpression
Full-expression storage duration (for temporaries).
Definition Specifiers.h:340
@ SD_Automatic
Automatic storage duration (most local variables).
Definition Specifiers.h:341
@ SD_Dynamic
Dynamic storage duration.
Definition Specifiers.h:344
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
Definition Specifiers.h:135
@ VK_XValue
An x-value expression is a reference to an object with independent storage but which can be "moved",...
Definition Specifiers.h:144
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
Definition Specifiers.h:139
const char * getTraitSpelling(ExpressionTrait T) LLVM_READONLY
Return the spelling of the type trait TT. Never null.
@ 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:4153
@ SveFixedLengthData
is AArch64 SVE fixed-length data vector
Definition TypeBase.h:4162
@ AltiVecVector
is AltiVec vector
Definition TypeBase.h:4147
@ AltiVecPixel
is AltiVec 'vector Pixel'
Definition TypeBase.h:4150
@ Neon
is ARM Neon vector
Definition TypeBase.h:4156
@ Generic
not a target-specific vector type
Definition TypeBase.h:4144
@ RVVFixedLengthData
is RISC-V RVV fixed-length data vector
Definition TypeBase.h:4168
@ RVVFixedLengthMask
is RISC-V RVV fixed-length mask vector
Definition TypeBase.h:4171
@ NeonPoly
is ARM Neon polynomial vector
Definition TypeBase.h:4159
@ SveFixedLengthPredicate
is AArch64 SVE fixed-length predicate vector
Definition TypeBase.h:4165
U cast(CodeGen::Address addr)
Definition Address.h:327
@ Parens
New-expression has a C++98 paren-delimited initializer.
Definition ExprCXX.h:2246
@ None
New-expression has no initializer as written.
Definition ExprCXX.h:2243
@ Braces
New-expression has a C++11 list-initializer.
Definition ExprCXX.h:2249
@ 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:5335
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Definition TypeBase.h:5338
Extra information about a function prototype.
Definition TypeBase.h:5361
Information about a single command.