diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /include/clang/Frontend/CompilerInvocation.h | |
parent | 657bc3d9848e3be92029b2416031340988cd0111 (diff) | |
download | src-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.tar.gz src-test2-13cc256e404620c1de0cbcc4e43ce1e2dbbc4898.zip |
Notes
Diffstat (limited to 'include/clang/Frontend/CompilerInvocation.h')
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 79 |
1 files changed, 37 insertions, 42 deletions
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index d6fe003da0fd..1314956c3f47 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -13,15 +13,15 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/FileSystemOptions.h" -#include "clang/Frontend/AnalyzerOptions.h" +#include "clang/Basic/DiagnosticOptions.h" +#include "clang/Lex/HeaderSearchOptions.h" +#include "clang/Lex/PreprocessorOptions.h" +#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h" #include "clang/Frontend/MigratorOptions.h" #include "clang/Frontend/CodeGenOptions.h" #include "clang/Frontend/DependencyOutputOptions.h" -#include "clang/Frontend/DiagnosticOptions.h" #include "clang/Frontend/FrontendOptions.h" -#include "clang/Frontend/HeaderSearchOptions.h" #include "clang/Frontend/LangStandard.h" -#include "clang/Frontend/PreprocessorOptions.h" #include "clang/Frontend/PreprocessorOutputOptions.h" #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "llvm/ADT/StringRef.h" @@ -52,6 +52,19 @@ class CompilerInvocationBase : public RefCountedBase<CompilerInvocation> { protected: /// Options controlling the language variant. IntrusiveRefCntPtr<LangOptions> LangOpts; + + /// Options controlling the target. + IntrusiveRefCntPtr<TargetOptions> TargetOpts; + + /// Options controlling the diagnostic engine. + IntrusiveRefCntPtr<DiagnosticOptions> DiagnosticOpts; + + /// Options controlling the \#include directive. + IntrusiveRefCntPtr<HeaderSearchOptions> HeaderSearchOpts; + + /// Options controlling the preprocessor (aside from \#include handling). + IntrusiveRefCntPtr<PreprocessorOptions> PreprocessorOpts; + public: CompilerInvocationBase(); @@ -59,6 +72,23 @@ public: LangOptions *getLangOpts() { return LangOpts.getPtr(); } const LangOptions *getLangOpts() const { return LangOpts.getPtr(); } + + TargetOptions &getTargetOpts() { return *TargetOpts.getPtr(); } + const TargetOptions &getTargetOpts() const { + return *TargetOpts.getPtr(); + } + + DiagnosticOptions &getDiagnosticOpts() const { return *DiagnosticOpts; } + + HeaderSearchOptions &getHeaderSearchOpts() { return *HeaderSearchOpts; } + const HeaderSearchOptions &getHeaderSearchOpts() const { + return *HeaderSearchOpts; + } + + PreprocessorOptions &getPreprocessorOpts() { return *PreprocessorOpts; } + const PreprocessorOptions &getPreprocessorOpts() const { + return *PreprocessorOpts; + } }; /// \brief Helper class for holding the data necessary to invoke the compiler. @@ -68,7 +98,7 @@ public: /// options, the warning flags, and so on. class CompilerInvocation : public CompilerInvocationBase { /// Options controlling the static analyzer. - AnalyzerOptions AnalyzerOpts; + AnalyzerOptionsRef AnalyzerOpts; MigratorOptions MigratorOpts; @@ -78,29 +108,17 @@ class CompilerInvocation : public CompilerInvocationBase { /// Options controlling dependency output. DependencyOutputOptions DependencyOutputOpts; - /// Options controlling the diagnostic engine. - DiagnosticOptions DiagnosticOpts; - /// Options controlling file system operations. FileSystemOptions FileSystemOpts; /// Options controlling the frontend itself. FrontendOptions FrontendOpts; - /// Options controlling the \#include directive. - HeaderSearchOptions HeaderSearchOpts; - - /// Options controlling the preprocessor (aside from \#include handling). - PreprocessorOptions PreprocessorOpts; - /// Options controlling preprocessed output. PreprocessorOutputOptions PreprocessorOutputOpts; - /// Options controlling the target. - TargetOptions TargetOpts; - public: - CompilerInvocation() {} + CompilerInvocation() : AnalyzerOpts(new AnalyzerOptions()) {} /// @name Utility Methods /// @{ @@ -127,10 +145,6 @@ public: /// executable), for finding the builtin compiler path. static std::string GetResourcesPath(const char *Argv0, void *MainAddr); - /// \brief Convert the CompilerInvocation to a list of strings suitable for - /// passing to CreateFromArgs. - void toArgs(std::vector<std::string> &Res) const; - /// \brief Set language defaults for the given input language and /// language standard in the given LangOptions object. /// @@ -148,8 +162,7 @@ public: /// @name Option Subgroups /// @{ - AnalyzerOptions &getAnalyzerOpts() { return AnalyzerOpts; } - const AnalyzerOptions &getAnalyzerOpts() const { + AnalyzerOptionsRef getAnalyzerOpts() const { return AnalyzerOpts; } @@ -170,29 +183,16 @@ public: return DependencyOutputOpts; } - DiagnosticOptions &getDiagnosticOpts() { return DiagnosticOpts; } - const DiagnosticOptions &getDiagnosticOpts() const { return DiagnosticOpts; } - FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; } - HeaderSearchOptions &getHeaderSearchOpts() { return HeaderSearchOpts; } - const HeaderSearchOptions &getHeaderSearchOpts() const { - return HeaderSearchOpts; - } - FrontendOptions &getFrontendOpts() { return FrontendOpts; } const FrontendOptions &getFrontendOpts() const { return FrontendOpts; } - PreprocessorOptions &getPreprocessorOpts() { return PreprocessorOpts; } - const PreprocessorOptions &getPreprocessorOpts() const { - return PreprocessorOpts; - } - PreprocessorOutputOptions &getPreprocessorOutputOpts() { return PreprocessorOutputOpts; } @@ -200,11 +200,6 @@ public: return PreprocessorOutputOpts; } - TargetOptions &getTargetOpts() { return TargetOpts; } - const TargetOptions &getTargetOpts() const { - return TargetOpts; - } - /// @} }; |