This is an archive of the discontinued LLVM Phabricator instance.

[PartialInlining] Replace delete with unique_ptr in computeCallsiteToProfCountMap
ClosedPublic

Authored by vitalybuka on May 15 2017, 4:12 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

vitalybuka created this revision.May 15 2017, 4:12 PM
vsk added a subscriber: vsk.May 16 2017, 7:29 AM
vsk added inline comments.
lib/Transforms/IPO/PartialInlining.cpp
576 ↗(On Diff #99079)

IMHO the code that uses the BFI should be moved into a separate function which accepts a BFI reference. On the "!GetBFI" path, you'd make_unique a BFI and pass it into a helper. Else, you'd pass in "&(*GetBFI)(*Caller)".

(On an unrelated note, I find "&(*GetBFI)(*Caller)" pretty hard to read...)

Should I abandon it?

davidxl accepted this revision.May 26 2017, 5:32 PM

The code will be simplified (with related code removed) once the new PM is the default, but I don't see harm to change this way. lgtm

This revision is now accepted and ready to land.May 26 2017, 5:32 PM
This revision was automatically updated to reflect the committed changes.