[PATCH] D105286: Fix memory leaks

Boleyn Su via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 1 08:07:33 PDT 2021


boleyn.su updated this revision to Diff 355887.
boleyn.su added a comment.

Fix a comiple error again :(


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105286/new/

https://reviews.llvm.org/D105286

Files:
  llvm/include/llvm/IR/PassManager.h


Index: llvm/include/llvm/IR/PassManager.h
===================================================================
--- llvm/include/llvm/IR/PassManager.h
+++ llvm/include/llvm/IR/PassManager.h
@@ -544,7 +544,7 @@
         detail::PassModel<IRUnitT, PassT, PreservedAnalyses, AnalysisManagerT,
                           ExtraArgTs...>;
 
-    Passes.emplace_back(new PassModelT(std::move(Pass)));
+    Passes.emplace_back(std::make_unique<PassModelT>(std::move(Pass)));
   }
 
   /// When adding a pass manager pass that has the same type as this pass


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105286.355887.patch
Type: text/x-patch
Size: 547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210701/34ce7268/attachment.bin>


More information about the llvm-commits mailing list