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);
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.
/// 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
}
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;
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)
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());
} 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());