[cfe-dev] CFG temporary objects destructors

Marcin Świderski marcin.sfider at gmail.com
Sun Oct 17 15:06:39 PDT 2010


Hi

I'm currently working on modeling destructors of temporary objects in CFG.
I've attached patch with prototype implementation and some tests.

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.

- Marcin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101018/a1b0e758/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfg-temp-obj-dtor.patch
Type: application/octet-stream
Size: 16109 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101018/a1b0e758/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temp_dtors_test.cpp
Type: application/octet-stream
Size: 1103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101018/a1b0e758/attachment-0001.obj>


More information about the cfe-dev mailing list