Fix Mem leak in LLVMTargetMachine.cpp
authorWang, Xin10 <xin10.wang@intel.com>
Wed, 12 Apr 2023 09:26:00 +0000 (05:26 -0400)
committerWang, Xin10 <xin10.wang@intel.com>
Wed, 12 Apr 2023 09:27:04 +0000 (05:27 -0400)
commitb00fc5ac995b982909e685439f3d5cef86b4bed6
tree95c829e8d9c742455a3d57ed933a205f12125d97
parentea3e8d3b5ab4869c2895c25666b0008e94c6e31d
Fix Mem leak in LLVMTargetMachine.cpp

If we go to line 302, with one of MCE or MAB is not nullptr, then we could
leak mem here.
Use unique_ptr to maintain these 2 pointer can avoid it.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D148003
llvm/lib/CodeGen/LLVMTargetMachine.cpp