[cfe-commits] r123959 - in /cfe/trunk: include/clang/AST/Attr.h include/clang/Basic/Attr.td include/clang/Basic/AttrKinds.h lib/Sema/SemaDecl.cpp lib/Serialization/ASTReaderDecl.cpp lib/Serialization/ASTWriter.cpp
Enea Zaffanella
zaffanella at cs.unipr.it
Wed Jan 26 01:41:47 PST 2011
Il 21/01/2011 03:08, Peter Collingbourne ha scritto:
> Author: pcc
> Date: Thu Jan 20 20:08:36 2011
> New Revision: 123959
>
> URL: http://llvm.org/viewvc/llvm-project?rev=123959&view=rev
> Log:
> Generalise support for non-inheritable attributes
[...]
> The patch introduces a new Attr subclass, InheritableAttr, from
> which all inheritable attributes derive. Non-inheritable attributes
> simply derive from Attr.
[...]
> - bool isInherited() const { return Inherited; }
Why removing this query method from the base class Attr?
May I suggest to make it virtual (with a default implementation
returning false) and then override it in InheritableAttr?
Otherwise, a client going through the list of all attributes (such as a
pretty printer) will have to manually do some RTTI just to know if the
attribute was written in the sources.
Enea.
More information about the cfe-commits
mailing list