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

John McCall rjmccall at apple.com
Thu Dec 6 22:55:18 PST 2012


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.



More information about the cfe-dev mailing list