[cfe-dev] [RFC] Preliminary patch to support MSVC __declspec(property)

endlessroad1991 at gmail.com endlessroad1991 at gmail.com
Mon Dec 10 19:52:17 PST 2012


Hi all, I've rewritten the __declspec(property) implementation,using
PseudoObject.

If you're comfortable with this patch, I'll work on tests, code-style, and
post it to cfe-commits.


On Fri, Dec 7, 2012 at 2:55 PM, John McCall <rjmccall at apple.com> wrote:

> On Dec 6, 2012, at 8:41 PM, "endlessroad1991 at gmail.com" <
> endlessroad1991 at gmail.com> wrote:
> > Yes, if we put it in CodeGen, we still have to do much work which is
> Sema's responsibility, and that's ugly.
> >
> > I looked into pseudo objects and ObjC property implementation.I see that
> set is handled in Sema::BuildBinOp(which calls
> Sema::checkPseudoObjectAssignment), and get is handled in
> Sema::CheckPlaceHolder, which is called in many places. And we are sure
> that L-Value property(thus set) won't be rewritten to getter call, because
> Sema::CheckPlaceHolder will only handle R-Value situations.
> >
> > Are these "deductions" correct? If so, I will reimplement property using
> pseudo objects.
> > Thanks for the info!
>
> Well, you would actually handle these in the functions that are *called*
> by those places, which are all in SemaPseudoObject.cpp.  But that's the
> basic idea.
>
> John.
>



-- 
Best Regards, Tong Shen (沈彤)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121211/fb187172/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v2.patch
Type: application/octet-stream
Size: 23432 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121211/fb187172/attachment.obj>


More information about the cfe-dev mailing list