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 LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H
15#define LLVM_CLANG_REWRITE_FRONTEND_ASTCONSUMERS_H
16
17#include "clang/Basic/LLVM.h"
18#include <memory>
19#include <string>
20
21namespace clang {
22
23class ASTConsumer;
24class DiagnosticsEngine;
25class LangOptions;
26class Preprocessor;
27
28// ObjC rewriter: attempts to rewrite ObjC constructs into pure C code.
29// This is considered experimental, and only works with Apple's ObjC runtime.
30std::unique_ptr<ASTConsumer>
31CreateObjCRewriter(const std::string &InFile, raw_ostream *OS,
32                   DiagnosticsEngine &Diags, const LangOptions &LOpts,
33                   bool SilenceRewriteMacroWarning);
34std::unique_ptr<ASTConsumer>
35CreateModernObjCRewriter(const std::string &InFile, 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.
41std::unique_ptr<ASTConsumer> CreateHTMLPrinter(raw_ostream *OS,
42                                               Preprocessor &PP,
43                                               bool SyntaxHighlight = true,
44                                               bool HighlightMacros = true);
45
46} // end clang namespace
47
48#endif
49