clang  6.0.0svn
ASTConsumers.h
Go to the documentation of this file.
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 
21 namespace clang {
22 
23 class ASTConsumer;
24 class DiagnosticsEngine;
25 class LangOptions;
26 class 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.
30 std::unique_ptr<ASTConsumer>
31 CreateObjCRewriter(const std::string &InFile, std::unique_ptr<raw_ostream> OS,
32  DiagnosticsEngine &Diags, const LangOptions &LOpts,
33  bool SilenceRewriteMacroWarning);
34 std::unique_ptr<ASTConsumer>
35 CreateModernObjCRewriter(const std::string &InFile,
36  std::unique_ptr<raw_ostream> OS,
37  DiagnosticsEngine &Diags, const LangOptions &LOpts,
38  bool SilenceRewriteMacroWarning, bool LineInfo);
39 
40 /// CreateHTMLPrinter - Create an AST consumer which rewrites source code to
41 /// HTML with syntax highlighting suitable for viewing in a web-browser.
42 std::unique_ptr<ASTConsumer> CreateHTMLPrinter(std::unique_ptr<raw_ostream> OS,
43  Preprocessor &PP,
44  bool SyntaxHighlight = true,
45  bool HighlightMacros = true);
46 
47 } // end clang namespace
48 
49 #endif
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:50
void HighlightMacros(Rewriter &R, FileID FID, const Preprocessor &PP)
HighlightMacros - This uses the macro table state from the end of the file, to reexpand macros and in...
std::unique_ptr< ASTConsumer > CreateModernObjCRewriter(const std::string &InFile, std::unique_ptr< raw_ostream > OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning, bool LineInfo)
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
std::unique_ptr< ASTConsumer > CreateObjCRewriter(const std::string &InFile, std::unique_ptr< raw_ostream > OS, DiagnosticsEngine &Diags, const LangOptions &LOpts, bool SilenceRewriteMacroWarning)
void SyntaxHighlight(Rewriter &R, FileID FID, const Preprocessor &PP)
SyntaxHighlight - Relex the specified FileID and annotate the HTML with information about keywords...
Dataflow Directional Tag Classes.