r291017 - Remove use of intrusive ref count ownership acquisition
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 4 14:36:40 PST 2017
Author: dblaikie
Date: Wed Jan 4 16:36:39 2017
New Revision: 291017
URL: http://llvm.org/viewvc/llvm-project?rev=291017&view=rev
Log:
Remove use of intrusive ref count ownership acquisition
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)
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h
cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h?rev=291017&r1=291016&r2=291017&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/CheckerManager.h Wed Jan 4 16:36:39 2017
@@ -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;
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=291017&r1=291016&r2=291017&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp Wed Jan 4 16:36:39 2017
@@ -116,7 +116,7 @@ ento::createCheckerManager(AnalyzerOptio
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);
More information about the cfe-commits
mailing list