This is an archive of the discontinued LLVM Phabricator instance.

[NFC][clang] Replace raw new/delete with unique_ptr to store ABIInfo in TargetCodeGenInfo
ClosedPublic

Authored by jasonliu on Apr 28 2020, 12:23 PM.

Details

Summary

Use unique_ptr to manage the lifetime of ABIInfo member inside TargetCodeGenInfo.

Diff Detail

Event Timeline

jasonliu created this revision.Apr 28 2020, 12:23 PM
clang/lib/CodeGen/TargetInfo.h
51

I'm not sure removing a virtual destructor is a good idea. The use of delete in relation to TargetCodeGenInfo (and derived class) pointers would need to be checked.

jasonliu updated this revision to Diff 260746.Apr 28 2020, 1:26 PM

Provide default virtual destructor.

jasonliu marked an inline comment as done.Apr 28 2020, 1:26 PM
jasonliu updated this revision to Diff 260766.Apr 28 2020, 2:07 PM

Funny that it's the front-end code that this patch makes more C++11 after so many years. LGTM; thanks.

This revision is now accepted and ready to land.Apr 28 2020, 3:19 PM
This revision was automatically updated to reflect the committed changes.