Skip to content
Snippets Groups Projects
Commit bf9c0da0 authored by David Blaikie's avatar David Blaikie
Browse files

unique_ptrify clang::ento::createCheckerManager

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216765 91177308-0d34-0410-b5e6-96231b3b80d8
parent 805714ac
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#define LLVM_CLANG_STATICANALYZER_FRONTEND_CHECKERREGISTRATION_H
#include "clang/Basic/LLVM.h"
#include <memory>
#include <string>
namespace clang {
......@@ -21,10 +22,9 @@ namespace clang {
namespace ento {
class CheckerManager;
CheckerManager *createCheckerManager(AnalyzerOptions &opts,
const LangOptions &langOpts,
ArrayRef<std::string> plugins,
DiagnosticsEngine &diags);
std::unique_ptr<CheckerManager>
createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
ArrayRef<std::string> plugins, DiagnosticsEngine &diags);
} // end ento namespace
......
......@@ -289,18 +289,12 @@ public:
void Initialize(ASTContext &Context) override {
Ctx = &Context;
checkerMgr.reset(createCheckerManager(*Opts, PP.getLangOpts(), Plugins,
PP.getDiagnostics()));
Mgr.reset(new AnalysisManager(*Ctx,
PP.getDiagnostics(),
PP.getLangOpts(),
PathConsumers,
CreateStoreMgr,
CreateConstraintMgr,
checkerMgr.get(),
*Opts,
Injector));
checkerMgr = createCheckerManager(*Opts, PP.getLangOpts(), Plugins,
PP.getDiagnostics());
Mgr = llvm::make_unique<AnalysisManager>(
*Ctx, PP.getDiagnostics(), PP.getLangOpts(), PathConsumers,
CreateStoreMgr, CreateConstraintMgr, checkerMgr.get(), *Opts, Injector);
}
/// \brief Store the top level decls in the set to be processed later on.
......
......@@ -99,11 +99,10 @@ void ClangCheckerRegistry::warnIncompatible(DiagnosticsEngine *diags,
<< pluginAPIVersion;
}
CheckerManager *ento::createCheckerManager(AnalyzerOptions &opts,
const LangOptions &langOpts,
ArrayRef<std::string> plugins,
DiagnosticsEngine &diags) {
std::unique_ptr<CheckerManager>
ento::createCheckerManager(AnalyzerOptions &opts, const LangOptions &langOpts,
ArrayRef<std::string> plugins,
DiagnosticsEngine &diags) {
std::unique_ptr<CheckerManager> checkerMgr(
new CheckerManager(langOpts, &opts));
......@@ -126,7 +125,7 @@ CheckerManager *ento::createCheckerManager(AnalyzerOptions &opts,
}
return checkerMgr.release();
return std::move(checkerMgr);
}
void ento::printCheckerHelp(raw_ostream &out, ArrayRef<std::string> plugins) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment