[PATCH] D51230: Use unique_ptr

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 12:08:47 PDT 2018


jgalenson created this revision.
jgalenson added a reviewer: pcc.
Herald added a subscriber: llvm-commits.

Is this the best way to create the MCInstrAnalysis?  Is there some way of reusing an existing one?


Repository:
  rL LLVM

https://reviews.llvm.org/D51230

Files:
  lib/Object/ELFObjectFile.cpp


Index: lib/Object/ELFObjectFile.cpp
===================================================================
--- lib/Object/ELFObjectFile.cpp
+++ lib/Object/ELFObjectFile.cpp
@@ -351,7 +351,8 @@
     default:
       return {};
   }
-  const auto *MIA = T->createMCInstrAnalysis(T->createMCInstrInfo());
+  std::unique_ptr<const MCInstrAnalysis> MIA(
+      T->createMCInstrAnalysis(T->createMCInstrInfo()));
   if (!MIA)
     return {};
   Optional<SectionRef> Plt = None, RelaPlt = None, GotPlt = None;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51230.162437.patch
Type: text/x-patch
Size: 499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180824/cce4b23c/attachment.bin>


More information about the llvm-commits mailing list