[PATCH] D33904: Add a __has_attribute_enhancement macro to clang

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 5 11:31:38 PDT 2017


george.burgess.iv created this revision.
Herald added a subscriber: javed.absar.

Attributes may gain features or added flexibility over time. This patch aims to add a simple and uniform way to directly add/query for arbitrary changes in attributes, instead of having to rely on other information (e.g. version numbers, the existence of other attributes added at around the same time as the feature you're interested in, ...).

The only user of this at the moment will be https://reviews.llvm.org/D32332, so I won't tag people for review here until that lands.

Better words than "enhancement" are welcome; I tried things like `__has_attribute_extension` and `__has_attribute_feature`, but we also have both `__has_extension` and `__has_feature`, so... :)


https://reviews.llvm.org/D33904

Files:
  docs/LanguageExtensions.rst
  include/clang/Basic/Attr.td
  include/clang/Basic/Attributes.h
  include/clang/Lex/Preprocessor.h
  lib/Basic/Attributes.cpp
  lib/Lex/PPMacroExpansion.cpp
  test/Preprocessor/has_attribute.c
  utils/TableGen/ClangAttrEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33904.101433.patch
Type: text/x-patch
Size: 21353 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170605/b5d6b5c8/attachment-0001.bin>


More information about the cfe-commits mailing list