[cfe-commits] r81068 - in /cfe/trunk/lib/Sema: Sema.h SemaDeclCXX.cpp SemaExprCXX.cpp SemaInit.cpp TreeTransform.h
Anders Carlsson
andersca at mac.com
Sat Sep 5 00:40:40 PDT 2009
Author: andersca
Date: Sat Sep 5 02:40:38 2009
New Revision: 81068
URL: http://llvm.org/viewvc/llvm-project?rev=81068&view=rev
Log:
Pass the ConstructLoc to BuildCXXConstructExpr.
Modified:
cfe/trunk/lib/Sema/Sema.h
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/SemaExprCXX.cpp
cfe/trunk/lib/Sema/SemaInit.cpp
cfe/trunk/lib/Sema/TreeTransform.h
Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=81068&r1=81067&r2=81068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat Sep 5 02:40:38 2009
@@ -1812,13 +1812,17 @@
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);
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=81068&r1=81067&r2=81068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Sep 5 02:40:38 2009
@@ -2808,7 +2808,7 @@
}
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 @@
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 @@
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 @@
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;
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=81068&r1=81067&r2=81068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat Sep 5 02:40:38 2009
@@ -941,7 +941,8 @@
// 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 @@
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;
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=81068&r1=81067&r2=81068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Sat Sep 5 02:40:38 2009
@@ -181,7 +181,8 @@
return true;
OwningExprResult InitResult =
- BuildCXXConstructExpr(DeclType, Constructor, &Init, 1);
+ BuildCXXConstructExpr(/*FIXME:ConstructLoc*/SourceLocation(),
+ DeclType, Constructor, &Init, 1);
if (InitResult.isInvalid())
return true;
Modified: cfe/trunk/lib/Sema/TreeTransform.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=81068&r1=81067&r2=81068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TreeTransform.h (original)
+++ cfe/trunk/lib/Sema/TreeTransform.h Sat Sep 5 02:40:38 2009
@@ -1450,7 +1450,9 @@
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);
}
More information about the cfe-commits
mailing list