diff options
author | Erich Keane <erich.keane@intel.com> | 2018-07-12 21:09:05 +0000 |
---|---|---|
committer | Erich Keane <erich.keane@intel.com> | 2018-07-12 21:09:05 +0000 |
commit | c480f30580ab0f23a4f7c2ac142fd89412e76a41 (patch) | |
tree | eab26223a76e522bc9487f72e9b9ba6d823800d2 /clang/lib/Parse/ParsePragma.cpp | |
parent | 0de57a676cfc7911e239ffcd45122eb090d2330f (diff) | |
download | bcm5719-llvm-c480f30580ab0f23a4f7c2ac142fd89412e76a41.tar.gz bcm5719-llvm-c480f30580ab0f23a4f7c2ac142fd89412e76a41.zip |
AttributeList de-listifying:
Basically, "AttributeList" loses all list-like mechanisms, ParsedAttributes is
switched to use a TinyPtrVector (and a ParsedAttributesView is created to
have a non-allocating attributes list). DeclaratorChunk gets the later kind,
Declarator/DeclSpec keep ParsedAttributes.
Iterators are added to the ParsedAttribute types so that for-loops work.
llvm-svn: 336945
Diffstat (limited to 'clang/lib/Parse/ParsePragma.cpp')
-rw-r--r-- | clang/lib/Parse/ParsePragma.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Parse/ParsePragma.cpp b/clang/lib/Parse/ParsePragma.cpp index afd99b23a89..553b490f48a 100644 --- a/clang/lib/Parse/ParsePragma.cpp +++ b/clang/lib/Parse/ParsePragma.cpp @@ -1410,26 +1410,26 @@ void Parser::HandlePragmaAttribute() { return; } - if (!Attrs.getList() || Attrs.getList()->isInvalid()) { + if (Attrs.empty() || Attrs.begin()->isInvalid()) { SkipToEnd(); return; } // Ensure that we don't have more than one attribute. - if (Attrs.getList()->getNext()) { - SourceLocation Loc = Attrs.getList()->getNext()->getLoc(); + if (Attrs.size() > 1) { + SourceLocation Loc = Attrs[1].getLoc(); Diag(Loc, diag::err_pragma_attribute_multiple_attributes); SkipToEnd(); return; } - if (!Attrs.getList()->isSupportedByPragmaAttribute()) { + AttributeList &Attribute = *Attrs.begin(); + if (!Attribute.isSupportedByPragmaAttribute()) { Diag(PragmaLoc, diag::err_pragma_attribute_unsupported_attribute) - << Attrs.getList()->getName(); + << Attribute.getName(); SkipToEnd(); return; } - AttributeList &Attribute = *Attrs.getList(); // Parse the subject-list. if (!TryConsumeToken(tok::comma)) { |