btf-reader: Use abigail::ir::canonicalize_types to canonicalize types

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>
This commit is contained in:
Dodji Seketeli 2023-01-07 01:15:28 +01:00
parent a0cc439b28
commit 00e3ac8937

View File

@ -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