[cfe-dev] Consumed analysis resets its state in between CFG blocks

Manuel Klimek klimek at google.com
Sat May 3 08:38:11 PDT 2014


Heya,

I am currently playing around with how the CFG looks in the face of
temporary destructors; one interesting tidbit is that temporary destructors
insert CFG blocks in places where one might not have expected them - for
example, before the call to an arbitrary destructor at the end of a full
expression.

Now the consumed analysis kills it state unconditionally at the end of each
block:
http://reviews.llvm.org/diffusion/L/browse/cfe/trunk/lib/Analysis/Consumed.cpp;207914$1400
This leads to missed warnings when we leave a CFG block in the middle of an
expression, and in general feels very brittle regarding future changes to
the CFG's layout.

I was wondering whether there are already mechanisms in the CFG to deal
with issues like this (I'd have expected a consumed analysis to work on the
scope of a variable instead of arbitrary block boundaries - for example,
could we use REGISTER_MAP_WITH_PROGRAMSTATE?).

Thoughts?
/Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140503/9c536e14/attachment.html>


More information about the cfe-dev mailing list