[cfe-dev] CFG temporary objects destructors
Zhongxing Xu
xuzhongxing at gmail.com
Fri Oct 22 22:41:46 PDT 2010
2010/10/23 Ted Kremenek <kremenek at apple.com>
> On Oct 17, 2010, at 3:06 PM, Marcin Ĺwiderski wrote:
>
> > 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.
>
> What we could do is generalize terminators in the same way we did with
> CFGElements. Right now terminators are Stmt*, but they could be something
> like CFGTerminator, which could discriminate between regular terminators and
> those used for blocks guarding destructor calls. The CFGTerminator for
> those blocks could essentially be the same Stmt* as the terminator guarding
> the block with the constructor, but with a special bit indicating it is for
> the matching destructor(s). The nice thing about this approach is that it
> naturally ties the two blocks together, they can share the same condition
> values, etc.
We need a way to convey the branch information to the second logical op used
as terminator. At first we bind logical op to a UndefinedVal which indicates
which branch is taken. Then the logical op is bound to its real value. At
the second terminator where the logical op appears, we still need the taken
branch information to decide which branch to take.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20101023/312be4a7/attachment.html>
More information about the cfe-dev
mailing list