aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/TreeTransform.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/TreeTransform.h')
-rw-r--r--lib/Sema/TreeTransform.h630
1 files changed, 298 insertions, 332 deletions
diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h
index 40358e31bc..843580bee1 100644
--- a/lib/Sema/TreeTransform.h
+++ b/lib/Sema/TreeTransform.h
@@ -91,8 +91,6 @@ protected:
public:
typedef Sema::OwningStmtResult OwningStmtResult;
typedef Sema::OwningExprResult OwningExprResult;
- typedef Sema::StmtArg StmtArg;
- typedef Sema::ExprArg ExprArg;
typedef Sema::MultiExprArg MultiExprArg;
typedef Sema::MultiStmtArg MultiStmtArg;
@@ -107,6 +105,9 @@ public:
return static_cast<const Derived&>(*this);
}
+ static inline OwningExprResult Owned(Expr *E) { return E; }
+ static inline OwningStmtResult Owned(Stmt *S) { return S; }
+
/// \brief Retrieves a reference to the semantic analysis object used for
/// this tree transform.
Sema &getSema() const { return SemaRef; }
@@ -420,7 +421,7 @@ public:
/// Subclasses may override this routine to provide different behavior.
QualType RebuildVariableArrayType(QualType ElementType,
ArrayType::ArraySizeModifier SizeMod,
- ExprArg SizeExpr,
+ Expr *SizeExpr,
unsigned IndexTypeQuals,
SourceRange BracketsRange);
@@ -431,7 +432,7 @@ public:
/// Subclasses may override this routine to provide different behavior.
QualType RebuildDependentSizedArrayType(QualType ElementType,
ArrayType::ArraySizeModifier SizeMod,
- ExprArg SizeExpr,
+ Expr *SizeExpr,
unsigned IndexTypeQuals,
SourceRange BracketsRange);
@@ -457,7 +458,7 @@ public:
/// By default, performs semantic analysis when building the vector type.
/// Subclasses may override this routine to provide different behavior.
QualType RebuildDependentSizedExtVectorType(QualType ElementType,
- ExprArg SizeExpr,
+ Expr *SizeExpr,
SourceLocation AttributeLoc);
/// \brief Build a new function type.
@@ -496,7 +497,7 @@ public:
///
/// By default, performs semantic analysis when building the typeof type.
/// Subclasses may override this routine to provide different behavior.
- QualType RebuildTypeOfExprType(ExprArg Underlying);
+ QualType RebuildTypeOfExprType(Expr *Underlying);
/// \brief Build a new typeof(type) type.
///
@@ -507,7 +508,7 @@ public:
///
/// By default, performs semantic analysis when building the decltype type.
/// Subclasses may override this routine to provide different behavior.
- QualType RebuildDecltypeType(ExprArg Underlying);
+ QualType RebuildDecltypeType(Expr *Underlying);
/// \brief Build a new template specialization type.
///
@@ -712,7 +713,7 @@ public:
MultiStmtArg Statements,
SourceLocation RBraceLoc,
bool IsStmtExpr) {
- return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, move(Statements),
+ return getSema().ActOnCompoundStmt(LBraceLoc, RBraceLoc, Statements,
IsStmtExpr);
}
@@ -721,11 +722,11 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildCaseStmt(SourceLocation CaseLoc,
- ExprArg LHS,
+ Expr *LHS,
SourceLocation EllipsisLoc,
- ExprArg RHS,
+ Expr *RHS,
SourceLocation ColonLoc) {
- return getSema().ActOnCaseStmt(CaseLoc, move(LHS), EllipsisLoc, move(RHS),
+ return getSema().ActOnCaseStmt(CaseLoc, LHS, EllipsisLoc, RHS,
ColonLoc);
}
@@ -733,9 +734,9 @@ public:
///
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
- OwningStmtResult RebuildCaseStmtBody(StmtArg S, StmtArg Body) {
- getSema().ActOnCaseStmtBody(S.get(), move(Body));
- return move(S);
+ OwningStmtResult RebuildCaseStmtBody(Stmt *S, Stmt *Body) {
+ getSema().ActOnCaseStmtBody(S, Body);
+ return S;
}
/// \brief Build a new default statement.
@@ -744,8 +745,8 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildDefaultStmt(SourceLocation DefaultLoc,
SourceLocation ColonLoc,
- StmtArg SubStmt) {
- return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, move(SubStmt),
+ Stmt *SubStmt) {
+ return getSema().ActOnDefaultStmt(DefaultLoc, ColonLoc, SubStmt,
/*CurScope=*/0);
}
@@ -756,8 +757,8 @@ public:
OwningStmtResult RebuildLabelStmt(SourceLocation IdentLoc,
IdentifierInfo *Id,
SourceLocation ColonLoc,
- StmtArg SubStmt) {
- return SemaRef.ActOnLabelStmt(IdentLoc, Id, ColonLoc, move(SubStmt));
+ Stmt *SubStmt) {
+ return SemaRef.ActOnLabelStmt(IdentLoc, Id, ColonLoc, SubStmt);
}
/// \brief Build a new "if" statement.
@@ -765,10 +766,9 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildIfStmt(SourceLocation IfLoc, Sema::FullExprArg Cond,
- VarDecl *CondVar, StmtArg Then,
- SourceLocation ElseLoc, StmtArg Else) {
- return getSema().ActOnIfStmt(IfLoc, Cond, CondVar,
- move(Then), ElseLoc, move(Else));
+ VarDecl *CondVar, Stmt *Then,
+ SourceLocation ElseLoc, Stmt *Else) {
+ return getSema().ActOnIfStmt(IfLoc, Cond, CondVar, Then, ElseLoc, Else);
}
/// \brief Start building a new switch statement.
@@ -776,9 +776,8 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildSwitchStmtStart(SourceLocation SwitchLoc,
- Sema::ExprArg Cond,
- VarDecl *CondVar) {
- return getSema().ActOnStartOfSwitchStmt(SwitchLoc, move(Cond),
+ Expr *Cond, VarDecl *CondVar) {
+ return getSema().ActOnStartOfSwitchStmt(SwitchLoc, Cond,
CondVar);
}
@@ -787,9 +786,8 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildSwitchStmtBody(SourceLocation SwitchLoc,
- StmtArg Switch, StmtArg Body) {
- return getSema().ActOnFinishSwitchStmt(SwitchLoc, move(Switch),
- move(Body));
+ Stmt *Switch, Stmt *Body) {
+ return getSema().ActOnFinishSwitchStmt(SwitchLoc, Switch, Body);
}
/// \brief Build a new while statement.
@@ -799,22 +797,21 @@ public:
OwningStmtResult RebuildWhileStmt(SourceLocation WhileLoc,
Sema::FullExprArg Cond,
VarDecl *CondVar,
- StmtArg Body) {
- return getSema().ActOnWhileStmt(WhileLoc, Cond,
- CondVar, move(Body));
+ Stmt *Body) {
+ return getSema().ActOnWhileStmt(WhileLoc, Cond, CondVar, Body);
}
/// \brief Build a new do-while statement.
///
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
- OwningStmtResult RebuildDoStmt(SourceLocation DoLoc, StmtArg Body,
+ OwningStmtResult RebuildDoStmt(SourceLocation DoLoc, Stmt *Body,
SourceLocation WhileLoc,
SourceLocation LParenLoc,
- ExprArg Cond,
+ Expr *Cond,
SourceLocation RParenLoc) {
- return getSema().ActOnDoStmt(DoLoc, move(Body), WhileLoc, LParenLoc,
- move(Cond), RParenLoc);
+ return getSema().ActOnDoStmt(DoLoc, Body, WhileLoc, LParenLoc,
+ Cond, RParenLoc);
}
/// \brief Build a new for statement.
@@ -823,12 +820,12 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildForStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
- StmtArg Init, Sema::FullExprArg Cond,
+ Stmt *Init, Sema::FullExprArg Cond,
VarDecl *CondVar, Sema::FullExprArg Inc,
- SourceLocation RParenLoc, StmtArg Body) {
- return getSema().ActOnForStmt(ForLoc, LParenLoc, move(Init), Cond,
+ SourceLocation RParenLoc, Stmt *Body) {
+ return getSema().ActOnForStmt(ForLoc, LParenLoc, Init, Cond,
CondVar,
- Inc, RParenLoc, move(Body));
+ Inc, RParenLoc, Body);
}
/// \brief Build a new goto statement.
@@ -847,8 +844,8 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildIndirectGotoStmt(SourceLocation GotoLoc,
SourceLocation StarLoc,
- ExprArg Target) {
- return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, move(Target));
+ Expr *Target) {
+ return getSema().ActOnIndirectGotoStmt(GotoLoc, StarLoc, Target);
}
/// \brief Build a new return statement.
@@ -856,9 +853,9 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildReturnStmt(SourceLocation ReturnLoc,
- ExprArg Result) {
+ Expr *Result) {
- return getSema().ActOnReturnStmt(ReturnLoc, move(Result));
+ return getSema().ActOnReturnStmt(ReturnLoc, Result);
}
/// \brief Build a new declaration statement.
@@ -887,13 +884,13 @@ public:
IdentifierInfo **Names,
MultiExprArg Constraints,
MultiExprArg Exprs,
- ExprArg AsmString,
+ Expr *AsmString,
MultiExprArg Clobbers,
SourceLocation RParenLoc,
bool MSAsm) {
return getSema().ActOnAsmStmt(AsmLoc, IsSimple, IsVolatile, NumOutputs,
NumInputs, Names, move(Constraints),
- move(Exprs), move(AsmString), move(Clobbers),
+ Exprs, AsmString, Clobbers,
RParenLoc, MSAsm);
}
@@ -902,11 +899,11 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildObjCAtTryStmt(SourceLocation AtLoc,
- StmtArg TryBody,
+ Stmt *TryBody,
MultiStmtArg CatchStmts,
- StmtArg Finally) {
- return getSema().ActOnObjCAtTryStmt(AtLoc, move(TryBody), move(CatchStmts),
- move(Finally));
+ Stmt *Finally) {
+ return getSema().ActOnObjCAtTryStmt(AtLoc, TryBody, move(CatchStmts),
+ Finally);
}
/// \brief Rebuild an Objective-C exception declaration.
@@ -927,9 +924,9 @@ public:
OwningStmtResult RebuildObjCAtCatchStmt(SourceLocation AtLoc,
SourceLocation RParenLoc,
VarDecl *Var,
- StmtArg Body) {
+ Stmt *Body) {
return getSema().ActOnObjCAtCatchStmt(AtLoc, RParenLoc,
- Var, move(Body));
+ Var, Body);
}
/// \brief Build a new Objective-C @finally statement.
@@ -937,8 +934,8 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildObjCAtFinallyStmt(SourceLocation AtLoc,
- StmtArg Body) {
- return getSema().ActOnObjCAtFinallyStmt(AtLoc, move(Body));
+ Stmt *Body) {
+ return getSema().ActOnObjCAtFinallyStmt(AtLoc, Body);
}
/// \brief Build a new Objective-C @throw statement.
@@ -946,8 +943,8 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildObjCAtThrowStmt(SourceLocation AtLoc,
- ExprArg Operand) {
- return getSema().BuildObjCAtThrowStmt(AtLoc, move(Operand));
+ Expr *Operand) {
+ return getSema().BuildObjCAtThrowStmt(AtLoc, Operand);
}
/// \brief Build a new Objective-C @synchronized statement.
@@ -955,10 +952,10 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildObjCAtSynchronizedStmt(SourceLocation AtLoc,
- ExprArg Object,
- StmtArg Body) {
- return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, move(Object),
- move(Body));
+ Expr *Object,
+ Stmt *Body) {
+ return getSema().ActOnObjCAtSynchronizedStmt(AtLoc, Object,
+ Body);
}
/// \brief Build a new Objective-C fast enumeration statement.
@@ -967,15 +964,15 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildObjCForCollectionStmt(SourceLocation ForLoc,
SourceLocation LParenLoc,
- StmtArg Element,
- ExprArg Collection,
+ Stmt *Element,
+ Expr *Collection,
SourceLocation RParenLoc,
- StmtArg Body) {
+ Stmt *Body) {
return getSema().ActOnObjCForCollectionStmt(ForLoc, LParenLoc,
- move(Element),
- move(Collection),
+ Element,
+ Collection,
RParenLoc,
- move(Body));
+ Body);
}
/// \brief Build a new C++ exception declaration.
@@ -997,10 +994,9 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildCXXCatchStmt(SourceLocation CatchLoc,
VarDecl *ExceptionDecl,
- StmtArg Handler) {
- return getSema().Owned(
- new (getSema().Context) CXXCatchStmt(CatchLoc, ExceptionDecl,
- Handler.takeAs<Stmt>()));
+ Stmt *Handler) {
+ return Owned(new (getSema().Context) CXXCatchStmt(CatchLoc, ExceptionDecl,
+ Handler));
}
/// \brief Build a new C++ try statement.
@@ -1008,9 +1004,9 @@ public:
/// By default, performs semantic analysis to build the new statement.
/// Subclasses may override this routine to provide different behavior.
OwningStmtResult RebuildCXXTryStmt(SourceLocation TryLoc,
- StmtArg TryBlock,
+ Stmt *TryBlock,
MultiStmtArg Handlers) {
- return getSema().ActOnCXXTryBlock(TryLoc, move(TryBlock), move(Handlers));
+ return getSema().ActOnCXXTryBlock(TryLoc, TryBlock, move(Handlers));
}
/// \brief Build a new expression that references a declaration.
@@ -1046,16 +1042,16 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildParenExpr(ExprArg SubExpr, SourceLocation LParen,
+ OwningExprResult RebuildParenExpr(Expr *SubExpr, SourceLocation LParen,
SourceLocation RParen) {
- return getSema().ActOnParenExpr(LParen, RParen, move(SubExpr));
+ return getSema().ActOnParenExpr(LParen, RParen, SubExpr);
}
/// \brief Build a new pseudo-destructor expression.
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildCXXPseudoDestructorExpr(ExprArg Base,
+ OwningExprResult RebuildCXXPseudoDestructorExpr(Expr *Base,
SourceLocation OperatorLoc,
bool isArrow,
NestedNameSpecifier *Qualifier,
@@ -1071,8 +1067,8 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildUnaryOperator(SourceLocation OpLoc,
UnaryOperator::Opcode Opc,
- ExprArg SubExpr) {
- return getSema().BuildUnaryOp(/*Scope=*/0, OpLoc, Opc, move(SubExpr));
+ Expr *SubExpr) {
+ return getSema().BuildUnaryOp(/*Scope=*/0, OpLoc, Opc, SubExpr);
}
/// \brief Build a new builtin offsetof expression.
@@ -1103,15 +1099,13 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildSizeOfAlignOf(ExprArg SubExpr, SourceLocation OpLoc,
+ OwningExprResult RebuildSizeOfAlignOf(Expr *SubExpr, SourceLocation OpLoc,
bool isSizeOf, SourceRange R) {
OwningExprResult Result
- = getSema().CreateSizeOfAlignOfExpr((Expr *)SubExpr.get(),
- OpLoc, isSizeOf, R);
+ = getSema().CreateSizeOfAlignOfExpr(SubExpr, OpLoc, isSizeOf, R);
if (Result.isInvalid())
return getSema().ExprError();
- SubExpr.release();
return move(Result);
}
@@ -1119,12 +1113,12 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildArraySubscriptExpr(ExprArg LHS,
+ OwningExprResult RebuildArraySubscriptExpr(Expr *LHS,
SourceLocation LBracketLoc,
- ExprArg RHS,
+ Expr *RHS,
SourceLocation RBracketLoc) {
- return getSema().ActOnArraySubscriptExpr(/*Scope=*/0, move(LHS),
- LBracketLoc, move(RHS),
+ return getSema().ActOnArraySubscriptExpr(/*Scope=*/0, LHS,
+ LBracketLoc, RHS,
RBracketLoc);
}
@@ -1132,11 +1126,11 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildCallExpr(ExprArg Callee, SourceLocation LParenLoc,
+ OwningExprResult RebuildCallExpr(Expr *Callee, SourceLocation LParenLoc,
MultiExprArg Args,
SourceLocation *CommaLocs,
SourceLocation RParenLoc) {
- return getSema().ActOnCallExpr(/*Scope=*/0, move(Callee), LParenLoc,
+ return getSema().ActOnCallExpr(/*Scope=*/0, Callee, LParenLoc,
move(Args), CommaLocs, RParenLoc);
}
@@ -1144,7 +1138,7 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildMemberExpr(ExprArg Base, SourceLocation OpLoc,
+ OwningExprResult RebuildMemberExpr(Expr *Base, SourceLocation OpLoc,
bool isArrow,
NestedNameSpecifier *Qualifier,
SourceRange QualifierRange,
@@ -1157,13 +1151,12 @@ public:
// We have a reference to an unnamed field.
assert(!Qualifier && "Can't have an unnamed field with a qualifier!");
- Expr *BaseExpr = Base.takeAs<Expr>();
- if (getSema().PerformObjectMemberConversion(BaseExpr, Qualifier,
+ if (getSema().PerformObjectMemberConversion(Base, Qualifier,
FoundDecl, Member))
return getSema().ExprError();
MemberExpr *ME =
- new (getSema().Context) MemberExpr(BaseExpr, isArrow,
+ new (getSema().Context) MemberExpr(Base, isArrow,
Member, MemberNameInfo,
cast<FieldDecl>(Member)->getType());
return getSema().Owned(ME);
@@ -1175,9 +1168,8 @@ public:
SS.setScopeRep(Qualifier);
}
- Expr *BaseExpr = Base.takeAs<Expr>();
- getSema().DefaultFunctionArrayConversion(BaseExpr);
- QualType BaseType = BaseExpr->getType();
+ getSema().DefaultFunctionArrayConversion(Base);
+ QualType BaseType = Base->getType();
// FIXME: this involves duplicating earlier analysis in a lot of
// cases; we should avoid this when possible.
@@ -1185,8 +1177,7 @@ public:
R.addDecl(FoundDecl);
R.resolveKind();
- return getSema().BuildMemberReferenceExpr(getSema().Owned(BaseExpr),
- BaseType, OpLoc, isArrow,
+ return getSema().BuildMemberReferenceExpr(Base, BaseType, OpLoc, isArrow,
SS, FirstQualifierInScope,
R, ExplicitTemplateArgs);
}
@@ -1197,22 +1188,21 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildBinaryOperator(SourceLocation OpLoc,
BinaryOperator::Opcode Opc,
- ExprArg LHS, ExprArg RHS) {
- return getSema().BuildBinOp(/*Scope=*/0, OpLoc, Opc,
- LHS.takeAs<Expr>(), RHS.takeAs<Expr>());
+ Expr *LHS, Expr *RHS) {
+ return getSema().BuildBinOp(/*Scope=*/0, OpLoc, Opc, LHS, RHS);
}
/// \brief Build a new conditional operator expression.
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildConditionalOperator(ExprArg Cond,
+ OwningExprResult RebuildConditionalOperator(Expr *Cond,
SourceLocation QuestionLoc,
- ExprArg LHS,
+ Expr *LHS,
SourceLocation ColonLoc,
- ExprArg RHS) {
- return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, move(Cond),
- move(LHS), move(RHS));
+ Expr *RHS) {
+ return getSema().ActOnConditionalOp(QuestionLoc, ColonLoc, Cond,
+ LHS, RHS);
}
/// \brief Build a new C-style cast expression.
@@ -1222,9 +1212,9 @@ public:
OwningExprResult RebuildCStyleCastExpr(SourceLocation LParenLoc,
TypeSourceInfo *TInfo,
SourceLocation RParenLoc,
- ExprArg SubExpr) {
+ Expr *SubExpr) {
return getSema().BuildCStyleCastExpr(LParenLoc, TInfo, RParenLoc,
- move(SubExpr));
+ SubExpr);
}
/// \brief Build a new compound literal expression.
@@ -1234,24 +1224,23 @@ public:
OwningExprResult RebuildCompoundLiteralExpr(SourceLocation LParenLoc,
TypeSourceInfo *TInfo,
SourceLocation RParenLoc,
- ExprArg Init) {
+ Expr *Init) {
return getSema().BuildCompoundLiteralExpr(LParenLoc, TInfo, RParenLoc,
- move(Init));
+ Init);
}
/// \brief Build a new extended vector element access expression.
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildExtVectorElementExpr(ExprArg Base,
+ OwningExprResult RebuildExtVectorElementExpr(Expr *Base,
SourceLocation OpLoc,
SourceLocation AccessorLoc,
IdentifierInfo &Accessor) {
CXXScopeSpec SS;
- QualType BaseType = ((Expr*) Base.get())->getType();
DeclarationNameInfo NameInfo(&Accessor, AccessorLoc);
- return getSema().BuildMemberReferenceExpr(move(Base), BaseType,
+ return getSema().BuildMemberReferenceExpr(Base, Base->getType(),
OpLoc, /*IsArrow*/ false,
SS, /*FirstQualifierInScope*/ 0,
NameInfo,
@@ -1286,10 +1275,10 @@ public:
MultiExprArg ArrayExprs,
SourceLocation EqualOrColonLoc,
bool GNUSyntax,
- ExprArg Init) {
+ Expr *Init) {
OwningExprResult Result
= SemaRef.ActOnDesignatedInitializer(Desig, EqualOrColonLoc, GNUSyntax,
- move(Init));
+ Init);
if (Result.isInvalid())
return SemaRef.ExprError();
@@ -1311,10 +1300,10 @@ public:
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildVAArgExpr(SourceLocation BuiltinLoc,
- ExprArg SubExpr, TypeSourceInfo *TInfo,
+ Expr *SubExpr, TypeSourceInfo *TInfo,
SourceLocation RParenLoc) {
return getSema().BuildVAArgExpr(BuiltinLoc,
- move(SubExpr), TInfo,
+ SubExpr, TInfo,
RParenLoc);
}
@@ -1345,9 +1334,9 @@ public:
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildStmtExpr(SourceLocation LParenLoc,
- StmtArg SubStmt,
+ Stmt *SubStmt,
SourceLocation RParenLoc) {
- return getSema().ActOnStmtExpr(LParenLoc, move(SubStmt), RParenLoc);
+ return getSema().ActOnStmtExpr(LParenLoc, SubStmt, RParenLoc);
}
/// \brief Build a new __builtin_types_compatible_p expression.
@@ -1368,10 +1357,10 @@ public:
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildChooseExpr(SourceLocation BuiltinLoc,
- ExprArg Cond, ExprArg LHS, ExprArg RHS,
+ Expr *Cond, Expr *LHS, Expr *RHS,
SourceLocation RParenLoc) {
return SemaRef.ActOnChooseExpr(BuiltinLoc,
- move(Cond), move(LHS), move(RHS),
+ Cond, LHS, RHS,
RParenLoc);
}
@@ -1385,9 +1374,9 @@ public:
/// provide different behavior.
OwningExprResult RebuildCXXOperatorCallExpr(OverloadedOperatorKind Op,
SourceLocation OpLoc,
- ExprArg Callee,
- ExprArg First,
- ExprArg Second);
+ Expr *Callee,
+ Expr *First,
+ Expr *Second);
/// \brief Build a new C++ "named" cast expression, such as static_cast or
/// reinterpret_cast.
@@ -1401,29 +1390,29 @@ public:
TypeSourceInfo *TInfo,
SourceLocation RAngleLoc,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *SubExpr,
SourceLocation RParenLoc) {
switch (Class) {
case Stmt::CXXStaticCastExprClass:
return getDerived().RebuildCXXStaticCastExpr(OpLoc, LAngleLoc, TInfo,
RAngleLoc, LParenLoc,
- move(SubExpr), RParenLoc);
+ SubExpr, RParenLoc);
case Stmt::CXXDynamicCastExprClass:
return getDerived().RebuildCXXDynamicCastExpr(OpLoc, LAngleLoc, TInfo,
RAngleLoc, LParenLoc,
- move(SubExpr), RParenLoc);
+ SubExpr, RParenLoc);
case Stmt::CXXReinterpretCastExprClass:
return getDerived().RebuildCXXReinterpretCastExpr(OpLoc, LAngleLoc, TInfo,
RAngleLoc, LParenLoc,
- move(SubExpr),
+ SubExpr,
RParenLoc);
case Stmt::CXXConstCastExprClass:
return getDerived().RebuildCXXConstCastExpr(OpLoc, LAngleLoc, TInfo,
RAngleLoc, LParenLoc,
- move(SubExpr), RParenLoc);
+ SubExpr, RParenLoc);
default:
assert(false && "Invalid C++ named cast");
@@ -1442,10 +1431,10 @@ public:
TypeSourceInfo *TInfo,
SourceLocation RAngleLoc,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *SubExpr,
SourceLocation RParenLoc) {
return getSema().BuildCXXNamedCast(OpLoc, tok::kw_static_cast,
- TInfo, move(SubExpr),
+ TInfo, SubExpr,
SourceRange(LAngleLoc, RAngleLoc),
SourceRange(LParenLoc, RParenLoc));
}
@@ -1459,10 +1448,10 @@ public:
TypeSourceInfo *TInfo,
SourceLocation RAngleLoc,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *SubExpr,
SourceLocation RParenLoc) {
return getSema().BuildCXXNamedCast(OpLoc, tok::kw_dynamic_cast,
- TInfo, move(SubExpr),
+ TInfo, SubExpr,
SourceRange(LAngleLoc, RAngleLoc),
SourceRange(LParenLoc, RParenLoc));
}
@@ -1476,10 +1465,10 @@ public:
TypeSourceInfo *TInfo,
SourceLocation RAngleLoc,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *SubExpr,
SourceLocation RParenLoc) {
return getSema().BuildCXXNamedCast(OpLoc, tok::kw_reinterpret_cast,
- TInfo, move(SubExpr),
+ TInfo, SubExpr,
SourceRange(LAngleLoc, RAngleLoc),
SourceRange(LParenLoc, RParenLoc));
}
@@ -1493,10 +1482,10 @@ public:
TypeSourceInfo *TInfo,
SourceLocation RAngleLoc,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *SubExpr,
SourceLocation RParenLoc) {
return getSema().BuildCXXNamedCast(OpLoc, tok::kw_const_cast,
- TInfo, move(SubExpr),
+ TInfo, SubExpr,
SourceRange(LAngleLoc, RAngleLoc),
SourceRange(LParenLoc, RParenLoc));
}
@@ -1508,9 +1497,8 @@ public:
OwningExprResult RebuildCXXFunctionalCastExpr(SourceRange TypeRange,
TypeSourceInfo *TInfo,
SourceLocation LParenLoc,
- ExprArg SubExpr,
+ Expr *Sub,
SourceLocation RParenLoc) {
- Expr *Sub = SubExpr.get();
return getSema().ActOnCXXTypeConstructExpr(TypeRange,
TInfo->getType().getAsOpaquePtr(),
LParenLoc,
@@ -1537,9 +1525,9 @@ public:
/// Subclasses may override this routine to provide different behavior.
OwningExprResult RebuildCXXTypeidExpr(QualType TypeInfoType,
SourceLocation TypeidLoc,
- ExprArg Operand,
+ Expr *Operand,
SourceLocation RParenLoc) {
- return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, move(Operand),
+ return getSema().BuildCXXTypeId(TypeInfoType, TypeidLoc, Operand,
RParenLoc);
}
@@ -1560,8 +1548,8 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildCXXThrowExpr(SourceLocation ThrowLoc, ExprArg Sub) {
- return getSema().ActOnCXXThrow(ThrowLoc, move(Sub));
+ OwningExprResult RebuildCXXThrowExpr(SourceLocation ThrowLoc, Expr *Sub) {
+ return getSema().ActOnCXXThrow(ThrowLoc, Sub);
}
/// \brief Build a new C++ default-argument expression.
@@ -1602,7 +1590,7 @@ public:
QualType AllocType,
SourceLocation TypeLoc,
SourceRange TypeRange,
- ExprArg ArraySize,
+ Expr *ArraySize,
SourceLocation ConstructorLParen,
MultiExprArg ConstructorArgs,
SourceLocation ConstructorRParen) {
@@ -1614,7 +1602,7 @@ public:
AllocType,
TypeLoc,
TypeRange,
- move(ArraySize),
+ ArraySize,
ConstructorLParen,
move(ConstructorArgs),
ConstructorRParen);
@@ -1627,9 +1615,9 @@ public:
OwningExprResult RebuildCXXDeleteExpr(SourceLocation StartLoc,
bool IsGlobalDelete,
bool IsArrayForm,
- ExprArg Operand) {
+ Expr *Operand) {
return getSema().ActOnCXXDelete(StartLoc, IsGlobalDelete, IsArrayForm,
- move(Operand));
+ Operand);
}
/// \brief Build a new unary type trait expression.
@@ -1738,7 +1726,7 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildCXXDependentScopeMemberExpr(ExprArg BaseE,
+ OwningExprResult RebuildCXXDependentScopeMemberExpr(Expr *BaseE,
QualType BaseType,
bool IsArrow,
SourceLocation OperatorLoc,
@@ -1751,7 +1739,7 @@ public:
SS.setRange(QualifierRange);
SS.setScopeRep(Qualifier);
- return SemaRef.BuildMemberReferenceExpr(move(BaseE), BaseType,
+ return SemaRef.BuildMemberReferenceExpr(BaseE, BaseType,
OperatorLoc, IsArrow,
SS, FirstQualifierInScope,
MemberNameInfo,
@@ -1762,7 +1750,7 @@ public:
///
/// By default, performs semantic analysis to build the new expression.
/// Subclasses may override this routine to provide different behavior.
- OwningExprResult RebuildUnresolvedMemberExpr(ExprArg BaseE,
+ OwningExprResult RebuildUnresolvedMemberExpr(Expr *BaseE,
QualType BaseType,
SourceLocation OperatorLoc,
bool IsArrow,
@@ -1775,7 +1763,7 @@ public:
SS.setRange(QualifierRange);
SS.setScopeRep(Qualifier);
- return SemaRef.BuildMemberReferenceExpr(move(BaseE), BaseType,
+ return SemaRef.BuildMemberReferenceExpr(BaseE, BaseType,
OperatorLoc, IsArrow,
SS, FirstQualifierInScope,
R, TemplateArgs);
@@ -1807,15 +1795,14 @@ public:
}