Implement shift operators
This commit is contained in:
@ -575,10 +575,11 @@ namespace gcc
|
||||
}
|
||||
if (left_type != right_type
|
||||
&& !are_compatible_pointers(left_type, right)
|
||||
&& !are_compatible_pointers(right_type, left))
|
||||
&& !are_compatible_pointers(right_type, left)
|
||||
&& !(is_integral_type(left_type) && right_type == elna_word_type_node))
|
||||
{
|
||||
error_at(expression_location,
|
||||
"invalid operands of type %s and %s for operator %s",
|
||||
"invalid operands of type '%s' and '%s' for operator %s",
|
||||
print_type(left_type).c_str(), print_type(right_type).c_str(),
|
||||
boot::print_binary_operator(expression->operation()));
|
||||
this->current_expression = error_mark_node;
|
||||
@ -628,6 +629,16 @@ namespace gcc
|
||||
case boot::binary_operator::not_equals:
|
||||
this->current_expression = build_equality_operation(expression, left, right);
|
||||
break;
|
||||
case boot::binary_operator::shift_left:
|
||||
this->current_expression = build_binary_operation(
|
||||
is_numeric_type(left_type) && right_type == elna_word_type_node,
|
||||
expression, LSHIFT_EXPR, left, right, left_type);
|
||||
break;
|
||||
case boot::binary_operator::shift_right:
|
||||
this->current_expression = build_binary_operation(
|
||||
is_numeric_type(left_type) && right_type == elna_word_type_node,
|
||||
expression, RSHIFT_EXPR, left, right, left_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user