clang  19.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_REWRITE_FRONTEND_ASTCONSUMERS_H
14 #define LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H
15 
16 #include "clang/Basic/LLVM.h"
17 #include <memory>
18 #include <string>
19 
20 namespace clang {
21 
22 class ASTConsumer;
23 class DiagnosticsEngine;
24 class LangOptions;
25 class Preprocessor;
26 
27 // ObjC rewriter: attempts to rewrite ObjC constructs into pure C code.
28 // This is considered experimental, and only works with Apple's ObjC runtime.
29 std::unique_ptr<ASTConsumer>
30 CreateObjCRewriter(const std::string &InFile, std::unique_ptr<raw_ostream> OS,
31  DiagnosticsEngine &Diags, const LangOptions &LOpts,
32  bool SilenceRewriteMacroWarning);
33 std::unique_ptr<ASTConsumer>
34 CreateModernObjCRewriter(const std::string &InFile,
35  std::unique_ptr<raw_ostream> OS,
36  DiagnosticsEngine &Diags, const LangOptions &LOpts,
37  bool SilenceRewriteMacroWarning, bool LineInfo);
38 
39 /// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
40 /// HTML with syntax highlighting suitable for viewing in a web-browser.
41 std::unique_ptr<ASTConsumer> CreateHTMLPrinter(std::unique_ptr<raw_ostream> OS,
42  Preprocessor &PP,
43  bool SyntaxHighlight = true,
44  bool HighlightMacros = true);
45 
46 } // end clang namespace
47 
48 #endif
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
llvm::raw_ostream & OS
Definition: Logger.cpp:24
void SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP, RelexRewriteCacheRef Cache=nullptr)
SyntaxHighlight - Relex the specified FileID and annotate the HTML with information about keywords,...
void HighlightMacros(Rewriter &R, FileID FID, const Preprocessor &PP, RelexRewriteCacheRef Cache=nullptr)
HighlightMacros - This uses the macro table state from the end of the file, to reexpand macros and in...
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< ASTConsumer > CreateObjCRewriter(const std::string &InFile, std::unique_ptr< raw_ostream > OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning)
std::unique_ptr< ASTConsumer > CreateModernObjCRewriter(const std::string &InFile, std::unique_ptr< raw_ostream > OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning, bool LineInfo)
std::unique_ptr< ASTConsumer > CreateHTMLPrinter(std::unique_ptr< raw_ostream > OS, Preprocessor &PP, bool SyntaxHighlight=true, bool HighlightMacros=true)
CreateHTMLPrinter - Create an AST consumer which rewrites source code to HTML with syntax highlightin...
Definition: HTMLPrint.cpp:49