diff options
author | Alexis Hunt <alercah@gmail.com> | 2010-08-18 23:23:40 +0000 |
---|---|---|
committer | Alexis Hunt <alercah@gmail.com> | 2010-08-18 23:23:40 +0000 |
commit | dcfba7b35b15ec4457ff7b7521507d944069d8f1 (patch) | |
tree | 8ecf93dbdcc5af83013af5dcf755174562a903c0 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 1d2b159882deb73df00c63f07d43deec54ce9274 (diff) | |
download | bcm5719-llvm-dcfba7b35b15ec4457ff7b7521507d944069d8f1.tar.gz bcm5719-llvm-dcfba7b35b15ec4457ff7b7521507d944069d8f1.zip |
Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.
Some other notes about newly-generated attribute classes:
- The constructor arguments are a SourceLocation and a Context&,
followed by the attributes arguments in the order that they were
defined in Attr.td
- Every argument in Attr.td has an appropriate accessor named getFoo,
and there are sometimes a few extra ones (such as to get the length
of a variadic argument).
Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.
llvm-svn: 111455
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 8599a146c69..2267e0c7579 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -1259,7 +1259,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, // FIXME: Do we need to check for default arguments here? if (Func->getNumParams() == 1 && InitialParamType == Argument) { if(AddMallocAttr && !Func->hasAttr<MallocAttr>()) - Func->addAttr(::new (Context) MallocAttr()); + Func->addAttr(::new (Context) MallocAttr(SourceLocation(), Context)); return; } } @@ -1287,7 +1287,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, Alloc->setImplicit(); if (AddMallocAttr) - Alloc->addAttr(::new (Context) MallocAttr()); + Alloc->addAttr(::new (Context) MallocAttr(SourceLocation(), Context)); ParmVarDecl *Param = ParmVarDecl::Create(Context, Alloc, SourceLocation(), 0, Argument, /*TInfo=*/0, |