From 9c3e84ffe0938cd6a73dd16d9a8b54b498863fef Mon Sep 17 00:00:00 2001 From: Sean Hunt Date: Thu, 17 Jun 2010 01:51:32 +0000 Subject: [PATCH] Comment Attr.td so people have a better understanding of what goes on. Also removed the unused Aliases member. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106202 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/Attr.td | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td index 417faf3a27..2b4e5c3a4a 100644 --- a/include/clang/Basic/Attr.td +++ b/include/clang/Basic/Attr.td @@ -4,6 +4,10 @@ // be reached at rideau3@gmail.com. //////////////////////////////////////////////////////////////////////////////// +// An attribute's subject is whatever it appertains to. In this file, it is +// more accurately a list of things that an attribute can appertain to. All +// Decls and Stmts are possibly AttrSubjects (even though the syntax may not +// allow attributes on a given Decl or Stmt). class AttrSubject; include "clang/Basic/DeclNodes.td" @@ -18,7 +22,6 @@ include "clang/Basic/StmtNodes.td" // The code fragment is a boolean expression that will confirm that the subject // meets the requirements; the subject will have the name S, and will have the // type specified by the base. It should be a simple boolean expression. - class SubsetSubject : AttrSubject { AttrSubject Base = base; @@ -26,6 +29,8 @@ class SubsetSubject code CheckCode = check; } +// This is the type of a variable which C++0x defines [[aligned()]] as being +// a possible subject. def NormalVar : SubsetSubjectgetStorageClass() != VarDecl::Register && S->getKind() != Decl::ImplicitParam @@ -36,6 +41,7 @@ def CXXVirtualMethod : SubsetSubjectisBitField()}]>; +// A single argument to an attribute class Argument { string Name = name; } @@ -49,20 +55,29 @@ class ObjCInterfaceArgument : Argument; class UnsignedIntArgument : Argument; class UnsignedIntOrTypeArgument : Argument; +// An integer argument with a default value class DefaultIntArgument : IntArgument { int Default = default; } +// Zero or more arguments of a type class VariadicArgument : Argument { Argument VariadicArg = arg; } class Attr { + // The various ways in which an attribute can be spelled in source list Spellings; + // The things to which an attribute can appertain list Subjects; + // The arguments allowed on an attribute list Args = []; + // The namespaces in which the attribute appears in C++0x attributes. + // The attribute will not be permitted in C++0x attribute-specifiers if + // this is empty; the empty string can be used as a namespace. list Namespaces = []; - list Aliases = []; + // A temporary development bit to tell TableGen not to emit certain + // information about the attribute. bit DoNotEmit = 1; } -- 2.50.1