]> granicus.if.org Git - clang/blob - include/clang/Frontend/ASTConsumers.h
1ce8682e9f5855f4a5a9274fd1d4b661de22db15
[clang] / include / clang / Frontend / ASTConsumers.h
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 DRIVER_ASTCONSUMERS_H
15 #define DRIVER_ASTCONSUMERS_H
16
17 #include "clang/Basic/LLVM.h"
18
19 #include <memory>
20
21 namespace clang {
22
23 class ASTConsumer;
24 class CodeGenOptions;
25 class DiagnosticsEngine;
26 class FileManager;
27 class LangOptions;
28 class Preprocessor;
29 class TargetOptions;
30
31 // AST pretty-printer: prints out the AST in a format that is close to the
32 // original C code.  The output is intended to be in a format such that
33 // clang could re-parse the output back into the same AST, but the
34 // implementation is still incomplete.
35 std::unique_ptr<ASTConsumer> CreateASTPrinter(raw_ostream *OS,
36                                               StringRef FilterString);
37
38 // AST dumper: dumps the raw AST in human-readable form to stderr; this is
39 // intended for debugging.
40 std::unique_ptr<ASTConsumer> CreateASTDumper(StringRef FilterString,
41                                              bool DumpDecls,
42                                              bool DumpLookups);
43
44 // AST Decl node lister: prints qualified names of all filterable AST Decl
45 // nodes.
46 std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister();
47
48 // Graphical AST viewer: for each function definition, creates a graph of
49 // the AST and displays it with the graph viewer "dotty".  Also outputs
50 // function declarations to stderr.
51 std::unique_ptr<ASTConsumer> CreateASTViewer();
52
53 // DeclContext printer: prints out the DeclContext tree in human-readable form
54 // to stderr; this is intended for debugging.
55 std::unique_ptr<ASTConsumer> CreateDeclContextPrinter();
56
57 } // end clang namespace
58
59 #endif