diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 11 | ||||
-rw-r--r-- | include/clang/Frontend/DependencyOutputOptions.h | 42 | ||||
-rw-r--r-- | include/clang/Frontend/PreprocessorOutputOptions.h | 7 | ||||
-rw-r--r-- | include/clang/Frontend/Utils.h | 6 |
4 files changed, 58 insertions, 8 deletions
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index b217dca965..fc0b95284d 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -12,6 +12,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/Frontend/CompileOptions.h" +#include "clang/Frontend/DependencyOutputOptions.h" #include "clang/Frontend/DiagnosticOptions.h" #include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Frontend/PreprocessorOptions.h" @@ -31,6 +32,9 @@ class CompilerInvocation { /// Options controlling IRgen and the backend. CompileOptions CompileOpts; + /// Options controlling dependency output. + DependencyOutputOptions DependencyOutputOpts; + /// Options controlling the diagnostic engine. DiagnosticOptions DiagOpts; @@ -68,6 +72,13 @@ public: return CompileOpts; } + DependencyOutputOptions &getDependencyOutputOpts() { + return DependencyOutputOpts; + } + const DependencyOutputOptions &getDependencyOutputOpts() const { + return DependencyOutputOpts; + } + DiagnosticOptions &getDiagnosticOpts() { return DiagOpts; } const DiagnosticOptions &getDiagnosticOpts() const { return DiagOpts; } diff --git a/include/clang/Frontend/DependencyOutputOptions.h b/include/clang/Frontend/DependencyOutputOptions.h new file mode 100644 index 0000000000..194c0ebafe --- /dev/null +++ b/include/clang/Frontend/DependencyOutputOptions.h @@ -0,0 +1,42 @@ +//===--- DependencyOutputOptions.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H +#define LLVM_CLANG_FRONTEND_DEPENDENCYOUTPUTOPTIONS_H + +#include <vector> + +namespace clang { + +/// DependencyOutputOptions - Options for controlling the compiler dependency +/// file generation. +class DependencyOutputOptions { +public: + unsigned IncludeSystemHeaders : 1; ///< Include system header dependencies. + unsigned UsePhonyTargets : 1; ///< Include phony targets for each + /// dependency, which can avoid some 'make' + /// problems. + + /// The file to write depencency output to. + std::string OutputFile; + + /// A list of names to use as the targets in the dependency file; this list + /// must contain at least one entry. + std::vector<std::string> Targets; + +public: + DependencyOutputOptions() { + IncludeSystemHeaders = 0; + UsePhonyTargets = 0; + } +}; + +} // end namespace clang + +#endif diff --git a/include/clang/Frontend/PreprocessorOutputOptions.h b/include/clang/Frontend/PreprocessorOutputOptions.h index e375a8545f..a712a3d1bb 100644 --- a/include/clang/Frontend/PreprocessorOutputOptions.h +++ b/include/clang/Frontend/PreprocessorOutputOptions.h @@ -10,9 +10,6 @@ #ifndef LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H #define LLVM_CLANG_FRONTEND_PREPROCESSOROUTPUTOPTIONS_H -#include <string> -#include <vector> - namespace clang { /// PreprocessorOutputOptions - Options for controlling the C preprocessor @@ -22,8 +19,8 @@ public: unsigned ShowCPP : 1; ///< Print normal preprocessed output. unsigned ShowMacros : 1; ///< Print macro definitions. unsigned ShowLineMarkers : 1; ///< Show #line markers. - unsigned ShowComments : 1; /// Show comments. - unsigned ShowMacroComments : 1; /// Show comments, even in macros. + unsigned ShowComments : 1; ///< Show comments. + unsigned ShowMacroComments : 1; ///< Show comments, even in macros. public: PreprocessorOutputOptions() { diff --git a/include/clang/Frontend/Utils.h b/include/clang/Frontend/Utils.h index d3a0b097f0..859f06a434 100644 --- a/include/clang/Frontend/Utils.h +++ b/include/clang/Frontend/Utils.h @@ -26,6 +26,7 @@ class raw_fd_ostream; namespace clang { class ASTConsumer; class Decl; +class DependencyOutputOptions; class Diagnostic; class HeaderSearch; class HeaderSearchOptions; @@ -77,9 +78,8 @@ bool CheckDiagnostics(Preprocessor &PP); /// AttachDependencyFileGen - Create a dependency file generator, and attach /// it to the given preprocessor. This takes ownership of the output stream. -void AttachDependencyFileGen(Preprocessor *PP, llvm::raw_ostream *OS, - std::vector<std::string> &Targets, - bool IncludeSystemHeaders, bool PhonyTarget); +void AttachDependencyFileGen(Preprocessor *PP, + const DependencyOutputOptions &Opts); /// CacheTokens - Cache tokens for use with PCH. Note that this requires /// a seekable stream. |