diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Frontend/CompilerInstance.h | 5 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 7 | ||||
-rw-r--r-- | include/clang/StaticAnalyzer/Core/AnalyzerOptions.h | 7 |
3 files changed, 9 insertions, 10 deletions
diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index b28e1031b8..8f1d590686 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -189,10 +189,7 @@ public: /// @name Forwarding Methods /// { - AnalyzerOptions &getAnalyzerOpts() { - return Invocation->getAnalyzerOpts(); - } - const AnalyzerOptions &getAnalyzerOpts() const { + AnalyzerOptionsRef getAnalyzerOpts() { return Invocation->getAnalyzerOpts(); } diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index d461befdb7..30c96cbb33 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -68,7 +68,7 @@ public: /// options, the warning flags, and so on. class CompilerInvocation : public CompilerInvocationBase { /// Options controlling the static analyzer. - AnalyzerOptions AnalyzerOpts; + AnalyzerOptionsRef AnalyzerOpts; MigratorOptions MigratorOpts; @@ -100,7 +100,7 @@ class CompilerInvocation : public CompilerInvocationBase { TargetOptions TargetOpts; public: - CompilerInvocation() {} + CompilerInvocation() : AnalyzerOpts(new AnalyzerOptions()) {} /// @name Utility Methods /// @{ @@ -148,8 +148,7 @@ public: /// @name Option Subgroups /// @{ - AnalyzerOptions &getAnalyzerOpts() { return AnalyzerOpts; } - const AnalyzerOptions &getAnalyzerOpts() const { + AnalyzerOptionsRef getAnalyzerOpts() const { return AnalyzerOpts; } diff --git a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h index 99b1c7b0c4..d126453c31 100644 --- a/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h +++ b/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h @@ -18,6 +18,7 @@ #include <string> #include <vector> #include "llvm/ADT/StringMap.h" +#include "llvm/ADT/IntrusiveRefCntPtr.h" namespace clang { class ASTConsumer; @@ -75,7 +76,7 @@ enum AnalysisInliningMode { NumInliningModes }; -class AnalyzerOptions { +class AnalyzerOptions : public llvm::RefCountedBase<AnalyzerOptions> { public: typedef llvm::StringMap<std::string> ConfigTable; @@ -164,7 +165,9 @@ public: InliningMode = NoRedundancy; } }; - + +typedef llvm::IntrusiveRefCntPtr<AnalyzerOptions> AnalyzerOptionsRef; + } #endif |