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

Miles Bader miles at gnu.org
Mon Sep 26 01:58:53 PDT 2011


Konstantin Tokarev <annulen at yandex.ru>
writes:
> Qt is not "a specific GUI library". It's framework for C++ development which
> could be used to develop large range of applications including GUI and
> non-GUI ones.

Er, .... let's be practical though: these language extensions are _in
practice_ only used by this particular GUI framework/library/
call-it-what-you-will.

>> Wouldn't some sort of generic mechanism be more desirable?
>
> OK, could you recommend better way to mark methods in "signals" and
> "slots" sections with specific attributes without significant
> performance loss?

Since your basic goal seems to simply adding new attributes, which are
then stored in the AST, and can be tested for, why not instead a
implement a feature that allows new attributes to be added at runtime?

E.g.,

   #pragma add_attribute oinkarific type

adds the "oinkarific" type attribute.

[Since attributes are a feature shared with gcc, it would be good to
add this in a way that's not inherently clang-specific, so gcc could
later add a similar feature if desired without too much ugliness.]

-Miles

-- 
Arrest, v. Formally to detain one accused of unusualness.




More information about the cfe-dev mailing list