Use the proper enum as parameter, instead of unsigned. No functionality change.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 5 Jan 2011 20:09:36 +0000 (20:09 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 5 Jan 2011 20:09:36 +0000 (20:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122900 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Sema/Sema.h
lib/Sema/SemaExpr.cpp

index 3ec6f05ea444b78e2cb798d5866a6edace8d9863..ebd618a822b80b3c902892bafe369180528c40f6 100644 (file)
@@ -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.
index f6abe553834ddda48bb84c50dd7c133f12032831..6f2e2ace86cf73c10f0a9c04bd986dff923c23ba 100644 (file)
@@ -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());