]> granicus.if.org Git - clang/commitdiff
unique_ptr-ify CompilerInstance::takeSema
authorDavid Blaikie <dblaikie@gmail.com>
Sun, 10 Aug 2014 19:14:48 +0000 (19:14 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Sun, 10 Aug 2014 19:14:48 +0000 (19:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215321 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/CompilerInstance.h
lib/Frontend/ASTUnit.cpp

index 44e91026acb53d7e8067765e4520b739d395e962..413c3600b5013c6bf780962bb1e621a32bcf7dab 100644 (file)
@@ -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()); }
 
   /// }
index 9505c0769fedc21ed841a93e22f4c9469ddf7ed0..78d86d4b6533caf1efefde375b112c85f98077e1 100644 (file)
@@ -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();