]> granicus.if.org Git - clang/commitdiff
Remove use of intrusive ref count ownership acquisition
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 4 Jan 2017 22:36:39 +0000 (22:36 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 4 Jan 2017 22:36:39 +0000 (22:36 +0000)
The one use of CheckerManager (AnalysisConsumer, calling
createCheckerManager) keeps a strong reference to the AnalysisOptions
anyway, so this ownership wasn't necessary.

(I'm not even sure AnalysisOptions needs ref counting at all - but
that's more involved)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291017 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/StaticAnalyzer/Core/CheckerManager.h
lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp

index 5af717d9026817f29e3029e71e492b4626e0103d..0316c8fb173ba901157a5115c7f6260f63ba808b 100644 (file)
@@ -102,12 +102,12 @@ enum class ObjCMessageVisitKind {
 
 class CheckerManager {
   const LangOptions LangOpts;
-  AnalyzerOptionsRef AOptions;
+  AnalyzerOptions &AOptions;
   CheckName CurrentCheckName;
 
 public:
-  CheckerManager(const LangOptions &langOpts, AnalyzerOptionsRef AOptions)
-      : LangOpts(langOpts), AOptions(std::move(AOptions)) {}
+  CheckerManager(const LangOptions &langOpts, AnalyzerOptions &AOptions)
+      : LangOpts(langOpts), AOptions(AOptions) {}
 
   ~CheckerManager();
 
@@ -119,7 +119,7 @@ public:
   void finishedCheckerRegistration();
 
   const LangOptions &getLangOpts() const { return LangOpts; }
-  AnalyzerOptions &getAnalyzerOptions() { return *AOptions; }
+  AnalyzerOptions &getAnalyzerOptions() { return AOptions; }
 
   typedef CheckerBase *CheckerRef;
   typedef const void *CheckerTag;
index 31b6638e651f913065b8cacb09e71c886c792b2c..6792f89876cd8111783b3b20a94f9fc8cb84c506 100644 (file)
@@ -116,7 +116,7 @@ ento::createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
                            ArrayRef<std::string> plugins,
                            DiagnosticsEngine &diags) {
   std::unique_ptr<CheckerManager> checkerMgr(
-      new CheckerManager(langOpts, &opts));
+      new CheckerManager(langOpts, opts));
 
   SmallVector<CheckerOptInfo, 8> checkerOpts = getCheckerOptList(opts);