ir: Introduce a missing IR kind for subrange types

Array subranges were introduced to support the Ada language.  In doing
so, I forgot to define an  enum type_or_decl_kind enumerator for the
array_type_def::subrange_type IR node.  This patch fixes that.

	* include/abg-ir.h (type_or_decl_kind::SUBRANGE_TYPE): Add a new
	enumerator to enum type_or_decl_kind::type_or_decl_kind.
	* src/abg-ir.cc (array_type_def::subrange_type::subrange_type):
	Use the new type_or_decl_kind::SUBRANGE_TYPE to flag the IR node
	representing array_type_def::subrange_type.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2024-02-08 17:30:38 +01:00
parent 91762ba16b
commit 6ba168688e
2 changed files with 15 additions and 14 deletions

View File

@ -1385,17 +1385,18 @@ protected:
ABSTRACT_TYPE_BASE = 1 << 9,
ABSTRACT_SCOPE_TYPE_DECL = 1 << 10,
BASIC_TYPE = 1 << 11,
QUALIFIED_TYPE = 1 << 12,
POINTER_TYPE = 1 << 13,
REFERENCE_TYPE = 1 << 14,
POINTER_TO_MEMBER_TYPE = 1 << 15,
ARRAY_TYPE = 1 << 16,
ENUM_TYPE = 1 << 17,
TYPEDEF_TYPE = 1 << 18,
CLASS_TYPE = 1 << 19,
UNION_TYPE = 1 << 20,
FUNCTION_TYPE = 1 << 21,
METHOD_TYPE = 1 << 22,
SUBRANGE_TYPE = 1 << 12,
QUALIFIED_TYPE = 1 << 13,
POINTER_TYPE = 1 << 14,
REFERENCE_TYPE = 1 << 15,
POINTER_TO_MEMBER_TYPE = 1 << 16,
ARRAY_TYPE = 1 << 17,
ENUM_TYPE = 1 << 18,
TYPEDEF_TYPE = 1 << 19,
CLASS_TYPE = 1 << 20,
UNION_TYPE = 1 << 21,
FUNCTION_TYPE = 1 << 22,
METHOD_TYPE = 1 << 23,
}; // end enum type_or_decl_kind
enum type_or_decl_kind

View File

@ -18700,7 +18700,7 @@ array_type_def::subrange_type::subrange_type(const environment& env,
const type_base_sptr& utype,
const location& loc,
translation_unit::language l)
: type_or_decl_base(env, ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
: type_or_decl_base(env, SUBRANGE_TYPE | ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
type_base(env,
upper_bound.get_unsigned_value()
- lower_bound.get_unsigned_value(),
@ -18731,7 +18731,7 @@ array_type_def::subrange_type::subrange_type(const environment& env,
bound_value upper_bound,
const location& loc,
translation_unit::language l)
: type_or_decl_base(env, ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
: type_or_decl_base(env, SUBRANGE_TYPE | ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
type_base(env,
upper_bound.get_unsigned_value()
- lower_bound.get_unsigned_value(), 0),
@ -18758,7 +18758,7 @@ array_type_def::subrange_type::subrange_type(const environment& env,
bound_value upper_bound,
const location& loc,
translation_unit::language l)
: type_or_decl_base(env, ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
: type_or_decl_base(env, SUBRANGE_TYPE | ABSTRACT_TYPE_BASE | ABSTRACT_DECL_BASE),
type_base(env, upper_bound.get_unsigned_value(), 0),
decl_base(env, name, loc, ""),
priv_(new priv(upper_bound, l))