[cfe-commits] [PATCH] Expressions have lvalues and rvalues
Zhongxing Xu
xuzhongxing at gmail.com
Wed Oct 15 06:41:26 PDT 2008
On Wed, Oct 15, 2008 at 3:39 PM, Ted Kremenek <kremenek at apple.com> wrote:
>
> On Oct 9, 2008, at 6:45 AM, Zhongxing Xu wrote:
>
> So I suggest when we evaluate expressions, we pass on an argument
>> indicating
>> whether we want to get its lvalue/rvalue, instead of specifying we are
>> getting a
>> LVal or NonLVal.
>>
>
> For casts:
>
> +void GRExprEngine::VisitCast(Expr* CastE, Expr* Ex, NodeTy* Pred, NodeSet&
> Dst,
> + bool asLValue) {
>
> NodeSet S1;
> QualType T = CastE->getType();
>
> - if (T->isReferenceType())
> - VisitLVal(Ex, Pred, S1);
> + if (asLValue || T->isReferenceType())
> + VisitLValue(Ex, Pred, S1);
> else
> Visit(Ex, Pred, S1);
>
> Is there a case where a cast should evaluate to an lvalue? I don't see
> VisitCast called with "asLValue" being true.
>
I will remove this 'asLValue'.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20081015/537bab19/attachment.html>
More information about the cfe-commits
mailing list