public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applying to mainline] ir: Introduce a missing IR kind for subrange types
Date: Mon, 12 Feb 2024 22:30:35 +0100	[thread overview]
Message-ID: <87r0hhxtdw.fsf@redhat.com> (raw)

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


                 reply	other threads:[~2024-02-12 21:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0hhxtdw.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).