From 6beb6aa8f0f6fa20e8c8de7a17f39b101ed0da59 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 10 Aug 2014 19:56:51 +0000 Subject: Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325) After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323 --- clang/lib/Frontend/CompilerInstance.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index 22788aa5fb0..6b8669e9a1e 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -101,8 +101,8 @@ void CompilerInstance::setSema(Sema *S) { TheSema.reset(S); } -void CompilerInstance::setASTConsumer(ASTConsumer *Value) { - Consumer.reset(Value); +void CompilerInstance::setASTConsumer(std::unique_ptr Value) { + Consumer = std::move(Value); } void CompilerInstance::setCodeCompletionConsumer(CodeCompleteConsumer *Value) { -- cgit v1.2.3