diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2018-02-27 15:19:20 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2018-02-27 15:19:20 +0000 |
commit | 6017bf4f315f9a49a2512cef0d640197172659b3 (patch) | |
tree | f19b88a8c5de0f7316a21adc5ddbd725b9416845 /clang/unittests/Tooling/ExecutionTest.cpp | |
parent | 46045364b291c7b674a8c8db53a370c1f518158e (diff) | |
download | bcm5719-llvm-6017bf4f315f9a49a2512cef0d640197172659b3.tar.gz bcm5719-llvm-6017bf4f315f9a49a2512cef0d640197172659b3.zip |
[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>
Summary:
Noticed during review of D41102.
I'm not sure whether there are any principal reasons why it returns raw owning pointer,
or it is just a old code that was not updated post-C++11.
I'm not too sure what testing i should do, because `check-all` is not error clean here for some reason,
but it does not //appear// asif those failures are related to these changes.
This is clang part.
Clang-tools-extra part is D43780.
Reviewers: klimek, bkramer, alexfh, pcc
Reviewed By: alexfh
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D43779
llvm-svn: 326201
Diffstat (limited to 'clang/unittests/Tooling/ExecutionTest.cpp')
-rw-r--r-- | clang/unittests/Tooling/ExecutionTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/unittests/Tooling/ExecutionTest.cpp b/clang/unittests/Tooling/ExecutionTest.cpp index 26db8c6d0ea..19e5de7823c 100644 --- a/clang/unittests/Tooling/ExecutionTest.cpp +++ b/clang/unittests/Tooling/ExecutionTest.cpp @@ -79,7 +79,9 @@ private: class ReportResultActionFactory : public FrontendActionFactory { public: ReportResultActionFactory(ExecutionContext *Context) : Context(Context) {} - FrontendAction *create() override { return new ReportResultAction(Context); } + std::unique_ptr<FrontendAction> create() override { + return llvm::make_unique<ReportResultAction>(Context); + } private: ExecutionContext *const Context; |