This is the mail archive of the
mailing list for the GCC project.
Re: [Patch] Add "unavailable" attribute [ObjC V1 prerequisite].
On 16 Apr 2010, at 23:56, Paolo Bonzini wrote:
On 04/17/2010 12:27 AM, H.J. Lu wrote:
On Fri, Apr 16, 2010 at 3:13 PM, Paolo Bonzini<firstname.lastname@example.org>
On 04/16/2010 08:57 PM, IainS wrote:
+ if (TREE_UNAVAILABLE (member))
+ error_unavailable_use (member, NULL_TREE);
+ else if (TREE_DEPRECATED (member))
warn_deprecated_use (member, NULL_TREE);
warn_deprecated_use is actually called only with the second
So this means that you're effectively always looking up the
can then use just one flag bit, and in warn_deprecated_use (maybe
diagnose_deprecated_use?) do either the deprecation warning or the
unavailability error. (Maybe you can also pass the
deprecated_state to it,
or something like that).
Effectively, TREE_DEPRECATED will mean "deprecated or
should widely reduces the code duplication. (I haven't thought
type_is_unavailable and how to eliminate that duplication, but
hey, I don't
want to ruin the fun...)
Is that possible to combine unavailable_flag and deprecated_flag
into one flag?
That's what I wrote, yes. unavaiable_flag and deprecated_flag are
just shortcuts for the presence of the attribute.
At the moment I'm thinking two bits of "AVAILABILITY"
0 = OK
1 = NOT_RECOMMENDED
2 = DEPRECATED
3 = UNAVAILABLE
seem like a reasonable way forward
I'll then factor the rest of the code to use that.