blob: 0093a7046acc1fcf1d984cd62adb6418bd450c72 [file] [log] [blame]
Chris Lattnereb8c9632007-10-07 06:04:32 +00001//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===//
Chris Lattner4b009652007-07-25 00:24:17 +00002//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner959e5be2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner4b009652007-07-25 00:24:17 +00007//
8//===----------------------------------------------------------------------===//
9//
Chris Lattnereb8c9632007-10-07 06:04:32 +000010// AST Consumers.
Chris Lattner4b009652007-07-25 00:24:17 +000011//
12//===----------------------------------------------------------------------===//
13
Chris Lattnereb8c9632007-10-07 06:04:32 +000014#ifndef DRIVER_ASTCONSUMERS_H
15#define DRIVER_ASTCONSUMERS_H
Chris Lattner4b009652007-07-25 00:24:17 +000016
Ted Kremenek7b6f67b2008-09-13 05:16:45 +000017#include "llvm/Support/raw_ostream.h"
Eli Friedmane316e9d2008-02-16 23:17:23 +000018#include <string>
Ted Kremenekbe2ea3b2007-11-28 21:32:21 +000019#include <iosfwd>
Ted Kremeneke09391a2007-11-27 21:46:50 +000020
Chris Lattner8d72ee02008-02-06 01:42:25 +000021namespace llvm {
22 class Module;
23 namespace sys { class Path; }
24}
Chris Lattner4b009652007-07-25 00:24:17 +000025namespace clang {
26
Chris Lattner1cc01712007-09-15 22:56:56 +000027class ASTConsumer;
Chris Lattner52332d02007-09-15 23:21:08 +000028class Diagnostic;
Ted Kremenek923de592007-12-05 00:26:13 +000029class FileManager;
Chris Lattner21f72d62008-04-16 06:11:58 +000030class Preprocessor;
Ted Kremenek4e9899f2008-04-17 22:31:54 +000031class PreprocessorFactory;
Daniel Dunbaraa7a0662008-10-23 05:50:47 +000032struct CompileOptions;
33struct LangOptions;
Ted Kremenek4e9899f2008-04-17 22:31:54 +000034
Ted Kremenek7b6f67b2008-09-13 05:16:45 +000035ASTConsumer *CreateASTPrinter(llvm::raw_ostream* OS = NULL);
Ted Kremenekd890f6a2007-12-19 22:24:34 +000036
Chris Lattnerb73abd52007-09-15 23:02:28 +000037ASTConsumer *CreateASTDumper();
Ted Kremenekd890f6a2007-12-19 22:24:34 +000038
Ted Kremenekb6976a22007-09-19 21:29:43 +000039ASTConsumer *CreateASTViewer();
Ted Kremenekd890f6a2007-12-19 22:24:34 +000040
Zhongxing Xu6036bbe2009-01-13 01:29:24 +000041ASTConsumer *CreateDeclContextPrinter();
42
Fariborz Jahanian8d2080c2008-01-18 01:15:54 +000043ASTConsumer *CreateCodeRewriterTest(const std::string& InFile,
Chris Lattner673f2bd2008-03-22 00:08:40 +000044 const std::string& OutFile,
Steve Naroff7fd0aff2008-03-10 20:43:59 +000045 Diagnostic &Diags,
46 const LangOptions &LOpts);
Ted Kremenek7c65b6c2008-08-05 18:50:11 +000047
Daniel Dunbar85e44e22008-10-21 23:49:24 +000048enum BackendAction {
49 Backend_EmitAssembly,
50 Backend_EmitBC,
51 Backend_EmitLL
52};
53ASTConsumer *CreateBackendConsumer(BackendAction Action,
54 Diagnostic &Diags,
55 const LangOptions &Features,
Daniel Dunbaraa7a0662008-10-23 05:50:47 +000056 const CompileOptions &CompileOpts,
Daniel Dunbar85e44e22008-10-21 23:49:24 +000057 const std::string& InFile,
58 const std::string& OutFile,
59 bool GenerateDebugInfo);
Ted Kremenekd890f6a2007-12-19 22:24:34 +000060
Chris Lattner21f72d62008-04-16 06:11:58 +000061ASTConsumer* CreateHTMLPrinter(const std::string &OutFile, Diagnostic &D,
Ted Kremenek4e9899f2008-04-17 22:31:54 +000062 Preprocessor *PP, PreprocessorFactory* PPF);
Ted Kremenek24612ae2008-03-18 21:19:49 +000063
Ted Kremenekd890f6a2007-12-19 22:24:34 +000064ASTConsumer *CreateSerializationTest(Diagnostic &Diags,
Ted Kremenek842126e2008-06-04 15:55:15 +000065 FileManager& FMgr);
Ted Kremenek397de012007-12-13 00:37:31 +000066
Ted Kremenek21189012007-12-19 23:49:37 +000067ASTConsumer *CreateASTSerializer(const std::string& InFile,
68 const std::string& EmitDir,
Ted Kremenek842126e2008-06-04 15:55:15 +000069 Diagnostic &Diags);
Ted Kremeneke805c4a2007-09-06 23:00:42 +000070
Steve Naroff200902c2008-09-17 00:13:27 +000071ASTConsumer *CreateBlockRewriter(const std::string& InFile,
Steve Naroff93c18352008-09-18 14:10:13 +000072 const std::string& OutFile,
Steve Naroff200902c2008-09-17 00:13:27 +000073 Diagnostic &Diags,
74 const LangOptions &LangOpts);
Ted Kremenekd9ceb3d2008-10-23 23:36:29 +000075
76ASTConsumer *CreateInheritanceViewer(const std::string& clsname);
77
Chris Lattner4b009652007-07-25 00:24:17 +000078} // end clang namespace
79
Ted Kremenek81ea7992008-07-02 00:03:09 +000080#include "AnalysisConsumer.h"
81
Chris Lattner4b009652007-07-25 00:24:17 +000082#endif