From: David Blaikie Date: Sun, 10 Aug 2014 19:14:48 +0000 (+0000) Subject: unique_ptr-ify CompilerInstance::takeSema X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4c407791d527ba1e0f5ddb6135f2c69732777e8;p=clang unique_ptr-ify CompilerInstance::takeSema git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215321 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Frontend/CompilerInstance.h b/include/clang/Frontend/CompilerInstance.h index 44e91026ac..413c3600b5 100644 --- a/include/clang/Frontend/CompilerInstance.h +++ b/include/clang/Frontend/CompilerInstance.h @@ -459,7 +459,7 @@ public: return *TheSema; } - Sema *takeSema() { return TheSema.release(); } + std::unique_ptr takeSema() { return std::move(TheSema); } void resetAndLeakSema() { BuryPointer(TheSema.release()); } /// } diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index 9505c0769f..78d86d4b65 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -1684,7 +1684,7 @@ void ASTUnit::transferASTDataFromCompilerInstance(CompilerInstance &CI) { // created. assert(CI.hasInvocation() && "missing invocation"); LangOpts = CI.getInvocation().LangOpts; - TheSema.reset(CI.takeSema()); + TheSema = CI.takeSema(); Consumer.reset(CI.takeASTConsumer()); if (CI.hasASTContext()) Ctx = &CI.getASTContext();