diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-01-21 02:08:36 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2011-01-21 02:08:36 +0000 |
commit | a97d70b7ea9633e8cbf976510d7a9ea66f4ac96c (patch) | |
tree | 222867072bc5b62454075029a4b69ad3bacf0c4b /include/clang/Basic/AttrKinds.h | |
parent | 00d66cce52cf027eac77591a9847f87dacf36995 (diff) |
Generalise support for non-inheritable attributes
Inheritable attributes on declarations may be inherited by any later
redeclaration at merge time. By contrast, a non-inheritable attribute
will not be inherited by later redeclarations. Non-inheritable
attributes may be semantically analysed early, allowing them to
influence the redeclaration/overloading process.
Before this change, the "overloadable" attribute received special
handling to be treated as non-inheritable, while all other attributes
were treated as inheritable. This patch generalises the concept,
while removing a FIXME. Some CUDA location attributes are also marked
as non-inheritable in order to support special overloading semantics
(to be introduced in a later patch).
The patch introduces a new Attr subclass, InheritableAttr, from
which all inheritable attributes derive. Non-inheritable attributes
simply derive from Attr.
N.B. I did not review every attribute to determine whether it should
be marked non-inheritable. This can be done later on an incremental
basis, as this change does not affect default functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123959 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/AttrKinds.h')
-rw-r--r-- | include/clang/Basic/AttrKinds.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/clang/Basic/AttrKinds.h b/include/clang/Basic/AttrKinds.h index 822573b734..65c4f98c95 100644 --- a/include/clang/Basic/AttrKinds.h +++ b/include/clang/Basic/AttrKinds.h @@ -21,6 +21,7 @@ namespace attr { // Kind - This is a list of all the recognized kinds of attributes. enum Kind { #define ATTR(X) X, +#define LAST_INHERITABLE_ATTR(X) X, LAST_INHERITABLE = X, #include "clang/Basic/AttrList.inc" NUM_ATTRS }; |