aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema')
-rw-r--r--lib/Sema/Sema.cpp3
-rw-r--r--lib/Sema/SemaCast.cpp3
-rw-r--r--lib/Sema/SemaDecl.cpp35
-rw-r--r--lib/Sema/SemaDeclCXX.cpp29
-rw-r--r--lib/Sema/SemaExpr.cpp27
-rw-r--r--lib/Sema/SemaExprCXX.cpp36
-rw-r--r--lib/Sema/SemaExprObjC.cpp18
-rw-r--r--lib/Sema/SemaInit.cpp2
-rw-r--r--lib/Sema/SemaStmt.cpp6
-rw-r--r--lib/Sema/SemaStmtAsm.cpp6
-rw-r--r--lib/Sema/SemaTemplate.cpp18
-rw-r--r--lib/Sema/TreeTransform.h7
12 files changed, 81 insertions, 109 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 62c7375ec6..fd57bbc237 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -1242,8 +1242,7 @@ bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD,
// FIXME: Try this before emitting the fixit, and suppress diagnostics
// while doing so.
E = ActOnCallExpr(0, E.take(), ParenInsertionLoc,
- MultiExprArg(*this, 0, 0),
- ParenInsertionLoc.getLocWithOffset(1));
+ MultiExprArg(), ParenInsertionLoc.getLocWithOffset(1));
return true;
}
diff --git a/lib/Sema/SemaCast.cpp b/lib/Sema/SemaCast.cpp
index 42f097dda5..0c3757821e 100644
--- a/lib/Sema/SemaCast.cpp
+++ b/lib/Sema/SemaCast.cpp
@@ -1331,8 +1331,7 @@ TryStaticImplicitCast(Sema &Self, ExprResult &SrcExpr, QualType DestType,
if (InitSeq.Failed() && (CStyle || !DestType->isReferenceType()))
return TC_NotApplicable;
- ExprResult Result
- = InitSeq.Perform(Self, Entity, InitKind, MultiExprArg(Self, &SrcExprRaw, 1));
+ ExprResult Result = InitSeq.Perform(Self, Entity, InitKind, SrcExprRaw);
if (Result.isInvalid()) {
msg = 0;
return TC_Failed;
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 8d4d924439..c1f235b206 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -2563,8 +2563,7 @@ void Sema::MergeVarDecl(VarDecl *New, LookupResult &Previous) {
/// no declarator (e.g. "struct foo;") is parsed.
Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
DeclSpec &DS) {
- return ParsedFreeStandingDeclSpec(S, AS, DS,
- MultiTemplateParamsArg(*this, 0, 0));
+ return ParsedFreeStandingDeclSpec(S, AS, DS, MultiTemplateParamsArg());
}
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
@@ -3423,7 +3422,7 @@ static bool RebuildDeclaratorInCurrentInstantiation(Sema &S, Declarator &D,
Decl *Sema::ActOnDeclarator(Scope *S, Declarator &D) {
D.setFunctionDefinitionKind(FDK_Declaration);
- Decl *Dcl = HandleDeclarator(S, D, MultiTemplateParamsArg(*this));
+ Decl *Dcl = HandleDeclarator(S, D, MultiTemplateParamsArg());
if (OriginalLexicalContext && OriginalLexicalContext->isObjCContainer() &&
Dcl && Dcl->getDeclContext()->isFileContext())
@@ -4215,7 +4214,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
D.getDeclSpec().getLocStart(),
D.getIdentifierLoc(),
D.getCXXScopeSpec(),
- TemplateParamLists.get(),
+ TemplateParamLists.data(),
TemplateParamLists.size(),
/*never a friend*/ false,
isExplicitSpecialization,
@@ -4256,7 +4255,7 @@ Sema::ActOnVariableDeclarator(Scope *S, Declarator &D, DeclContext *DC,
if (TemplateParamLists.size() > 0 && D.getCXXScopeSpec().isSet()) {
NewVD->setTemplateParameterListsInfo(Context,
TemplateParamLists.size(),
- TemplateParamLists.get());
+ TemplateParamLists.data());
}
if (D.getDeclSpec().isConstexprSpecified())
@@ -5169,7 +5168,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
D.getDeclSpec().getLocStart(),
D.getIdentifierLoc(),
D.getCXXScopeSpec(),
- TemplateParamLists.get(),
+ TemplateParamLists.data(),
TemplateParamLists.size(),
isFriend,
isExplicitSpecialization,
@@ -5208,7 +5207,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
if (TemplateParamLists.size() > 1) {
NewFD->setTemplateParameterListsInfo(Context,
TemplateParamLists.size() - 1,
- TemplateParamLists.get());
+ TemplateParamLists.data());
}
} else {
// This is a function template specialization.
@@ -5216,7 +5215,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
// For source fidelity, store all the template param lists.
NewFD->setTemplateParameterListsInfo(Context,
TemplateParamLists.size(),
- TemplateParamLists.get());
+ TemplateParamLists.data());
// C++0x [temp.expl.spec]p20 forbids "template<> friend void foo(int);".
if (isFriend) {
@@ -5248,7 +5247,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
// For source fidelity, store all the template param lists.
NewFD->setTemplateParameterListsInfo(Context,
TemplateParamLists.size(),
- TemplateParamLists.get());
+ TemplateParamLists.data());
}
if (Invalid) {
@@ -5522,8 +5521,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC,
TemplateIdAnnotation *TemplateId = D.getName().TemplateId;
TemplateArgs.setLAngleLoc(TemplateId->LAngleLoc);
TemplateArgs.setRAngleLoc(TemplateId->RAngleLoc);
- ASTTemplateArgsPtr TemplateArgsPtr(*this,
- TemplateId->getTemplateArgs(),
+ ASTTemplateArgsPtr TemplateArgsPtr(TemplateId->getTemplateArgs(),
TemplateId->NumArgs);
translateTemplateArguments(TemplateArgsPtr,
TemplateArgs);
@@ -6509,8 +6507,7 @@ void Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init,
}
InitializationSequence InitSeq(*this, Entity, Kind, Args, NumArgs);
ExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, Args,NumArgs),
- &DclT);
+ MultiExprArg(Args, NumArgs), &DclT);
if (Result.isInvalid()) {
VDecl->setInvalidDecl();
return;
@@ -6897,8 +6894,7 @@ void Sema::ActOnUninitializedDecl(Decl *RealDecl,
= InitializationKind::CreateDefault(Var->getLocation());
InitializationSequence InitSeq(*this, Entity, Kind, 0, 0);
- ExprResult Init = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, 0, 0));
+ ExprResult Init = InitSeq.Perform(*this, Entity, Kind, MultiExprArg());
if (Init.isInvalid())
Var->setInvalidDecl();
else if (Init.get()) {
@@ -7480,8 +7476,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
Scope *ParentScope = FnBodyScope->getParent();
D.setFunctionDefinitionKind(FDK_Definition);
- Decl *DP = HandleDeclarator(ParentScope, D,
- MultiTemplateParamsArg(*this));
+ Decl *DP = HandleDeclarator(ParentScope, D, MultiTemplateParamsArg());
return ActOnStartOfFunctionDef(FnBodyScope, DP);
}
@@ -8292,7 +8287,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
(SS.isNotEmpty() && TUK != TUK_Reference)) {
if (TemplateParameterList *TemplateParams
= MatchTemplateParametersToScopeSpecifier(KWLoc, NameLoc, SS,
- TemplateParameterLists.get(),
+ TemplateParameterLists.data(),
TemplateParameterLists.size(),
TUK == TUK_Friend,
isExplicitSpecialization,
@@ -8310,7 +8305,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
TemplateParams, AS,
ModulePrivateLoc,
TemplateParameterLists.size()-1,
- TemplateParameterLists.get());
+ TemplateParameterLists.data());
return Result.get();
} else {
// The "template<>" header is extraneous.
@@ -8859,7 +8854,7 @@ CreateNewDecl:
if (TemplateParameterLists.size() > 0) {
New->setTemplateParameterListsInfo(Context,
TemplateParameterLists.size(),
- TemplateParameterLists.get());
+ TemplateParameterLists.data());
}
}
else
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index e085bdafb0..ee6b19eb0b 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -246,8 +246,7 @@ Sema::SetParamDefaultArgument(ParmVarDecl *Param, Expr *Arg,
InitializationKind Kind = InitializationKind::CreateCopy(Param->getLocation(),
EqualLoc);
InitializationSequence InitSeq(*this, Entity, Kind, &Arg, 1);
- ExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, &Arg, 1));
+ ExprResult Result = InitSeq.Perform(*this, Entity, Kind, Arg);
if (Result.isInvalid())
return true;
Arg = Result.takeAs<Expr>();
@@ -2207,7 +2206,7 @@ Sema::BuildMemberInitializer(ValueDecl *Member, Expr *Init,
InitializationSequence InitSeq(*this, MemberEntity, Kind, Args, NumArgs);
ExprResult MemberInit = InitSeq.Perform(*this, MemberEntity, Kind,
- MultiExprArg(*this, Args, NumArgs),
+ MultiExprArg(Args, NumArgs),
0);
if (MemberInit.isInvalid())
return true;
@@ -2276,7 +2275,7 @@ Sema::BuildDelegatingInitializer(TypeSourceInfo *TInfo, Expr *Init,
InitRange.getEnd());
InitializationSequence InitSeq(*this, DelegationEntity, Kind, Args, NumArgs);
ExprResult DelegationInit = InitSeq.Perform(*this, DelegationEntity, Kind,
- MultiExprArg(*this, Args,NumArgs),
+ MultiExprArg(Args, NumArgs),
0);
if (DelegationInit.isInvalid())
return true;
@@ -2414,8 +2413,7 @@ Sema::BuildBaseInitializer(QualType BaseType, TypeSourceInfo *BaseTInfo,
InitRange.getEnd());
InitializationSequence InitSeq(*this, BaseEntity, Kind, Args, NumArgs);
ExprResult BaseInit = InitSeq.Perform(*this, BaseEntity, Kind,
- MultiExprArg(*this, Args, NumArgs),
- 0);
+ MultiExprArg(Args, NumArgs), 0);
if (BaseInit.isInvalid())
return true;
@@ -2483,8 +2481,7 @@ BuildImplicitBaseInitializer(Sema &SemaRef, CXXConstructorDecl *Constructor,
InitializationKind InitKind
= InitializationKind::CreateDefault(Constructor->getLocation());
InitializationSequence InitSeq(SemaRef, InitEntity, InitKind, 0, 0);
- BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind,
- MultiExprArg(SemaRef, 0, 0));
+ BaseInit = InitSeq.Perform(SemaRef, InitEntity, InitKind, MultiExprArg());
break;
}
@@ -8706,7 +8703,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
Sema::CompoundScopeRAII CompoundScope(*this);
CopyConstructor->setBody(ActOnCompoundStmt(CopyConstructor->getLocation(),
CopyConstructor->getLocation(),
- MultiStmtArg(*this, 0, 0),
+ MultiStmtArg(),
/*isStmtExpr=*/false)
.takeAs<Stmt>());
CopyConstructor->setImplicitlyDefined(true);
@@ -8889,7 +8886,7 @@ void Sema::DefineImplicitMoveConstructor(SourceLocation CurrentLocation,
Sema::CompoundScopeRAII CompoundScope(*this);
MoveConstructor->setBody(ActOnCompoundStmt(MoveConstructor->getLocation(),
MoveConstructor->getLocation(),
- MultiStmtArg(*this, 0, 0),
+ MultiStmtArg(),
/*isStmtExpr=*/false)
.takeAs<Stmt>());
MoveConstructor->setImplicitlyDefined(true);
@@ -9050,7 +9047,7 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType,
// directly into the target of the omitted copy/move
if (ConstructKind == CXXConstructExpr::CK_Complete &&
Constructor->isCopyOrMoveConstructor() && hasOneRealArgument(ExprArgs)) {
- Expr *SubExpr = ((Expr **)ExprArgs.get())[0];
+ Expr *SubExpr = ExprArgs[0];
Elidable = SubExpr->isTemporaryObject(Context, Constructor->getParent());
}
@@ -9070,7 +9067,7 @@ Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType,
unsigned ConstructKind,
SourceRange ParenRange) {
unsigned NumExprs = ExprArgs.size();
- Expr **Exprs = ExprArgs.get();
+ Expr **Exprs = ExprArgs.data();
MarkFunctionReferenced(ConstructLoc, Constructor);
return Owned(CXXConstructExpr::Create(Context, DeclInitType, ConstructLoc,
@@ -9142,7 +9139,7 @@ Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor,
bool AllowExplicit) {
// FIXME: This duplicates a lot of code from Sema::ConvertArgumentsForCall.
unsigned NumArgs = ArgsPtr.size();
- Expr **Args = (Expr **)ArgsPtr.get();
+ Expr **Args = ArgsPtr.data();
const FunctionProtoType *Proto
= Constructor->getType()->getAs<FunctionProtoType>();
@@ -9904,7 +9901,7 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
if (TemplateParameterList *TemplateParams
= MatchTemplateParametersToScopeSpecifier(TagLoc, NameLoc, SS,
- TempParamLists.get(),
+ TempParamLists.data(),
TempParamLists.size(),
/*friend*/ true,
isExplicitSpecialization,
@@ -9919,7 +9916,7 @@ Decl *Sema::ActOnTemplatedFriendTag(Scope *S, SourceLocation FriendLoc,
TemplateParams, AS_public,
/*ModulePrivateLoc=*/SourceLocation(),
TempParamLists.size() - 1,
- TempParamLists.get()).take();
+ TempParamLists.data()).take();
} else {
// The "template<>" header is extraneous.
Diag(TemplateParams->getTemplateLoc(), diag::err_template_tag_noparams)
@@ -10079,7 +10076,7 @@ Decl *Sema::ActOnFriendTypeDecl(Scope *S, const DeclSpec &DS,
if (unsigned NumTempParamLists = TempParams.size())
D = FriendTemplateDecl::Create(Context, CurContext, Loc,
NumTempParamLists,
- TempParams.get(),
+ TempParams.data(),
TSI,
DS.getFriendSpecLoc());
else
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 1628e7f14b..74296f1335 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1098,8 +1098,8 @@ Sema::ActOnGenericSelectionExpr(SourceLocation KeyLoc,
unsigned NumAssocs = ArgTypes.size();
assert(NumAssocs == ArgExprs.size());
- ParsedType *ParsedTypes = ArgTypes.get();
- Expr **Exprs = ArgExprs.get();
+ ParsedType *ParsedTypes = ArgTypes.data();
+ Expr **Exprs = ArgExprs.data();
TypeSourceInfo **Types = new TypeSourceInfo*[NumAssocs];
for (unsigned i = 0; i < NumAssocs; ++i) {
@@ -1428,8 +1428,7 @@ Sema::DecomposeUnqualifiedId(const UnqualifiedId &Id,
Buffer.setLAngleLoc(Id.TemplateId->LAngleLoc);
Buffer.setRAngleLoc(Id.TemplateId->RAngleLoc);
- ASTTemplateArgsPtr TemplateArgsPtr(*this,
- Id.TemplateId->getTemplateArgs(),
+ ASTTemplateArgsPtr TemplateArgsPtr(Id.TemplateId->getTemplateArgs(),
Id.TemplateId->NumArgs);
translateTemplateArguments(TemplateArgsPtr, Buffer);
@@ -3441,8 +3440,7 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc,
Expr *ResultE = Result.takeAs<Expr>();
InitializationSequence InitSeq(*this, Entity, Kind, &ResultE, 1);
- Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, &ResultE, 1));
+ Result = InitSeq.Perform(*this, Entity, Kind, ResultE);
if (Result.isInvalid())
return ExprError();
@@ -3782,7 +3780,7 @@ Sema::ActOnCallExpr(Scope *S, Expr *Fn, SourceLocation LParenLoc,
if (Result.isInvalid()) return ExprError();
Fn = Result.take();
- Expr **Args = ArgExprs.get();
+ Expr **Args = ArgExprs.data();
if (getLangOpts().CPlusPlus) {
// If this is a pseudo-destructor expression, build the call immediately.
@@ -4142,9 +4140,8 @@ Sema::BuildCompoundLiteralExpr(SourceLocation LParenLoc, TypeSourceInfo *TInfo,
SourceRange(LParenLoc, RParenLoc),
/*InitList=*/true);
InitializationSequence InitSeq(*this, Entity, Kind, &LiteralExpr, 1);
- ExprResult Result = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(*this, &LiteralExpr, 1),
- &literalType);
+ ExprResult Result = InitSeq.Perform(*this, Entity, Kind, LiteralExpr,
+ &literalType);
if (Result.isInvalid())
return ExprError();
LiteralExpr = Result.get();
@@ -4167,7 +4164,7 @@ ExprResult
Sema::ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList,
SourceLocation RBraceLoc) {
unsigned NumInit = InitArgList.size();
- Expr **InitList = InitArgList.get();
+ Expr **InitList = InitArgList.data();
// Immediately handle non-overload placeholders. Overloads can be
// resolved contextually, but everything else here can't.
@@ -4603,7 +4600,7 @@ ExprResult Sema::ActOnParenListExpr(SourceLocation L,
SourceLocation R,
MultiExprArg Val) {
unsigned nexprs = Val.size();
- Expr **exprs = Val.get();
+ Expr **exprs = Val.data();
assert((exprs != 0) && "ActOnParenOrParenListExpr() missing expr list");
Expr *expr = new (Context) ParenListExpr(Context, L, exprs, nexprs, R);
return Owned(expr);
@@ -8215,8 +8212,7 @@ ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
InitializedEntity Entity =
InitializedEntity::InitializeTemporary(LHSExpr->getType());
InitializationSequence InitSeq(*this, Entity, Kind, &RHSExpr, 1);
- ExprResult Init = InitSeq.Perform(*this, Entity, Kind,
- MultiExprArg(&RHSExpr, 1));
+ ExprResult Init = InitSeq.Perform(*this, Entity, Kind, RHSExpr);
if (Init.isInvalid())
return Init;
RHSExpr = Init.take();
@@ -10468,8 +10464,7 @@ static ExprResult captureInLambda(Sema &S, LambdaScopeInfo *LSI,
InitializationSequence Init(S, Entities.back(), InitKind, &Ref, 1);
ExprResult Result(true);
if (!Init.Diagnose(S, Entities.back(), InitKind, &Ref, 1))
- Result = Init.Perform(S, Entities.back(), InitKind,
- MultiExprArg(S, &Ref, 1));
+ Result = Init.Perform(S, Entities.back(), InitKind, Ref);
// If this initialization requires any cleanups (e.g., due to a
// default argument to a copy constructor), note that for the
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index c5ea7bb1fe..189d5904e1 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -809,7 +809,7 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo,
SourceLocation RParenLoc) {
QualType Ty = TInfo->getType();
unsigned NumExprs = exprs.size();
- Expr **Exprs = (Expr**)exprs.get();
+ Expr **Exprs = exprs.data();
SourceLocation TyBeginLoc = TInfo->getTypeLoc().getBeginLoc();
if (Ty->isDependentType() ||
@@ -1290,7 +1290,7 @@ Sema::BuildCXXNew(SourceLocation StartLoc, bool UseGlobal,
FunctionDecl *OperatorNew = 0;
FunctionDecl *OperatorDelete = 0;
- Expr **PlaceArgs = (Expr**)PlacementArgs.get();
+ Expr **PlaceArgs = PlacementArgs.data();
unsigned NumPlaceArgs = PlacementArgs.size();
if (!AllocType->isDependentType() &&
@@ -2351,9 +2351,7 @@ static ExprResult BuildCXXCastArgument(Sema &S,
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Method);
SmallVector<Expr*, 8> ConstructorArgs;
- if (S.CompleteConstructorCall(Constructor,
- MultiExprArg(&From, 1),
- CastLoc, ConstructorArgs))
+ if (S.CompleteConstructorCall(Constructor, From, CastLoc, ConstructorArgs))
return ExprError();
S.CheckConstructorAccess(CastLoc, Constructor,
@@ -2508,8 +2506,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
if (SCS.Second == ICK_Derived_To_Base) {
SmallVector<Expr*, 8> ConstructorArgs;
if (CompleteConstructorCall(cast<CXXConstructorDecl>(SCS.CopyConstructor),
- MultiExprArg(*this, &From, 1),
- /*FIXME:ConstructLoc*/SourceLocation(),
+ From, /*FIXME:ConstructLoc*/SourceLocation(),
ConstructorArgs))
return ExprError();
return BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
@@ -2522,8 +2519,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
}
return BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
ToType, SCS.CopyConstructor,
- MultiExprArg(*this, &From, 1),
- /*HadMultipleCandidates*/ false,
+ From, /*HadMultipleCandidates*/ false,
/*ZeroInit*/ false,
CXXConstructExpr::CK_Complete,
SourceRange());
@@ -3412,9 +3408,7 @@ static bool evaluateTypeTrait(Sema &S, TypeTrait Kind, SourceLocation KWLoc,
if (Init.Failed())
return false;
- ExprResult Result = Init.Perform(S, To, InitKind,
- MultiExprArg(ArgExprs.data(),
- ArgExprs.size()));
+ ExprResult Result = Init.Perform(S, To, InitKind, ArgExprs);
if (Result.isInvalid() || SFINAE.hasErrorOccurred())
return false;
@@ -3572,7 +3566,7 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, BinaryTypeTrait BTT,
if (Init.Failed())
return false;
- ExprResult Result = Init.Perform(Self, To, Kind, MultiExprArg(&FromPtr, 1));
+ ExprResult Result = Init.Perform(Self, To, Kind, FromPtr);
return !Result.isInvalid() && !SFINAE.hasErrorOccurred();
}
@@ -4099,7 +4093,7 @@ static bool ConvertForConditional(Sema &Self, ExprResult &E, QualType T) {
SourceLocation());
Expr *Arg = E.take();
InitializationSequence InitSeq(Self, Entity, Kind, &Arg, 1);
- ExprResult Result = InitSeq.Perform(Self, Entity, Kind, MultiExprArg(&Arg, 1));
+ ExprResult Result = InitSeq.Perform(Self, Entity, Kind, Arg);
if (Result.isInvalid())
return true;
@@ -4561,14 +4555,14 @@ QualType Sema::FindCompositePointerType(SourceLocation Loc,
// Convert E1 to Composite1
ExprResult E1Result
- = E1ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,&E1,1));
+ = E1ToC1.Perform(*this, Entity1, Kind, E1);
if (E1Result.isInvalid())
return QualType();
E1 = E1Result.takeAs<Expr>();
// Convert E2 to Composite1
ExprResult E2Result
- = E2ToC1.Perform(*this, Entity1, Kind, MultiExprArg(*this,&E2,1));
+ = E2ToC1.Perform(*this, Entity1, Kind, E2);
if (E2Result.isInvalid())
return QualType();
E2 = E2Result.takeAs<Expr>();
@@ -4586,14 +4580,14 @@ QualType Sema::FindCompositePointerType(SourceLocation Loc,
// Convert E1 to Composite2
ExprResult E1Result
- = E1ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, &E1, 1));
+ = E1ToC2.Perform(*this, Entity2, Kind, E1);
if (E1Result.isInvalid())
return QualType();
E1 = E1Result.takeAs<Expr>();
// Convert E2 to Composite2
ExprResult E2Result
- = E2ToC2.Perform(*this, Entity2, Kind, MultiExprArg(*this, &E2, 1));
+ = E2ToC2.Perform(*this, Entity2, Kind, E2);
if (E2Result.isInvalid())
return QualType();
E2 = E2Result.takeAs<Expr>();
@@ -5198,8 +5192,7 @@ ExprResult Sema::ActOnPseudoDestructorExpr(Scope *S, Expr *Base,
} else {
// Resolve the template-id to a type.
TemplateIdAnnotation *TemplateId = SecondTypeName.TemplateId;
- ASTTemplateArgsPtr TemplateArgsPtr(*this,
- TemplateId->getTemplateArgs(),
+ ASTTemplateArgsPtr TemplateArgsPtr(TemplateId->getTemplateArgs(),
TemplateId->NumArgs);
TypeResult T = ActOnTemplateIdType(TemplateId->SS,
TemplateId->TemplateKWLoc,
@@ -5248,8 +5241,7 @@ ExprResult Sema::ActOnPseudoDestructorExpr(Scope *S, Expr *Base,
} else {
// Resolve the template-id to a type.
TemplateIdAnnotation *TemplateId = FirstTypeName.TemplateId;
- ASTTemplateArgsPtr TemplateArgsPtr(*this,
- TemplateId->getTemplateArgs(),
+ ASTTemplateArgsPtr TemplateArgsPtr(TemplateId->getTemplateArgs(),
TemplateId->NumArgs);
TypeResult T = ActOnTemplateIdType(TemplateId->SS,
TemplateId->TemplateKWLoc,
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 88f884e0aa..df300a5103 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -345,7 +345,7 @@ static ExprResult CheckObjCCollectionLiteralElement(Sema &S, Expr *Element,
SourceLocation());
InitializationSequence Seq(S, Entity, Kind, &Element, 1);
if (!Seq.Failed())
- return Seq.Perform(S, Entity, Kind, MultiExprArg(S, &Element, 1));
+ return Seq.Perform(S, Entity, Kind, Element);
}
Expr *OrigElement = Element;
@@ -708,7 +708,7 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
// Check that each of the elements provided is valid in a collection literal,
// performing conversions as necessary.
- Expr **ElementsBuffer = Elements.get();
+ Expr **ElementsBuffer = Elements.data();
for (unsigned I = 0, N = Elements.size(); I != N; ++I) {
ExprResult Converted = CheckObjCCollectionLiteralElement(*this,
ElementsBuffer[I],
@@ -724,10 +724,8 @@ ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {
Context.getObjCInterfaceType(NSArrayDecl));
return MaybeBindToTemporary(
- ObjCArrayLiteral::Create(Context,
- llvm::makeArrayRef(Elements.get(),
- Elements.size()),
- Ty, ArrayWithObjectsMethod, SR));
+ ObjCArrayLiteral::Create(Context, Elements, Ty,
+ ArrayWithObjectsMethod, SR));
}
ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR,
@@ -1911,7 +1909,7 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
// If the receiver type is dependent, we can't type-check anything
// at this point. Build a dependent expression.
unsigned NumArgs = ArgsIn.size();
- Expr **Args = ArgsIn.get();
+ Expr **Args = ArgsIn.data();
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
return Owned(ObjCMessageExpr::Create(Context, ReceiverType,
VK_RValue, LBracLoc, ReceiverTypeInfo,
@@ -1965,7 +1963,7 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
ExprValueKind VK = VK_RValue;
unsigned NumArgs = ArgsIn.size();
- Expr **Args = ArgsIn.get();
+ Expr **Args = ArgsIn.data();
if (CheckMessageArgumentTypes(ReceiverType, Args, NumArgs, Sel, Method, true,
SuperLoc.isValid(), LBracLoc, RBracLoc,
ReturnType, VK))
@@ -2095,7 +2093,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
// If the receiver is type-dependent, we can't type-check anything
// at this point. Build a dependent expression.
unsigned NumArgs = ArgsIn.size();
- Expr **Args = ArgsIn.get();
+ Expr **Args = ArgsIn.data();
assert(SuperLoc.isInvalid() && "Message to super with dependent type");
return Owned(ObjCMessageExpr::Create(Context, Context.DependentTy,
VK_RValue, LBracLoc, Receiver, Sel,
@@ -2295,7 +2293,7 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver,
// Check the message arguments.
unsigned NumArgs = ArgsIn.size();
- Expr **Args = ArgsIn.get();
+ Expr **Args = ArgsIn.data();
QualType ReturnType;
ExprValueKind VK = VK_RValue;
bool ClassMessage = (ReceiverType->isObjCClassType() ||
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index e2cfda00ba..a14e16c9b5 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -4775,7 +4775,7 @@ InitializationSequence::Perform(Sema &S,
QualType *ResultType) {
if (Failed()) {
unsigned NumArgs = Args.size();
- Diagnose(S, Entity, Kind, Args.get(), NumArgs);
+ Diagnose(S, Entity, Kind, Args.data(), NumArgs);
return ExprError();
}
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp
index 2113a66cd9..c885d484e7 100644
--- a/lib/Sema/SemaStmt.cpp
+++ b/lib/Sema/SemaStmt.cpp
@@ -254,7 +254,7 @@ StmtResult
Sema::ActOnCompoundStmt(SourceLocation L, SourceLocation R,
MultiStmtArg elts, bool isStmtExpr) {
unsigned NumElts = elts.size();
- Stmt **Elts = elts.get();
+ Stmt **Elts = elts.data();
// If we're in C89 mode, check that we don't have any decls after stmts. If
// so, emit an extension diagnostic.
if (!getLangOpts().C99 && !getLangOpts().CPlusPlus) {
@@ -2539,7 +2539,7 @@ Sema::ActOnObjCAtTryStmt(SourceLocation AtLoc, Stmt *Try,
getCurFunction()->setHasBranchProtectedScope();
unsigned NumCatchStmts = CatchStmts.size();
return Owned(ObjCAtTryStmt::Create(Context, AtLoc, Try,
- CatchStmts.get(),
+ CatchStmts.data(),
NumCatchStmts,
Finally));
}
@@ -2674,7 +2674,7 @@ Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
unsigned NumHandlers = RawHandlers.size();
assert(NumHandlers > 0 &&
"The parser shouldn't call this if there are no handlers.");
- Stmt **Handlers = RawHandlers.get();
+ Stmt **Handlers = RawHandlers.data();
SmallVector<TypeWithHandler, 8> TypesWithHandlers;
diff --git a/lib/Sema/SemaStmtAsm.cpp b/lib/Sema/SemaStmtAsm.cpp
index 874ab545e7..38bc254438 100644
--- a/lib/Sema/SemaStmtAsm.cpp
+++ b/lib/Sema/SemaStmtAsm.cpp
@@ -99,10 +99,10 @@ StmtResult Sema::ActOnAsmStmt(SourceLocation AsmLoc, bool IsSimple,
SourceLocation RParenLoc) {
unsigned NumClobbers = clobbers.size();
StringLiteral **Constraints =
- reinterpret_cast<StringLiteral**>(constraints.get());
- Expr **Exprs = exprs.get();
+ reinterpret_cast<StringLiteral**>(constraints.data());
+ Expr **Exprs = exprs.data();
StringLiteral *AsmString = cast<StringLiteral>(asmString);
- StringLiteral **Clobbers = reinterpret_cast<StringLiteral**>(clobbers.get());
+ StringLiteral **Clobbers = reinterpret_cast<StringLiteral**>(clobbers.data());
SmallVector<TargetInfo::ConstraintInfo, 4> OutputConstraintInfos;
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 61e002a7c8..977b360230 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -5201,7 +5201,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
= MatchTemplateParametersToScopeSpecifier(TemplateNameLoc,
TemplateNameLoc,
SS,
- (TemplateParameterList**)TemplateParameterLists.get(),
+ TemplateParameterLists.data(),
TemplateParameterLists.size(),
TUK == TUK_Friend,
isExplicitSpecialization,
@@ -5356,7 +5356,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
if (TemplateParameterLists.size() > 0) {
Specialization->setTemplateParameterListsInfo(Context,
TemplateParameterLists.size(),
- (TemplateParameterList**) TemplateParameterLists.get());
+ TemplateParameterLists.data());
}
PrevDecl = 0;
CanonType = Context.getTypeDeclType(Specialization);
@@ -5384,7 +5384,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
TemplateParams,
AS_none, /*ModulePrivateLoc=*/SourceLocation(),
TemplateParameterLists.size() - 1,
- (TemplateParameterList**) TemplateParameterLists.get());
+ TemplateParameterLists.data());
}
// Create a new class template partial specialization declaration node.
@@ -5408,7 +5408,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
if (TemplateParameterLists.size() > 1 && SS.isSet()) {
Partial->setTemplateParameterListsInfo(Context,
TemplateParameterLists.size() - 1,
- (TemplateParameterList**) TemplateParameterLists.get());
+ TemplateParameterLists.data());
}
if (!PrevPartial)
@@ -5463,7 +5463,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
if (TemplateParameterLists.size() > 0) {
Specialization->setTemplateParameterListsInfo(Context,
TemplateParameterLists.size(),
- (TemplateParameterList**) TemplateParameterLists.get());
+ TemplateParameterLists.data());
}
if (!PrevDecl)
@@ -6475,9 +6475,8 @@ Sema::ActOnExplicitInstantiation(Scope *S,
Decl *TagD = ActOnTag(S, TagSpec, Sema::TUK_Reference,
KWLoc, SS, Name, NameLoc, Attr, AS_none,
/*ModulePrivateLoc=*/SourceLocation(),
- MultiTemplateParamsArg(*this, 0, 0),
- Owned, IsDependent, SourceLocation(), false,
- Typ