From patchwork Wed Aug 11 16:09:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dodji Seketeli X-Patchwork-Id: 44640 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 6D7C93985440 for ; Wed, 11 Aug 2021 16:10:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D7C93985440 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1628698219; bh=MsTnqzToYnB+ui7FzBgrfB2vgaqvxPCoTdkNW5I7Mx8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Help: List-Subscribe:From:Reply-To:From; b=RXKKh2l5t9DyNnomQOeysMIV8vzKe5WU4ymKuPJzFes9zpHRbjKFoInKbqi8wOY2L zKvyblBkqQZKWFDY/K3WvWjYMRwC72WP4ZcLxIVdIlTIxkfHed2z6AyinVmRcutwEd eCDg0Ex5xjxMlAPwqLeNpck88K7e6KFYkfJakPDU= 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 ESMTP id 0363C385841C for ; Wed, 11 Aug 2021 16:10:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0363C385841C Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-FLk5ym4AOUu8TZvIW_vMxQ-1; Wed, 11 Aug 2021 12:10:04 -0400 X-MC-Unique: FLk5ym4AOUu8TZvIW_vMxQ-1 Received: by mail-wr1-f70.google.com with SMTP id m5-20020a5d6a050000b0290154e83dce73so888475wru.19 for ; Wed, 11 Aug 2021 09:10:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:organization:date:message-id :user-agent:mime-version; bh=MsTnqzToYnB+ui7FzBgrfB2vgaqvxPCoTdkNW5I7Mx8=; b=DoBLpJzw+VnYhnUdMHlxmmncGiHgeCW8Q8rC/GuXbpoWb05ZpgdI+OjZI8+CBZGRka XaFLUyY2CrP6v+RB8gazuSRRsQGUd8qKdEUPb9SWczMmSFcH1bomShVYXAROUfD15NAe 2sC/lDt3FIoosn8tG/uylADAG5y2r8ixyo2Jl7aiVCaw7VXE2bg7LrSfsYBEUjRtoMWE YQ29wJ3xq9T/SdelpMmXlNOJcyLqe6qpd3VXwIUdZ9llpwCioVWIZFJnVOhNClEaeZTc EdgoXXevogrfzI0qG/Jv30u9GPIj0CB4rs5DVNsNKN3WWxbKfol0/vcnprNs8SchwpFK cFCQ== X-Gm-Message-State: AOAM533zbHxG10LYDk3XWZWTNnxwdDmWuX6vpK252UDRuyhdJPlkkc72 VAS80PXKTngRUjSAyMn8GPYzKODzxxbzzU/T2pBEH9u9zWAe1xQ9PrmwS2mFD9HxWJp9qj/w9N1 LLfD/Ug1tSU/Ur6CUA3pogbHmw3i25XCifyJMAN46MTZoL1mj51Udw5R53R0GwUxKfjc6 X-Received: by 2002:a5d:5550:: with SMTP id g16mr38211182wrw.336.1628698202739; Wed, 11 Aug 2021 09:10:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzY+sAPzUkjf+gyBJnUNRdC7M3KZg5bwiMprNYdrcD2LkGvShgY45zaQZXvYUm3QbVf4g98hw== X-Received: by 2002:a5d:5550:: with SMTP id g16mr38211127wrw.336.1628698202358; Wed, 11 Aug 2021 09:10:02 -0700 (PDT) Received: from localhost ([88.120.130.27]) by smtp.gmail.com with ESMTPSA id 9sm24705564wmf.34.2021.08.11.09.10.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 09:10:01 -0700 (PDT) Received: by localhost (Postfix, from userid 1000) id BCB355800FB; Wed, 11 Aug 2021 18:09:58 +0200 (CEST) To: libabigail@sourceware.org Subject: [PATCH 6/8, applied] Bug 27236 - Allow updating classes from abixml Organization: Red Hat / France X-Operating-System: Fedora 35 X-URL: http://www.redhat.com Date: Wed, 11 Aug 2021 18:09:58 +0200 Message-ID: <87lf58c695.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 X-Spam-Status: No, score=-12.3 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_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libabigail@sourceware.org X-Mailman-Version: 2.1.29 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, Some classes can be defined piece-wise, in some rare cases in the abixml. build_class_decl is currently preventing that to happen, leading to some spurious self comparison errors. Fixed thus. * src/abg-reader.cc (build_class_decl): Keep going when the class has already been built. The rest of the code knows how to add new stuff. * tests/data/test-abidiff/test-PR18791-report0.txt: Adjust. Signed-off-by: Dodji Seketeli Applied to master. --- src/abg-reader.cc | 7 +- .../test-abidiff/test-PR18791-report0.txt | 131 +++++++++++++++++- 2 files changed, 132 insertions(+), 6 deletions(-) diff --git a/src/abg-reader.cc b/src/abg-reader.cc index 63216029..b115304f 100644 --- a/src/abg-reader.cc +++ b/src/abg-reader.cc @@ -4535,14 +4535,13 @@ build_class_decl(read_context& ctxt, ABG_ASSERT(!id.empty()); + class_decl_sptr previous_definition, previous_declaration; if (type_base_sptr t = ctxt.get_type_decl(id)) { - class_decl_sptr result = is_class_type(t); - ABG_ASSERT(result); - return result; + previous_definition = is_class_type(t); + ABG_ASSERT(previous_definition); } - class_decl_sptr previous_definition, previous_declaration; const vector *types_ptr = 0; if (!is_anonymous && !previous_definition) types_ptr = ctxt.get_all_type_decls(id); diff --git a/tests/data/test-abidiff/test-PR18791-report0.txt b/tests/data/test-abidiff/test-PR18791-report0.txt index 5de96dc6..6c236f92 100644 --- a/tests/data/test-abidiff/test-PR18791-report0.txt +++ b/tests/data/test-abidiff/test-PR18791-report0.txt @@ -1,4 +1,4 @@ -Functions changes summary: 1 Removed, 35 Changed, 1 Added functions +Functions changes summary: 1 Removed, 60 Changed, 1 Added functions Variables changes summary: 0 Removed, 0 Changed, 0 Added variable 1 Removed function: @@ -9,7 +9,7 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable [A] 'method void std::__cxx11::_List_base >::_M_clear()' -35 functions with some indirect sub-type change: +60 functions with some indirect sub-type change: [C] 'method bool sigc::connection::block(bool)' has some indirect sub-type changes: implicit parameter 0 of type 'sigc::connection*' has sub-type changes: @@ -193,6 +193,26 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable implicit parameter 0 of type 'sigc::internal::signal_impl*' has sub-type changes: pointed to type 'struct sigc::internal::signal_impl' changed, as reported earlier + [C] 'method void sigc::internal::slot_rep::disconnect()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::internal::slot_rep*' has sub-type changes: + pointed to type 'struct sigc::internal::slot_rep' changed, as reported earlier + + [C] 'method void sigc::internal::trackable_callback_list::add_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::internal::trackable_callback_list*' has sub-type changes: + pointed to type 'struct sigc::internal::trackable_callback_list' changed, as reported earlier + + [C] 'method void sigc::internal::trackable_callback_list::clear()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::internal::trackable_callback_list*' has sub-type changes: + pointed to type 'struct sigc::internal::trackable_callback_list' changed, as reported earlier + + [C] 'method void sigc::internal::trackable_callback_list::remove_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::internal::trackable_callback_list*' has sub-type changes: + pointed to type 'struct sigc::internal::trackable_callback_list' changed, as reported earlier + + [C] 'method sigc::internal::trackable_callback_list::~trackable_callback_list(int)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::internal::trackable_callback_list*' has sub-type changes: + pointed to type 'struct sigc::internal::trackable_callback_list' changed, as reported earlier + [C] 'method void sigc::signal_base::block(bool)' has some indirect sub-type changes: implicit parameter 0 of type 'sigc::signal_base*' has sub-type changes: in pointed to type 'struct sigc::signal_base': @@ -281,3 +301,110 @@ Variables changes summary: 0 Removed, 0 Changed, 0 Added variable implicit parameter 0 of type 'sigc::signal_base*' has sub-type changes: pointed to type 'struct sigc::signal_base' changed, as reported earlier + [C] 'method void sigc::slot_base::add_destroy_notify_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::slot_base*' has sub-type changes: + in pointed to type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method bool sigc::slot_base::block(bool)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method void sigc::slot_base::disconnect()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method bool sigc::slot_base::operator bool()' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::slot_base*' has sub-type changes: + in pointed to type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method sigc::slot_base& sigc::slot_base::operator=(const sigc::slot_base&)' has some indirect sub-type changes: + return type changed: + referenced type 'class sigc::slot_base' changed, as reported earlier + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + parameter 1 of type 'const sigc::slot_base&' has sub-type changes: + in referenced type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method void sigc::slot_base::remove_destroy_notify_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::slot_base*' has sub-type changes: + in pointed to type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method void sigc::slot_base::set_parent(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::slot_base*' has sub-type changes: + in pointed to type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method sigc::slot_base::slot_base(sigc::slot_base::rep_type*)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + parameter 1 of type 'sigc::slot_base::rep_type*' has sub-type changes: + pointed to type 'typedef sigc::slot_base::rep_type' changed, as reported earlier + + [C] 'method sigc::slot_base::slot_base()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method sigc::slot_base::slot_base(const sigc::slot_base&)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + parameter 1 of type 'const sigc::slot_base&' has sub-type changes: + in referenced type 'const sigc::slot_base': + unqualified underlying type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method bool sigc::slot_base::unblock()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method sigc::slot_base::~slot_base(int)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::slot_base*' has sub-type changes: + pointed to type 'class sigc::slot_base' changed, as reported earlier + + [C] 'method void sigc::trackable::add_destroy_notify_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::trackable*' has sub-type changes: + in pointed to type 'const sigc::trackable': + unqualified underlying type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method sigc::internal::trackable_callback_list* sigc::trackable::callback_list()' has some indirect sub-type changes: + return type changed: + pointed to type 'struct sigc::internal::trackable_callback_list' changed, as reported earlier + implicit parameter 0 of type 'const sigc::trackable*' has sub-type changes: + in pointed to type 'const sigc::trackable': + unqualified underlying type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method void sigc::trackable::notify_callbacks()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::trackable*' has sub-type changes: + pointed to type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method sigc::trackable& sigc::trackable::operator=(const sigc::trackable&)' has some indirect sub-type changes: + return type changed: + referenced type 'struct sigc::trackable' changed, as reported earlier + implicit parameter 0 of type 'sigc::trackable*' has sub-type changes: + pointed to type 'struct sigc::trackable' changed, as reported earlier + parameter 1 of type 'const sigc::trackable&' has sub-type changes: + in referenced type 'const sigc::trackable': + unqualified underlying type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method void sigc::trackable::remove_destroy_notify_callback(void*)' has some indirect sub-type changes: + implicit parameter 0 of type 'const sigc::trackable*' has sub-type changes: + in pointed to type 'const sigc::trackable': + unqualified underlying type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method sigc::trackable::trackable(const sigc::trackable&)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::trackable*' has sub-type changes: + pointed to type 'struct sigc::trackable' changed, as reported earlier + parameter 1 of type 'const sigc::trackable&' has sub-type changes: + in referenced type 'const sigc::trackable': + unqualified underlying type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method sigc::trackable::trackable()' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::trackable*' has sub-type changes: + pointed to type 'struct sigc::trackable' changed, as reported earlier + + [C] 'method sigc::trackable::~trackable(int)' has some indirect sub-type changes: + implicit parameter 0 of type 'sigc::trackable*' has sub-type changes: + pointed to type 'struct sigc::trackable' changed, as reported earlier +