[PATCH] D117931: [Clang] Support `address_space` attribute in `#pragma clang attribute
Egor Zhdan via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 21 15:14:15 PST 2022
egorzhdan created this revision.
Herald added a reviewer: aaron.ballman.
Herald added a subscriber: jdoerfert.
egorzhdan requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This change adds support for type attributes (for example, `address_space`) in pragmas, so that the following code now compiles correctly:
#pragma clang attribute push (__attribute__ ((address_space(1))), apply_to=variable(is_global))
#pragma clang attribute pop
Since the attribute matching logic (`attr::SubjectMatchRule`) applies to an already constructed `Decl`, we first determine the declaration's type ignoring pragma attributes, then construct the `Decl`, and then recalculate its type if any type attribute was applied.
rG LLVM Github Monorepo
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 7854 bytes
Desc: not available
More information about the cfe-commits