]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/include/clang/Frontend/Utils.h
Merge ACPICA 20100915.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / include / clang / Frontend / Utils.h
1 //===--- Utils.h - Misc utilities for the front-end -------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 //  This header contains miscellaneous utilities for various front-end actions.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CLANG_FRONTEND_UTILS_H
15 #define LLVM_CLANG_FRONTEND_UTILS_H
16
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/raw_ostream.h"
19
20 namespace llvm {
21 class Triple;
22 }
23
24 namespace clang {
25 class ASTConsumer;
26 class Decl;
27 class DependencyOutputOptions;
28 class Diagnostic;
29 class DiagnosticOptions;
30 class HeaderSearch;
31 class HeaderSearchOptions;
32 class IdentifierTable;
33 class LangOptions;
34 class MinimalAction;
35 class Preprocessor;
36 class PreprocessorOptions;
37 class PreprocessorOutputOptions;
38 class SourceManager;
39 class Stmt;
40 class TargetInfo;
41 class FrontendOptions;
42
43 /// Normalize \arg File for use in a user defined #include directive (in the
44 /// predefines buffer).
45 std::string NormalizeDashIncludePath(llvm::StringRef File);
46
47 /// Apply the header search options to get given HeaderSearch object.
48 void ApplyHeaderSearchOptions(HeaderSearch &HS,
49                               const HeaderSearchOptions &HSOpts,
50                               const LangOptions &Lang,
51                               const llvm::Triple &triple);
52
53 /// InitializePreprocessor - Initialize the preprocessor getting it and the
54 /// environment ready to process a single file.
55 void InitializePreprocessor(Preprocessor &PP,
56                             const PreprocessorOptions &PPOpts,
57                             const HeaderSearchOptions &HSOpts,
58                             const FrontendOptions &FEOpts);
59
60 /// ProcessWarningOptions - Initialize the diagnostic client and process the
61 /// warning options specified on the command line.
62 void ProcessWarningOptions(Diagnostic &Diags, const DiagnosticOptions &Opts);
63
64 /// DoPrintPreprocessedInput - Implement -E mode.
65 void DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream* OS,
66                               const PreprocessorOutputOptions &Opts);
67
68 /// CreatePrintParserActionsAction - Return the actions implementation that
69 /// implements the -parse-print-callbacks option.
70 MinimalAction *CreatePrintParserActionsAction(Preprocessor &PP,
71                                               llvm::raw_ostream* OS);
72
73 /// CheckDiagnostics - Gather the expected diagnostics and check them.
74 bool CheckDiagnostics(Preprocessor &PP);
75
76 /// AttachDependencyFileGen - Create a dependency file generator, and attach
77 /// it to the given preprocessor.  This takes ownership of the output stream.
78 void AttachDependencyFileGen(Preprocessor &PP,
79                              const DependencyOutputOptions &Opts);
80
81 /// CacheTokens - Cache tokens for use with PCH. Note that this requires
82 /// a seekable stream.
83 void CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS);
84
85 }  // end namespace clang
86
87 #endif