diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaInit.cpp | 5 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaTemplate.cpp | 3 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 2 |
9 files changed, 22 insertions, 19 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ceb5822433..22bdc7999b 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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); diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 13655ba092..35faa4a5ea 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1651,7 +1651,7 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( Params.push_back(Param); } - ObjCMethod->setMethodParams(Context, &Params[0], Sel.getNumArgs()); + ObjCMethod->setMethodParams(Context, Params.data(), Sel.getNumArgs()); ObjCMethod->setObjCDeclQualifier( CvtQTToAstBitMask(ReturnQT.getObjCDeclQualifier())); const ObjCMethodDecl *PrevMethod = 0; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d72d56f1d6..e819b1c10f 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5144,7 +5144,7 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { CurBlock->Params.push_back(FTI.ArgInfo[i].Param.getAs<ParmVarDecl>()); CurBlock->isVariadic = FTI.isVariadic; } - CurBlock->TheDecl->setParams(Context, &CurBlock->Params[0], + CurBlock->TheDecl->setParams(Context, CurBlock->Params.data(), CurBlock->Params.size()); CurBlock->TheDecl->setIsVariadic(CurBlock->isVariadic); ProcessDeclAttributes(CurBlock->TheDecl, ParamInfo); @@ -5215,7 +5215,7 @@ Sema::OwningExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, if (!BSI->hasPrototype) BlockTy = Context.getFunctionNoProtoType(RetTy); else - BlockTy = Context.getFunctionType(RetTy, &ArgTypes[0], ArgTypes.size(), + BlockTy = Context.getFunctionType(RetTy, ArgTypes.data(), ArgTypes.size(), BSI->isVariadic, 0); // FIXME: Check that return/parameter types are complete/non-abstract diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 17113f68bd..f3ad2a1b32 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -1687,8 +1687,9 @@ Sema::OwningExprResult Sema::ActOnDesignatedInitializer(Designation &Desig, Desig.ClearExprs(*this); DesignatedInitExpr *DIE - = DesignatedInitExpr::Create(Context, &Designators[0], Designators.size(), - &InitExpressions[0], InitExpressions.size(), + = DesignatedInitExpr::Create(Context, + Designators.data(), Designators.size(), + InitExpressions.data(), InitExpressions.size(), Loc, GNUSyntax, Init.takeAs<Expr>()); return Owned(DIE); } diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index ebaa99fa98..1a1362e669 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1000,7 +1000,7 @@ Sema::OwningStmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, TargetInfo::ConstraintInfo Info(Literal->getStrData(), Literal->getByteLength(), Names[i]); - if (!Context.Target.validateInputConstraint(&OutputConstraintInfos[0], + if (!Context.Target.validateInputConstraint(OutputConstraintInfos.data(), NumOutputs, Info)) { return StmtError(Diag(Literal->getLocStart(), diag::err_asm_invalid_input_constraint) diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 47388ace34..c533789458 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -879,7 +879,8 @@ Sema::ActOnTemplateIdType(TemplateTy TemplateD, SourceLocation TemplateLoc, translateTemplateArguments(TemplateArgsIn, TemplateArgLocs, TemplateArgs); QualType Result = CheckTemplateIdType(Template, TemplateLoc, LAngleLoc, - &TemplateArgs[0], TemplateArgs.size(), + TemplateArgs.data(), + TemplateArgs.size(), RAngleLoc); TemplateArgsIn.release(); diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 08019aaea4..a5b0911788 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -686,7 +686,7 @@ Sema::InstantiateBaseSpecifiers(CXXRecordDecl *Instantiation, } if (!Invalid && - AttachBaseSpecifiers(Instantiation, &InstantiatedBases[0], + AttachBaseSpecifiers(Instantiation, InstantiatedBases.data(), InstantiatedBases.size())) Invalid = true; @@ -770,7 +770,7 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation, // Finish checking fields. ActOnFields(0, Instantiation->getLocation(), DeclPtrTy::make(Instantiation), - &Fields[0], Fields.size(), SourceLocation(), SourceLocation(), + Fields.data(), Fields.size(), SourceLocation(), SourceLocation(), 0); // Add any implicitly-declared members that we might need. diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 385112b7d7..b9a9ae8c50 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -301,7 +301,7 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) { // Attach the parameters for (unsigned P = 0; P < Params.size(); ++P) Params[P]->setOwningFunction(Method); - Method->setParams(SemaRef.Context, &Params[0], Params.size()); + Method->setParams(SemaRef.Context, Params.data(), Params.size()); if (InitMethodInstantiation(Method, D)) Method->setInvalidDecl(); @@ -348,7 +348,7 @@ Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) { // Attach the parameters for (unsigned P = 0; P < Params.size(); ++P) Params[P]->setOwningFunction(Constructor); - Constructor->setParams(SemaRef.Context, &Params[0], Params.size()); + Constructor->setParams(SemaRef.Context, Params.data(), Params.size()); if (InitMethodInstantiation(Constructor, D)) Constructor->setInvalidDecl(); @@ -538,7 +538,7 @@ TemplateDeclInstantiator::InstantiateFunctionType(FunctionDecl *D, if (ResultType.isNull()) return QualType(); - return SemaRef.BuildFunctionType(ResultType, &ParamTys[0], ParamTys.size(), + return SemaRef.BuildFunctionType(ResultType, ParamTys.data(), ParamTys.size(), Proto->isVariadic(), Proto->getTypeQuals(), D->getLocation(), D->getDeclName()); } diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 4889a56513..e10a912ccf 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -795,7 +795,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) { ArgTys.push_back(ArgTy); } - T = Context.getFunctionType(T, &ArgTys[0], ArgTys.size(), + T = Context.getFunctionType(T, ArgTys.data(), ArgTys.size(), FTI.isVariadic, FTI.TypeQuals); } break; |