blob: 97adfb30c829f34d87f7a76e444916449874f821 [file] [log] [blame]
Chris Lattner97e8b6f2007-10-07 06:04:32 +00001//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
Reid Spencer5f016e22007-07-11 17:01:13 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Reid Spencer5f016e22007-07-11 17:01:13 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattner97e8b6f2007-10-07 06:04:32 +000010// AST Consumers.
Reid Spencer5f016e22007-07-11 17:01:13 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattner97e8b6f2007-10-07 06:04:32 +000014#ifndef DRIVER_ASTCONSUMERS_H
15#define DRIVER_ASTCONSUMERS_H
Reid Spencer5f016e22007-07-11 17:01:13 +000016
Ted Kremeneka95d3752008-09-13 05:16:45 +000017#include "llvm/Support/raw_ostream.h"
Eli Friedman7df3d712008-02-16 23:17:23 +000018#include <string>
Ted Kremenekea75c552007-11-28 21:32:21 +000019#include <iosfwd>
Ted Kremenek1b5a4bd2007-11-27 21:46:50 +000020
Chris Lattnere66b65c2008-02-06 01:42:25 +000021namespace llvm {
22 class Module;
23 namespace sys { class Path; }
24}
Reid Spencer5f016e22007-07-11 17:01:13 +000025namespace clang {
26
Chris Lattner556beb72007-09-15 22:56:56 +000027class ASTConsumer;
Chris Lattnerc0508f92007-09-15 23:21:08 +000028class Diagnostic;
Ted Kremenekdca24662007-12-05 00:26:13 +000029class FileManager;
Chris Lattner3245a0a2008-04-16 06:11:58 +000030class Preprocessor;
Ted Kremenek339b9c22008-04-17 22:31:54 +000031class PreprocessorFactory;
Daniel Dunbar70f92432008-10-23 05:50:47 +000032struct CompileOptions;
33struct LangOptions;
Ted Kremenek339b9c22008-04-17 22:31:54 +000034
Ted Kremeneka95d3752008-09-13 05:16:45 +000035ASTConsumer *CreateASTPrinter(llvm::raw_ostream* OS = NULL);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000036
Chris Lattner3d4997d2007-09-15 23:02:28 +000037ASTConsumer *CreateASTDumper();
Ted Kremenekfdfc1982007-12-19 22:24:34 +000038
Ted Kremenek80de08f2007-09-19 21:29:43 +000039ASTConsumer *CreateASTViewer();
Ted Kremenekfdfc1982007-12-19 22:24:34 +000040
Fariborz Jahanianb4b2f0c2008-01-18 01:15:54 +000041ASTConsumer *CreateCodeRewriterTest(const std::string& InFile,
Chris Lattnerc68ab772008-03-22 00:08:40 +000042 const std::string& OutFile,
Steve Naroff4f943c22008-03-10 20:43:59 +000043 Diagnostic &Diags,
44 const LangOptions &LOpts);
Ted Kremenek815c78f2008-08-05 18:50:11 +000045
Daniel Dunbard69bacc2008-10-21 23:49:24 +000046enum BackendAction {
47 Backend_EmitAssembly,
48 Backend_EmitBC,
49 Backend_EmitLL
50};
51ASTConsumer *CreateBackendConsumer(BackendAction Action,
52 Diagnostic &Diags,
53 const LangOptions &Features,
Daniel Dunbar70f92432008-10-23 05:50:47 +000054 const CompileOptions &CompileOpts,
Daniel Dunbard69bacc2008-10-21 23:49:24 +000055 const std::string& InFile,
56 const std::string& OutFile,
57 bool GenerateDebugInfo);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000058
Chris Lattner3245a0a2008-04-16 06:11:58 +000059ASTConsumer* CreateHTMLPrinter(const std::string &OutFile, Diagnostic &D,
Ted Kremenek339b9c22008-04-17 22:31:54 +000060 Preprocessor *PP, PreprocessorFactory* PPF);
Ted Kremenek6a340832008-03-18 21:19:49 +000061
Ted Kremenekfdfc1982007-12-19 22:24:34 +000062ASTConsumer *CreateSerializationTest(Diagnostic &Diags,
Ted Kremeneke7d07d12008-06-04 15:55:15 +000063 FileManager& FMgr);
Ted Kremeneka1fa3a12007-12-13 00:37:31 +000064
Ted Kremenekf06c9282007-12-19 23:49:37 +000065ASTConsumer *CreateASTSerializer(const std::string& InFile,
66 const std::string& EmitDir,
Ted Kremeneke7d07d12008-06-04 15:55:15 +000067 Diagnostic &Diags);
Ted Kremenek055c2752007-09-06 23:00:42 +000068
Steve Naroff1c9f81b2008-09-17 00:13:27 +000069ASTConsumer *CreateBlockRewriter(const std::string& InFile,
Steve Naroff13188952008-09-18 14:10:13 +000070 const std::string& OutFile,
Steve Naroff1c9f81b2008-09-17 00:13:27 +000071 Diagnostic &Diags,
72 const LangOptions &LangOpts);
Ted Kremenek7cae2f62008-10-23 23:36:29 +000073
74ASTConsumer *CreateInheritanceViewer(const std::string& clsname);
75
Reid Spencer5f016e22007-07-11 17:01:13 +000076} // end clang namespace
77
Ted Kremenekf4381fd2008-07-02 00:03:09 +000078#include "AnalysisConsumer.h"
79
Reid Spencer5f016e22007-07-11 17:01:13 +000080#endif