FirstChild =
true;
35 boolTopLevel =
true;
39llvm::json::OStream
JOS;
43 template<
typenameFn>
void AddChild(Fn DoAddChild) {
49 template<
typenameFn>
void AddChild(StringRef
Label, Fn DoAddChild) {
58 while(!Pending.empty()) {
59Pending.back()(
true);
70std::string LabelStr(!
Label.empty() ?
Label:
"inner");
71 boolWasFirstChild = FirstChild;
72 autoDumpWithIndent = [=](
boolIsLastChild) {
74 JOS.attributeBegin(LabelStr);
79 unsignedDepth = Pending.size();
86 while(Depth < Pending.size()) {
87Pending.back()(
true);
88this->Pending.pop_back();
100Pending.push_back(std::move(DumpWithIndent));
102Pending.back()(
false);
103Pending.back() = std::move(DumpWithIndent);
119const comments::FullComment *>,
132StringRef LastLocFilename, LastLocPresumedFilename;
133 unsignedLastLocLine, LastLocPresumedLine;
144 voidattributeOnlyIfTrue(StringRef Key,
bool Value) {
149 voidwriteIncludeStack(
PresumedLoc Loc,
boolJustFirst =
false);
160std::string createPointerRepresentation(
const void*Ptr);
161llvm::json::Object createQualType(
QualTypeQT,
boolDesugar =
true);
162llvm::json::Object createBareDeclRef(
const Decl*
D);
164 voidwriteBareDeclRef(
const Decl*
D);
165llvm::json::Object createCXXRecordDefinitionData(
const CXXRecordDecl*RD);
168llvm::json::Array createCastPath(
const CastExpr*
C);
170 voidwritePreviousDeclImpl(...) {}
172 template<
typenameT>
voidwritePreviousDeclImpl(
constMergeable<T> *
D) {
173 const T*
First=
D->getFirstDecl();
175 JOS.attribute(
"firstRedecl", createPointerRepresentation(
First));
178 template<
typenameT>
voidwritePreviousDeclImpl(
constRedeclarable<T> *
D) {
179 const T*Prev =
D->getPreviousDecl();
181 JOS.attribute(
"previousDecl", createPointerRepresentation(Prev));
183 voidaddPreviousDeclaration(
constDecl *
D);
185StringRef getCommentCommandName(
unsignedCommandID)
const;
192PrintPolicy(PrintPolicy), Traits(Traits), LastLocLine(0),
193LastLocPresumedLine(0) {}
204 constDecl *From =
nullptr, StringRef
Label= {});
205 void Visit(
constCXXCtorInitializer *
Init);
206 void Visit(
constOpenACCClause *
C);
207 void Visit(
constOMPClause *
C);
208 void Visit(
constBlockDecl::Capture &
C);
210 void Visit(
constconcepts::Requirement *R);
211 void Visit(
constAPValue &
Value, QualType Ty);
212 void Visit(
constConceptReference *);
354 constcomments::FullComment *);
356 constcomments::FullComment *);
358 constcomments::FullComment *);
360 constcomments::FullComment *);
362 constcomments::FullComment *);
364 constcomments::FullComment *FC);
366 constcomments::FullComment *FC);
368 constcomments::FullComment *);
371 constcomments::FullComment *);
373 constcomments::FullComment *);
379 template<
typenameSpecializationDecl>
380 voidwriteTemplateDeclSpecialization(
constSpecializationDecl *SD,
381 boolDumpExplicitInst,
383 boolDumpedAny =
false;
384 for(
const auto*RedeclWithBadType : SD->redecls()) {
388 const auto*Redecl = dyn_cast<SpecializationDecl>(RedeclWithBadType);
393assert(isa<CXXRecordDecl>(RedeclWithBadType) &&
394 "expected an injected-class-name");
398 switch(Redecl->getTemplateSpecializationKind()) {
401 if(!DumpExplicitInst)
407NodeDumper.
AddChild([=] { NodeDumper.writeBareDeclRef(Redecl); });
419NodeDumper.
AddChild([=] { NodeDumper.writeBareDeclRef(SD); });
422 template<
typenameTemplateDecl>
423 voidwriteTemplateDecl(
const TemplateDecl*TD,
boolDumpExplicitInst) {
434 for(
const auto*Child : TD->specializations())
435writeTemplateDeclSpecialization(Child, DumpExplicitInst,
443: NodeDumper(OS, SrcMgr, Ctx, PrintPolicy, Traits) {}
448writeTemplateDecl(FTD,
true);
451writeTemplateDecl(CTD,
false);
454writeTemplateDecl(VTD,
false);
Defines the clang::ASTContext interface.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines Expressions and AST nodes for C++2a concepts.
C Language Family Type Representation.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ASTNodeTraverser traverses the Clang AST for dumping purposes.
void Visit(const Decl *D, bool VisitLocs=false)
void dumpTemplateParameters(const TemplateParameterList *TPL)
Attr - This represents one attribute.
Represents a base class of a C++ class.
Represents a C++ struct/union/class.
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Declaration of a class template.
A simple visitor class that helps create attribute visitors.
A simple visitor class that helps create declaration visitors.
ConstStmtVisitor - This class implements a simple visitor for Stmt subclasses.
A simple visitor class that helps create template argument visitors.
Decl - This represents one declaration (or definition), e.g.
bool isCanonicalDecl() const
Whether this particular Decl is a canonical one.
Represents difference between two FPOptions values.
Declaration of a template function.
AssociationTy< true > ConstAssociation
void VisitClassTemplateDecl(const ClassTemplateDecl *CTD)
void VisitVarTemplateDecl(const VarTemplateDecl *VTD)
JSONNodeDumper & doGetNodeDelegate()
void VisitFunctionTemplateDecl(const FunctionTemplateDecl *FTD)
JSONDumper(raw_ostream &OS, const SourceManager &SrcMgr, ASTContext &Ctx, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits)
void VisitObjCSubscriptRefExpr(const ObjCSubscriptRefExpr *OSRE)
void VisitObjCInterfaceDecl(const ObjCInterfaceDecl *D)
void VisitUnresolvedLookupExpr(const UnresolvedLookupExpr *ULE)
void VisitCleanupAttr(const CleanupAttr *CA)
void VisitCaseStmt(const CaseStmt *CS)
void VisitImplicitCastExpr(const ImplicitCastExpr *ICE)
void VisitNamespaceAliasDecl(const NamespaceAliasDecl *NAD)
void VisitFunctionProtoType(const FunctionProtoType *T)
void VisitObjCImplementationDecl(const ObjCImplementationDecl *D)
void VisitVectorType(const VectorType *VT)
void VisitFunctionDecl(const FunctionDecl *FD)
void VisitObjCProtocolExpr(const ObjCProtocolExpr *OPE)
void VisitUsingDecl(const UsingDecl *UD)
void VisitEnumConstantDecl(const EnumConstantDecl *ECD)
void VisitConstantExpr(const ConstantExpr *CE)
void VisitRequiresExpr(const RequiresExpr *RE)
void VisitExprWithCleanups(const ExprWithCleanups *EWC)
void VisitCXXBoolLiteralExpr(const CXXBoolLiteralExpr *BLE)
void VisitTagType(const TagType *TT)
void Visit(const Attr *A)
void VisitLabelStmt(const LabelStmt *LS)
void VisitRValueReferenceType(const ReferenceType *RT)
void VisitObjCInterfaceType(const ObjCInterfaceType *OIT)
void VisitCXXConstructExpr(const CXXConstructExpr *CE)
void VisitObjCEncodeExpr(const ObjCEncodeExpr *OEE)
void VisitCXXDependentScopeMemberExpr(const CXXDependentScopeMemberExpr *ME)
void VisitStringLiteral(const StringLiteral *SL)
void VisitBlockDecl(const BlockDecl *D)
void VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *Node)
void VisitSizeOfPackExpr(const SizeOfPackExpr *SOPE)
void VisitCXXUnresolvedConstructExpr(const CXXUnresolvedConstructExpr *UCE)
void VisitCXXTypeidExpr(const CXXTypeidExpr *CTE)
void VisitObjCPropertyImplDecl(const ObjCPropertyImplDecl *D)
void VisitAccessSpecDecl(const AccessSpecDecl *ASD)
void VisitDeprecatedAttr(const DeprecatedAttr *DA)
void VisitMemberPointerType(const MemberPointerType *MPT)
void VisitMemberExpr(const MemberExpr *ME)
void visitBlockCommandComment(const comments::BlockCommandComment *C, const comments::FullComment *)
void VisitCXXRecordDecl(const CXXRecordDecl *RD)
void VisitTemplateTemplateParmDecl(const TemplateTemplateParmDecl *D)
void VisitSwitchStmt(const SwitchStmt *SS)
void visitHTMLEndTagComment(const comments::HTMLEndTagComment *C, const comments::FullComment *)
void VisitBinaryOperator(const BinaryOperator *BO)
void visitVerbatimBlockLineComment(const comments::VerbatimBlockLineComment *C, const comments::FullComment *)
void VisitNonTypeTemplateParmDecl(const NonTypeTemplateParmDecl *D)
void VisitTemplateTypeParmDecl(const TemplateTypeParmDecl *D)
void VisitLinkageSpecDecl(const LinkageSpecDecl *LSD)
void VisitTypedefDecl(const TypedefDecl *TD)
void VisitTypedefType(const TypedefType *TT)
void VisitUnresolvedUsingType(const UnresolvedUsingType *UUT)
void VisitSubstTemplateTypeParmPackType(const SubstTemplateTypeParmPackType *T)
void VisitElaboratedType(const ElaboratedType *ET)
void VisitUnaryTransformType(const UnaryTransformType *UTT)
void VisitCallExpr(const CallExpr *CE)
void VisitVisibilityAttr(const VisibilityAttr *VA)
void VisitCompoundAssignOperator(const CompoundAssignOperator *CAO)
void visitParamCommandComment(const comments::ParamCommandComment *C, const comments::FullComment *FC)
void visitVerbatimBlockComment(const comments::VerbatimBlockComment *C, const comments::FullComment *)
void VisitAtomicExpr(const AtomicExpr *AE)
void VisitUsingShadowDecl(const UsingShadowDecl *USD)
void VisitFloatingLiteral(const FloatingLiteral *FL)
void VisitTemplateTypeParmType(const TemplateTypeParmType *TTPT)
void VisitUsingDirectiveDecl(const UsingDirectiveDecl *UDD)
void VisitTemplateSpecializationType(const TemplateSpecializationType *TST)
void VisitWhileStmt(const WhileStmt *WS)
void VisitDeclarationTemplateArgument(const TemplateArgument &TA)
void VisitVarDecl(const VarDecl *VD)
void VisitEnumDecl(const EnumDecl *ED)
void VisitPackTemplateArgument(const TemplateArgument &TA)
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA)
void visitTextComment(const comments::TextComment *C, const comments::FullComment *)
void VisitFieldDecl(const FieldDecl *FD)
void VisitCXXBindTemporaryExpr(const CXXBindTemporaryExpr *BTE)
void VisitIntegralTemplateArgument(const TemplateArgument &TA)
void VisitObjCSelectorExpr(const ObjCSelectorExpr *OSE)
void VisitSYCLUniqueStableNameExpr(const SYCLUniqueStableNameExpr *E)
void VisitDeclRefExpr(const DeclRefExpr *DRE)
void VisitNullPtrTemplateArgument(const TemplateArgument &TA)
void VisitNamespaceDecl(const NamespaceDecl *ND)
void VisitObjCIvarRefExpr(const ObjCIvarRefExpr *OIRE)
void visitVerbatimLineComment(const comments::VerbatimLineComment *C, const comments::FullComment *)
void VisitAutoType(const AutoType *AT)
void VisitObjCIvarDecl(const ObjCIvarDecl *D)
void VisitUnavailableAttr(const UnavailableAttr *UA)
void VisitMacroQualifiedType(const MacroQualifiedType *MQT)
void VisitObjCPropertyDecl(const ObjCPropertyDecl *D)
void VisitObjCMethodDecl(const ObjCMethodDecl *D)
void visitTParamCommandComment(const comments::TParamCommandComment *C, const comments::FullComment *FC)
void VisitAddrLabelExpr(const AddrLabelExpr *ALE)
void VisitPredefinedExpr(const PredefinedExpr *PE)
void VisitAliasAttr(const AliasAttr *AA)
void VisitObjCCategoryImplDecl(const ObjCCategoryImplDecl *D)
void VisitPackExpansionType(const PackExpansionType *PET)
void VisitDependentSizedExtVectorType(const DependentSizedExtVectorType *VT)
void visitHTMLStartTagComment(const comments::HTMLStartTagComment *C, const comments::FullComment *)
void VisitSectionAttr(const SectionAttr *SA)
void VisitUsingType(const UsingType *TT)
void VisitSubstTemplateTypeParmType(const SubstTemplateTypeParmType *STTPT)
void VisitArrayType(const ArrayType *AT)
void VisitTypeTemplateArgument(const TemplateArgument &TA)
void VisitObjCBoxedExpr(const ObjCBoxedExpr *OBE)
void VisitObjCTypeParamDecl(const ObjCTypeParamDecl *D)
void VisitGenericSelectionExpr(const GenericSelectionExpr *GSE)
void VisitTemplateTemplateArgument(const TemplateArgument &TA)
void VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *Node)
void VisitObjCBoolLiteralExpr(const ObjCBoolLiteralExpr *OBLE)
void VisitFixedPointLiteral(const FixedPointLiteral *FPL)
void VisitGotoStmt(const GotoStmt *GS)
void VisitCharacterLiteral(const CharacterLiteral *CL)
void VisitInitListExpr(const InitListExpr *ILE)
void VisitObjCProtocolDecl(const ObjCProtocolDecl *D)
void VisitTLSModelAttr(const TLSModelAttr *TA)
void VisitCompoundStmt(const CompoundStmt *IS)
void VisitHLSLBufferDecl(const HLSLBufferDecl *D)
void VisitCXXThisExpr(const CXXThisExpr *TE)
void VisitObjCPropertyRefExpr(const ObjCPropertyRefExpr *OPRE)
void VisitConstantArrayType(const ConstantArrayType *CAT)
void VisitObjCCompatibleAliasDecl(const ObjCCompatibleAliasDecl *D)
void VisitCXXNewExpr(const CXXNewExpr *NE)
void VisitOpenACCAsteriskSizeExpr(const OpenACCAsteriskSizeExpr *E)
void VisitObjCAtCatchStmt(const ObjCAtCatchStmt *OACS)
void VisitNullTemplateArgument(const TemplateArgument &TA)
void VisitCastExpr(const CastExpr *CE)
void VisitInjectedClassNameType(const InjectedClassNameType *ICNT)
JSONNodeDumper(raw_ostream &OS, const SourceManager &SrcMgr, ASTContext &Ctx, const PrintingPolicy &PrintPolicy, const comments::CommandTraits *Traits)
void VisitIfStmt(const IfStmt *IS)
void VisitUnaryOperator(const UnaryOperator *UO)
void visitInlineCommandComment(const comments::InlineCommandComment *C, const comments::FullComment *)
void VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *TTE)
void VisitIntegerLiteral(const IntegerLiteral *IL)
void VisitUsingEnumDecl(const UsingEnumDecl *UED)
void VisitObjCMessageExpr(const ObjCMessageExpr *OME)
void VisitFunctionType(const FunctionType *T)
void VisitRecordDecl(const RecordDecl *RD)
void VisitTypeAliasDecl(const TypeAliasDecl *TAD)
void VisitExpressionTemplateArgument(const TemplateArgument &TA)
void VisitNamedDecl(const NamedDecl *ND)
void VisitObjCCategoryDecl(const ObjCCategoryDecl *D)
void VisitFriendDecl(const FriendDecl *FD)
void VisitCXXDeleteExpr(const CXXDeleteExpr *DE)
void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *MTE)
void AddChild(Fn DoAddChild)
Add a child of the current node. Calls DoAddChild without arguments.
NodeStreamer(raw_ostream &OS)
void AddChild(StringRef Label, Fn DoAddChild)
Add a child of the current node with an optional label.
Represents an unpacked "presumed" location which can be presented to the user.
A (possibly-)qualified type.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
Represents a template argument.
The base class of all kinds of template declarations (e.g., class, function, etc.).
NamedDecl * getTemplatedDecl() const
Get the underlying, templated declaration.
TemplateParameterList * getTemplateParameters() const
Get the list of template parameters.
Base wrapper for a particular "section" of type source info.
The base class of the type hierarchy.
Declaration of a variable template.
The JSON file list parser is used to communicate input to InstallAPI.
const FunctionProtoType * T
@ TSK_ExplicitInstantiationDefinition
This template specialization was instantiated from a template due to an explicit instantiation defini...
@ TSK_ExplicitInstantiationDeclaration
This template specialization was instantiated from a template due to an explicit instantiation declar...
@ TSK_ExplicitSpecialization
This template specialization was declared or defined by an explicit specialization (C++ [temp....
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
@ TSK_Undeclared
This template specialization was formed from a template-id but has not yet been declared,...
AccessSpecifier
A C++ access specifier (public, private, protected), plus the special value "none" which means differ...
Describes how types, statements, expressions, and declarations should be printed.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4