Page MenuHomePhabricator

[StaticAnalyzer] Move inline counter increaser to inlineCall function
ClosedPublic

Authored by szepet on Apr 18 2017, 10:44 AM.

Details

Summary

Even though the shouldInlineCall function returns true, it can happen that the function is not going to be inlined (as it can be seen at line 913 and below).

Moved the bumpNumTimesInlined(D) (the counter increaser) call to the inlineCall function where it logically belongs.

Diff Detail

Event Timeline

szepet created this revision.Apr 18 2017, 10:44 AM
szepet edited the summary of this revision. (Show Details)Apr 18 2017, 10:46 AM
NoQ edited edge metadata.Apr 27 2017, 8:22 AM

Yep, this sounds logical!

I wonder how hard would it be to come up with a test for this. Like, we could set -analyzer-config max-times-inline-large to 2, and then call some large function in a loop with a bug that only manifests in the context of the 4th iteration of the loop.

Because this is a heuristic that controls the analyzer's bail-outs, did you accidentally try to see if the fix actually improves the analyzer's efficiency (in terms of bugs-per-minute, for example)?

zaks.anna edited edge metadata.Apr 28 2017, 12:04 AM

Looks good to me as well. Thanks!

zaks.anna accepted this revision.May 9 2017, 11:24 PM

I am fine to land this without a test. @szepet, Do you have commit access or should we commit on your behalf?

This revision is now accepted and ready to land.May 9 2017, 11:24 PM
This revision was automatically updated to reflect the committed changes.