[cfe-dev] Proposal: parsing Qt signals/slots with attributes

Chris Lattner clattner at apple.com
Mon Sep 26 13:52:52 PDT 2011


On Sep 26, 2011, at 7:02 AM, Konstantin Tokarev wrote:
> 26.09.2011, 15:04, "David Chisnall" <csdavec at swan.ac.uk>:
> 
>>  It would help if you could explain what you want to use these attributes for (i.e. why would clang supporting them in the parser help you).  The IBAction / IBOutlet support is there to allow the various ad-hoc Objective-C parsers that understood these macros to continue to understand them when switching to libclang.  What tools does Qt use that need to understand these annotations?
> 
> "signals" and "slots" annotations are currently used by Meta-Object Compiler (code generating tool which is part of Qt).
> 
> Attribute-based annotations will be used by Qt Creator to provide code completetion, and it can be used in other tools (e.g. code analysis tools) which need to inspect Qt code and use advanced Clang capabilities in the same time.

I haven't looked at the patch in question, but it seems reasonable to add some sort of qt_foobar attribute if it substantially improves QT development.

Random thought experiment: would it be possible to kill off MOC entirely (at least when building with Clang)?

-Chris



More information about the cfe-dev mailing list