On May 30, 2010, at 12:46 AM, Jordy Rose wrote:

> 3. LazyCompoundVal is LazyCompoundVal...i.e. I don't fully understand what
> circumstances they're used in. On the other hand, if I understand
> correctly, things with compound values should never have direct bindings
> /other/ than LazyCompoundVal.

LazyCompoundVals are used to represent assignment of compound literals or 
struct copies to a struct variable without having to explicitly copy the 
bindings, e.g.:

  struct S { int x, y; };
  ...
  struct S A = { 0, 0 };
  A.y = foo();
  ...
  struct S B = A;

In the struct copy, instead of doing a separate binding for each field of B, we 
just say the 'B' has the same value as 'A', but with the values of 'A' at the 
time of the assignment.  The "lazy" aspect is that the values for B are defined 
lazily by looking at the values of A.


_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to