public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH, applied] btf-reader: Use abigail::ir::canonicalize_types to canonicalize types
Date: Sat, 07 Jan 2023 01:51:47 +0100	[thread overview]
Message-ID: <87h6x3kvz0.fsf@redhat.com> (raw)

Hello,

In the btf::reader::canonicalize_types function, this patch now uses
the abigail::ir::canonicalize_types() function to canonicalize types,
just like the other front-ends.  The advantage of this function is
that it can perform some sanity checking for type canonicalization
that might be useful for later debugging purposes.

	* src/abg-btf-reader.cc (btf::reader::canonicalize_types): Use the
	abigail::ir::canonicalize_types function from abg-ir-priv.h
	file to canonicalize types.

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

diff --git a/src/abg-btf-reader.cc b/src/abg-btf-reader.cc
index abab0f66..2c009aee 100644
--- a/src/abg-btf-reader.cc
+++ b/src/abg-btf-reader.cc
@@ -19,6 +19,7 @@
 #include <unordered_map>
 
 #include "abg-elf-helpers.h"
+#include "abg-ir-priv.h"
 
 // <headers defining libabigail's API go under here>
 ABG_BEGIN_EXPORT_DECLARATIONS
@@ -180,12 +181,15 @@ class reader : public elf_based_reader
   {types_to_canonicalize_.push_back(t);}
 
   /// Canonicalize all the types scheduled for canonicalization using
-  /// schedule_type_for_canonocalization().
+  /// abigail::ir::canonicalize_types() which performs some sanity
+  /// checking around type canonicalization if necessary.
   void
   canonicalize_types()
   {
-    for (auto t : types_to_canonicalize_)
-      canonicalize(t);
+    ir::canonicalize_types(types_to_canonicalize_.begin(),
+			   types_to_canonicalize_.end(),
+			   [](const vector<type_base_sptr>::const_iterator& i)
+			   {return *i;});
   }
 
   uint64_t
-- 
2.39.0




-- 
		Dodji


                 reply	other threads:[~2023-01-07  0:51 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=87h6x3kvz0.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).