diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-12 23:52:32 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-12 23:52:32 +0000 |
commit | 26266885d6eba8ee197577dd42a8e68a0e4dd2e8 (patch) | |
tree | 8ff1d1460dc996509d51ca61f561fe71b07ad772 /include/clang/Frontend | |
parent | 80ac2358bbf3e18a941d54d481d372c7a0155199 (diff) |
Add FrontendOptions, and starting moving clang-cc to it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend')
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 19 | ||||
-rw-r--r-- | include/clang/Frontend/DiagnosticOptions.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/FrontendOptions.h | 52 |
3 files changed, 65 insertions, 10 deletions
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index 8a8b0fb000..fc0497a7ac 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -15,6 +15,7 @@ #include "clang/Frontend/AnalysisConsumer.h" #include "clang/Frontend/DependencyOutputOptions.h" #include "clang/Frontend/DiagnosticOptions.h" +#include "clang/Frontend/FrontendOptions.h" #include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Frontend/PreprocessorOptions.h" #include "clang/Frontend/PreprocessorOutputOptions.h" @@ -42,6 +43,9 @@ class CompilerInvocation { /// Options controlling the diagnostic engine. DiagnosticOptions DiagOpts; + /// Options controlling the frontend itself. + FrontendOptions FrontendOpts; + /// Options controlling the #include directive. HeaderSearchOptions HeaderSearchOpts; @@ -54,19 +58,9 @@ class CompilerInvocation { /// Options controlling preprocessed output. PreprocessorOutputOptions PreprocessorOutputOpts; - /// The location for the output file. This is optional only for compiler - /// invocations which have no output. - std::string OutputFile; - public: CompilerInvocation() {} - /// @name Invidual Options - /// @{ - - std::string &getOutputFile() { return OutputFile; } - const std::string &getOutputFile() const { return OutputFile; } - /// @} /// @name Option Subgroups /// @{ @@ -96,6 +90,11 @@ public: return HeaderSearchOpts; } + FrontendOptions &getFrontendOpts() { return FrontendOpts; } + const FrontendOptions &getFrontendOpts() const { + return FrontendOpts; + } + LangOptions &getLangOpts() { return LangOpts; } const LangOptions &getLangOpts() const { return LangOpts; } diff --git a/include/clang/Frontend/DiagnosticOptions.h b/include/clang/Frontend/DiagnosticOptions.h index 704769ec12..6346dc0bfd 100644 --- a/include/clang/Frontend/DiagnosticOptions.h +++ b/include/clang/Frontend/DiagnosticOptions.h @@ -31,6 +31,9 @@ public: unsigned ShowOptionNames : 1; /// Show the diagnostic name for mappable /// diagnostics. unsigned ShowColors : 1; /// Show diagnostics with ANSI color sequences. + unsigned VerifyDiagnostics; /// Check that diagnostics match the expected + /// diagnostics, indicated by markers in the + /// input source file. /// Column limit for formatting message diagnostics, or 0 if unused. unsigned MessageLength; @@ -57,6 +60,7 @@ public: ShowLocation = 1; ShowOptionNames = 0; ShowSourceRanges = 0; + VerifyDiagnostics = 0; } }; diff --git a/include/clang/Frontend/FrontendOptions.h b/include/clang/Frontend/FrontendOptions.h new file mode 100644 index 0000000000..da177bc037 --- /dev/null +++ b/include/clang/Frontend/FrontendOptions.h @@ -0,0 +1,52 @@ +//===--- FrontendOptions.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_FRONTENDOPTIONS_H +#define LLVM_CLANG_FRONTEND_FRONTENDOPTIONS_H + +#include <string> +#include <vector> + +namespace clang { + +/// FrontendOptions - Options for controlling the behavior of the frontend. +class FrontendOptions { +public: + unsigned DisableFree : 1; ///< Disable freeing of memory on exit. + unsigned EmptyInputOnly : 1; ///< Force input files to be treated as if they + /// were empty, for timing the frontend startup. + unsigned FixItAll : 1; ///< Apply FIX-IT advice to the input source files. + unsigned RelocatablePCH : 1; ///< When generating PCH files, instruct the + /// PCH writer to create relocatable PCH files. + unsigned ShowStats : 1; ///< Show frontend performance metrics and statistics. + unsigned ShowTimers : 1; ///< Show timers for individual actions. + + /// The input files. + std::vector<std::string> InputFilenames; + + /// The output file, if any. + std::string OutputFile; + + /// If given, the name for a C++ class to view the inheritance of. + std::string ViewClassInheritance; + +public: + FrontendOptions() { + DisableFree = 0; + EmptyInputOnly = 0; + FixItAll = 0; + RelocatablePCH = 0; + ShowStats = 0; + ShowTimers = 0; + } +}; + +} // end namespace clang + +#endif |