clang  16.0.0git
ASTConsumers.h
Go to the documentation of this file.
1 //===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // AST Consumers.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
14 #define LLVM_CLANG_FRONTEND_ASTCONSUMERS_H
15 
17 #include "clang/Basic/LLVM.h"
18 #include <memory>
19 
20 namespace clang {
21 
22 class ASTConsumer;
23 
24 // AST pretty-printer: prints out the AST in a format that is close to the
25 // original C code. The output is intended to be in a format such that
26 // clang could re-parse the output back into the same AST, but the
27 // implementation is still incomplete.
28 std::unique_ptr<ASTConsumer> CreateASTPrinter(std::unique_ptr<raw_ostream> OS,
29  StringRef FilterString);
30 
31 // AST dumper: dumps the raw AST in human-readable form to the given output
32 // stream, or stdout if OS is nullptr.
33 std::unique_ptr<ASTConsumer>
34 CreateASTDumper(std::unique_ptr<raw_ostream> OS, StringRef FilterString,
35  bool DumpDecls, bool Deserialize, bool DumpLookups,
36  bool DumpDeclTypes, ASTDumpOutputFormat Format);
37 
38 // AST Decl node lister: prints qualified names of all filterable AST Decl
39 // nodes.
40 std::unique_ptr<ASTConsumer> CreateASTDeclNodeLister();
41 
42 // Graphical AST viewer: for each function definition, creates a graph of
43 // the AST and displays it with the graph viewer "dotty". Also outputs
44 // function declarations to stderr.
45 std::unique_ptr<ASTConsumer> CreateASTViewer();
46 
47 } // end clang namespace
48 
49 #endif
clang::CreateASTViewer
std::unique_ptr< ASTConsumer > CreateASTViewer()
Definition: ASTConsumers.cpp:215
clang::ASTDumpOutputFormat
ASTDumpOutputFormat
Used to specify the format for printing AST dump information.
Definition: ASTDumperUtils.h:21
ASTDumperUtils.h
clang::CreateASTPrinter
std::unique_ptr< ASTConsumer > CreateASTPrinter(std::unique_ptr< raw_ostream > OS, StringRef FilterString)
Definition: ASTConsumers.cpp:160
LLVM.h
clang::CreateASTDumper
std::unique_ptr< ASTConsumer > CreateASTDumper(std::unique_ptr< raw_ostream > OS, StringRef FilterString, bool DumpDecls, bool Deserialize, bool DumpLookups, bool DumpDeclTypes, ASTDumpOutputFormat Format)
Definition: ASTConsumers.cpp:167
clang
Definition: CalledOnceCheck.h:17
clang::CreateASTDeclNodeLister
std::unique_ptr< ASTConsumer > CreateASTDeclNodeLister()
Definition: ASTConsumers.cpp:178