diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:26:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-23 22:26:28 +0000 |
commit | 02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f (patch) | |
tree | c44af66edb700be2df3d1ad41420df5c7174d5f1 /include/clang/Frontend/CompilerInvocation.h | |
parent | 340d0d30018dd3ed77fb17f33e785acd745bf97d (diff) |
Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Frontend/CompilerInvocation.h')
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index a58fef1f4b..de8f60049a 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -13,11 +13,11 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/TargetOptions.h" #include "clang/Basic/FileSystemOptions.h" +#include "clang/Basic/DiagnosticOptions.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" @@ -55,6 +55,10 @@ protected: /// Options controlling the target. IntrusiveRefCntPtr<TargetOptions> TargetOpts; + + /// Options controlling the diagnostic engine. + IntrusiveRefCntPtr<DiagnosticOptions> DiagnosticOpts; + public: CompilerInvocationBase(); @@ -67,6 +71,8 @@ public: const TargetOptions &getTargetOpts() const { return *TargetOpts.getPtr(); } + + DiagnosticOptions &getDiagnosticOpts() const { return *DiagnosticOpts; } }; /// \brief Helper class for holding the data necessary to invoke the compiler. @@ -86,9 +92,6 @@ class CompilerInvocation : public CompilerInvocationBase { /// Options controlling dependency output. DependencyOutputOptions DependencyOutputOpts; - /// Options controlling the diagnostic engine. - DiagnosticOptions DiagnosticOpts; - /// Options controlling file system operations. FileSystemOptions FileSystemOpts; @@ -174,9 +177,6 @@ public: return DependencyOutputOpts; } - DiagnosticOptions &getDiagnosticOpts() { return DiagnosticOpts; } - const DiagnosticOptions &getDiagnosticOpts() const { return DiagnosticOpts; } - FileSystemOptions &getFileSystemOpts() { return FileSystemOpts; } const FileSystemOptions &getFileSystemOpts() const { return FileSystemOpts; |