public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@seketeli.org>
To: Giuliano Procida <gprocida@google.com>
Cc: maennich@google.com,  libabigail@sourceware.org,
	 kernel-team@android.com
Subject: [PATCH 1/2] ir: Add better comments to types_have_similar_structure
Date: Fri, 04 Dec 2020 12:05:14 +0100	[thread overview]
Message-ID: <861rg5q1at.fsf_-_@seketeli.org> (raw)
In-Reply-To: <865z5hq1eo.fsf@seketeli.org> (Dodji Seketeli's message of "Fri,  04 Dec 2020 12:02:55 +0100")


	* src/abg-ir.cc (types_have_similar_structure): Arrays are also
	indirect types, just like pointers and references, for the purpose
	of the concept of "type similarity".  Add that to the introductory
	comment of the function.  Add some more misc comments throughout
	the code base.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 src/abg-ir.cc | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/abg-ir.cc b/src/abg-ir.cc
index c6f7c13..7354ae3 100644
--- a/src/abg-ir.cc
+++ b/src/abg-ir.cc
@@ -23474,10 +23474,10 @@ types_have_similar_structure(const type_base_sptr& first,
 ///
 /// typedef are resolved to their definitions; their names are ignored.
 ///
-/// Two indirect types (pointers or references) have similar structure
-/// if their underlying types are of the same kind and have the same
-/// name.  In the indirect types case, the size of the underlying type
-/// does not matter.
+/// Two indirect types (pointers, references or arrays) have similar
+/// structure if their underlying types are of the same kind and have
+/// the same name.  In the indirect types case, the size of the
+/// underlying type does not matter.
 ///
 /// Two direct types (i.e, non indirect) have a similar structure if
 /// they have the same kind, name and size.  Two class types have
@@ -23488,7 +23488,9 @@ types_have_similar_structure(const type_base_sptr& first,
 ///
 /// @param second the second type to consider.
 ///
-/// @param indirect_type whether to do an indirect comparison
+/// @param indirect_type if true, then consider @p first and @p
+/// second as being underlying types of indirect types.  Meaning that
+/// their size does'nt matter.
 ///
 /// @return true iff @p first and @p second have similar structures.
 bool
@@ -23517,7 +23519,7 @@ types_have_similar_structure(const type_base* first,
       const pointer_type_def* ty2 = is_pointer_type(second);
       return types_have_similar_structure(ty1->get_pointed_to_type(),
 					  ty2->get_pointed_to_type(),
-					  true);
+					  /*indirect_type=*/true);
     }
 
   // Peel off matching references.
@@ -23528,7 +23530,7 @@ types_have_similar_structure(const type_base* first,
 	return false;
       return types_have_similar_structure(ty1->get_pointed_to_type(),
 					  ty2->get_pointed_to_type(),
-					  true);
+					  /*indirect_type=*/true);
     }
 
   if (const type_decl* ty1 = is_type_decl(first))
-- 
1.8.3.1



-- 
		Dodji

  reply	other threads:[~2020-12-04 11:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03 15:09 [PATCH] abidiff: improve treatment of array types in leaf changes mode Giuliano Procida
2020-12-04 11:02 ` Dodji Seketeli
2020-12-04 11:05   ` Dodji Seketeli [this message]
2020-12-04 11:07   ` [PATCH 2/2] ir: Arrays are indirect types for type similarity purposes Dodji Seketeli
2020-12-04 14:41   ` [PATCH] abidiff: improve treatment of array types in leaf changes mode Giuliano Procida
2020-12-07 13:24     ` Dodji Seketeli

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=861rg5q1at.fsf_-_@seketeli.org \
    --to=dodji@seketeli.org \
    --cc=gprocida@google.com \
    --cc=kernel-team@android.com \
    --cc=libabigail@sourceware.org \
    --cc=maennich@google.com \
    /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).