diff options
author | Jay Foad <jay.foad@gmail.com> | 2009-05-21 09:52:38 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2009-05-21 09:52:38 +0000 |
commit | 7d0479f2c2d60ccff381ce63105168bd132fb304 (patch) | |
tree | 417d43f95d605528391e6ab8c9a460f9b6347b83 /clang/lib/Parse/ParseDecl.cpp | |
parent | 9fc7856e3b6f549030863bf35441b456a0affec7 (diff) | |
download | bcm5719-llvm-7d0479f2c2d60ccff381ce63105168bd132fb304.tar.gz bcm5719-llvm-7d0479f2c2d60ccff381ce63105168bd132fb304.zip |
Use v.data() instead of &v[0] when SmallVector v might be empty.
llvm-svn: 72210
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index db24d21c322..4c2a77e7d05 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -377,7 +377,7 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D) { "Unexpected number of commas!"); Actions.AddCXXDirectInitializerToDecl(ThisDecl, LParenLoc, move_arg(Exprs), - &CommaLocs[0], RParenLoc); + CommaLocs.data(), RParenLoc); } } else { Actions.ActOnUninitializedDecl(ThisDecl); @@ -438,7 +438,7 @@ ParseInitDeclaratorListAfterFirstDeclarator(Declarator &D) { ParseDeclarator(D); } - return Actions.FinalizeDeclaratorGroup(CurScope, &DeclsInGroup[0], + return Actions.FinalizeDeclaratorGroup(CurScope, DeclsInGroup.data(), DeclsInGroup.size()); } @@ -1387,7 +1387,7 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc, AttrList = ParseAttributes(); Actions.ActOnFields(CurScope, - RecordLoc,TagDecl,&FieldDecls[0],FieldDecls.size(), + RecordLoc, TagDecl, FieldDecls.data(), FieldDecls.size(), LBraceLoc, RBraceLoc, AttrList); StructScope.Exit(); @@ -1537,7 +1537,7 @@ void Parser::ParseEnumBody(SourceLocation StartLoc, DeclPtrTy EnumDecl) { SourceLocation RBraceLoc = MatchRHSPunctuation(tok::r_brace, LBraceLoc); Actions.ActOnEnumBody(StartLoc, LBraceLoc, RBraceLoc, EnumDecl, - &EnumConstantDecls[0], EnumConstantDecls.size()); + EnumConstantDecls.data(), EnumConstantDecls.size()); Action::AttrTy *AttrList = 0; // If attributes exist after the identifier list, parse them. @@ -2462,7 +2462,7 @@ void Parser::ParseFunctionDeclarator(SourceLocation LParenLoc, Declarator &D, // Remember that we parsed a function type, and remember the attributes. D.AddTypeInfo(DeclaratorChunk::getFunction(/*proto*/true, IsVariadic, EllipsisLoc, - &ParamInfo[0], ParamInfo.size(), + ParamInfo.data(), ParamInfo.size(), DS.getTypeQualifiers(), hasExceptionSpec, hasAnyExceptionSpec, |