This is an archive of the discontinued LLVM Phabricator instance.

[Analyzer] Correctly handle parameters passed by reference when bodyfarming std::call_once
ClosedPublic

Authored by george.karpenkov on Oct 17 2017, 6:10 PM.

Details

Summary

Also explicitly do not support functors for now, since that entails figuring out which call operator corresponds to the passed parameters.
Resolution: we really should not do body farming for templated C++ functions, even in seemingly trivial cases!

Diff Detail

Repository
rL LLVM

Event Timeline

danielmarjamaki added a subscriber: danielmarjamaki.

Stylistically this looks pretty good to me. Just a minor nit.

lib/Analysis/BodyFarm.cpp
389 ↗(On Diff #119415)

ehm.. I would remove this blank

dcoughlin accepted this revision.Oct 20 2017, 10:59 AM

Some nits inline, but looks good to me!

lib/Analysis/BodyFarm.cpp
388 ↗(On Diff #119415)

Nit: 'i' doesn't match the naming conventions and it is not particularly descriptive. Perhaps "ParamIndex"?

391 ↗(On Diff #119415)

Nit: You can move PTy inside the if block so it is not calculated when it is not needed.

This revision is now accepted and ready to land.Oct 20 2017, 10:59 AM
george.karpenkov marked 3 inline comments as done.Oct 20 2017, 4:27 PM
This revision was automatically updated to reflect the committed changes.