<div dir="ltr"><br><br>
<div class="gmail_quote">On Fri, Oct 10, 2008 at 4:52 PM, wasti <span dir="ltr"><<a href="mailto:sebastian.redl@getdesigned.at">sebastian.redl@getdesigned.at</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>On Thu, 9 Oct 2008 22:21:47 -0700, Chris Lattner <<a href="mailto:clattner@apple.com">clattner@apple.com</a>><br>
wrote:<br>
<div class="Ih2E3d">> On Oct 9, 2008, at 8:07 AM, Sebastian Redl wrote:<br>><br>>> Zhongxing Xu wrote:<br>>>> We have two kinds of RVal: LVal and NonLVal. LVal represents location<br>>>> value,<br>
>>> NonLVal represents non-location value.<br>>> All other considerations aside, this terminology is a spawn of the<br>>> deepest hell and must be eradicated. Rvalue/lvalue considerations are<br>>> complicated enough without messing them up this way.<br>
><br>> Sebastian, please be civil here - we attempt to maintain a positive<br>> and helpful community.  What are you getting at? What do you suggest?<br><br></div>I'm sorry. But I've always learned that rvalues and lvalues are strictly<br>
opposed. The statement above thus is illogical - rvals cannot be lvals or<br>non-lvals. Non-lvals *are* rvals. Values can be lvalues or rvalues.<br>Anything else is opposed to the terminology the C++ standard (at least)<br>
uses and can only bring chaotic confusion. In a few months, nobody will be<br>able to understand the code in question anymore.<br><br>In fact, something I've noticed in the code of Clang is that rvalues and<br>lvalues are not seen as strictly distinct, probably because this<br>
distinction is not that important in C. In C++, with references and (in<br>C++0x) rvalue vs lvalue references, with complicated rules about which<br>temporaries can be elided that also partially depend on rvalue vs lvalue<br>
issues, this distinction feels very important to me. In writing code (and<br>thinking about code to write) for validation of the C++ cast operators, I<br>have felt the lack of a clear distinction as something that made my code<br>
harder to understand.<br><br>I will look at the code to give some concrete suggestions as soon as I can.<br>However, I just started a new job, and my life is somewhat hectic at the<br>moment.<br></blockquote>
<div>In static analysis, when an expression is on the LHS of an assignment statement, we want to get the storage location it represents, I call it lvalue of the expression. When an expression is on the RHS of an assignment statement, we want to get its value in the normal sense, I call it the rvalue of the expression. If such terminology should cause confusion, I am OK to change the terminology.</div>

<div> </div>
<div>Talking about the abstract values occuring in the static analysis, we divide them into two categories: LVal and NonLVal. LVal represents some kind of abstract location value, that is some address. NonLVal represent non-location value.</div>

<div> </div>
<div>So an expression's lvalue must be LVal, while its rvalue might be either LVal or NonLVal.</div>
<div> </div>
<div>The terminologies used here are not intended to be strictly consistent with the C/C++ standard. Because we are not doing codegen, but doing static analysis - symbolically simulating the execution of the program.</div>
</div></div>