* [PATCH, applied] btf-reader: Use abigail::ir::canonicalize_types to canonicalize types
@ 2023-01-07 0:51 Dodji Seketeli
0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2023-01-07 0:51 UTC (permalink / raw)
To: libabigail
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-07 0:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-07 0:51 [PATCH, applied] btf-reader: Use abigail::ir::canonicalize_types to canonicalize 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).