aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-05 20:09:36 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-01-05 20:09:36 +0000
commitb1fa3dc2f914aaa8b5a851c6b5115ec239d20495 (patch)
tree746ca7d97d78df6fe84df6a3f315a0d82c67889f
parent1d65ebba273e6797902dcfa93964bae5ca0fe8d2 (diff)
Use the proper enum as parameter, instead of unsigned. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122900 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Sema/Sema.h4
-rw-r--r--lib/Sema/SemaExpr.cpp13
2 files changed, 7 insertions, 10 deletions
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index 3ec6f05ea4..ebd618a822 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -1801,7 +1801,7 @@ public:
ExprResult ActOnStringLiteral(const Token *Toks, unsigned NumToks);
// Binary/Unary Operators. 'Tok' is the token for the operator.
- ExprResult CreateBuiltinUnaryOp(SourceLocation OpLoc, unsigned OpcIn,
+ ExprResult CreateBuiltinUnaryOp(SourceLocation OpLoc, UnaryOperatorKind Opc,
Expr *InputArg);
ExprResult BuildUnaryOp(Scope *S, SourceLocation OpLoc,
UnaryOperatorKind Opc, Expr *input);
@@ -1932,7 +1932,7 @@ public:
ExprResult BuildBinOp(Scope *S, SourceLocation OpLoc,
BinaryOperatorKind Opc, Expr *lhs, Expr *rhs);
ExprResult CreateBuiltinBinOp(SourceLocation TokLoc,
- unsigned Opc, Expr *lhs, Expr *rhs);
+ BinaryOperatorKind Opc, Expr *lhs, Expr *rhs);
/// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
/// in the case of a the GNU conditional expr extension.
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index f6abe55383..6f2e2ace86 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -7497,10 +7497,9 @@ static void DiagnoseSelfAssignment(Sema &S, Expr *lhs, Expr *rhs,
/// operator @p Opc at location @c TokLoc. This routine only supports
/// built-in operations; ActOnBinOp handles overloaded operators.
ExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
- unsigned Op,
+ BinaryOperatorKind Opc,
Expr *lhs, Expr *rhs) {
QualType ResultTy; // Result type of the binary operator.
- BinaryOperatorKind Opc = (BinaryOperatorKind) Op;
// The following two variables are used for compound assignment operators
QualType CompLHSTy; // Type of LHS after promotions for computation
QualType CompResultTy; // Type of computation result
@@ -7844,10 +7843,8 @@ ExprResult Sema::BuildBinOp(Scope *S, SourceLocation OpLoc,
}
ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
- unsigned OpcIn,
+ UnaryOperatorKind Opc,
Expr *Input) {
- UnaryOperatorKind Opc = static_cast<UnaryOperatorKind>(OpcIn);
-
ExprValueKind VK = VK_RValue;
ExprObjectKind OK = OK_Ordinary;
QualType resultType;
@@ -7888,7 +7885,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
else if (resultType->isPlaceholderType()) {
ExprResult PR = CheckPlaceholderExpr(Input, OpLoc);
if (PR.isInvalid()) return ExprError();
- return CreateBuiltinUnaryOp(OpLoc, OpcIn, PR.take());
+ return CreateBuiltinUnaryOp(OpLoc, Opc, PR.take());
}
return ExprError(Diag(OpLoc, diag::err_typecheck_unary_expr)
@@ -7908,7 +7905,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
else if (resultType->isPlaceholderType()) {
ExprResult PR = CheckPlaceholderExpr(Input, OpLoc);
if (PR.isInvalid()) return ExprError();
- return CreateBuiltinUnaryOp(OpLoc, OpcIn, PR.take());
+ return CreateBuiltinUnaryOp(OpLoc, Opc, PR.take());
} else {
return ExprError(Diag(OpLoc, diag::err_typecheck_unary_expr)
<< resultType << Input->getSourceRange());
@@ -7925,7 +7922,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
} else if (resultType->isPlaceholderType()) {
ExprResult PR = CheckPlaceholderExpr(Input, OpLoc);
if (PR.isInvalid()) return ExprError();
- return CreateBuiltinUnaryOp(OpLoc, OpcIn, PR.take());
+ return CreateBuiltinUnaryOp(OpLoc, Opc, PR.take());
} else {
return ExprError(Diag(OpLoc, diag::err_typecheck_unary_expr)
<< resultType << Input->getSourceRange());