diff options
Diffstat (limited to 'boot/symbol.cc')
| -rw-r--r-- | boot/symbol.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/boot/symbol.cc b/boot/symbol.cc index 8feba4a..310ae8a 100644 --- a/boot/symbol.cc +++ b/boot/symbol.cc @@ -830,6 +830,21 @@ namespace elna::boot || is_float_type(checked); } + bool is_index_type(const type& checked, const target_info& target) + { + const type unaliased = resolve_underlying_type(checked); + if (const auto primitive = unaliased.get<primitive_type>()) + { + const bool is_int = primitive->identifier.starts_with("Int") + && primitive->properties.size == target.int_properties.front().size; + const bool is_word = primitive->identifier.starts_with("Word") + && primitive->properties.size == target.word_properties.front().size; + + return is_int || is_word; + } + return false; + } + bool is_integral_type(const type& checked) { return is_integer_type(checked) || is_word_type(checked); |
