r216765 - unique_ptrify clang::ento::createCheckerManager
David Blaikie
dblaikie at gmail.com
Fri Aug 29 13:11:04 PDT 2014
Author: dblaikie
Date: Fri Aug 29 15:11:03 2014
New Revision: 216765
URL: http://llvm.org/viewvc/llvm-project?rev=216765&view=rev
Log:
unique_ptrify clang::ento::createCheckerManager
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
Modified: cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h?rev=216765&r1=216764&r2=216765&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h Fri Aug 29 15:11:03 2014
@@ -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
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp?rev=216765&r1=216764&r2=216765&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp Fri Aug 29 15:11:03 2014
@@ -289,18 +289,12 @@ public:
void Initialize(ASTContext &Context) override {
Ctx = &Context;
- checkerMgr.reset(createCheckerManager(*Opts, PP.getLangOpts(), Plugins,
- PP.getDiagnostics()));
+ checkerMgr = createCheckerManager(*Opts, PP.getLangOpts(), Plugins,
+ PP.getDiagnostics());
- Mgr.reset(new AnalysisManager(*Ctx,
- PP.getDiagnostics(),
- PP.getLangOpts(),
- PathConsumers,
- CreateStoreMgr,
- CreateConstraintMgr,
- checkerMgr.get(),
- *Opts,
- Injector));
+ 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.
Modified: cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp?rev=216765&r1=216764&r2=216765&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp Fri Aug 29 15:11:03 2014
@@ -99,11 +99,10 @@ void ClangCheckerRegistry::warnIncompati
<< 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::createCheckerManag
}
- return checkerMgr.release();
+ return std::move(checkerMgr);
}
void ento::printCheckerHelp(raw_ostream &out, ArrayRef<std::string> plugins) {
More information about the cfe-commits
mailing list