This is an archive of the discontinued LLVM Phabricator instance.

Use lld::make<T> to make TpiSource objects
ClosedPublic

Authored by ruiu on Nov 18 2019, 10:15 PM.

Details

Summary

In lld we rarely use std::unique_ptr but instead allocate new instances
using lld::make<T>() so that they are deallocated at the end of linking.
This patch changes existing code so that that follows the convention.

Diff Detail

Event Timeline

ruiu created this revision.Nov 18 2019, 10:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 18 2019, 10:15 PM
rnk accepted this revision.Nov 19 2019, 9:53 AM

lgtm

We make O(#objects) of these, and they live for the lifetime of the link.

lld/COFF/DebugTypes.h
35 ↗(On Diff #229974)

nit, but if you put the ctor and dtor out of line, you will achieve the object size saving goals of this LLVM coding guideline:
https://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers

This revision is now accepted and ready to land.Nov 19 2019, 9:53 AM
This revision was automatically updated to reflect the committed changes.
ruiu marked an inline comment as done.Nov 19 2019, 8:25 PM
ruiu added inline comments.
lld/COFF/DebugTypes.h
35 ↗(On Diff #229974)

Fixed before submitting. Thanks!