[PATCH] D52389: Use unique_ptr to hold AsmInfo,MRI,MII,STI

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 19:51:40 PDT 2018


dblaikie added inline comments.


================
Comment at: include/llvm/Target/TargetMachine.h:87-90
+  std::unique_ptr<MCAsmInfo> AsmInfo;
+  std::unique_ptr<MCRegisterInfo> MRI;
+  std::unique_ptr<MCInstrInfo> MII;
+  std::unique_ptr<MCSubtargetInfo> STI;
----------------
Should these be unique_ptr<const T> like the original that was const T*?


================
Comment at: lib/Target/TargetMachine.cpp:43
 
-TargetMachine::~TargetMachine() {
-  delete AsmInfo;
-  delete MRI;
-  delete MII;
-  delete STI;
-}
+TargetMachine::~TargetMachine() {}
 
----------------
Could use = default here?


Repository:
  rL LLVM

https://reviews.llvm.org/D52389





More information about the llvm-commits mailing list