Implement .max and .min type properties
This commit is contained in:
@ -733,6 +733,7 @@ namespace gcc
|
||||
if (result)
|
||||
{
|
||||
TREE_PUBLIC(definition_tree) = definition->exported;
|
||||
TYPE_NAME(tree_type) = get_identifier(definition->identifier.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -952,6 +953,14 @@ namespace gcc
|
||||
this->current_expression = build_int_cstu(elna_word_type_node,
|
||||
TYPE_ALIGN_UNIT(this->current_expression));
|
||||
}
|
||||
else if (expression->field() == "min" && is_integral_type(this->current_expression))
|
||||
{
|
||||
this->current_expression = TYPE_MIN_VALUE(this->current_expression);
|
||||
}
|
||||
else if (expression->field() == "max" && is_integral_type(this->current_expression))
|
||||
{
|
||||
this->current_expression = TYPE_MAX_VALUE(this->current_expression);
|
||||
}
|
||||
else
|
||||
{
|
||||
error_at(expression_location, "type '%s' does not have property '%s'",
|
||||
|
Reference in New Issue
Block a user