[PATCH] D15174: [MSVC] Fix for http://llvm.org/PR25636: indexed accessor property not supported correctly.

John McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 4 01:00:53 PST 2015


rjmccall added a comment.

In http://reviews.llvm.org/D15174#302248, @ABataev wrote:

> John,
>  the result is always the result of Put operation. For pre-increment we 
>  have to return new value, for the post-increment - previous value 
>  returned by Get (checked it on MSVC).
>  So, currently postincrement works correctly, pre-increment and 
>  assignment not. For pre-increment and assignment we have to capture the 
>  result of Put operation as a result.
>  It means, that in your solution we need to modify
>
> buildAssignmentOperation() and buildIncDecOperation() and the worst thing is that these functions must be changed only for MSPropertySubscriptExpr.


Just property subscripts and not MS property references in general?

Fortunately, PseudoOpBuilder is already a dynamic class with expression-specific subclasses, so hooking these processes is quite easy; you should be able to just add a virtual method which tells them whether the result of these compound operations should be the value that's passed to the setter or the formal result of the setter.  Something like this:

  virtual bool useSetterResultAsExprResult() const { return false; }

If that returns false, they should try to capture the set value as the result; otherwise, they should try to capture the setter result.


http://reviews.llvm.org/D15174





More information about the cfe-commits mailing list