From patchwork Fri Dec 3 11:46:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Matthias_M=C3=A4nnich?= X-Patchwork-Id: 48464 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 172A63858017 for ; Fri, 3 Dec 2021 12:09:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 172A63858017 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638533363; bh=DbWThjuXKM/ZTQyNuPMQBROc9d9YARIyTTf/OIgGEQg=; h=Date:In-Reply-To:References:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XKax0Hl3uWQRDwVFbVis+r9qQI/iHQnVUkh7PG5XAHiEqEywQSHH1rMC31/n3QLbv lY3bcmwEQY/z9cg3JrtGc9TLmz9EpeeSU98BElLmSALP/4Ni2fs0kPK/sUDimRHNLf 57HoRh8g430Ir7em7XJWkzHi8HsrJaJFX3RE7CEE= X-Original-To: libabigail@sourceware.org Delivered-To: libabigail@sourceware.org Received: from mail-wm1-x34a.google.com (mail-wm1-x34a.google.com [IPv6:2a00:1450:4864:20::34a]) by sourceware.org (Postfix) with ESMTPS id 30C8B3858015 for ; Fri, 3 Dec 2021 12:09:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30C8B3858015 Received: by mail-wm1-x34a.google.com with SMTP id y141-20020a1c7d93000000b0033c2ae3583fso1450775wmc.5 for ; Fri, 03 Dec 2021 04:09:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=DbWThjuXKM/ZTQyNuPMQBROc9d9YARIyTTf/OIgGEQg=; b=yosR/Rq1fxUfWgNpgr8i2WzTN4EygS7Y+roFJqiEHM6qehePN+1YRkzctYtkAcHffT IuYnneOQSKBgHHTt0iyb28AIilMzLjQKi2+SqrifDPkN/akb1o2DxcEvZT4e8d74bvme lEiwm6dMEPhCQoT+zdTE0K8U7JWlVJbtqOQsy7ZudFqy7E7uWoHu/QcWN3ZlZ7q0J/MX MXePBXOhtcJJZiUw3gQdMoTMOfGEV5Q4AfKVmKJ1RpiitGSTAT2tesWOi3NGrImus/Co cryhKnSczOLPrbzXx1oN291a3IyLTRPffGHCD6S3nO8+ZCpcjSXpvu1SH0UWwxSnT+FS apKg== X-Gm-Message-State: AOAM532ygB1UT+uQ8rgUdNgb18Lgy8FjdH+NCZGWyRRe5UELbvb0gC1Q 8mximppJ25nF+kJaf/G/XUngPMSfEzMaNR5Uf6pmjPq7LSDqNPV8WKQggs13Nhhojg1PEZ4gbRS zE5HUOcIs9YyqKoeBShexMok84FYymDlQhKuJmUy0BisyoRPXYk4k/gfCpoN2Vh8V0rx/r1s= X-Google-Smtp-Source: ABdhPJweATvSXdxI5Q8MXU8GipmnstsefRCbLeN8CgrWq/FwVkTrMX2lb1ph8A63fJZYeoY5gUAa/DlYr5y09Q== X-Received: from lux.lon.corp.google.com ([2a00:79e0:d:210:47e9:78df:690b:201]) (user=maennich job=sendgmr) by 2002:a05:600c:4ec7:: with SMTP id g7mr14521105wmq.138.1638533356177; Fri, 03 Dec 2021 04:09:16 -0800 (PST) Date: Fri, 3 Dec 2021 11:46:23 +0000 In-Reply-To: <20211203114622.2944173-1-maennich@google.com> Message-Id: <20211203114622.2944173-6-maennich@google.com> Mime-Version: 1.0 References: <20211203114622.2944173-1-maennich@google.com> X-Mailer: git-send-email 2.34.1.400.ga245620fadb-goog Subject: [PATCH 5/5] XML writer: resolve declaration-only enum definitions To: libabigail@sourceware.org X-Spam-Status: No, score=-22.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL 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: Matthias Maennich via Libabigail From: =?utf-8?q?Matthias_M=C3=A4nnich?= Reply-To: Matthias Maennich Cc: maennich@google.com, kernel-team@android.com Errors-To: libabigail-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libabigail" Let the writer look through declaration-only enums for definitions. This matches what get_preferred_type, write_class_decl and write_union_decl do. No current test cases are affected. * src/abg-writer.cc (write_enum_type_decl): Look through declaration-only types the same as for structs and unions. Reviewed-by: Giuliano Procida Signed-off-by: Matthias Maennich --- src/abg-writer.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/abg-writer.cc b/src/abg-writer.cc index 76e60eb92347..31667bf7ccea 100644 --- a/src/abg-writer.cc +++ b/src/abg-writer.cc @@ -3020,14 +3020,16 @@ write_array_type_def(const array_type_def_sptr& decl, /// /// @return true upon succesful completion, false otherwise. static bool -write_enum_type_decl(const enum_type_decl_sptr& decl, - const string& id, - write_context& ctxt, - unsigned indent) +write_enum_type_decl(const enum_type_decl_sptr& d, + const string& id, + write_context& ctxt, + unsigned indent) { - if (!decl) + if (!d) return false; + enum_type_decl_sptr decl = is_enum_type(look_through_decl_only_enum(d)); + annotate(decl->get_canonical_type(), ctxt, indent); ostream& o = ctxt.get_ostream();