diff options
| author | John McCall <rjmccall@apple.com> | 2010-12-24 02:08:15 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-12-24 02:08:15 +0000 |
| commit | 53fa71476d0539b031a8f91232607f5ca8f182e5 (patch) | |
| tree | 9e6d370da16c00a54a4b7f8ad66553458cedf899 /clang/lib/Sema/DeclSpec.cpp | |
| parent | b4d271ef46bde4815c3ca3363779645ce3513811 (diff) | |
| download | bcm5719-llvm-53fa71476d0539b031a8f91232607f5ca8f182e5.tar.gz bcm5719-llvm-53fa71476d0539b031a8f91232607f5ca8f182e5.zip | |
Refactor how we collect attributes during parsing, and add slots for attributes
on array and function declarators. This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.
llvm-svn: 122535
Diffstat (limited to 'clang/lib/Sema/DeclSpec.cpp')
| -rw-r--r-- | clang/lib/Sema/DeclSpec.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/DeclSpec.cpp b/clang/lib/Sema/DeclSpec.cpp index 5304193b664..4afdc24275f 100644 --- a/clang/lib/Sema/DeclSpec.cpp +++ b/clang/lib/Sema/DeclSpec.cpp @@ -46,7 +46,8 @@ void UnqualifiedId::setConstructorTemplateId(TemplateIdAnnotation *TemplateId) { /// DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. /// "TheDeclarator" is the declarator that this will be added to. -DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, +DeclaratorChunk DeclaratorChunk::getFunction(const ParsedAttributes &attrs, + bool hasProto, bool isVariadic, SourceLocation EllipsisLoc, ParamInfo *ArgInfo, unsigned NumArgs, @@ -65,6 +66,7 @@ DeclaratorChunk DeclaratorChunk::getFunction(bool hasProto, bool isVariadic, I.Kind = Function; I.Loc = LPLoc; I.EndLoc = RPLoc; + I.Fun.AttrList = attrs.getList(); I.Fun.hasPrototype = hasProto; I.Fun.isVariadic = isVariadic; I.Fun.EllipsisLoc = EllipsisLoc.getRawEncoding(); @@ -483,7 +485,7 @@ void DeclSpec::SaveWrittenBuiltinSpecs() { writtenBS.Type = getTypeSpecType(); // Search the list of attributes for the presence of a mode attribute. writtenBS.ModeAttr = false; - AttributeList* attrs = getAttributes(); + AttributeList* attrs = getAttributes().getList(); while (attrs) { if (attrs->getKind() == AttributeList::AT_mode) { writtenBS.ModeAttr = true; |

