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));
70 JOS.attribute(
"type", createQualType(
QualType(T, 0),
false));
72 attributeOnlyIfTrue(
"isInstantiationDependent",
75 attributeOnlyIfTrue(
"containsUnexpandedPack",
77 attributeOnlyIfTrue(
"isImported", T->
isFromAST());
83 JOS.attribute(
"kind",
"QualType");
84 JOS.attribute(
"type", createQualType(T));
89 JOS.attribute(
"id", createPointerRepresentation(D));
95 JOS.attributeObject(
"loc",
96 [D,
this] { writeSourceLocation(D->
getLocation()); });
97 JOS.attributeObject(
"range",
99 attributeOnlyIfTrue(
"isImplicit", D->
isImplicit());
103 JOS.attribute(
"isUsed",
true);
105 JOS.attribute(
"isReferenced",
true);
107 if (
const auto *ND = dyn_cast<NamedDecl>(D))
108 attributeOnlyIfTrue(
"isHidden", ND->isHidden());
111 JOS.attribute(
"parentDeclContext",
114 addPreviousDeclaration(D);
123 JOS.attribute(
"id", createPointerRepresentation(C));
125 JOS.attributeObject(
"loc",
126 [C,
this] { writeSourceLocation(C->
getLocation()); });
127 JOS.attributeObject(
"range",
135 JOS.attribute(
"kind",
"TemplateArgument");
137 JOS.attributeObject(
"range", [R,
this] { writeSourceRange(R); });
140 JOS.attribute(Label.empty() ?
"fromDecl" :
Label, createBareDeclRef(From));
146 JOS.attribute(
"kind",
"CXXCtorInitializer");
150 JOS.attribute(
"baseInit",
153 JOS.attribute(
"delegatingInit",
156 llvm_unreachable(
"Unknown initializer type");
162 JOS.attribute(
"kind",
"Capture");
163 attributeOnlyIfTrue(
"byref", C.
isByRef());
164 attributeOnlyIfTrue(
"nested", C.
isNested());
170 JOS.attribute(
"associationKind", A.getTypeSourceInfo() ?
"case" :
"default");
171 attributeOnlyIfTrue(
"selected", A.isSelected());
182 JOS.attribute(
"line", ActualLine);
183 }
else if (LastLocLine != ActualLine)
184 JOS.attribute(
"line", ActualLine);
186 unsigned PresumedLine = Presumed.
getLine();
187 if (ActualLine != PresumedLine && LastLocPresumedLine != PresumedLine)
188 JOS.attribute(
"presumedLine", PresumedLine);
191 JOS.attribute(
"tokLen",
194 LastLocPresumedLine = PresumedLine;
195 LastLocLine = ActualLine;
203 if (Expansion != Spelling) {
206 JOS.attributeObject(
"spellingLoc", [Spelling,
this] {
207 writeBareSourceLocation(Spelling,
true);
209 JOS.attributeObject(
"expansionLoc", [Expansion, Loc,
this] {
210 writeBareSourceLocation(Expansion,
false);
214 JOS.attribute(
"isMacroArgExpansion",
true);
217 writeBareSourceLocation(Spelling,
true);
220 void JSONNodeDumper::writeSourceRange(
SourceRange R) {
221 JOS.attributeObject(
"begin",
222 [R,
this] { writeSourceLocation(R.
getBegin()); });
223 JOS.attributeObject(
"end", [R,
this] { writeSourceLocation(R.
getEnd()); });
226 std::string JSONNodeDumper::createPointerRepresentation(
const void *Ptr) {
230 return "0x" + llvm::utohexstr(reinterpret_cast<uint64_t>(Ptr),
true);
233 llvm::json::Object JSONNodeDumper::createQualType(
QualType QT,
bool Desugar) {
237 if (Desugar && !QT.
isNull()) {
245 void JSONNodeDumper::writeBareDeclRef(
const Decl *D) {
246 JOS.attribute(
"id", createPointerRepresentation(D));
251 if (
const auto *ND = dyn_cast<NamedDecl>(D))
252 JOS.attribute(
"name", ND->getDeclName().getAsString());
253 if (
const auto *VD = dyn_cast<ValueDecl>(D))
254 JOS.attribute(
"type", createQualType(VD->getType()));
257 llvm::json::Object JSONNodeDumper::createBareDeclRef(
const Decl *D) {
258 llvm::json::Object Ret{{
"id", createPointerRepresentation(D)}};
263 if (
const auto *ND = dyn_cast<NamedDecl>(D))
264 Ret[
"name"] = ND->getDeclName().getAsString();
265 if (
const auto *VD = dyn_cast<ValueDecl>(D))
266 Ret[
"type"] = createQualType(VD->getType());
270 llvm::json::Array JSONNodeDumper::createCastPath(
const CastExpr *
C) {
271 llvm::json::Array Ret;
280 llvm::json::Object Val{{
"name", RD->getName()}};
282 Val[
"isVirtual"] =
true;
283 Ret.push_back(std::move(Val));
288 #define FIELD2(Name, Flag) if (RD->Flag()) Ret[Name] = true 289 #define FIELD1(Flag) FIELD2(#Flag, Flag) 291 static llvm::json::Object
293 llvm::json::Object Ret;
295 FIELD2(
"exists", hasDefaultConstructor);
296 FIELD2(
"trivial", hasTrivialDefaultConstructor);
297 FIELD2(
"nonTrivial", hasNonTrivialDefaultConstructor);
298 FIELD2(
"userProvided", hasUserProvidedDefaultConstructor);
299 FIELD2(
"isConstexpr", hasConstexprDefaultConstructor);
300 FIELD2(
"needsImplicit", needsImplicitDefaultConstructor);
301 FIELD2(
"defaultedIsConstexpr", defaultedDefaultConstructorIsConstexpr);
306 static llvm::json::Object
308 llvm::json::Object Ret;
310 FIELD2(
"simple", hasSimpleCopyConstructor);
311 FIELD2(
"trivial", hasTrivialCopyConstructor);
312 FIELD2(
"nonTrivial", hasNonTrivialCopyConstructor);
313 FIELD2(
"userDeclared", hasUserDeclaredCopyConstructor);
314 FIELD2(
"hasConstParam", hasCopyConstructorWithConstParam);
315 FIELD2(
"implicitHasConstParam", implicitCopyConstructorHasConstParam);
316 FIELD2(
"needsImplicit", needsImplicitCopyConstructor);
317 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForCopyConstructor);
319 FIELD2(
"defaultedIsDeleted", defaultedCopyConstructorIsDeleted);
324 static llvm::json::Object
326 llvm::json::Object Ret;
328 FIELD2(
"exists", hasMoveConstructor);
329 FIELD2(
"simple", hasSimpleMoveConstructor);
330 FIELD2(
"trivial", hasTrivialMoveConstructor);
331 FIELD2(
"nonTrivial", hasNonTrivialMoveConstructor);
332 FIELD2(
"userDeclared", hasUserDeclaredMoveConstructor);
333 FIELD2(
"needsImplicit", needsImplicitMoveConstructor);
334 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForMoveConstructor);
336 FIELD2(
"defaultedIsDeleted", defaultedMoveConstructorIsDeleted);
341 static llvm::json::Object
343 llvm::json::Object Ret;
345 FIELD2(
"trivial", hasTrivialCopyAssignment);
346 FIELD2(
"nonTrivial", hasNonTrivialCopyAssignment);
347 FIELD2(
"hasConstParam", hasCopyAssignmentWithConstParam);
348 FIELD2(
"implicitHasConstParam", implicitCopyAssignmentHasConstParam);
349 FIELD2(
"userDeclared", hasUserDeclaredCopyAssignment);
350 FIELD2(
"needsImplicit", needsImplicitCopyAssignment);
351 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForCopyAssignment);
356 static llvm::json::Object
358 llvm::json::Object Ret;
360 FIELD2(
"exists", hasMoveAssignment);
361 FIELD2(
"simple", hasSimpleMoveAssignment);
362 FIELD2(
"trivial", hasTrivialMoveAssignment);
363 FIELD2(
"nonTrivial", hasNonTrivialMoveAssignment);
364 FIELD2(
"userDeclared", hasUserDeclaredMoveAssignment);
365 FIELD2(
"needsImplicit", needsImplicitMoveAssignment);
366 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForMoveAssignment);
371 static llvm::json::Object
373 llvm::json::Object Ret;
375 FIELD2(
"simple", hasSimpleDestructor);
376 FIELD2(
"irrelevant", hasIrrelevantDestructor);
377 FIELD2(
"trivial", hasTrivialDestructor);
378 FIELD2(
"nonTrivial", hasNonTrivialDestructor);
379 FIELD2(
"userDeclared", hasUserDeclaredDestructor);
380 FIELD2(
"needsImplicit", needsImplicitDestructor);
381 FIELD2(
"needsOverloadResolution", needsOverloadResolutionForDestructor);
383 FIELD2(
"defaultedIsDeleted", defaultedDestructorIsDeleted);
389 JSONNodeDumper::createCXXRecordDefinitionData(
const CXXRecordDecl *RD) {
390 llvm::json::Object Ret;
398 FIELD1(isTriviallyCopyable);
405 FIELD1(hasUserDeclaredConstructor);
406 FIELD1(hasConstexprNonCopyMoveConstructor);
408 FIELD1(hasVariantMembers);
409 FIELD2(
"canConstDefaultInit", allowConstDefaultInit);
424 std::string JSONNodeDumper::createAccessSpecifier(
AccessSpecifier AS) {
431 llvm_unreachable(
"Unknown access specifier");
436 llvm::json::Object Ret;
438 Ret[
"type"] = createQualType(BS.
getType());
440 Ret[
"writtenAccess"] =
443 Ret[
"isVirtual"] =
true;
445 Ret[
"isPackExpansion"] =
true;
451 JOS.attribute(
"decl", createBareDeclRef(TT->
getDecl()));
466 attributeOnlyIfTrue(
"const", T->
isConst());
467 attributeOnlyIfTrue(
"volatile", T->
isVolatile());
468 attributeOnlyIfTrue(
"restrict", T->
isRestrict());
469 attributeOnlyIfTrue(
"variadic", E.
Variadic);
471 case RQ_LValue:
JOS.attribute(
"refQualifier",
"&");
break;
472 case RQ_RValue:
JOS.attribute(
"refQualifier",
"&&");
break;
478 JOS.attribute(
"exceptionSpec",
"throw");
479 llvm::json::Array Types;
481 Types.push_back(createQualType(QT));
482 JOS.attribute(
"exceptionTypes", std::move(Types));
485 JOS.attribute(
"exceptionSpec",
"throw");
486 JOS.attribute(
"throwsAny",
true);
489 JOS.attribute(
"exceptionSpec",
"noexcept");
493 JOS.attribute(
"exceptionSpec",
"noexcept");
494 JOS.attribute(
"conditionEvaluatesTo",
500 JOS.attribute(
"exceptionSpec",
"nothrow");
522 JOS.attribute(
"sizeModifier",
"*");
525 JOS.attribute(
"sizeModifier",
"static");
533 JOS.attribute(
"indexTypeQualifiers", Str);
539 JOS.attribute(
"size", CAT->
getSize().getSExtValue());
546 "attrLoc", [VT,
this] { writeSourceLocation(VT->
getAttributeLoc()); });
555 JOS.attribute(
"vectorKind",
"altivec");
558 JOS.attribute(
"vectorKind",
"altivec pixel");
561 JOS.attribute(
"vectorKind",
"altivec bool");
564 JOS.attribute(
"vectorKind",
"neon");
567 JOS.attribute(
"vectorKind",
"neon poly");
573 JOS.attribute(
"decl", createBareDeclRef(UUT->
getDecl()));
579 JOS.attribute(
"transformKind",
"underlying_type");
585 JOS.attribute(
"decl", createBareDeclRef(TT->
getDecl()));
593 JOS.attribute(
"decl", createBareDeclRef(TTPT->
getDecl()));
600 JOS.attribute(
"typeKeyword",
"auto");
603 JOS.attribute(
"typeKeyword",
"decltype(auto)");
606 JOS.attribute(
"typeKeyword",
"__auto_type");
613 attributeOnlyIfTrue(
"isAlias", TST->
isTypeAlias());
616 llvm::raw_string_ostream OS(Str);
618 JOS.attribute(
"templateName", OS.str());
623 JOS.attribute(
"decl", createBareDeclRef(ICNT->
getDecl()));
627 JOS.attribute(
"decl", createBareDeclRef(OIT->
getDecl()));
632 JOS.attribute(
"numExpansions", *N);
638 llvm::raw_string_ostream OS(Str);
639 NNS->print(OS, PrintPolicy,
true);
640 JOS.attribute(
"qualifier", OS.str());
643 JOS.attribute(
"ownedTagDecl", createBareDeclRef(TD));
672 attributeOnlyIfTrue(
"isInline", ND->
isInline());
674 JOS.attribute(
"originalNamespace",
679 JOS.attribute(
"nominatedNamespace",
685 JOS.attribute(
"aliasedNamespace",
692 llvm::raw_string_ostream SOS(Name);
696 JOS.attribute(
"name", Name);
705 JOS.attribute(
"type", createQualType(VD->
getType()));
716 attributeOnlyIfTrue(
"inline", VD->
isInline());
717 attributeOnlyIfTrue(
"constexpr", VD->
isConstexpr());
731 JOS.attribute(
"type", createQualType(FD->
getType()));
732 attributeOnlyIfTrue(
"mutable", FD->
isMutable());
734 attributeOnlyIfTrue(
"isBitfield", FD->
isBitField());
740 JOS.attribute(
"type", createQualType(FD->
getType()));
746 attributeOnlyIfTrue(
"pure", FD->
isPure());
748 attributeOnlyIfTrue(
"constexpr", FD->
isConstexpr());
749 attributeOnlyIfTrue(
"variadic", FD->
isVariadic());
752 JOS.attribute(
"explicitlyDefaulted",
753 FD->
isDeleted() ?
"deleted" :
"default");
761 JOS.attribute(
"scopedEnumTag",
766 JOS.attribute(
"type", createQualType(ECD->
getType()));
781 JOS.attribute(
"definitionData", createCXXRecordDefinitionData(RD));
783 JOS.attributeArray(
"bases", [
this, RD] {
784 for (
const auto &Spec : RD->
bases())
785 JOS.value(createCXXBaseSpecifier(Spec));
798 JOS.attributeObject(
"defaultArg", [=] {
799 Visit(D->getDefaultArgument(), SourceRange(),
800 D->getDefaultArgStorage().getInheritedFrom(),
801 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
808 JOS.attribute(
"type", createQualType(D->
getType()));
814 JOS.attributeObject(
"defaultArg", [=] {
815 Visit(D->getDefaultArgument(), SourceRange(),
816 D->getDefaultArgStorage().getInheritedFrom(),
817 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
829 JOS.attributeObject(
"defaultArg", [=] {
830 Visit(D->getDefaultArgument().getArgument(),
831 D->getDefaultArgStorage().getInheritedFrom()->getSourceRange(),
832 D->getDefaultArgStorage().getInheritedFrom(),
833 D->defaultArgumentWasInherited() ?
"inherited from" :
"previous");
843 JOS.attribute(
"language", Lang);
844 attributeOnlyIfTrue(
"hasBraces", LSD->
hasBraces());
848 JOS.attribute(
"access", createAccessSpecifier(ASD->
getAccess()));
853 JOS.attribute(
"type", createQualType(T->getType()));
858 JOS.attribute(
"type", createQualType(D->
getType()));
873 attributeOnlyIfTrue(
"variadic", D->
isVariadic());
884 JOS.attribute(
"variance",
"covariant");
887 JOS.attribute(
"variance",
"contravariant");
897 llvm::json::Array Protocols;
899 Protocols.push_back(createBareDeclRef(
P));
900 if (!Protocols.empty())
901 JOS.attribute(
"protocols", std::move(Protocols));
913 llvm::json::Array Protocols;
915 Protocols.push_back(createBareDeclRef(
P));
916 if (!Protocols.empty())
917 JOS.attribute(
"protocols", std::move(Protocols));
925 llvm::json::Array Protocols;
927 Protocols.push_back(createBareDeclRef(
P));
928 if (!Protocols.empty())
929 JOS.attribute(
"protocols", std::move(Protocols));
947 JOS.attribute(
"type", createQualType(D->
getType()));
963 attributeOnlyIfTrue(
"readwrite",
967 attributeOnlyIfTrue(
"nonatomic",
972 attributeOnlyIfTrue(
"unsafe_unretained",
975 attributeOnlyIfTrue(
"nullability",
977 attributeOnlyIfTrue(
"null_resettable",
993 attributeOnlyIfTrue(
"variadic", D->
isVariadic());
1003 llvm::raw_string_ostream OS(Str);
1006 JOS.attribute(
"selector", OS.str());
1010 JOS.attribute(
"receiverKind",
"instance");
1013 JOS.attribute(
"receiverKind",
"class");
1017 JOS.attribute(
"receiverKind",
"super (instance)");
1021 JOS.attribute(
"receiverKind",
"super (class)");
1027 if (OME->
getType() != CallReturnTy)
1028 JOS.attribute(
"callReturnType", createQualType(CallReturnTy));
1034 llvm::raw_string_ostream OS(Str);
1036 MD->getSelector().print(OS);
1037 JOS.attribute(
"selector", OS.str());
1043 llvm::raw_string_ostream OS(Str);
1046 JOS.attribute(
"selector", OS.str());
1050 JOS.attribute(
"protocol", createBareDeclRef(OPE->
getProtocol()));
1055 JOS.attribute(
"propertyKind",
"implicit");
1057 JOS.attribute(
"getter", createBareDeclRef(MD));
1059 JOS.attribute(
"setter", createBareDeclRef(MD));
1061 JOS.attribute(
"propertyKind",
"explicit");
1072 JOS.attribute(
"subscriptKind",
1076 JOS.attribute(
"getter", createBareDeclRef(MD));
1078 JOS.attribute(
"setter", createBareDeclRef(MD));
1082 JOS.attribute(
"decl", createBareDeclRef(OIRE->
getDecl()));
1083 attributeOnlyIfTrue(
"isFreeIvar", OIRE->
isFreeIvar());
1088 JOS.attribute(
"value", OBLE->
getValue() ?
"__objc_yes" :
"__objc_no");
1092 JOS.attribute(
"referencedDecl", createBareDeclRef(DRE->
getDecl()));
1094 JOS.attribute(
"foundReferencedDecl",
1112 JOS.attribute(
"canOverflow",
false);
1123 JOS.attribute(
"computeResultType",
1133 JOS.attribute(
"referencedMemberDecl", createPointerRepresentation(VD));
1143 attributeOnlyIfTrue(
"isGlobal", NE->
isGlobalNew());
1144 attributeOnlyIfTrue(
"isArray", NE->
isArray());
1152 JOS.attribute(
"operatorNewDecl", createBareDeclRef(FD));
1154 JOS.attribute(
"operatorDeleteDecl", createBareDeclRef(FD));
1158 attributeOnlyIfTrue(
"isArray", DE->
isArrayForm());
1161 JOS.attribute(
"operatorDeleteDecl", createBareDeclRef(FD));
1165 attributeOnlyIfTrue(
"implicit", TE->
isImplicit());
1170 llvm::json::Array Path = createCastPath(CE);
1172 JOS.attribute(
"path", std::move(Path));
1176 JOS.attribute(
"conversionFunc", createBareDeclRef(ND));
1185 attributeOnlyIfTrue(
"adl", CE->
usesADL());
1196 JOS.attribute(
"name",
"__builtin_omp_required_simd_align");
break;
1211 JOS.attributeArray(
"lookups", [
this, ULE] {
1213 JOS.value(createBareDeclRef(D));
1219 JOS.attribute(
"labelDeclId", createPointerRepresentation(ALE->
getLabel()));
1226 JOS.attribute(
"typeArg", createQualType(Unadjusted));
1227 if (Adjusted != Unadjusted)
1228 JOS.attribute(
"adjustedTypeArg", createQualType(Adjusted));
1235 llvm::raw_string_ostream OS(Str);
1237 JOS.attribute(
"value", OS.str());
1243 JOS.attribute(
"field", createBareDeclRef(FD));
1260 JOS.attribute(
"ctorType", createQualType(Ctor->
getType()));
1261 attributeOnlyIfTrue(
"elidable", CE->
isElidable());
1269 JOS.attribute(
"constructionKind",
"complete");
1272 JOS.attribute(
"constructionKind",
"delegating");
1275 JOS.attribute(
"constructionKind",
"non-virtual base");
1278 JOS.attribute(
"constructionKind",
"virtual base");
1284 attributeOnlyIfTrue(
"cleanupsHaveSideEffects",
1287 JOS.attributeArray(
"cleanups", [
this, EWC] {
1289 JOS.value(createBareDeclRef(CO));
1297 JOS.attribute(
"temp", createPointerRepresentation(Temp));
1299 JOS.attribute(
"dtor", createBareDeclRef(Dtor));
1305 JOS.attribute(
"extendingDecl", createBareDeclRef(VD));
1309 JOS.attribute(
"storageDuration",
"automatic");
1312 JOS.attribute(
"storageDuration",
"dynamic");
1315 JOS.attribute(
"storageDuration",
"full expression");
1318 JOS.attribute(
"storageDuration",
"static");
1321 JOS.attribute(
"storageDuration",
"thread");
1333 attributeOnlyIfTrue(
"hasExplicitTemplateArgs",
1337 JOS.attributeArray(
"explicitTemplateArgs", [DSME,
this] {
1340 [&TAL,
this] { Visit(TAL.getArgument(), TAL.getSourceRange()); });
1346 JOS.attribute(
"value",
1363 JOS.attribute(
"value", Buffer);
1367 llvm::raw_string_ostream SS(Buffer);
1369 JOS.attribute(
"value", SS.str());
1379 attributeOnlyIfTrue(
"isConstexpr", IS->
isConstexpr());
1392 JOS.attribute(
"declId", createPointerRepresentation(LS->
getDecl()));
1395 JOS.attribute(
"targetLabelDeclId",
1396 createPointerRepresentation(GS->
getLabel()));
1411 JOS.attribute(
"isNull",
true);
1418 JOS.attribute(
"decl", createBareDeclRef(TA.
getAsDecl()));
1421 JOS.attribute(
"isNullptr",
true);
1437 JOS.attribute(
"isExpr",
true);
1440 JOS.attribute(
"isPack",
true);
1443 StringRef JSONNodeDumper::getCommentCommandName(
unsigned CommandID)
const {
1463 JOS.attribute(
"renderKind",
"normal");
1466 JOS.attribute(
"renderKind",
"bold");
1469 JOS.attribute(
"renderKind",
"emphasized");
1472 JOS.attribute(
"renderKind",
"monospaced");
1476 llvm::json::Array Args;
1477 for (
unsigned I = 0, E = C->
getNumArgs(); I < E; ++I)
1481 JOS.attribute(
"args", std::move(Args));
1488 attributeOnlyIfTrue(
"malformed", C->
isMalformed());
1490 llvm::json::Array Attrs;
1491 for (
unsigned I = 0, E = C->
getNumAttrs(); I < E; ++I)
1493 {{
"name", C->getAttr(I).Name}, {
"value", C->getAttr(I).Value}});
1496 JOS.attribute(
"attrs", std::move(Attrs));
1508 llvm::json::Array Args;
1509 for (
unsigned I = 0, E = C->
getNumArgs(); I < E; ++I)
1513 JOS.attribute(
"args", std::move(Args));
1520 JOS.attribute(
"direction",
"in");
1523 JOS.attribute(
"direction",
"out");
1526 JOS.attribute(
"direction",
"in,out");
1545 llvm::json::Array Positions;
1546 for (
unsigned I = 0, E = C->
getDepth(); I < E; ++I)
1547 Positions.push_back(C->
getIndex(I));
1549 if (!Positions.empty())
1550 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)
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.
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.
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)
const ValueDecl * getExtendingDecl() const
Get the declaration which triggered the lifetime-extension of this temporary, if any.
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)
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 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
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)
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 ...'
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)
SourceRange getRange() const
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 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.
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.
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.