public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, applying to mainline] ir: Introduce a missing IR kind for subrange types
@ 2024-02-12 21:30 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2024-02-12 21:30 UTC (permalink / raw)
  To: libabigail

Hello,

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>
Applying to the master branch.
---
 include/abg-ir.h | 23 ++++++++++++-----------
 src/abg-ir.cc    |  6 +++---
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/include/abg-ir.h b/include/abg-ir.h
index a500762a..964d1397 100644
--- a/include/abg-ir.h
+++ b/include/abg-ir.h
@@ -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
diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index 58e19c5b..f4d9174f 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -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))
-- 
2.39.3


-- 
		Dodji


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-12 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 21:30 [PATCH, applying to mainline] ir: Introduce a missing IR kind for subrange types Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).