blob: a74a02d4085c287e375ee6b46954e5371afb353c [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- clang.h - C-Language Front-end -----------------------------------===//
2//
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//
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 Kremenekae360762007-12-03 22:06:55 +000017#include <vector>
18#include <string>
19
Reid Spencer5f016e22007-07-11 17:01:13 +000020namespace clang {
21class Preprocessor;
Reid Spencer5f016e22007-07-11 17:01:13 +000022class MinimalAction;
23class TargetInfo;
24class Diagnostic;
Ted Kremenek44579782007-09-25 18:37:20 +000025class ASTConsumer;
Steve Naroffb4292f22007-10-31 20:55:39 +000026class IdentifierTable;
Ted Kremenek7a9d49f2007-12-11 21:27:55 +000027class SourceManager;
Reid Spencer5f016e22007-07-11 17:01:13 +000028
29/// DoPrintPreprocessedInput - Implement -E mode.
Chris Lattnere988bc22008-01-27 23:55:11 +000030void DoPrintPreprocessedInput(Preprocessor &PP, const std::string& OutFile);
Reid Spencer5f016e22007-07-11 17:01:13 +000031
Chris Lattnerb57e3d42008-05-08 06:52:13 +000032/// RewriteMacrosInInput - Implement -rewrite-macros mode.
Chris Lattner09510522008-05-09 22:43:24 +000033void RewriteMacrosInInput(Preprocessor &PP, const std::string &InFileName,
34 const std::string& OutFile);
Chris Lattnerb13c5ee2008-10-12 05:29:20 +000035
36void DoRewriteTest(Preprocessor &PP, const std::string &InFileName,
37 const std::string &OutFileName);
38
Chris Lattnerb57e3d42008-05-08 06:52:13 +000039
Reid Spencer5f016e22007-07-11 17:01:13 +000040/// CreatePrintParserActionsAction - Return the actions implementation that
41/// implements the -parse-print-callbacks option.
Steve Naroffb4292f22007-10-31 20:55:39 +000042MinimalAction *CreatePrintParserActionsAction(IdentifierTable &);
Reid Spencer5f016e22007-07-11 17:01:13 +000043
Reid Spencer5f016e22007-07-11 17:01:13 +000044/// EmitLLVMFromASTs - Implement -emit-llvm, which generates llvm IR from C.
Ted Kremenek95041a22007-12-19 22:51:13 +000045void EmitLLVMFromASTs(Preprocessor &PP, bool PrintStats);
Reid Spencer5f016e22007-07-11 17:01:13 +000046
Ted Kremenek44579782007-09-25 18:37:20 +000047/// CheckASTConsumer - Implement diagnostic checking for AST consumers.
Ted Kremenek95041a22007-12-19 22:51:13 +000048bool CheckASTConsumer(Preprocessor &PP, ASTConsumer* C);
Ted Kremenekd39bcd82007-09-26 18:39:29 +000049
Argyrios Kyrtzidis14d41402008-06-13 12:15:34 +000050/// CheckDiagnostics - Gather the expected diagnostics and check them.
51bool CheckDiagnostics(Preprocessor &PP);
52
Ted Kremenek85888962008-10-21 00:54:44 +000053/// CacheTokens - Cache tokens for use with PCH.
54void CacheTokens(Preprocessor& PP, const std::string& OutFile);
Reid Spencer5f016e22007-07-11 17:01:13 +000055
56} // end namespace clang
57
58#endif