From patchwork Thu Sep 7 14:02:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 75454 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 31E073858D37 for ; Thu, 7 Sep 2023 14:02:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 31E073858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1694095378; bh=uVc9SvzOFeBrtxCcuvGlUtDUwIS7vYZMT7wRTzggqsg=; h=To:Cc:Subject:References:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Help:List-Subscribe:From: Reply-To:From; b=mitS9Q5bBq/S8L4ZHTM57BAaURcLlje2viaoV97u/7nBdpwUVybeBwLYktD8HaX4h eJaNZX5GfrKsaVh9zP/aWjtKXlbD+mQVev2u/Wz6hiXNApYP7pOhApOCCOUaz5RJ0s XkRbYhfzlUlixWAu+CjNDzKTvjU5ykyzWSmzx7Sk= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org 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 6E2A63858D1E for ; Thu, 7 Sep 2023 14:02:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6E2A63858D1E Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-206-9Q1Ac9KePbqqWO9gw1jYWw-1; Thu, 07 Sep 2023 10:02:49 -0400 X-MC-Unique: 9Q1Ac9KePbqqWO9gw1jYWw-1 Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-40ff67467c9so12008271cf.2 for ; Thu, 07 Sep 2023 07:02:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694095368; x=1694700168; h=mime-version:user-agent:message-id:in-reply-to:date:references :organization:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uVc9SvzOFeBrtxCcuvGlUtDUwIS7vYZMT7wRTzggqsg=; b=mF9RKey03lyYfGK1bGmnqrHn3MKUPt4ZuAyYyvyDek90ZTGBMaTxI1XYCileoOxXyG HQAOiocLtQY+Cyk+2QdgyhjN68iVSR2QV8/3maIaOFLvQBHKpcMo+ewHP3MnSONh7Hz4 bCaatIp49eF7Z9IcMZN1JFlVXm/EbS/6VUzlMTPUcyuOU81uzo1G9IJ0FgeHEg5t/q83 KM7HED0yzrCoYR4lSysq2PKwU5aZiYwRSy+JoHB8FHGXU9VIP2O/nwUxVJTgsxkaTqe+ +NRYlPKpVJx7r9whcR89FlJL35kkUylYK2h9zjEU8NVxmS7DdwGDZfqORWgvjTzWwVdL tM2Q== X-Gm-Message-State: AOJu0YwpsCB5O6/Gjj3v9TtQiQyeKrcvRKzF8UKgL5jdcbLmgtd2R4xC 9O1Wp/yYe/EsKnwT1NOYn6uG0M2XRl9y9he3BMjXGho945xjcpfW6OmtUJJOx1N3gwzVkfuUnRD KOsEMkmuKP1V2oPkg3G848TX8Gjay X-Received: by 2002:a05:622a:1346:b0:412:2513:fb6 with SMTP id w6-20020a05622a134600b0041225130fb6mr24712597qtk.5.1694095368326; Thu, 07 Sep 2023 07:02:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZQFG/PE2RJClkm+qfDc31UIm+3JhpUfRhA2RFNliI8ZYbyj5p9OmcverT+SYuOggDcvJbqw== X-Received: by 2002:a05:622a:1346:b0:412:2513:fb6 with SMTP id w6-20020a05622a134600b0041225130fb6mr24712537qtk.5.1694095367628; Thu, 07 Sep 2023 07:02:47 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id b3-20020ac844c3000000b00410929fe3b9sm6208421qto.58.2023.09.07.07.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Sep 2023 07:02:46 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id B2C35B4FD2; Thu, 7 Sep 2023 16:02:44 +0200 (CEST) To: Dodji Seketeli Cc: libabigail@sourceware.org Subject: [PATCH 10/16] ir: Add fn types to type lookup maps Organization: Red Hat / France References: <87il8mglc1.fsf@redhat.com> X-Operating-System: CentOS Stream release 9 X-URL: http://www.redhat.com Date: Thu, 07 Sep 2023 16:02:44 +0200 In-Reply-To: <87il8mglc1.fsf@redhat.com> (Dodji Seketeli's message of "Thu, 07 Sep 2023 15:32:46 +0200") Message-ID: <87a5tyf5dn.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_H3, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Mailing list of the Libabigail project List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-Patchwork-Original-From: Dodji Seketeli via Libabigail From: Dodji Seketeli Reply-To: Dodji Seketeli Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Hello, This is a fix to an inconsistency I stumbled upon while looking at something else. So, function types were not being added to the type lookup maps. Fixed this. * src/abg-ir.cc (maybe_update_types_lookup_map): Handle function types. (translation_unit::bind_function_type_life_time): Update types lookup map. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-ir.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/abg-ir.cc b/src/abg-ir.cc index cb230082..93d79b33 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -1479,6 +1479,8 @@ translation_unit::bind_function_type_life_time(function_type_sptr ftype) const ABG_ASSERT(existing_tu == this); else ftype->set_translation_unit(const_cast(this)); + + maybe_update_types_lookup_map(ftype); } /// This implements the ir_traversable_base::traverse virtual @@ -14198,6 +14200,8 @@ maybe_update_types_lookup_map(const decl_base_sptr& decl) maybe_update_types_lookup_map(array_type); else if (array_type_def::subrange_sptr subrange_type = is_subrange_type(decl)) maybe_update_types_lookup_map(subrange_type); + else if (function_type_sptr fn_type = is_function_type(decl)) + maybe_update_types_lookup_map(fn_type); else ABG_ASSERT_NOT_REACHED; } @@ -14218,6 +14222,8 @@ maybe_update_types_lookup_map(const type_base_sptr& type) { if (decl_base_sptr decl = get_type_declaration(type)) maybe_update_types_lookup_map(decl); + else if (function_type_sptr fn_type = is_function_type(type)) + maybe_update_types_lookup_map(fn_type); else ABG_ASSERT_NOT_REACHED; }