]> granicus.if.org Git - clang/commitdiff
unique_ptrify clang::BackendConsumer::takeModule
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 05:08:19 +0000 (05:08 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 05:08:19 +0000 (05:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216707 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CodeGenAction.cpp

index 73066a95b2e3c6247c7fd3778e150f69360f272f..fe46fc78d135b778db8a18beb2984cc05bfc4600 100644 (file)
@@ -72,7 +72,7 @@ namespace clang {
       llvm::TimePassesIsEnabled = TimePasses;
     }
 
-    llvm::Module *takeModule() { return TheModule.release(); }
+    std::unique_ptr<llvm::Module> takeModule() { return std::move(TheModule); }
     llvm::Module *takeLinkModule() { return LinkModule.release(); }
 
     void HandleCXXStaticMemberVarInstantiation(VarDecl *VD) override {
@@ -576,7 +576,7 @@ void CodeGenAction::EndSourceFileAction() {
     BEConsumer->takeLinkModule();
 
   // Steal the module from the consumer.
-  TheModule.reset(BEConsumer->takeModule());
+  TheModule = BEConsumer->takeModule();
 }
 
 std::unique_ptr<llvm::Module> CodeGenAction::takeModule() {