forked from OSchip/llvm-project
Pass the ConstructLoc to BuildCXXConstructExpr.
llvm-svn: 81068
This commit is contained in:
parent
453fe4285d
commit
1b4ebfab2b
|
@ -1812,13 +1812,17 @@ public:
|
|||
QualType DeclInitType,
|
||||
Expr **Exprs, unsigned NumExprs);
|
||||
|
||||
OwningExprResult BuildCXXConstructExpr(QualType DeclInitType,
|
||||
/// BuildCXXConstructExpr - Creates a complete call to a constructor,
|
||||
/// including handling of its default argument expressions.
|
||||
OwningExprResult BuildCXXConstructExpr(SourceLocation ConstructLoc,
|
||||
QualType DeclInitType,
|
||||
CXXConstructorDecl *Constructor,
|
||||
Expr **Exprs, unsigned NumExprs);
|
||||
|
||||
/// BuildCXXConstructExpr - Creates a complete call to a constructor,
|
||||
/// including handling of its default argument expressions.
|
||||
OwningExprResult BuildCXXConstructExpr(QualType DeclInitType,
|
||||
// FIXME: Can re remove this and have the above BuildCXXConstructExpr check if
|
||||
// the constructor can be elidable?
|
||||
OwningExprResult BuildCXXConstructExpr(SourceLocation ConstructLoc,
|
||||
QualType DeclInitType,
|
||||
CXXConstructorDecl *Constructor,
|
||||
bool Elidable,
|
||||
Expr **Exprs, unsigned NumExprs);
|
||||
|
|
|
@ -2808,7 +2808,7 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation,
|
|||
}
|
||||
|
||||
Sema::OwningExprResult
|
||||
Sema::BuildCXXConstructExpr(QualType DeclInitType,
|
||||
Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType,
|
||||
CXXConstructorDecl *Constructor,
|
||||
Expr **Exprs, unsigned NumExprs) {
|
||||
bool Elidable = false;
|
||||
|
@ -2830,18 +2830,16 @@ Sema::BuildCXXConstructExpr(QualType DeclInitType,
|
|||
Elidable = true;
|
||||
}
|
||||
|
||||
return BuildCXXConstructExpr(DeclInitType, Constructor, Elidable,
|
||||
Exprs, NumExprs);
|
||||
return BuildCXXConstructExpr(ConstructLoc, DeclInitType, Constructor,
|
||||
Elidable, Exprs, NumExprs);
|
||||
}
|
||||
|
||||
/// BuildCXXConstructExpr - Creates a complete call to a constructor,
|
||||
/// including handling of its default argument expressions.
|
||||
Sema::OwningExprResult
|
||||
Sema::BuildCXXConstructExpr(QualType DeclInitType,
|
||||
CXXConstructorDecl *Constructor,
|
||||
bool Elidable,
|
||||
Expr **Exprs,
|
||||
unsigned NumExprs) {
|
||||
Sema::BuildCXXConstructExpr(SourceLocation ConstructLoc, QualType DeclInitType,
|
||||
CXXConstructorDecl *Constructor, bool Elidable,
|
||||
Expr **Exprs, unsigned NumExprs) {
|
||||
ExprOwningPtr<CXXConstructExpr> Temp(this,
|
||||
CXXConstructExpr::Create(Context,
|
||||
DeclInitType,
|
||||
|
@ -2856,8 +2854,7 @@ Sema::BuildCXXConstructExpr(QualType DeclInitType,
|
|||
ParmVarDecl *Param = FDecl->getParamDecl(j);
|
||||
|
||||
OwningExprResult ArgExpr =
|
||||
BuildCXXDefaultArgExpr(/*FIXME:*/SourceLocation(),
|
||||
FDecl, Param);
|
||||
BuildCXXDefaultArgExpr(ConstructLoc, FDecl, Param);
|
||||
if (ArgExpr.isInvalid())
|
||||
return ExprError();
|
||||
|
||||
|
@ -2901,8 +2898,9 @@ bool Sema::InitializeVarWithConstructor(VarDecl *VD,
|
|||
CXXConstructorDecl *Constructor,
|
||||
QualType DeclInitType,
|
||||
Expr **Exprs, unsigned NumExprs) {
|
||||
OwningExprResult TempResult = BuildCXXConstructExpr(DeclInitType, Constructor,
|
||||
Exprs, NumExprs);
|
||||
OwningExprResult TempResult =
|
||||
BuildCXXConstructExpr(/*FIXME: ConstructLoc*/ SourceLocation(),
|
||||
DeclInitType, Constructor, Exprs, NumExprs);
|
||||
if (TempResult.isInvalid())
|
||||
return true;
|
||||
|
||||
|
|
|
@ -941,7 +941,8 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
|
|||
// FIXME. Do we need to check for isLValueReferenceType?
|
||||
DefaultFunctionArrayConversion(From);
|
||||
OwningExprResult InitResult =
|
||||
BuildCXXConstructExpr(ToType.getNonReferenceType(),
|
||||
BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
|
||||
ToType.getNonReferenceType(),
|
||||
CD, &From, 1);
|
||||
// Take ownership of this expression.
|
||||
From = InitResult.takeAs<Expr>();
|
||||
|
@ -986,7 +987,8 @@ Sema::PerformImplicitConversion(Expr *&From, QualType ToType,
|
|||
assert(!ToType->isReferenceType());
|
||||
|
||||
OwningExprResult FromResult =
|
||||
BuildCXXConstructExpr(ToType, SCS.CopyConstructor, &From, 1);
|
||||
BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
|
||||
ToType, SCS.CopyConstructor, &From, 1);
|
||||
|
||||
if (FromResult.isInvalid())
|
||||
return true;
|
||||
|
|
|
@ -181,7 +181,8 @@ bool Sema::CheckInitializerTypes(Expr *&Init, QualType &DeclType,
|
|||
return true;
|
||||
|
||||
OwningExprResult InitResult =
|
||||
BuildCXXConstructExpr(DeclType, Constructor, &Init, 1);
|
||||
BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
|
||||
DeclType, Constructor, &Init, 1);
|
||||
if (InitResult.isInvalid())
|
||||
return true;
|
||||
|
||||
|
|
|
@ -1450,7 +1450,9 @@ public:
|
|||
MultiExprArg Args) {
|
||||
unsigned NumArgs = Args.size();
|
||||
Expr **ArgsExprs = (Expr **)Args.release();
|
||||
return getSema().BuildCXXConstructExpr(T, Constructor, IsElidable,
|
||||
return getSema().BuildCXXConstructExpr(/*FIXME:ConstructLoc*/
|
||||
SourceLocation(),
|
||||
T, Constructor, IsElidable,
|
||||
ArgsExprs, NumArgs);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue