summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.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
commit7d0479f2c2d60ccff381ce63105168bd132fb304 (patch)
tree417d43f95d605528391e6ab8c9a460f9b6347b83 /clang/lib/Sema/SemaDecl.cpp
parent9fc7856e3b6f549030863bf35441b456a0affec7 (diff)
downloadbcm5719-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/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ceb58224339..22bdc7999bb 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -456,7 +456,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid,
for (unsigned i = 0, e = FT->getNumArgs(); i != e; ++i)
Params.push_back(ParmVarDecl::Create(Context, New, SourceLocation(), 0,
FT->getArgType(i), VarDecl::None, 0));
- New->setParams(Context, &Params[0], Params.size());
+ New->setParams(Context, Params.data(), Params.size());
}
AddKnownFunctionAttributes(New);
@@ -732,7 +732,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
llvm::SmallVector<QualType, 16> ParamTypes(OldProto->arg_type_begin(),
OldProto->arg_type_end());
NewQType = Context.getFunctionType(NewFuncType->getResultType(),
- &ParamTypes[0], ParamTypes.size(),
+ ParamTypes.data(), ParamTypes.size(),
OldProto->isVariadic(),
OldProto->getTypeQuals());
New->setType(NewQType);
@@ -752,7 +752,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) {
Params.push_back(Param);
}
- New->setParams(Context, &Params[0], Params.size());
+ New->setParams(Context, Params.data(), Params.size());
}
return MergeCompatibleFunctionDecls(New, Old);
@@ -2243,7 +2243,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
"Should not need args for typedef of non-prototype fn");
}
// Finally, we know we have the right number of parameters, install them.
- NewFD->setParams(Context, &Params[0], Params.size());
+ NewFD->setParams(Context, Params.data(), Params.size());
@@ -2804,7 +2804,7 @@ Sema::DeclGroupPtrTy Sema::FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group,
}
}
return DeclGroupPtrTy::make(DeclGroupRef::Create(Context,
- &Decls[0], Decls.size()));
+ Decls.data(), Decls.size()));
}
@@ -4084,7 +4084,8 @@ void Sema::ActOnFields(Scope* S,
if (Record) {
Record->completeDefinition(Context);
} else {
- ObjCIvarDecl **ClsFields = reinterpret_cast<ObjCIvarDecl**>(&RecFields[0]);
+ ObjCIvarDecl **ClsFields =
+ reinterpret_cast<ObjCIvarDecl**>(RecFields.data());
if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(EnclosingDecl)) {
ID->setIVarList(ClsFields, RecFields.size(), Context);
ID->setLocEnd(RBrac);
OpenPOWER on IntegriCloud