Implement the sizeof operator
This commit is contained in:
@ -67,6 +67,13 @@ namespace gcc
|
||||
cast_target, this->current_expression);
|
||||
}
|
||||
|
||||
void generic_visitor::visit(source::size_of_expression *expression)
|
||||
{
|
||||
auto body_type = build_type(expression->body());
|
||||
|
||||
this->current_expression = build1(CONVERT_EXPR, integer_type_node, TYPE_SIZE_UNIT(body_type));
|
||||
}
|
||||
|
||||
void generic_visitor::visit(source::program *program)
|
||||
{
|
||||
for (const auto definition : program->value_definitions)
|
||||
|
Reference in New Issue
Block a user