1 //===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // AST Consumers. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_CLANG_FRONTEND_ASTCONSUMERS_H 15 #define LLVM_CLANG_FRONTEND_ASTCONSUMERS_H 16 17 #include "clang/Basic/LLVM.h" 18 #include <memory> 19 20 namespace clang { 21 22 class ASTConsumer; 23 class CodeGenOptions; 24 class DiagnosticsEngine; 25 class FileManager; 26 class LangOptions; 27 class Preprocessor; 28 class TargetOptions; 29 30 // AST pretty-printer: prints out the AST in a format that is close to the 31 // original C code. The output is intended to be in a format such that 32 // clang could re-parse the output back into the same AST, but the 33 // implementation is still incomplete. 34 std::unique_ptr<ASTConsumer> CreateASTPrinter(std::unique_ptr<raw_ostream> OS, 35 StringRef FilterString); 36 37 // AST dumper: dumps the raw AST in human-readable form to stderr; this is 38 // intended for debugging. 39 std::unique_ptr<ASTConsumer> CreateASTDumper(StringRef FilterString, 40 bool DumpDecls, bool Deserialize, 41 bool DumpLookups); 42 43 // AST Decl node lister: prints qualified names of all filterable AST Decl 44 // nodes. 45 std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister(); 46 47 // Graphical AST viewer: for each function definition, creates a graph of 48 // the AST and displays it with the graph viewer "dotty". Also outputs 49 // function declarations to stderr. 50 std::unique_ptr<ASTConsumer> CreateASTViewer(); 51 52 // DeclContext printer: prints out the DeclContext tree in human-readable form 53 // to stderr; this is intended for debugging. 54 std::unique_ptr<ASTConsumer> CreateDeclContextPrinter(); 55 56 } // end clang namespace 57 58 #endif 59