Skip to content

Commit 43a3845

Browse files
committed
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) llvm-svn: 291017
1 parent 7ad9dc1 commit 43a3845

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

clang/include/clang/StaticAnalyzer/Core/CheckerManager.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@ enum class ObjCMessageVisitKind {
102102

103103
class CheckerManager {
104104
const LangOptions LangOpts;
105-
AnalyzerOptionsRef AOptions;
105+
AnalyzerOptions &AOptions;
106106
CheckName CurrentCheckName;
107107

108108
public:
109-
CheckerManager(const LangOptions &langOpts, AnalyzerOptionsRef AOptions)
110-
: LangOpts(langOpts), AOptions(std::move(AOptions)) {}
109+
CheckerManager(const LangOptions &langOpts, AnalyzerOptions &AOptions)
110+
: LangOpts(langOpts), AOptions(AOptions) {}
111111

112112
~CheckerManager();
113113

@@ -119,7 +119,7 @@ class CheckerManager {
119119
void finishedCheckerRegistration();
120120

121121
const LangOptions &getLangOpts() const { return LangOpts; }
122-
AnalyzerOptions &getAnalyzerOptions() { return *AOptions; }
122+
AnalyzerOptions &getAnalyzerOptions() { return AOptions; }
123123

124124
typedef CheckerBase *CheckerRef;
125125
typedef const void *CheckerTag;

clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ento::createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
116116
ArrayRef<std::string> plugins,
117117
DiagnosticsEngine &diags) {
118118
std::unique_ptr<CheckerManager> checkerMgr(
119-
new CheckerManager(langOpts, &opts));
119+
new CheckerManager(langOpts, opts));
120120

121121
SmallVector<CheckerOptInfo, 8> checkerOpts = getCheckerOptList(opts);
122122

0 commit comments

Comments
 (0)