blob: 33bc7fe5832420b5bcfe9147ad7759eb9802dcc6 [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001//===--- clang.h - C-Language Front-end -----------------------------------===//
2//
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//
10// This is the header file that pulls together the top-level driver.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_CLANG_H
15#define LLVM_CLANG_CLANG_H
16
Ted Kremenek40499482007-12-03 22:06:55 +000017#include <vector>
18#include <string>
19
Chris Lattner4b009652007-07-25 00:24:17 +000020namespace clang {
21class Preprocessor;
Chris Lattner4b009652007-07-25 00:24:17 +000022class MinimalAction;
23class TargetInfo;
24class Diagnostic;
Ted Kremenek0841c702007-09-25 18:37:20 +000025class ASTConsumer;
Steve Naroffebeb4282007-10-31 20:55:39 +000026class IdentifierTable;
Ted Kremenekb3ee1932007-12-11 21:27:55 +000027class SourceManager;
Chris Lattner4b009652007-07-25 00:24:17 +000028
Sebastian Redl44ff86c2009-03-06 17:41:35 +000029/// ProcessWarningOptions - Initialize the diagnostic client and process the
30/// warning options specified on the command line.
31bool ProcessWarningOptions(Diagnostic &Diags);
32
Chris Lattner4b009652007-07-25 00:24:17 +000033/// DoPrintPreprocessedInput - Implement -E mode.
Chris Lattnerefd02a32008-01-27 23:55:11 +000034void DoPrintPreprocessedInput(Preprocessor &PP, const std::string& OutFile);
Chris Lattner4b009652007-07-25 00:24:17 +000035
Chris Lattner1665a9f2008-05-08 06:52:13 +000036/// RewriteMacrosInInput - Implement -rewrite-macros mode.
Chris Lattner302b0622008-05-09 22:43:24 +000037void RewriteMacrosInInput(Preprocessor &PP, const std::string &InFileName,
38 const std::string& OutFile);
Chris Lattnerc3fbf392008-10-12 05:29:20 +000039
40void DoRewriteTest(Preprocessor &PP, const std::string &InFileName,
41 const std::string &OutFileName);
42
Chris Lattner1665a9f2008-05-08 06:52:13 +000043
Chris Lattner4b009652007-07-25 00:24:17 +000044/// CreatePrintParserActionsAction - Return the actions implementation that
45/// implements the -parse-print-callbacks option.
Daniel Dunbar747a95e2008-10-31 08:56:51 +000046MinimalAction *CreatePrintParserActionsAction(Preprocessor &PP);
Chris Lattner4b009652007-07-25 00:24:17 +000047
Argiris Kirtzidis8d833762008-06-13 12:15:34 +000048/// CheckDiagnostics - Gather the expected diagnostics and check them.
49bool CheckDiagnostics(Preprocessor &PP);
50
Daniel Dunbar35fe5de2008-10-24 22:12:41 +000051/// CreateDependencyFileGen - Create dependency file generator.
52/// This is only done if either -MD or -MMD has been specified.
53bool CreateDependencyFileGen(Preprocessor *PP,
54 std::string &OutputFile,
55 const std::string &InputFile,
56 const char *&ErrStr);
57
Ted Kremenek71c6cc62008-10-21 00:54:44 +000058/// CacheTokens - Cache tokens for use with PCH.
59void CacheTokens(Preprocessor& PP, const std::string& OutFile);
Chris Lattner4b009652007-07-25 00:24:17 +000060
61} // end namespace clang
62
63#endif