rjmccall added inline comments.

Comment at: include/clang/AST/Expr.h:875
+  /// is set to true.
+  bool IsUnique = false;
rjmccall wrote:
> Humor me and pack this in the bitfields in Stmt, please. :)

Comment at: lib/CodeGen/CGExpr.cpp:4815
+    }
+  }
Oh!  So it's an interesting point that the RHS might be used as the result 
expression, which means its use might not really be unique anymore.  It happens 
to work in some sense for non-trivial C++ class types (when they're passed 
indirectly, as under the Itanium ABI) because the temporary outlives the call; 
on the other hand, the call is allowed to mutate its argument, and it's not 
clear that it's okay to have those mutations be reflected in code that's using 
the result of the assignment.  Similarly, managed types (like non-trivial C 
structs, or ARC pointers) might be consumed by the call; if we're going to pass 
them, perhaps we need to copy the value before doing so.

What do you think?

I think the technical implication is that what you're doing here shouldn't be 
necessary; the OVE arguably should not be unique if its value is used in 
multiple places, and that includes being used as a result.


cfe-commits mailing list

Reply via email to