Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:36:28

0001 //===--- ASTDumper.h - Dumping implementation for ASTs --------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_CLANG_AST_ASTDUMPER_H
0010 #define LLVM_CLANG_AST_ASTDUMPER_H
0011 
0012 #include "clang/AST/ASTNodeTraverser.h"
0013 #include "clang/AST/TextNodeDumper.h"
0014 #include "clang/Basic/SourceManager.h"
0015 
0016 namespace clang {
0017 
0018 class ASTDumper : public ASTNodeTraverser<ASTDumper, TextNodeDumper> {
0019 
0020   TextNodeDumper NodeDumper;
0021 
0022   raw_ostream &OS;
0023 
0024   const bool ShowColors;
0025 
0026 public:
0027   ASTDumper(raw_ostream &OS, const ASTContext &Context, bool ShowColors)
0028       : NodeDumper(OS, Context, ShowColors), OS(OS), ShowColors(ShowColors) {}
0029 
0030   ASTDumper(raw_ostream &OS, bool ShowColors)
0031       : NodeDumper(OS, ShowColors), OS(OS), ShowColors(ShowColors) {}
0032 
0033   TextNodeDumper &doGetNodeDelegate() { return NodeDumper; }
0034 
0035   void dumpInvalidDeclContext(const DeclContext *DC);
0036   void dumpLookups(const DeclContext *DC, bool DumpDecls);
0037 
0038   template <typename SpecializationDecl>
0039   void dumpTemplateDeclSpecialization(const SpecializationDecl *D,
0040                                       bool DumpExplicitInst, bool DumpRefOnly);
0041   template <typename TemplateDecl>
0042   void dumpTemplateDecl(const TemplateDecl *D, bool DumpExplicitInst);
0043 
0044   void VisitFunctionTemplateDecl(const FunctionTemplateDecl *D);
0045   void VisitClassTemplateDecl(const ClassTemplateDecl *D);
0046   void VisitVarTemplateDecl(const VarTemplateDecl *D);
0047 };
0048 
0049 } // namespace clang
0050 
0051 #endif