return StmtEmpty();
}
- virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc, ExprArg Cond,
- StmtArg Body) {
+ virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
+ FullExprArg Cond, StmtArg Body) {
return StmtEmpty();
}
virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
if (Cond.isInvalid() || Body.isInvalid())
return StmtError();
- return Actions.ActOnWhileStmt(WhileLoc, move(Cond), move(Body));
+ return Actions.ActOnWhileStmt(WhileLoc, Actions.FullExpr(Cond), move(Body));
}
/// ParseDoStatement
virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond);
virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
StmtArg Switch, StmtArg Body);
- virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc, ExprArg Cond,
- StmtArg Body);
+ virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
+ FullExprArg Cond, StmtArg Body);
virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
SourceLocation WhileLoc, ExprArg Cond);
}
Action::OwningStmtResult
-Sema::ActOnWhileStmt(SourceLocation WhileLoc, ExprArg Cond, StmtArg Body) {
- Expr *condExpr = Cond.takeAs<Expr>();
+Sema::ActOnWhileStmt(SourceLocation WhileLoc, FullExprArg Cond, StmtArg Body) {
+ ExprArg CondArg(Cond.release());
+ Expr *condExpr = CondArg.takeAs<Expr>();
assert(condExpr && "ActOnWhileStmt(): missing expression");
if (!condExpr->isTypeDependent()) {
DefaultFunctionArrayConversion(condExpr);
- Cond = condExpr;
+ CondArg = condExpr;
QualType condType = condExpr->getType();
if (getLangOptions().CPlusPlus) {
<< condType << condExpr->getSourceRange());
}
- Cond.release();
+ CondArg.release();
return Owned(new (Context) WhileStmt(condExpr, Body.takeAs<Stmt>(),
WhileLoc));
}
if (Body.isInvalid())
return SemaRef.StmtError();
- return SemaRef.ActOnWhileStmt(S->getWhileLoc(), move(Cond), move(Body));
+ return SemaRef.ActOnWhileStmt(S->getWhileLoc(), FullExpr(Cond), move(Body));
}
Sema::OwningStmtResult TemplateStmtInstantiator::VisitDoStmt(DoStmt *S) {
}
virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
- ExprArg Cond, StmtArg Body) {
+ FullExprArg Cond, StmtArg Body) {
llvm::cout << __FUNCTION__ << "\n";
return StmtEmpty();
}