[PATCH] D30009: Add support for '#pragma clang attribute'

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 18:09:52 PDT 2018


dexonsmith added a subscriber: erik.pilkington.
dexonsmith added a comment.

In https://reviews.llvm.org/D30009#1218647, @rsmith wrote:

> One consequence of this patch (see https://reviews.llvm.org/rL341002) is that adding documentation to an existing attribute //changes the behavior of Clang//. That does not seem acceptable to me: documentation improvements should not change which attributes we allow this pragma to appertain to.
>
> If we really want an "only documented attribtues can use this feature" rule (and I'm really not convinced that is a useful rule to enforce


I also don't quite see why this is useful.

> ), I think the best way to do that is to add another flag on the Attr instance in the .td file to opt the attribute out of `#pragma clang` support, opt out all the undocumented attributes, and add an error to TableGen if we find that an undocumented attribute has `#pragma clang` support enabled.

It seems arbitrary not to support an attribute from `#pragma clang attribute` just because it was once undocumented.  It does seem incrementally better, but still not great.

(FYI, @arphaman is on vacation until next week so he's unlikely to respond promptly.)


Repository:
  rL LLVM

https://reviews.llvm.org/D30009





More information about the llvm-commits mailing list