[cfe-commits] [PATCH] CallExprs returning references can be lvalues

Zhongxing Xu xuzhongxing at gmail.com
Wed Jun 2 22:57:04 PDT 2010


This patch looks great. Do you have commit access? Or shall I commit it for
you?

On Thu, Jun 3, 2010 at 1:16 PM, Jordy Rose <jediknil at belkadan.com> wrote:

> On Thu, 3 Jun 2010 12:21:09 +0800, Zhongxing Xu <xuzhongxing at gmail.com>
> wrote:
> > One small suggestion: It's easier to review if each patch only solves
> one
> > specific problem. We'd like small patches that fix one well defined and
> > isolated problem.
>
> Thanks for the correction/reminder, my mistake. (Once again it's because I
> did the non-dependent part second.)
>
>
>
> > Comments below:
> >
> > Index: lib/Analysis/CFG.cpp
> > ===================================================================
> > --- lib/Analysis/CFG.cpp    (revision 105255)
> > +++ lib/Analysis/CFG.cpp    (working copy)
> > @@ -538,6 +538,15 @@
> >      addStmt(B->getRHS());
> >      return addStmt(B->getLHS());
> >    }
> > +  else if (B->isAssignmentOp()) {
> > +    if (asc.alwaysAdd()) {
> > +      autoCreateBlock();
> > +      AppendStmt(Block, B, asc);
> > +    }
> > +
> > +    addStmt(B->getRHS());
> >
> > Is it necessary to add all RHS of assignment expr as block-level expr?
>
> Ah. No, probably not. I was trying to imitate the default VisitStmt()
> behavior and change things as little as possible, but I must have gotten
> addStmt() and Visit() crossed in my mind. I'm not even sure the LHS needs
> to be addStmt()ed.
>
> Just so my understanding is clear: addStmt() / "always add" is only for
> statements that affect control-flow, correct?
>
> Revised patch attached, just for the crasher on "ref() = 0". Per advice
> I'll re-submit the second one once the first one's committed.
>
> Jordy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20100603/eb1303e9/attachment.html>


More information about the cfe-commits mailing list