Page MenuHomePhabricator

[LifetimeAnalysis] Add support for free functions

Authored by xazax.hun on Aug 15 2019, 9:14 AM.



This patch adds support to the idiom when people using the free version of begin, end and the like instead of the member functions. Moreover, some containers, like any or variant only support this idiom.

Once this patch is accepted we do not anticipate adding more hard coded rules. Hopefully, they will all be subsumed by function annotations in the future.

Diff Detail


Event Timeline

xazax.hun created this revision.Aug 15 2019, 9:14 AM
mgehre added inline comments.Aug 15 2019, 1:47 PM
6622 ↗(On Diff #215413)

Maybe move the Callee->getNumParams() == 1 check from the caller into this function so it's obvious that getParamDecl(0) is allowed?

gribozavr accepted this revision.Aug 20 2019, 1:43 AM
This revision is now accepted and ready to land.Aug 20 2019, 1:43 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 20 2019, 9:48 AM
xazax.hun marked 2 inline comments as done.Aug 20 2019, 10:29 AM
xazax.hun added inline comments.
6622 ↗(On Diff #215413)

Thanks, I addressed this one before committing.