This factors cost and reporting out of the inlining workflow, thus
making it easier to reuse when driving inlining from the upcoming
InliningAdvisor.
Depends on: D79215
Differential D79275
[llvm][NFC] Inliner: factor cost and reporting out of inlining process mtrofin on May 1 2020, 4:04 PM. Authored by
Details This factors cost and reporting out of the inlining workflow, thus Depends on: D79215
Diff Detail
Event Timeline
Comment Actions so there will be a follow up refactoring to move the DoInline lamda into a standalone helper?
Comment Actions Looks good to me (I'd probably have pulled it out into a separate function in one go (as it stands the code feels awkwardly complicated - creating a lambda for just one caller - I generally try to make the code self-consistent/justified with each commit, insofar as that's possible) but given you're headed that way, whichever way you find best to get there seems OK) |
If you don't need to mutate it, you can pass DebugLoc by value (quick grep across llvm/include shows that to be quite common) - it's small/cheap to copy.
& changes like this can just be committed for post-commit review
(ah, I see what motivated you to fix/change this - your new/changed callsite, that passes a const& DebugLoc... *goes over there to comment*)