1 //===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
14 #define LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
16 #include "clang/AST/ASTDumperUtils.h"
17 #include "clang/Basic/LLVM.h"
24 class DiagnosticsEngine;
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);
37 // AST dumper: dumps the raw AST in human-readable form to the given output
38 // stream, or stdout if OS is nullptr.
39 std::unique_ptr<ASTConsumer>
40 CreateASTDumper(std::unique_ptr<raw_ostream> OS, StringRef FilterString,
41 bool DumpDecls, bool Deserialize, bool DumpLookups,
42 bool DumpDeclTypes, ASTDumpOutputFormat Format);
44 // AST Decl node lister: prints qualified names of all filterable AST Decl
46 std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister();
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();
53 } // end clang namespace