r215321 - unique_ptr-ify CompilerInstance::takeSema

David Blaikie dblaikie at gmail.com
Sun Aug 10 12:14:48 PDT 2014


Author: dblaikie
Date: Sun Aug 10 14:14:48 2014
New Revision: 215321

URL: http://llvm.org/viewvc/llvm-project?rev=215321&view=rev
Log:
unique_ptr-ify CompilerInstance::takeSema

Modified:
    cfe/trunk/include/clang/Frontend/CompilerInstance.h
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/include/clang/Frontend/CompilerInstance.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CompilerInstance.h?rev=215321&r1=215320&r2=215321&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CompilerInstance.h (original)
+++ cfe/trunk/include/clang/Frontend/CompilerInstance.h Sun Aug 10 14:14:48 2014
@@ -459,7 +459,7 @@ public:
     return *TheSema;
   }
 
-  Sema *takeSema() { return TheSema.release(); }
+  std::unique_ptr<Sema> takeSema() { return std::move(TheSema); }
   void resetAndLeakSema() { BuryPointer(TheSema.release()); }
 
   /// }

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=215321&r1=215320&r2=215321&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Sun Aug 10 14:14:48 2014
@@ -1684,7 +1684,7 @@ void ASTUnit::transferASTDataFromCompile
   // 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();





More information about the cfe-commits mailing list