diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-22 22:25:00 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-22 22:25:00 +0000 |
| commit | 6aea57560fa50112f1d2be10de0650ce1eca6854 (patch) | |
| tree | 87ba1b5e6d390fdb9d681b7c8993bf6ee46afafb /clang/lib | |
| parent | a0b2dc93b562f6cb2368f3d7f0a0f863ee8a0365 (diff) | |
| download | bcm5719-llvm-6aea57560fa50112f1d2be10de0650ce1eca6854.tar.gz bcm5719-llvm-6aea57560fa50112f1d2be10de0650ce1eca6854.zip | |
Slight code reorganization to allow instantiating post-inc/dec.
llvm-svn: 76807
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 8c780296a7d..bb3f21a2126 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -1703,12 +1703,7 @@ Sema::ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, // build a built-in operation. } - QualType result = CheckIncrementDecrementOperand(Arg, OpLoc, - Opc == UnaryOperator::PostInc); - if (result.isNull()) - return ExprError(); - Input.release(); - return Owned(new (Context) UnaryOperator(Arg, Opc, result, OpLoc)); + return CreateBuiltinUnaryOp(OpLoc, Opc, move(Input)); } Action::OwningExprResult @@ -5014,16 +5009,17 @@ Action::OwningExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc, Expr *Input = (Expr *)InputArg.get(); QualType resultType; switch (Opc) { - case UnaryOperator::PostInc: - case UnaryOperator::PostDec: case UnaryOperator::OffsetOf: assert(false && "Invalid unary operator"); break; case UnaryOperator::PreInc: case UnaryOperator::PreDec: + case UnaryOperator::PostInc: + case UnaryOperator::PostDec: resultType = CheckIncrementDecrementOperand(Input, OpLoc, - Opc == UnaryOperator::PreInc); + Opc == UnaryOperator::PreInc || + Opc == UnaryOperator::PostInc); break; case UnaryOperator::AddrOf: resultType = CheckAddressOfOperand(Input, OpLoc); |

