summaryrefslogtreecommitdiffstats
path: root/tools/clang-check
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-07-17 20:40:36 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-07-17 20:40:36 +0000
commit4d15e347a0bb35430635e1ae50d429c49761ae31 (patch)
treeacf66daecbe11d2bbc0db6285245ec70edb71dfb /tools/clang-check
parent6042ad3646ce7238962b2fdfd60c66c2dc06df1c (diff)
unique_ptr-ify ownership of ASTConsumers
(after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/clang-check')
-rw-r--r--tools/clang-check/ClangCheck.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/clang-check/ClangCheck.cpp b/tools/clang-check/ClangCheck.cpp
index cc8d43cec2..df3b4e0d95 100644
--- a/tools/clang-check/ClangCheck.cpp
+++ b/tools/clang-check/ClangCheck.cpp
@@ -28,6 +28,7 @@
#include "llvm/Option/OptTable.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Signals.h"
+#include "llvm/ADT/STLExtras.h"
using namespace clang::driver;
using namespace clang::tooling;
@@ -179,14 +180,14 @@ private:
namespace clang_check {
class ClangCheckActionFactory {
public:
- clang::ASTConsumer *newASTConsumer() {
+ std::unique_ptr<clang::ASTConsumer> newASTConsumer() {
if (ASTList)
return clang::CreateASTDeclNodeLister();
if (ASTDump)
return clang::CreateASTDumper(ASTDumpFilter);
if (ASTPrint)
return clang::CreateASTPrinter(&llvm::outs(), ASTDumpFilter);
- return new clang::ASTConsumer();
+ return llvm::make_unique<clang::ASTConsumer>();
}
};
}