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

endlessroad1991 at gmail.com endlessroad1991 at gmail.com
Sat Mar 23 04:34:49 PDT 2013


Hi all,
Here's an updated version of property patch, based on clang 3.2 release.
Changes:
- Add tests in Parser and Sema
- Fix warnings
- Fix property reference expr serialization/deserialization bug
- Fix property reference of base-class property, like SuperClass::V

I have been using this patch on a quite large and complex codebase for over
a month, including the following situations:
- normal property definition and get/set
- property reference in almost everywhere: binary-op operand, array-size,
function call arguments, var initializer, etc
- both implicit(this) and explicit property reference
- property whose type is dependent
- reference of property of super-class
- headers are compiled into .pch files, and then used by source files(it
proves serialization/deserialization works fine)
For now I haven't found any problems.

I believe it's stable enough.
So would some clang developer take a final look at this, and try merging it
into trunk?
Thank you very much.

On Fri, Mar 22, 2013 at 8:42 PM, Will Wilson <will at indefiant.com> wrote:

> Tong Shen et al,
>
> What's the current status of this patch? I ask as I'm encountering quite a
> few examples of MSVC properties in code right now and it's causing
> something of a headache to workaround. It would be great to see even basic
> parsing support for it for now.
>
> - Will.
>
>
> On 10 January 2013 15:39, Aaron Ballman <aaron at aaronballman.com> wrote:
>
>> I should also note that I'm seeing a couple of warnings in your patch as
>> well:
>>
>> warning C4062: enumerator 'MSProperty' in switch of enum
>> 'clang::Decl::Kind' is not handled
>> C:\llvm\llvm\tools\clang\tools\libclang\CIndex.cpp 4545
>>
>> warning C4062: enumerator 'MSPropertyRefExprClass' in switch of enum
>> 'clang::Stmt::StmtClass' is not handled
>> C:\llvm\llvm\tools\clang\tools\libclang\CXCursor.cpp 486
>>
>> ~Aaron
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>
>
>
> --
> *Indefiant Ltd.*
> *
> *
> Firsby Lodge, New Main Road, Scamblesby, Louth, Lincs LN11 9XH UK
> *Tel: +44 20 8123 7663 England Registered No. 07936820 VAT No. **128556202
> *
>



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


More information about the cfe-commits mailing list