diff options
author | Anders Carlsson <andersca@mac.com> | 2009-05-17 18:26:53 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-05-17 18:26:53 +0000 |
commit | a99fad8ff134273fe85f2970c7d89133d1218900 (patch) | |
tree | 4d25d0300e3251287762c273b44817068f4c7c38 /lib/Sema/SemaStmt.cpp | |
parent | 0e650017acdbbeb0c590e77bbea88c200ea1caef (diff) |
Add the FullExprArg wrapper and use it for if statement conditions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71982 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index d59443b2cb..5c04c2491f 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -180,17 +180,19 @@ Sema::ActOnLabelStmt(SourceLocation IdentLoc, IdentifierInfo *II, } Action::OwningStmtResult -Sema::ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal, +Sema::ActOnIfStmt(SourceLocation IfLoc, FullExprArg CondVal, StmtArg ThenVal, SourceLocation ElseLoc, StmtArg ElseVal) { - Expr *condExpr = CondVal.takeAs<Expr>(); + OwningExprResult CondResult(CondVal.release()); + + Expr *condExpr = CondResult.takeAs<Expr>(); assert(condExpr && "ActOnIfStmt(): missing expression"); if (!condExpr->isTypeDependent()) { DefaultFunctionArrayConversion(condExpr); // Take ownership again until we're past the error checking. - CondVal = condExpr; + CondResult = condExpr; QualType condType = condExpr->getType(); if (getLangOptions().CPlusPlus) { @@ -213,7 +215,7 @@ Sema::ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal, Diag(stmt->getSemiLoc(), diag::warn_empty_if_body); } - CondVal.release(); + CondResult.release(); return Owned(new (Context) IfStmt(IfLoc, condExpr, thenStmt, ElseLoc, ElseVal.takeAs<Stmt>())); } |