[cfe-dev] [RFC] Preliminary patch to support MSVC __declspec(property)
Francois Pichet
pichet2000 at gmail.com
Thu Dec 27 21:46:07 PST 2012
On Sat, Dec 22, 2012 at 10:11 AM, endlessroad1991 at gmail.com <
endlessroad1991 at gmail.com> wrote:
> Some guy from PathScale told me that AMP headers doesn't contain
> subscriptable property. And I looked at ATL headers, neither do they. So
> for these purposed, subscriptable property is not necessary.
> And I still think that subscriptable property is kind of messy...
> So I only implement non-subscriptable property.
>
> Brief:
> - Add a MSPropertyDecl, parallel to FieldDecl. Now property is separated
> from Field.
> - Add a MSPropertyRefExpr. It seems to be necessary, because we can't just
> create a PseudoObjectExpr.
>
> Current status:
> - Non-subscriptable property only.
> - Property can be inherited.
> - Get, Set, =, +=/-=/..., ++/-- works correctly.
> - Property type can be incomplete type, as function return type.
>
> Patch, and a "difficult" testcase attached.
> I'm quite happy with this version, because it's much simpler and cleaner.
> John - Thank you very much, for the MSPropertyDecl and PseudoObjectExpr
> tips. They are really crucial to this patch.
>
> --
> Best Regards, Tong Shen (沈彤)
>
>
Hi, 2 more comments:
I did test your patch against the C++ AMP headers which use the property
extensions.
+ // Use "scopeName" to store GetterName and "parmName" to store
SetterName
+ Attrs.addNew(Ident, Loc, GetterName, Loc, SetterName,
SourceLocation(),
+ 0, 0, AttributeList::AS_Declspec);
I don't think this is acceptable to reuse these variables for unrelated
purpose, you will need to find another way to pass the getter and setter
names. You might want to create a new addNew overload.
+
+template<typename Derived>
+ExprResult
+TreeTransform<Derived>::TransformMSPropertyRefExpr(MSPropertyRefExpr *E) {
+ llvm_unreachable("Shouldn't get here");
+}
This needs to be implemented. This code is triggered using property +
template.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121228/da4c6dea/attachment.html>
More information about the cfe-dev
mailing list