3 #include "llvm/ADT/StringSwitch.h" 7 void JSONNodeDumper::addPreviousDeclaration(
const Decl *D) {
9 #define DECL(DERIVED, BASE) \ 11 return writePreviousDeclImpl(cast<DERIVED##Decl>(D)); 12 #define ABSTRACT_DECL(DECL) 13 #include "clang/AST/DeclNodes.inc" 17 llvm_unreachable(
"Decl that isn't part of DeclNodes.inc!");
21 const char *AttrName =
nullptr;
25 AttrName = #X"Attr"; \ 27 #include "clang/Basic/AttrList.inc" 30 JOS.attribute(
"id", createPointerRepresentation(A));
31 JOS.attribute(
"kind", AttrName);
32 JOS.attributeObject(
"range", [A,
this] { writeSourceRange(A->
getRange()); });
34 attributeOnlyIfTrue(
"implicit", A->
isImplicit());
49 JOS.attribute(
"id", createPointerRepresentation(S));
51 JOS.attributeObject(
"range",
54 if (
const auto *E = dyn_cast<Expr>(S)) {
55 JOS.attribute(
"type", createQualType(E->getType()));
57 switch (E->getValueKind()) {
58 case VK_LValue: Category =
"lvalue";
break;
59 case VK_XValue: Category =
"xvalue";
break;
60 case VK_RValue: Category =
"rvalue";
break;
62 JOS.attribute(
"valueCategory", Category);
68 JOS.attribute(
"id", createPointerRepresentation(T));
74 JOS.attribute(
"type", createQualType(
QualType(T, 0),
false));
76 attributeOnlyIfTrue(
"isInstantiationDependent",
79 attributeOnlyIfTrue(
"containsUnexpandedPack",
81 attributeOnlyIfTrue(
"isImported", T->
isFromAST());
87 JOS.attribute(
"kind",
"QualType");
88 JOS.attribute(
"type", createQualType(T));
93 JOS.attribute(
"id", createPointerRepresentation(D));
99 JOS.attributeObject(
"loc",
100 [D,
this] { writeSourceLocation(D->
getLocation()); });
101 JOS.attributeObject(
"range",
103 attributeOnlyIfTrue(
"isImplicit", D->
isImplicit());
107 JOS.attribute(
"isUsed",
true);
109 JOS.attribute(
"isReferenced",
true);
111 if (
const auto *ND = dyn_cast<NamedDecl>(D))
112 attributeOnlyIfTrue(
"isHidden", ND->isHidden());
119 JOS.attribute(
"parentDeclContextId",
120 createPointerRepresentation(ParentDeclContextDecl));
123 addPreviousDeclaration(D);
132 JOS.attribute(
"id", createPointerRepresentation(C));
134 JOS.attributeObject(
"loc",
135 [C,
this] { writeSourceLocation(C->
getLocation()); });
136 JOS.attributeObject(
"range",
144 JOS.attribute(
"kind",
"TemplateArgument");
146 JOS.attributeObject(
"range", [R,
this] { writeSourceRange(R); });
149 JOS.attribute(Label.empty() ?
"fromDecl" :
Label, createBareDeclRef(From));
155 JOS.attribute(
"kind",
"CXXCtorInitializer");
159 JOS.attribute(
"baseInit",
162 JOS.attribute(
"delegatingInit",
165 llvm_unreachable(
"Unknown initializer type");
171 JOS.attribute(
"kind",
"Capture");
172 attributeOnlyIfTrue(
"byref", C.
isByRef());
173 attributeOnlyIfTrue(
"nested", C.
isNested());
179 JOS.attribute(
"associationKind", A.getTypeSourceInfo() ?
"case" :
"default");
180 attributeOnlyIfTrue(
"selected", A.isSelected());
183 void JSONNodeDumper::writeIncludeStack(
PresumedLoc Loc,
bool JustFirst) {
187 JOS.attributeBegin(
"includedFrom");
209 if (LastLocFilename != ActualFile) {
210 JOS.attribute(
"file", ActualFile);
211 JOS.attribute(
"line", ActualLine);
212 }
else if (LastLocLine != ActualLine)
213 JOS.attribute(
"line", ActualLine);
216 if (PresumedFile != ActualFile && LastLocPresumedFilename != PresumedFile)
217 JOS.attribute(
"presumedFile", PresumedFile);
219 unsigned PresumedLine = Presumed.
getLine();
220 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
221 JOS.attribute(
"presumedLine", PresumedLine);
224 JOS.attribute(
"tokLen",
226 LastLocFilename = ActualFile;
227 LastLocPresumedFilename = PresumedFile;
228 LastLocPresumedLine = PresumedLine;
229 LastLocLine = ActualLine;
243 if (Expansion != Spelling) {
246 JOS.attributeObject(
"spellingLoc", [Spelling,
this] {
247 writeBareSourceLocation(Spelling,
true);
249 JOS.attributeObject(
"expansionLoc", [Expansion, Loc,
this] {
250 writeBareSourceLocation(Expansion,
false);
254 JOS.attribute(
"isMacroArgExpansion",
true);
257 writeBareSourceLocation(Spelling,
true);
260 void JSONNodeDumper::writeSourceRange(
SourceRange R) {
261 JOS.attributeObject(
"begin",
262 [R,
this] { writeSourceLocation(R.
getBegin()); });
263 JOS.attributeObject(
"end", [R,
this] { writeSourceLocation(R.
getEnd()); });
266 std::string JSONNodeDumper::createPointerRepresentation(
const void *Ptr) {
270 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr),
true);
273 llvm::json::Object JSONNodeDumper::createQualType(
QualType QT,
bool Desugar) {
277 if (Desugar && !QT.
isNull()) {
282 Ret[
"typeAliasDeclId"] = createPointerRepresentation(TT->getDecl());
287 void JSONNodeDumper::writeBareDeclRef(
const Decl *D) {
288 JOS.attribute(
"id", createPointerRepresentation(D));
293 if (
const auto *ND = dyn_cast<NamedDecl>(D))
294 JOS.attribute(
"name", ND->getDeclName().getAsString());
295 if (
const auto *VD = dyn_cast<ValueDecl>(D))
296 JOS.attribute(
"type", createQualType(VD->getType()));
299 llvm::json::Object JSONNodeDumper::createBareDeclRef(
const Decl *D) {
300 llvm::json::Object
Ret{{
"id", createPointerRepresentation(D)}};
305 if (
const auto *ND = dyn_cast<NamedDecl>(D))
306 Ret[
"name"] = ND->getDeclName().getAsString();
307 if (
const auto *VD = dyn_cast<ValueDecl>(D))
308 Ret[
"type"] = createQualType(VD->getType());
312 llvm::json::Array JSONNodeDumper::createCastPath(
const CastExpr *
C) {
313 llvm::json::Array
Ret;
322 llvm::json::Object Val{{
"name", RD->getName()}};
324 Val[
"isVirtual"] =
true;
325 Ret.push_back(std::move(Val));
330 #define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true 331 #define FIELD1(Flag) FIELD2(#Flag, Flag) 333 static llvm::json::Object
335 llvm::json::Object
Ret;
337 FIELD2(
"exists", hasDefaultConstructor);
338 FIELD2(
"trivial", hasTrivialDefaultConstructor);
339 FIELD2(
"nonTrivial", hasNonTrivialDefaultConstructor);
340 FIELD2(
"userProvided", hasUserProvidedDefaultConstructor);
341 FIELD2(
"isConstexpr", hasConstexprDefaultConstructor);
342 FIELD2(
"needsImplicit", needsImplicitDefaultConstructor);
343 FIELD2(
"defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
348 static llvm::json::Object
350 llvm::json::Object
Ret;
352 FIELD2(
"simple", hasSimpleCopyConstructor);
353 FIELD2(
"trivial", hasTrivialCopyConstructor);
354 FIELD2(
"nonTrivial", hasNonTrivialCopyConstructor);
355 FIELD2(
"userDeclared", hasUserDeclaredCopyConstructor);
356 FIELD2(
"hasConstParam", hasCopyConstructorWithConstParam);
357 FIELD2(
"implicitHasConstParam", implicitCopyConstructorHasConstParam);
358 FIELD2(
"needsImplicit", needsImplicitCopyConstructor);
359 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
361 FIELD2(
"defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
366 static llvm::json::Object
368 llvm::json::Object
Ret;
370 FIELD2(
"exists", hasMoveConstructor);
371 FIELD2(
"simple", hasSimpleMoveConstructor);
372 FIELD2(
"trivial", hasTrivialMoveConstructor);
373 FIELD2(
"nonTrivial", hasNonTrivialMoveConstructor);
374 FIELD2(
"userDeclared", hasUserDeclaredMoveConstructor);
375 FIELD2(
"needsImplicit", needsImplicitMoveConstructor);
376 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
378 FIELD2(
"defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
383 static llvm::json::Object
385 llvm::json::Object
Ret;
387 FIELD2(
"trivial", hasTrivialCopyAssignment);
388 FIELD2(
"nonTrivial", hasNonTrivialCopyAssignment);
389 FIELD2(
"hasConstParam", hasCopyAssignmentWithConstParam);
390 FIELD2(
"implicitHasConstParam", implicitCopyAssignmentHasConstParam);
391 FIELD2(
"userDeclared", hasUserDeclaredCopyAssignment);
392 FIELD2(
"needsImplicit", needsImplicitCopyAssignment);
393 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
398 static llvm::json::Object
400 llvm::json::Object
Ret;
402 FIELD2(
"exists", hasMoveAssignment);
403 FIELD2(
"simple", hasSimpleMoveAssignment);
404 FIELD2(
"trivial", hasTrivialMoveAssignment);
405 FIELD2(
"nonTrivial", hasNonTrivialMoveAssignment);
406 FIELD2(
"userDeclared", hasUserDeclaredMoveAssignment);
407 FIELD2(
"needsImplicit", needsImplicitMoveAssignment);
408 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
413 static llvm::json::Object
415 llvm::json::Object
Ret;
417 FIELD2(
"simple", hasSimpleDestructor);
418 FIELD2(
"irrelevant", hasIrrelevantDestructor);
419 FIELD2(
"trivial", hasTrivialDestructor);
420 FIELD2(
"nonTrivial", hasNonTrivialDestructor);
421 FIELD2(
"userDeclared", hasUserDeclaredDestructor);
422 FIELD2(
"needsImplicit", needsImplicitDestructor);
423 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForDestructor);
425 FIELD2(
"defaultedIsDeleted", defaultedDestructorIsDeleted);
431 JSONNodeDumper::createCXXRecordDefinitionData(
const CXXRecordDecl *RD) {
432 llvm::json::Object
Ret;
440 FIELD1(isTriviallyCopyable);
447 FIELD1(hasUserDeclaredConstructor);
448 FIELD1(hasConstexprNonCopyMoveConstructor);
450 FIELD1(hasVariantMembers);
451 FIELD2(
"canConstDefaultInit", allowConstDefaultInit);
466 std::string JSONNodeDumper::createAccessSpecifier(
AccessSpecifier AS) {
473 llvm_unreachable(
"Unknown access specifier");
478 llvm::json::Object
Ret;
480 Ret[
"type"] = createQualType(BS.
getType());
482 Ret[
"writtenAccess"] =
485 Ret[
"isVirtual"] =
true;
487 Ret[
"isPackExpansion"] =
true;
493 JOS.attribute(
"decl", createBareDeclRef(TT->
getDecl()));
508 attributeOnlyIfTrue(
"const", T->
isConst());
509 attributeOnlyIfTrue(
"volatile", T->
isVolatile());
510 attributeOnlyIfTrue(
"restrict", T->
isRestrict());
511 attributeOnlyIfTrue(
"variadic", E.
Variadic);
513 case RQ_LValue:
JOS.attribute(
"refQualifier",
"&");
break;
514 case RQ_RValue:
JOS.attribute(
"refQualifier",
"&&");
break;
520 JOS.attribute(
"exceptionSpec",
"throw");
521 llvm::json::Array Types;
523 Types.push_back(createQualType(QT));
524 JOS.attribute(
"exceptionTypes", std::move(Types));
527 JOS.attribute(
"exceptionSpec",
"throw");
528 JOS.attribute(
"throwsAny",
true);
531 JOS.attribute(
"exceptionSpec",
"noexcept");
535 JOS.attribute(
"exceptionSpec",
"noexcept");
536 JOS.attribute(
"conditionEvaluatesTo",
542 JOS.attribute(
"exceptionSpec",
"nothrow");
564 JOS.attribute(
"sizeModifier",
"*");
567 JOS.attribute(
"sizeModifier",
"static");
575 JOS.attribute(
"indexTypeQualifiers", Str);
581 JOS.attribute(
"size", CAT->
getSize().getSExtValue());
588 "attrLoc", [VT,
this] { writeSourceLocation(VT->
getAttributeLoc()); });
597 JOS.attribute(
"vectorKind",
"altivec");
600 JOS.attribute(
"vectorKind",
"altivec pixel");
603 JOS.attribute(
"vectorKind",
"altivec bool");
606 JOS.attribute(
"vectorKind",
"neon");
609 JOS.attribute(
"vectorKind",
"neon poly");
615 JOS.attribute(
"decl", createBareDeclRef(UUT->
getDecl()));
621 JOS.attribute(
"transformKind",
"underlying_type");
627 JOS.attribute(
"decl", createBareDeclRef(TT->
getDecl()));
635 JOS.attribute(
"decl", createBareDeclRef(TTPT->
getDecl()));
642 JOS.attribute(
"typeKeyword",
"auto");
645 JOS.attribute(
"typeKeyword",
"decltype(auto)");
648 JOS.attribute(
"typeKeyword",
"__auto_type");
655 attributeOnlyIfTrue(
"isAlias", TST->
isTypeAlias());
658 llvm::raw_string_ostream OS(Str);
660 JOS.attribute(
"templateName", OS.str());
665 JOS.attribute(
"decl", createBareDeclRef(ICNT->
getDecl()));
669 JOS.attribute(
"decl", createBareDeclRef(OIT->
getDecl()));
674 JOS.attribute(
"numExpansions", *N);
680 llvm::raw_string_ostream OS(Str);
681 NNS->print(OS, PrintPolicy,
true);
682 JOS.attribute(
"qualifier", OS.str());
685 JOS.attribute(
"ownedTagDecl", createBareDeclRef(TD));
700 std::string MangledName = ASTNameGen.
getName(ND);
701 if (!MangledName.empty())
702 JOS.attribute(
"mangledName", MangledName);
718 attributeOnlyIfTrue(
"isInline", ND->
isInline());
720 JOS.attribute(
"originalNamespace",
725 JOS.attribute(
"nominatedNamespace",
731 JOS.attribute(
"aliasedNamespace",
738 llvm::raw_string_ostream SOS(Name);
742 JOS.attribute(
"name", Name);
751 JOS.attribute(
"type", createQualType(VD->
getType()));
762 attributeOnlyIfTrue(
"inline", VD->
isInline());
763 attributeOnlyIfTrue(
"constexpr", VD->
isConstexpr());
777 JOS.attribute(
"type", createQualType(FD->
getType()));
778 attributeOnlyIfTrue(
"mutable", FD->
isMutable());
780 attributeOnlyIfTrue(
"isBitfield", FD->
isBitField());
786 JOS.attribute(
"type", createQualType(FD->
getType()));
792 attributeOnlyIfTrue(
"pure", FD->
isPure());
794 attributeOnlyIfTrue(
"constexpr", FD->
isConstexpr());
795 attributeOnlyIfTrue(
"variadic", FD->
isVariadic());
798 JOS.attribute(
"explicitlyDefaulted",
799 FD->
isDeleted() ?
"deleted" :
"default");
807 JOS.attribute(
"scopedEnumTag",
812 JOS.attribute(
"type", createQualType(ECD->
getType()));
827 JOS.attribute(
"definitionData", createCXXRecordDefinitionData(RD));
829 JOS.attributeArray(
"bases", [
this, RD] {
830 for (
const auto &Spec : RD->
bases())
831 JOS.value(createCXXBaseSpecifier(Spec));
844 JOS.attributeObject(
"defaultArg", [=] {
845 Visit(D->getDefaultArgument(), SourceRange(),
846 D->getDefaultArgStorage().getInheritedFrom(),
847 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
854 JOS.attribute(
"type", createQualType(D->
getType()));
860 JOS.attributeObject(
"defaultArg", [=] {
861 Visit(D->getDefaultArgument(), SourceRange(),
862 D->getDefaultArgStorage().getInheritedFrom(),
863 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
875 JOS.attributeObject(
"defaultArg", [=] {
876 Visit(D->getDefaultArgument().getArgument(),
877 D->getDefaultArgStorage().getInheritedFrom()->getSourceRange(),
878 D->getDefaultArgStorage().getInheritedFrom(),
879 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
889 JOS.attribute(
"language", Lang);
890 attributeOnlyIfTrue(
"hasBraces", LSD->
hasBraces());
894 JOS.attribute(
"access", createAccessSpecifier(ASD->
getAccess()));
899 JOS.attribute(
"type", createQualType(T->getType()));
904 JOS.attribute(
"type", createQualType(D->
getType()));
919 attributeOnlyIfTrue(
"variadic", D->
isVariadic());
930 JOS.attribute(
"variance",
"covariant");
933 JOS.attribute(
"variance",
"contravariant");
943 llvm::json::Array Protocols;
945 Protocols.push_back(createBareDeclRef(
P));
946 if (!Protocols.empty())
947 JOS.attribute(
"protocols", std::move(Protocols));
959 llvm::json::Array Protocols;
961 Protocols.push_back(createBareDeclRef(
P));
962 if (!Protocols.empty())
963 JOS.attribute(
"protocols", std::move(Protocols));
971 llvm::json::Array Protocols;
973 Protocols.push_back(createBareDeclRef(
P));
974 if (!Protocols.empty())
975 JOS.attribute(
"protocols", std::move(Protocols));
993 JOS.attribute(
"type", createQualType(D->
getType()));
1009 attributeOnlyIfTrue(
"readwrite",
1013 attributeOnlyIfTrue(
"nonatomic",
1018 attributeOnlyIfTrue(
"unsafe_unretained",
1022 attributeOnlyIfTrue(
"nullability",
1024 attributeOnlyIfTrue(
"null_resettable",
1040 attributeOnlyIfTrue(
"variadic", D->
isVariadic());
1050 llvm::raw_string_ostream OS(Str);
1053 JOS.attribute(
"selector", OS.str());
1057 JOS.attribute(
"receiverKind",
"instance");
1060 JOS.attribute(
"receiverKind",
"class");
1064 JOS.attribute(
"receiverKind",
"super (instance)");
1068 JOS.attribute(
"receiverKind",
"super (class)");
1074 if (OME->
getType() != CallReturnTy)
1075 JOS.attribute(
"callReturnType", createQualType(CallReturnTy));
1081 llvm::raw_string_ostream OS(Str);
1083 MD->getSelector().print(OS);
1084 JOS.attribute(
"selector", OS.str());
1090 llvm::raw_string_ostream OS(Str);
1093 JOS.attribute(
"selector", OS.str());
1097 JOS.attribute(
"protocol", createBareDeclRef(OPE->
getProtocol()));
1102 JOS.attribute(
"propertyKind",
"implicit");
1104 JOS.attribute(
"getter", createBareDeclRef(MD));
1106 JOS.attribute(
"setter", createBareDeclRef(MD));
1108 JOS.attribute(
"propertyKind",
"explicit");
1119 JOS.attribute(
"subscriptKind",
1123 JOS.attribute(
"getter", createBareDeclRef(MD));
1125 JOS.attribute(
"setter", createBareDeclRef(MD));
1129 JOS.attribute(
"decl", createBareDeclRef(OIRE->
getDecl()));
1130 attributeOnlyIfTrue(
"isFreeIvar", OIRE->
isFreeIvar());
1135 JOS.attribute(
"value", OBLE->
getValue() ?
"__objc_yes" :
"__objc_no");
1139 JOS.attribute(
"referencedDecl", createBareDeclRef(DRE->
getDecl()));
1141 JOS.attribute(
"foundReferencedDecl",
1159 JOS.attribute(
"canOverflow",
false);
1170 JOS.attribute(
"computeResultType",
1180 JOS.attribute(
"referencedMemberDecl", createPointerRepresentation(VD));
1190 attributeOnlyIfTrue(
"isGlobal", NE->
isGlobalNew());
1191 attributeOnlyIfTrue(
"isArray", NE->
isArray());
1199 JOS.attribute(
"operatorNewDecl", createBareDeclRef(FD));
1201 JOS.attribute(
"operatorDeleteDecl", createBareDeclRef(FD));
1205 attributeOnlyIfTrue(
"isArray", DE->
isArrayForm());
1208 JOS.attribute(
"operatorDeleteDecl", createBareDeclRef(FD));
1212 attributeOnlyIfTrue(
"implicit", TE->
isImplicit());
1217 llvm::json::Array Path = createCastPath(CE);
1219 JOS.attribute(
"path", std::move(Path));
1223 JOS.attribute(
"conversionFunc", createBareDeclRef(ND));
1232 attributeOnlyIfTrue(
"adl", CE->
usesADL());
1243 JOS.attribute(
"name",
"__builtin_omp_required_simd_align");
break;
1258 JOS.attributeArray(
"lookups", [
this, ULE] {
1260 JOS.value(createBareDeclRef(D));
1266 JOS.attribute(
"labelDeclId", createPointerRepresentation(ALE->
getLabel()));
1273 JOS.attribute(
"typeArg", createQualType(Unadjusted));
1274 if (Adjusted != Unadjusted)
1275 JOS.attribute(
"adjustedTypeArg", createQualType(Adjusted));
1282 llvm::raw_string_ostream OS(Str);
1284 JOS.attribute(
"value", OS.str());
1290 JOS.attribute(
"field", createBareDeclRef(FD));
1307 JOS.attribute(
"ctorType", createQualType(Ctor->
getType()));
1308 attributeOnlyIfTrue(
"elidable", CE->
isElidable());
1316 JOS.attribute(
"constructionKind",
"complete");
1319 JOS.attribute(
"constructionKind",
"delegating");
1322 JOS.attribute(
"constructionKind",
"non-virtual base");
1325 JOS.attribute(
"constructionKind",
"virtual base");
1331 attributeOnlyIfTrue(
"cleanupsHaveSideEffects",
1334 JOS.attributeArray(
"cleanups", [
this, EWC] {
1336 JOS.value(createBareDeclRef(CO));
1344 JOS.attribute(
"temp", createPointerRepresentation(Temp));
1346 JOS.attribute(
"dtor", createBareDeclRef(Dtor));
1352 JOS.attribute(
"extendingDecl", createBareDeclRef(VD));
1356 JOS.attribute(
"storageDuration",
"automatic");
1359 JOS.attribute(
"storageDuration",
"dynamic");
1362 JOS.attribute(
"storageDuration",
"full expression");
1365 JOS.attribute(
"storageDuration",
"static");
1368 JOS.attribute(
"storageDuration",
"thread");
1380 attributeOnlyIfTrue(
"hasExplicitTemplateArgs",
1384 JOS.attributeArray(
"explicitTemplateArgs", [DSME,
this] {
1387 [&TAL,
this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1393 JOS.attribute(
"value",
1410 JOS.attribute(
"value", Buffer);
1414 llvm::raw_string_ostream SS(Buffer);
1416 JOS.attribute(
"value", SS.str());
1426 attributeOnlyIfTrue(
"isConstexpr", IS->
isConstexpr());
1439 JOS.attribute(
"declId", createPointerRepresentation(LS->
getDecl()));
1442 JOS.attribute(
"targetLabelDeclId",
1443 createPointerRepresentation(GS->
getLabel()));
1458 JOS.attribute(
"isNull",
true);
1465 JOS.attribute(
"decl", createBareDeclRef(TA.
getAsDecl()));
1468 JOS.attribute(
"isNullptr",
true);
1484 JOS.attribute(
"isExpr",
true);
1487 JOS.attribute(
"isPack",
true);
1490 StringRef JSONNodeDumper::getCommentCommandName(
unsigned CommandID)
const {
1510 JOS.attribute(
"renderKind",
"normal");
1513 JOS.attribute(
"renderKind",
"bold");
1516 JOS.attribute(
"renderKind",
"emphasized");
1519 JOS.attribute(
"renderKind",
"monospaced");
1522 JOS.attribute(
"renderKind",
"anchor");
1526 llvm::json::Array Args;
1527 for (
unsigned I = 0, E = C->
getNumArgs(); I < E; ++I)
1531 JOS.attribute(
"args", std::move(Args));
1538 attributeOnlyIfTrue(
"malformed", C->
isMalformed());
1540 llvm::json::Array Attrs;
1541 for (
unsigned I = 0, E = C->
getNumAttrs(); I < E; ++I)
1543 {{
"name", C->getAttr(I).Name}, {
"value", C->getAttr(I).Value}});
1546 JOS.attribute(
"attrs", std::move(Attrs));
1558 llvm::json::Array Args;
1559 for (
unsigned I = 0, E = C->
getNumArgs(); I < E; ++I)
1563 JOS.attribute(
"args", std::move(Args));
1570 JOS.attribute(
"direction",
"in");
1573 JOS.attribute(
"direction",
"out");
1576 JOS.attribute(
"direction",
"in,out");
1595 llvm::json::Array Positions;
1596 for (
unsigned I = 0, E = C->
getDepth(); I < E; ++I)
1597 Positions.push_back(C->
getIndex(I));
1599 if (!Positions.empty())
1600 JOS.attribute(
"positions", std::move(Positions));
void VisitFieldDecl(const FieldDecl *FD)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
bool isBaseInitializer() const
Determine whether this initializer is initializing a base class.
The receiver is the instance of the superclass object.
Represents a type that was referred to using an elaborated type keyword, e.g., struct S...
NamedDecl * getTargetDecl() const
Gets the underlying declaration which has been brought into the local scope.
const CXXDestructorDecl * getDestructor() const
Represents a function declaration or definition.
NamedDecl * getFoundDecl()
Get the NamedDecl through which this reference occurred.
The receiver is an object instance.
protocol_range protocols() const
no exception specification
A class which contains all the information about a particular captured value.
Represents the dependent type named by a dependently-scoped typename using declaration, e.g.
A (possibly-)qualified type.
const char * getDeclKindName() const
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
ValueDecl * getMemberDecl() const
Retrieve the member declaration to which this expression refers.
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
void VisitFloatingLiteral(const FloatingLiteral *FL)
ObjCMethodDecl * getAtIndexMethodDecl() const
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
ObjCInterfaceDecl * getClassInterface()
Selector getSelector() const
unsigned getNumBases() const
Retrieves the number of base classes of this class.
__auto_type (GNU extension)
ObjCIvarDecl * getPropertyIvarDecl() const
bool isSuperReceiver() const
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
bool hasVarStorage() const
True if this IfStmt has storage for a variable declaration.
bool isListInitialization() const
Determine whether this expression models list-initialization.
void VisitCXXNewExpr(const CXXNewExpr *NE)
void Visit(REF(TemplateArgument) TA, ParamTys... P)
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
ObjCProtocolDecl * getProtocol() const
Stmt - This represents one statement.
FunctionType - C99 6.7.5.3 - Function Declarators.
bool isArrayFormAsWritten() const
IfStmt - This represents an if/then/else.
void VisitUsingDecl(const UsingDecl *UD)
StringRef getBufferName(SourceLocation Loc, bool *Invalid=nullptr) const
Return the filename or buffer identifier of the buffer the location is in.
ObjCMethodDecl * setAtIndexMethodDecl() const
An instance of this object exists for each enum constant that is defined.
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
StorageClass getStorageClass() const
Returns the storage class as written in the source.
Represents the declaration of a typedef-name via the 'typedef' type specifier.
bool isConstexpr() const
Whether this is a (C++11) constexpr function or constexpr constructor.
ArrayRef< CleanupObject > getObjects() const
static llvm::json::Object createCopyConstructorDefinitionData(const CXXRecordDecl *RD)
void VisitNamedDecl(const NamedDecl *ND)
Decl - This represents one declaration (or definition), e.g.
bool needsOverloadResolutionForDestructor() const
Determine whether we need to eagerly declare a destructor for this class.
TagDecl * getDecl() const
llvm::APFloat getValue() const
ObjCMethodDecl * getImplicitPropertySetter() const
void VisitUnaryTransformType(const UnaryTransformType *UTT)
FunctionDecl * getOperatorNew() const
bool isVirtual() const
Determines whether the base class is a virtual base class (or not).
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
The base class of the type hierarchy.
bool requiresZeroInitialization() const
Whether this construction first requires zero-initialization before the initializer is called...
The parameter is covariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant and ...
void VisitTypedefType(const TypedefType *TT)
Represents an array type, per C99 6.7.5.2 - Array Declarators.
Represent a C++ namespace.
Represents a call to a C++ constructor.
ObjCSubscriptRefExpr - used for array and dictionary subscripting.
void Visit(const Type *T)
Performs the operation associated with this visitor object.
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
A container of type source information.
RefQualifierKind RefQualifier
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
bool hasVarStorage() const
True if this SwitchStmt has storage for a condition variable.
IdentKind getIdentKind() const
void VisitMemberPointerType(const MemberPointerType *MPT)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
TemplateTypeParmDecl * getDecl() const
Represents a C++ constructor within a class.
void VisitWhileStmt(const WhileStmt *WS)
Represents a prvalue temporary that is written into memory so that a reference can bind to it...
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
bool isVirtualAsWritten() const
Whether this function is marked as virtual explicitly.
bool needsOverloadResolutionForCopyConstructor() const
Determine whether we need to eagerly declare a defaulted copy constructor for this class...
bool hasInClassInitializer() const
Determine whether this member has a C++11 default member initializer.
This name appears in an unevaluated operand.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
void VisitDeclRefExpr(const DeclRefExpr *DRE)
unsigned getDepth() const
Get the nesting depth of the template parameter.
void VisitTypeTemplateArgument(const TemplateArgument &TA)
FriendDecl - Represents the declaration of a friend entity, which can be a function, a type, or a templated function or type.
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
Represents a variable declaration or definition.
bool isFixed() const
Returns true if this is an Objective-C, C++11, or Microsoft-style enumeration with a fixed underlying...
const T * getAs() const
Member-template getAs<specific type>'.
ObjCCategoryImplDecl * getImplementation() const
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Extra information about a function prototype.
ObjCMethodDecl - Represents an instance or class method declaration.
static llvm::json::Object createMoveConstructorDefinitionData(const CXXRecordDecl *RD)
bool hasInitStorage() const
True if this SwitchStmt has storage for an init statement.
DeclarationName getName() const
Gets the name looked up.
const char * getName() const
bool isInvalidDecl() const
unsigned getNumPlacementArgs() const
bool requiresADL() const
True if this declaration should be extended by argument-dependent lookup.
protocol_range protocols() const
Represents an expression – generally a full-expression – that introduces cleanups to be run at the ...
noexcept(expression), value-dependent
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
const ObjCInterfaceDecl * getSuperClass() const
ObjCPropertyDecl * getExplicitProperty() const
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
const char * getStmtClassName() const
SourceLocation getAttributeLoc() const
LabelStmt - Represents a label, which has a substatement.
Represents a struct/union/class.
LanguageIDs getLanguage() const
Return the language specified by this linkage specification.
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
TypeSourceInfo * getFriendType() const
If this friend declaration names an (untemplated but possibly dependent) type, return the type; other...
unsigned getDepth() const
Retrieve the depth of the template parameter.
void print(raw_ostream &OS, const PrintingPolicy &Policy, bool SuppressNNS=false) const
Print the template name.
bool cleanupsHaveSideEffects() const
QualType getComputationResultType() const
unsigned getRegParm() const
bool isImplicit() const
Returns true if the attribute has been implicitly created instead of explicitly written by the user...
bool isInline() const
Returns true if this is an inline namespace declaration.
void VisitNamespaceDecl(const NamespaceDecl *ND)
Used for GCC's __alignof.
The parameter is contravariant, e.g., X<T> is a subtype of X<U> when the type parameter is covariant ...
bool isSpelledAsLValue() const
Represents a member of a struct/union/class.
TemplateName getTemplateName() const
Retrieve the name of the template that we are specializing.
TypeSourceInfo * getTypeSourceInfo() const
Returns the declarator information for a base class or delegating initializer.
const IdentifierInfo * getMacroIdentifier() const
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
ObjCMethodDecl * getSetterMethodDecl() const
virtual SourceRange getSourceRange() const LLVM_READONLY
Source range that this declaration covers.
std::string getName(const Decl *D)
void VisitFriendDecl(const FriendDecl *FD)
TagDecl * getOwnedTagDecl() const
Return the (re)declaration of this type owned by this occurrence of this type, or nullptr if there is...
Represents an access specifier followed by colon ':'.
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
An r-value expression (a pr-value in the C++11 taxonomy) produces a temporary value.
Selector getSelector() const
void VisitUnaryOperator(const UnaryOperator *UO)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
Represents Objective-C's @catch statement.
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
bool getProducesResult() const
StringRef getOpcodeStr() const
Describes an C or C++ initializer list.
A C++ typeid expression (C++ [expr.typeid]), which gets the type_info that corresponds to the supplie...
Represents a C++ using-declaration.
static llvm::json::Object createMoveAssignmentDefinitionData(const CXXRecordDecl *RD)
UnresolvedUsingTypenameDecl * getDecl() const
AssociationTy< true > ConstAssociation
bool isBitField() const
Determines whether this field is a bitfield.
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
An lvalue ref-qualifier was provided (&).
bool isMessagingSetter() const
True if the property reference will result in a message to the setter.
FunctionDecl * getOperatorDelete() const
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
bool isElidable() const
Whether this construction is elidable.
void VisitCharacterLiteral(const CharacterLiteral *CL)
Microsoft throw(...) extension.
AccessSpecifier getAccessSpecifier() const
Returns the access specifier for this base specifier.
LabelDecl * getDecl() const
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
An x-value expression is a reference to an object with independent storage but which can be "moved"...
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
path_iterator path_begin()
SourceLocation getExpansionLoc(SourceLocation Loc) const
Given a SourceLocation object Loc, return the expansion location referenced by the ID...
PropertyAttributeKind getPropertyAttributes() const
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation...
const clang::PrintingPolicy & getPrintingPolicy() const
bool isByRef() const
Whether this is a "by ref" capture, i.e.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
unsigned getNumTemplateArgs() const
Retrieve the number of template arguments provided as part of this template-id.
A builtin binary operation expression such as "x + y" or "x <= y".
static bool isPostfix(Opcode Op)
isPostfix - Return true if this is a postfix operation, like x++.
unsigned getSpellingLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
bool hasElseStorage() const
True if this IfStmt has storage for an else statement.
CXXRecordDecl * getDecl() const
bool isConstexpr() const
Whether this variable is (C++11) constexpr.
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
New-expression has a C++98 paren-delimited initializer.
void VisitIntegerLiteral(const IntegerLiteral *IL)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitAutoType(const AutoType *AT)
CaseStmt - Represent a case statement.
void VisitPredefinedExpr(const PredefinedExpr *PE)
unsigned getIndex() const
Get the index of the template parameter within its parameter list.
bool isAnyMemberInitializer() const
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
Represents an Objective-C protocol declaration.
Represents binding an expression to a temporary.
DeclContext * getLexicalDeclContext()
getLexicalDeclContext - The declaration context where this Decl was lexically declared (LexicalDC)...
SourceLocation getSpellingLoc(SourceLocation Loc) const
Given a SourceLocation object, return the spelling location referenced by the ID. ...
CXXTemporary * getTemporary()
FieldDecl * getAnyMember() const
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
PropertyControl getPropertyImplementation() const
void * getAsOpaquePtr() const
bool hasExplicitBound() const
Whether this type parameter has an explicitly-written type bound, e.g., "T : NSView".
Represents a C++ member access expression where the actual member referenced could not be resolved be...
Represents an ObjC class declaration.
Represents a linkage specification.
QualType getReturnType() const
void VisitIfStmt(const IfStmt *IS)
is ARM Neon polynomial vector
bool isParameterPack() const
Whether this template template parameter is a template parameter pack.
SplitQualType getSplitDesugaredType() const
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
Represents an extended vector type where either the type or size is dependent.
Represents the this expression in C++.
New-expression has no initializer as written.
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...
ObjCPropertyImplDecl - Represents implementation declaration of a property in a class or category imp...
bool hasBraces() const
Determines whether this linkage specification had braces in its syntactic form.
void VisitPackExpansionType(const PackExpansionType *PET)
bool isStdInitListInitialization() const
Whether this constructor call was written as list-initialization, but was interpreted as forming a st...
Represents the declaration of a typedef-name via a C++11 alias-declaration.
void VisitArrayType(const ArrayType *AT)
Represents a prototype with parameter type info, e.g.
void VisitRecordDecl(const RecordDecl *RD)
ValueDecl * getExtendingDecl()
Get the declaration which triggered the lifetime-extension of this temporary, if any.
CXXConstructorDecl * getConstructor() const
Get the constructor that this expression will (ultimately) call.
QualType getComputationLHSType() const
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
bool isDelegatingInitializer() const
Determine whether this initializer is creating a delegating constructor.
UnaryExprOrTypeTraitExpr - expression with either a type or (unevaluated) expression operand...
bool isParameterPack() const
Whether this parameter is a non-type template parameter pack.
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
ValueDecl * getAsDecl() const
Retrieve the declaration for a declaration non-type template argument.
void outputString(raw_ostream &OS) const
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
unsigned getValue() const
ObjCMethodDecl * getBoxingMethod() const
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
bool isInlineSpecified() const
Determine whether the "inline" keyword was specified for this function.
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
StringRef getKindName() const
void VisitCaseStmt(const CaseStmt *CS)
bool isVariadic() const
Whether this function is variadic.
bool isDefaulted() const
Whether this function is defaulted per C++0x.
bool isInvalid() const
Return true if this object is invalid or uninitialized.
bool isScopedUsingClassTag() const
Returns true if this is a C++11 scoped enumeration.
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 ...
Declaration of a template type parameter.
unsigned getIndex() const
bool getHasRegParm() const
const T * castAs() const
Member-template castAs<specific type>.
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why? This is only meaningful if the named memb...
unsigned getLine() const
Return the presumed line number of this location.
This name appears as a potential result of an lvalue-to-rvalue conversion that is a constant expressi...
Represents a C++ destructor within a class.
New-expression has a C++11 list-initializer.
std::string getAsString() const
Retrieve the human-readable string for this name.
bool isImplicit() const
isImplicit - Indicates whether the declaration was implicitly generated by the implementation.
const char * getTypeClassName() const
void VisitFunctionProtoType(const FunctionProtoType *T)
QualType getArgumentType() const
DeclContext * getDeclContext()
ObjCSelectorExpr used for @selector in Objective-C.
ObjCInterfaceDecl * getSuperClass() const
TLSKind getTLSKind() const
Represents an expression that computes the length of a parameter pack.
StorageClass getStorageClass() const
Returns the storage class as written in the source.
NonTypeTemplateParmDecl - Declares a non-type template parameter, e.g., "Size" in.
static llvm::json::Object createDestructorDefinitionData(const CXXRecordDecl *RD)
void VisitElaboratedType(const ElaboratedType *ET)
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void print(llvm::raw_ostream &OS) const
Prints the full selector name (e.g. "foo:bar:").
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
StorageClass
Storage classes.
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
void VisitBinaryOperator(const BinaryOperator *BO)
Direct list-initialization (C++11)
Qualifiers Quals
The local qualifiers.
LabelDecl * getLabel() const
StorageDuration getStorageDuration() const
Retrieve the storage duration for the materialized temporary.
QualType getEncodedType() const
An expression that sends a message to the given Objective-C object or class.
Represents an unpacked "presumed" location which can be presented to the user.
ObjCMethodDecl * getImplicitPropertyGetter() const
SourceLocation getEnd() const
UnaryOperator - This represents the unary-expression's (except sizeof and alignof), the postinc/postdec operators from postfix-expression, and various extensions.
bool isInstanceMethod() const
Represents a GCC generic vector type.
ReceiverKind getReceiverKind() const
Determine the kind of receiver that this message is being sent to.
ArraySizeModifier getSizeModifier() const
QualType getTypeOperand(ASTContext &Context) const
Retrieves the type operand of this typeid() expression after various required adjustments (removing r...
QualType getCallReturnType(ASTContext &Ctx) const
TemplateTemplateParmDecl - Declares a template template parameter, e.g., "T" in.
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
std::string getAsString() const
static QualType Desugar(ASTContext &Context, QualType QT, bool &ShouldAKA)
unsigned getExpansionLineNumber(SourceLocation Loc, bool *Invalid=nullptr) const
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
bool isNull() const
Return true if this QualType doesn't point to a type yet.
InitializationStyle getInitStyle() const
The style of initialization for this declaration.
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
APValue getAPValueResult() const
Dynamic storage duration.
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
const char * getFilename() const
Return the presumed filename of this location.
noexcept(expression), evals to 'false'
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
is AltiVec 'vector Pixel'
static StringRef getIdentKindName(IdentKind IK)
not a target-specific vector type
ExceptionSpecificationType Type
The kind of exception specification this is.
bool isImplicitProperty() const
ExtProtoInfo getExtProtoInfo() const
void Visit(const Attr *A)
unsigned getColumn() const
Return the presumed column number of this location.
bool isParameterPack() const
Returns whether this is a parameter pack.
Encodes a location in the source.
bool getSynthesize() const
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
bool isPure() const
Whether this virtual function is pure, i.e.
bool hasVarStorage() const
True if this WhileStmt has storage for a condition variable.
bool isMemberDataPointer() const
Returns true if the member type (i.e.
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitVectorType(const VectorType *VT)
Represents a C++ temporary.
bool hasExplicitTemplateArgs() const
Determines whether this member expression actually had a C++ template argument list explicitly specif...
Interfaces are the core concept in Objective-C for object oriented design.
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
static llvm::json::Object createDefaultConstructorDefinitionData(const CXXRecordDecl *RD)
static bool Ret(InterpState &S, CodePtr &PC, APValue &Result)
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...
Represents a new-expression for memory allocation and constructor calls, e.g: "new CXXNewExpr(foo)"...
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
bool wasDeclaredWithTypename() const
Whether this template type parameter was declared with the 'typename' keyword.
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
Represents the declaration of a struct/union/class/enum.
ASTContext & getASTContext() const LLVM_READONLY
CallingConv getCC() const
ObjCCategoryDecl * getCategoryDecl() const
static llvm::json::Object createCopyAssignmentDefinitionData(const CXXRecordDecl *RD)
std::string getValueAsString(unsigned Radix) const
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
bool canOverflow() const
Returns true if the unary operator can cause an overflow.
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
No ref-qualifier was provided.
C-style initialization with assignment.
bool isPackExpansion() const
Determine whether this base specifier is a pack expansion.
bool isBoundToLvalueReference() const
Determine whether this materialized temporary is bound to an lvalue reference; otherwise, it's bound to an rvalue reference.
bool isParameterPack() const
bool isLiteral(TokenKind K)
Return true if this is a "literal" kind, like a numeric constant, string, etc.
ObjCCategoryDecl - Represents a category declaration.
This is a basic class for representing single OpenMP clause.
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
UnaryExprOrTypeTrait getKind() const
bool isScoped() const
Returns true if this is a C++11 scoped enumeration.
ObjCProtocolExpr used for protocol expression in Objective-C.
bool hasDefaultArgument() const
Determine whether this template parameter has a default argument.
is AltiVec 'vector bool ...'
SourceRange getRange() const
Represents one property declaration in an Objective-C interface.
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
ImplicitCastExpr - Allows us to explicitly represent implicit type conversions, which have no direct ...
bool hasTemplateKeyword() const
Determines whether the member name was preceded by the template keyword.
NestedNameSpecifier * getQualifier() const
Retrieve the qualification on this type.
bool isMessagingGetter() const
True if the property reference will result in a message to the getter.
AutoTypeKeyword getKeyword() const
Qualifiers getIndexTypeQualifiers() const
Used for C's _Alignof and C++'s alignof.
bool isUsed(bool CheckUsedAttr=true) const
Whether any (re-)declaration of the entity was used, meaning that a definition is required...
bool isOriginalNamespace() const
Return true if this declaration is an original (first) declaration of the namespace.
VarDecl * getVariable() const
The variable being captured.
llvm::APSInt getAsIntegral() const
Retrieve the template argument as an integral value.
void VisitVarDecl(const VarDecl *VD)
void printPretty(raw_ostream &OS, const ASTContext &Ctx, QualType Ty) const
Indicates that the nullability of the type was spelled with a property attribute rather than a type q...
An rvalue ref-qualifier was provided (&&).
ObjCBoxedExpr - used for generalized expression boxing.
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
bool isArgumentType() const
ArrayRef< TemplateArgumentLoc > template_arguments() const
ObjCImplementationDecl * getImplementation() const
Optional< unsigned > getNumExpansions() const
Retrieve the number of expansions that this pack expansion will generate, if known.
bool isPartOfExplicitCast() const
std::string getAsString() const
FunctionDecl * getOperatorDelete() const
void VisitConstantExpr(const ConstantExpr *CE)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
void VisitFunctionType(const FunctionType *T)
protocol_range protocols() const
NonOdrUseReason isNonOdrUse() const
Is this expression a non-odr-use reference, and if so, why?
The injected class name of a C++ class template or class template partial specialization.
Represents a pack expansion of types.
InitializationStyle getInitializationStyle() const
The kind of initializer this new-expression has.
CompoundAssignOperator - For compound assignments (e.g.
static const char * getStorageClassSpecifierString(StorageClass SC)
Return the string used to specify the storage class SC.
Represents a C11 generic selection.
StringRef getName() const
Return the actual identifier string.
void VisitMemberExpr(const MemberExpr *ME)
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
AddrLabelExpr - The GNU address of label extension, representing &&label.
TLS with a dynamic initializer.
Represents a template argument.
bool isThisDeclarationReferenced() const
Whether this declaration was referenced.
This name appears as a potential result of a discarded value expression.
const ObjCInterfaceDecl * getClassInterface() const
bool isTypeOperand() const
NamespaceDecl * getNominatedNamespace()
Returns the namespace nominated by this using-directive.
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
Dataflow Directional Tag Classes.
bool isResultDependent() const
Whether this generic selection is result-dependent.
ExtInfo getExtInfo() const
not evaluated yet, for special member function
[C99 6.4.2.2] - A predefined identifier such as func.
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitInitListExpr(const InitListExpr *ILE)
Represents a delete expression for memory deallocation and destructor calls, e.g. ...
bool isNested() const
Whether this is a nested capture, i.e.
Kind getPropertyImplementation() const
void VisitSwitchStmt(const SwitchStmt *SS)
void VisitLabelStmt(const LabelStmt *LS)
bool NE(InterpState &S, CodePtr OpPC)
bool hasInitStorage() const
True if this IfStmt has the storage for an init statement.
QualType getSuperType() const
Retrieve the type referred to by 'super'.
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
QualType getUnderlyingType() const
AccessSpecifier getAccess() const
NamespaceDecl * getOriginalNamespace()
Get the original (first) namespace declaration.
unsigned getIndex() const
Retrieve the index of the template parameter.
DeclarationName getMember() const
Retrieve the name of the member that this expression refers to.
void VisitTypedefDecl(const TypedefDecl *TD)
Represents the declaration of an Objective-C type parameter.
VectorKind getVectorKind() const
void VisitCallExpr(const CallExpr *CE)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
bool isListInitialization() const
Whether this constructor call was written as list-initialization.
const Type * getBaseClass() const
If this is a base class initializer, returns the type of the base class.
PresumedLoc getPresumedLoc(SourceLocation Loc, bool UseLineDirectives=true) const
Returns the "presumed" location of a SourceLocation specifies.
A pointer to member type per C++ 8.3.3 - Pointers to members.
bool isParameterPack() const
Determine whether this variable is actually a function parameter pack or init-capture pack...
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
const ObjCInterfaceDecl * getClassInterface() const
TypeSourceInfo * getTypeOperandSourceInfo() const
Retrieve source information for the type operand.
llvm::APInt getValue() const
void VisitBlockDecl(const BlockDecl *D)
LabelDecl * getLabel() const
QualType getClassReceiver() const
Returns the type of a class message send, or NULL if the message is not a class message.
SwitchStmt - This represents a 'switch' stmt.
bool needsOverloadResolutionForMoveConstructor() const
Determine whether we need to eagerly declare a defaulted move constructor for this class...
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
Location wrapper for a TemplateArgument.
bool isMacroArgExpansion(SourceLocation Loc, SourceLocation *StartLoc=nullptr) const
Tests whether the given source location represents a macro argument's expansion into the function-lik...
Represents a C++ base or member initializer.
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
unsigned getNumObjects() const
ObjCEncodeExpr, used for @encode in Objective-C.
bool isFromAST() const
Whether this type comes from an AST file.
const llvm::APInt & getSize() const
void VisitGotoStmt(const GotoStmt *GS)
void VisitCastExpr(const CastExpr *CE)
Base for LValueReferenceType and RValueReferenceType.
static const char * getCastKindName(CastKind CK)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitEnumDecl(const EnumDecl *ED)
NamedDecl * getConversionFunction() const
If this cast applies a user-defined conversion, retrieve the conversion function that it invokes...
void VisitConstantArrayType(const ConstantArrayType *CAT)
bool isArrow() const
Determine whether this member expression used the '->' operator; otherwise, it used the '...
Represents a base class of a C++ class.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
bool capturesCXXThis() const
llvm::iterator_range< decls_iterator > decls() const
Describes an explicit type conversion that uses functional notion but could not be resolved because o...
GotoStmt - This represents a direct goto.
TypedefNameDecl * getDecl() const
void VisitTagType(const TagType *TT)
unsigned getDepth() const
Call-style initialization (C++98)
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
bool isMutable() const
Determines whether this field is mutable (C++ only).
static bool isTrivial(ASTContext &Ctx, const Expr *E)
Checks if the expression is constant or does not have non-trivial function calls. ...
Represents a C++ struct/union/class.
void VisitRValueReferenceType(const ReferenceType *RT)
bool isMemberFunctionPointer() const
Returns true if the member type (i.e.
bool isNRVOVariable() const
Determine whether this local variable can be used with the named return value optimization (NRVO)...
ObjCIvarDecl - Represents an ObjC instance variable.
There is no such object (it's outside its lifetime).
WhileStmt - This represents a 'while' stmt.
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
bool isGlobalDelete() const
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
StringLiteral - This represents a string literal expression, e.g.
Full-expression storage duration (for temporaries).
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
TLS with a known-constant initializer.
QualType getIntegerType() const
Return the integer type this enum decl corresponds to.
StringRef getName() const
Get the name of identifier for this declaration as a StringRef.
void VisitStringLiteral(const StringLiteral *SL)
void Visit(PTR(Stmt) S, ParamTys... P)
NestedNameSpecifier * getQualifier() const
Retrieve the nested-name-specifier that qualifies the name.
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
unsigned getNumElements() const
ObjCBoolLiteralExpr - Objective-C Boolean Literal.
Microsoft __declspec(nothrow) extension.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
QualType getAsType() const
Retrieve the type for a type template argument.
#define FIELD2(Name, Flag)
A reference to a declared variable, function, enum, etc.
Represents a type template specialization; the template must be a class template, a type alias templa...
ObjCPropertyDecl * getPropertyDecl() const
ObjCTypeParamVariance getVariance() const
Determine the variance of this type parameter.
bool isDeleted() const
Whether this function has been deleted.
const VarDecl * getCatchParamDecl() const
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
FieldDecl * getInitializedFieldInUnion()
If this initializes a union, specifies which field in the union to initialize.
bool hadMultipleCandidates() const
Whether the referred constructor was resolved from an overloaded set having size greater than 1...
void VisitNullTemplateArgument(const TemplateArgument &TA)
bool isArraySubscriptRefExpr() const
QualType getTypeAsWritten() const
Retrieve the type that is being constructed, as specified in the source code.
static StringRef getNameForCallConv(CallingConv CC)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
AccessSpecifier getAccessSpecifierAsWritten() const
Retrieves the access specifier as written in the source code (which may mean that no access specifier...
void VisitCXXThisExpr(const CXXThisExpr *TE)
An l-value expression is a reference to an object with independent storage.
A trivial tuple used to represent a source range.
bool isModulePrivate() const
Whether this declaration was marked as being private to the module in which it was defined...
static StringRef getOpcodeStr(Opcode Op)
getOpcodeStr - Turn an Opcode enum value into the punctuation char it corresponds to...
ObjCMethodDecl * getGetterMethodDecl() const
This represents a decl that may have a name.
A boolean literal, per ([C++ lex.bool] Boolean literals).
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
Represents a C++ namespace alias.
APValue::ValueKind getResultAPValueKind() const
Automatic storage duration (most local variables).
bool isInline() const
Whether this variable is (C++1z) inline.
AccessControl getAccessControl() const
Represents C++ using-directive.
SourceLocation getIncludeLoc() const
Return the presumed include location of this location.
attr::Kind getKind() const
The receiver is a superclass.
SourceLocation getBegin() const
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitFunctionDecl(const FunctionDecl *FD)
const LangOptions & getLangOpts() const
NamedDecl * getPack() const
Retrieve the parameter pack.
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration...
bool caseStmtIsGNURange() const
True if this case statement is of the form case LHS ...
Represents the canonical version of C arrays with a specified constant size.
The parameter is invariant: must match exactly.
ExceptionSpecInfo ExceptionSpec
A class which abstracts out some details necessary for making a call.
Attr - This represents one attribute.
bool isDeletedAsWritten() const
SourceLocation getLocation() const
Represents a shadow declaration introduced into a scope by a (resolved) using declaration.
QualType getType() const
Return the type wrapped by this type source info.
std::pair< FileID, unsigned > getDecomposedLoc(SourceLocation Loc) const
Decompose the specified location into a raw FileID + Offset pair.
noexcept(expression), evals to 'true'
NamedDecl * getAliasedNamespace() const
Retrieve the namespace that this alias refers to, which may either be a NamespaceDecl or a NamespaceA...
ObjCCompatibleAliasDecl - Represents alias of a class.
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
ConstructionKind getConstructionKind() const
Determine whether this constructor is actually constructing a base class (rather than a complete obje...
QualType getType() const
Retrieves the type of the base class.