From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 27EF73858D33 for ; Sat, 7 Jan 2023 00:51:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27EF73858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673052711; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=r8rwjtO/u0BgI/k4Wde53UFeqkKDJyOhOyRCHwNKKxk=; b=LWahi4vFwfOVXeZ9I9ZWJTVzH2F8Kl944FG+CvpAveauR8WrKiwE/CcmlBOFBt4OLnw3dj sPd+6xltEqULi+kizKVPysqGHiJZZbaWavnQUXd2iWkClyriv7Gm1fBAXb1WPatvhd2ahI UKiAaG+psm+z51nUMcvPXPT4QyXE2fs= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-100--nUwXxjgNm-VFU6CbnmN4A-1; Fri, 06 Jan 2023 19:51:50 -0500 X-MC-Unique: -nUwXxjgNm-VFU6CbnmN4A-1 Received: by mail-qt1-f198.google.com with SMTP id a13-20020ac8610d000000b003a8151cadebso1451923qtm.10 for ; Fri, 06 Jan 2023 16:51:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:organization:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r8rwjtO/u0BgI/k4Wde53UFeqkKDJyOhOyRCHwNKKxk=; b=QlPkgphQaOeE+UFwU2SXXPruw4irBisUZLAhJ8CUheuziWPpxNZTGXnuDWwi2F4H6i F3U94DH0EO198J3MERL7GZ39wM5sxMz9HgUSnHYGntn75hEvBzzZUa2enHtpVgSPSC2i w4SudQZkhc+i719kSDxHel4QxZxjwtjiMEnKcrjNxFsD+ZxgbqrOA6wZMK1zi2yEJpsK n2HYTaYMJRGY5T+1fC47wUV+WlqR3vpFssnlJFxt02C4moLQTR/jmbvj9+p+yXsTn70e Bm8mvaPdkH3yZyY/sHvAPWnAO5niumRl1Vh7FWcE9x2aschdbxrXifsHSi2qdR8QedX2 TQCg== X-Gm-Message-State: AFqh2koYVIUGeqfMJPj1TvTlWOBqddcn1oTJXJ5PwiQelEFbAQQ6cjWo tfTkknrRa6tmOh0FqFiYVd4Veil4ObMLbMweCbV12BKccnXMvbpFEnE+BuDU8/4JUBJ72/VIJZK f10kEkJzkOP96hu6eBeT5FbPYZF1etTiiwC8zBun5uU+h4Nmf0RzLWDUEx28iZhFi7+sJ X-Received: by 2002:ac8:7389:0:b0:3a5:264c:5f38 with SMTP id t9-20020ac87389000000b003a5264c5f38mr88634400qtp.63.1673052709876; Fri, 06 Jan 2023 16:51:49 -0800 (PST) X-Google-Smtp-Source: AMrXdXvXlDmzP2Two0+SVvo991S07zyAZRpndBzoQ0UL8c+0zsSH4PvXRIjZpEW5MuWDRObJCxTdEw== X-Received: by 2002:ac8:7389:0:b0:3a5:264c:5f38 with SMTP id t9-20020ac87389000000b003a5264c5f38mr88634379qtp.63.1673052709521; Fri, 06 Jan 2023 16:51:49 -0800 (PST) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id do25-20020a05620a2b1900b006fc94f65417sm1396818qkb.40.2023.01.06.16.51.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jan 2023 16:51:49 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 74497581C59; Sat, 7 Jan 2023 01:51:47 +0100 (CET) From: Dodji Seketeli To: libabigail@sourceware.org Subject: [PATCH, applied] btf-reader: Use abigail::ir::canonicalize_types to canonicalize types Organization: Red Hat / France X-Operating-System: Fedora 38 X-URL: http://www.redhat.com Date: Sat, 07 Jan 2023 01:51:47 +0100 Message-ID: <87h6x3kvz0.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 --- 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 #include "abg-elf-helpers.h" +#include "abg-ir-priv.h" // 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::const_iterator& i) + {return *i;}); } uint64_t -- 2.39.0 -- Dodji