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_REWRITE_FRONTEND_ASTCONSUMERS_H
14 #define LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H
16 #include "clang/Basic/LLVM.h"
23 class DiagnosticsEngine;
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);
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,
43 bool SyntaxHighlight = true,
44 bool HighlightMacros = true);
46 } // end clang namespace