blob: ca93e0fbf9ab13764edd612518825c089024655e [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
Eli Friedman7df3d712008-02-16 23:17:23 +000017#include <string>
Ted Kremenekea75c552007-11-28 21:32:21 +000018#include <iosfwd>
Ted Kremenek1b5a4bd2007-11-27 21:46:50 +000019
Chris Lattnere66b65c2008-02-06 01:42:25 +000020namespace llvm {
21 class Module;
22 namespace sys { class Path; }
23}
Reid Spencer5f016e22007-07-11 17:01:13 +000024namespace clang {
25
Chris Lattner556beb72007-09-15 22:56:56 +000026class ASTConsumer;
Chris Lattnerc0508f92007-09-15 23:21:08 +000027class Diagnostic;
Ted Kremenekdca24662007-12-05 00:26:13 +000028class FileManager;
Chris Lattner45e8cbd2007-11-28 05:34:05 +000029struct LangOptions;
Chris Lattner3245a0a2008-04-16 06:11:58 +000030class Preprocessor;
Ted Kremenek339b9c22008-04-17 22:31:54 +000031class PreprocessorFactory;
32
Reid Spencer5f016e22007-07-11 17:01:13 +000033
Ted Kremenekea75c552007-11-28 21:32:21 +000034ASTConsumer *CreateASTPrinter(std::ostream* OS = NULL);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000035
Chris Lattner3d4997d2007-09-15 23:02:28 +000036ASTConsumer *CreateASTDumper();
Ted Kremenekfdfc1982007-12-19 22:24:34 +000037
Ted Kremenek80de08f2007-09-19 21:29:43 +000038ASTConsumer *CreateASTViewer();
Ted Kremenekfdfc1982007-12-19 22:24:34 +000039
Ted Kremenek5f39c2d2008-02-22 20:00:31 +000040ASTConsumer *CreateCFGDumper(bool ViewGraphs, const std::string& FName);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000041
Ted Kremenekbfc10c92008-02-22 20:13:09 +000042ASTConsumer *CreateLiveVarAnalyzer(const std::string& fname);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000043
Chris Lattnerc0508f92007-09-15 23:21:08 +000044ASTConsumer *CreateDeadStoreChecker(Diagnostic &Diags);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000045
Ted Kremenek2bf55142007-09-17 20:49:30 +000046ASTConsumer *CreateUnitValsChecker(Diagnostic &Diags);
Ted Kremeneke603df42008-01-08 18:04:06 +000047
Ted Kremenekcb330932008-02-18 21:21:23 +000048ASTConsumer *CreateGRSimpleVals(Diagnostic &Diags,
Ted Kremenek339b9c22008-04-17 22:31:54 +000049 Preprocessor* PP, PreprocessorFactory* PPF,
Ted Kremenekcb330932008-02-18 21:21:23 +000050 const std::string& Function,
Ted Kremenek55af98c2008-04-14 18:40:58 +000051 const std::string& HTMLDir, bool Visualize,
52 bool TrimGraph, bool AnalyzeAll);
Ted Kremenek2fff37e2008-03-06 00:08:09 +000053
Ted Kremenekd71ed262008-04-10 22:16:52 +000054ASTConsumer *CreateCFRefChecker(Diagnostic &Diags,
Ted Kremenek339b9c22008-04-17 22:31:54 +000055 Preprocessor* PP, PreprocessorFactory* PPF,
Ted Kremeneke5c30122008-04-29 05:13:59 +000056 const LangOptions& LangOpts,
Ted Kremenekd71ed262008-04-10 22:16:52 +000057 const std::string& Function,
Ted Kremenek55af98c2008-04-14 18:40:58 +000058 const std::string& HTMLDir, bool Visualize,
59 bool TrimGraph, bool AnalyzeAll);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000060
Fariborz Jahanianb4b2f0c2008-01-18 01:15:54 +000061ASTConsumer *CreateCodeRewriterTest(const std::string& InFile,
Chris Lattnerc68ab772008-03-22 00:08:40 +000062 const std::string& OutFile,
Steve Naroff4f943c22008-03-10 20:43:59 +000063 Diagnostic &Diags,
64 const LangOptions &LOpts);
Ted Kremenekfdfc1982007-12-19 22:24:34 +000065
Chris Lattner3245a0a2008-04-16 06:11:58 +000066ASTConsumer* CreateHTMLPrinter(const std::string &OutFile, Diagnostic &D,
Ted Kremenek339b9c22008-04-17 22:31:54 +000067 Preprocessor *PP, PreprocessorFactory* PPF);
Ted Kremenek6a340832008-03-18 21:19:49 +000068
Ted Kremenekfdfc1982007-12-19 22:24:34 +000069ASTConsumer *CreateSerializationTest(Diagnostic &Diags,
Ted Kremeneke7d07d12008-06-04 15:55:15 +000070 FileManager& FMgr);
Ted Kremeneka1fa3a12007-12-13 00:37:31 +000071
Ted Kremenekf06c9282007-12-19 23:49:37 +000072ASTConsumer *CreateASTSerializer(const std::string& InFile,
73 const std::string& EmitDir,
Ted Kremeneke7d07d12008-06-04 15:55:15 +000074 Diagnostic &Diags);
Ted Kremenek055c2752007-09-06 23:00:42 +000075
Reid Spencer5f016e22007-07-11 17:01:13 +000076} // end clang namespace
77
78#endif