[cfe-dev] Possible bug in check::RegionChanges

Krzysztof Wiśniewski via cfe-dev cfe-dev at lists.llvm.org
Mon Sep 19 10:33:27 PDT 2016


I've been working on new checker that registers for region change update.
Together with Artem Dergachev, we noticed that the function
*wantsRegionChangeUpdate *never seems to be called. The heavy work
necessary to fill data structures for *checkRegionChanges *is being done
regardless of it in *ProgramState::invalidateRegionsImpl.* The
documentation for *checkRegionChanges* says the following:
"Note that this callback will not be invoked unless wantsRegionChangeUpdate
returns true"
 and for *wantsRegionChangeUpdate:*
"Since it is not necessarily cheap to compute which regions are being
changed, this allows the analyzer core to skip the more expensive
*checkRegionChanges* when no checkers are tracking any state."

My question is whether someone can confirm that this is indeed an invalid
behavior? For me it looks like it used to work differently and at some
point someone changed the logic rendering *wantsRegionChangeUpdate *useless.
If this indeed is a bug, I suggest we might wish to consult *CheckerManager
* in *ProgramState::invalidateRegionsImpl*  whether there is some one
checker registered for an update and only then prepare the input data in
order to improve performance.

Kind regards,
Krzysztof Wiśniewski
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160919/9d8e2f73/attachment.html>

More information about the cfe-dev mailing list