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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 24 22:37:23 PDT 2018


MaskRay marked 2 inline comments as done.
MaskRay added inline comments.


================
Comment at: lib/Target/TargetMachine.cpp:43
 
-TargetMachine::~TargetMachine() {
-  delete AsmInfo;
-  delete MRI;
-  delete MII;
-  delete STI;
-}
+TargetMachine::~TargetMachine() {}
 
----------------
dblaikie wrote:
> Could use = default here?
In my understanding about an out-of-line destructor, it does not matter if `{}` or `= default` is used, either will make the destructor non-trivial. But I agree with you in that `= default;` looks better.


Repository:
  rL LLVM

https://reviews.llvm.org/D52389





More information about the llvm-commits mailing list