aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@gmail.com>2009-05-21 09:52:38 +0000
committerJay Foad <jay.foad@gmail.com>2009-05-21 09:52:38 +0000
commitbeaaccd8e2a8748f77b66e2b330fb9136937e14c (patch)
tree27f094096f297cc213a45db9a8b3a7413fd53396 /lib/Parse/ParseDecl.cpp
parentecfbdcbaf71609ab99cdebbf2d704173070dbaf3 (diff)
Use v.data() instead of &v[0] when SmallVector v might be empty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r--lib/Parse/ParseDecl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index db24d21c32..4c2a77e7d0 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/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,