[PATCH] D114235: [clang] Extend ParsedAttr to allow custom handling for type attributes

Martin Böhme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 19 04:38:56 PST 2021


mboehme created this revision.
mboehme added a reviewer: aaron.ballman.
mboehme added a project: clang.
mboehme requested review of this revision.
Herald added a subscriber: cfe-commits.

A typical use case would be to allow custom attributes for pointer types. See examples/Attribute/Attribute.cpp for an example.

Unfortuantely, it is hard to provide meaningful test coverage for this change.  The existing handleDeclAttribute() covered by lit tests for
attributes because multiple declaration attributes are marked 'SimpleHandler', which causes ClangAttrEmitter.cpp to generate a
handleDeclAttribute() handler for them.  However, all of the existing type attributes need custom semantic handling, so it is not possible to simply implement them with 'SimpleHandler'.

The modified Attribute.cpp example does at least demonstrate that it is possible to use the new API without any build errors, but this is all that it does.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114235

Files:
  clang/docs/ClangPlugins.rst
  clang/examples/Attribute/Attribute.cpp
  clang/include/clang/Sema/ParsedAttr.h
  clang/lib/Sema/SemaType.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114235.388462.patch
Type: text/x-patch
Size: 13385 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211119/cec0d70d/attachment-0001.bin>


More information about the cfe-commits mailing list