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

endlessroad1991 at gmail.com endlessroad1991 at gmail.com
Thu Jan 10 00:35:29 PST 2013


Here's a updated patch. Solved several problems:
- Template(When type of the property is dependent) is now implemented.
- Property reference in class functions can be properly found.
- When property reference is used as array size(new
[])/var-initializer/array-base, it can be properly processed now. Add
CheckPlaceholderType(which calls checkPseudoObjectRValue) to these
situations.
- Better diagnostics messages, no more "assert"
- Other stuff completed, ASTStmtWriter/ASTStmtReader.

One problems left. After it's solved, I hope this patch can get into
mainline :-)
John - I have to comment out "assert(!ty->isDependentType());" in
PseudoOpBuilder::CanCaptureValueOfType to make postfix ++ work for the
attached cpp testcase. I don't understand what's it for, but just
commenting it out seems to make things work. However, Linus criticized a
kernel developer for just playing with magic numbers without knowing the
reason, so I think it's better to dig a little deeper.

Patch and a testcase attached.

-- 
Best Regards, Tong Shen (沈彤)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130110/d6714510/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: property.patch
Type: application/octet-stream
Size: 48376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130110/d6714510/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.cpp
Type: text/x-c++src
Size: 1401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130110/d6714510/attachment.cpp>


More information about the cfe-commits mailing list