[cfe-dev] CFG temporary objects destructors

Ted Kremenek kremenek at apple.com
Wed Oct 20 21:45:34 PDT 2010


On Oct 17, 2010, at 3:06 PM, Marcin Świderski wrote:

> After some thinking I've decided to add additional step with forward traversing of AST for every CXXExprWithTemporaries node. During this step destructors are added to CFG for every CXXBindTemporaryExpr (with special case for binding const reference to temporary). However I have a problem with branching for destructors that have to be called conditionaly. Blocks structure that is constructed is fine, but I don't know what to use for terminator of block initiating the branch and for first element in block closing the branch (I didn't check this yet, but I think that it could be used during backward analysis). Could I use fake if/else statement for this? Similar solution is used to make every declaration into separate statement.

I think I understand what you are getting at, but could you provide a code example to illustrate?



More information about the cfe-dev mailing list