From c3645ecfb6b03c8aebe00e40c99cad0e1c3362a9 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 16 Feb 2025 07:53:31 +0100 Subject: [PATCH] Implement .max and .min type properties --- gcc/elna-generic.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/elna-generic.cc b/gcc/elna-generic.cc index c8761cd..a5ce382 100644 --- a/gcc/elna-generic.cc +++ b/gcc/elna-generic.cc @@ -952,6 +952,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'",