Currently, all attributes are expected to have unique spellings.
However, this does not meet our needs for target-specific attributes,
which really only exist for a given target. For instance, ARM and
MSP430 both have an attribute spelled "interrupt", but with different
arguments.

This was previously handled by making the attributes have no spelling
whatsoever, and doing string comparisons when the target was asked
about the attribute. However, that does not work with things like
__has_attribute and is non-tenable.

This patch exposes a "ParseKind" member for target-specific attributes
that lets distinct attributes share a common spelling. The attributes
will be given a common parsed attribute enumeration (the AT_* enum),
but retain a distinct Attr subclass. It then uses this functionality
to handle the ARM and MSP430 interrupt attributes, and adds new tests
to ensure the attributes are applied appropriately based on target.

~Aaron

Attachment: AttrNames.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to