Message ID | 20230223-submit-gmp-hiding-v1-0-ea6ff9e32716@adacore.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 26A9A385B513 for <patchwork@sourceware.org>; Thu, 23 Feb 2023 19:48:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 26A9A385B513 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677181708; bh=vRGh1OQfo7YbXjHQxqtRMVTVsY+lVxsuNxCutptTP1k=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=l+1OsR8ap+DimLtRPmEMSur2KAh/cUty63HOSX1p45G/ZmsaCRVQvkq+NpKjCJXdv FbGSSUxUxZbdqRSKM0sj9wrBQAPxi1Hliv+aiAtV4VPwZcbzztUE8Ec/0onT+oaRZ2 AvZTeBvjR9CsVsVCJQVXMEXrTyHh4xM7X3mJ3++0= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 01D693858C00 for <gdb-patches@sourceware.org>; Thu, 23 Feb 2023 19:48:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 01D693858C00 Received: by mail-il1-x130.google.com with SMTP id z5so2498615ilq.0 for <gdb-patches@sourceware.org>; Thu, 23 Feb 2023 11:48:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vRGh1OQfo7YbXjHQxqtRMVTVsY+lVxsuNxCutptTP1k=; b=xaErYR2RdL7TXZ5yPSaqzHAaD0Nc4uf68rzfB4p+m5TO8uQMVLmI0oj7xJtIr0NuNd BpUY3BDxajuy8fzERvBphHryTQa3PqioA1vUYyt2r7vrI+I+LzHJENIuzTgMQInYunvH gSwu8/7bV69OV0Ut3+w+9zVlfGvGYE3luZa/SxHqCX3v9mbLK5NXDf/jRk1yLkZ7tMym QoAv9g91My8U0DZT4dwgOjC4HUdPQ9GQQ/7zqcaR8au48mGYrgl0m6JwngRtLtIbcpn6 0bB5wVa9ir87kBTGfHtHDw6yv6XGax+7UXXPtUrl/vxwVEDonMyGtJ12ybLP9x9gyoYO vSJQ== X-Gm-Message-State: AO0yUKXE3Cv3VA1q7jJZsc7Ly2Kv/OCWUZbFTRAthauFxTZS64bXGhoQ 62ZbSzXxKj950LaFCeGW82R0KcdMaLQly0qU X-Google-Smtp-Source: AK7set+WQY3r/yLswuqErdYHCJ76lQ5VPkvzL4aJgz7AXQXYwE3JbRRdIptUFmaxPlvOIp8SLtnSEw== X-Received: by 2002:a05:6e02:154c:b0:313:e397:ee95 with SMTP id j12-20020a056e02154c00b00313e397ee95mr10433220ilu.4.1677181681198; Thu, 23 Feb 2023 11:48:01 -0800 (PST) Received: from localhost.localdomain (75-166-130-93.hlrn.qwest.net. [75.166.130.93]) by smtp.gmail.com with ESMTPSA id x4-20020a920604000000b00316e4139270sm2038351ilg.35.2023.02.23.11.48.00 for <gdb-patches@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 11:48:00 -0800 (PST) Subject: [PATCH 0/6] Make GMP data members private Date: Thu, 23 Feb 2023 12:47:58 -0700 Message-Id: <20230223-submit-gmp-hiding-v1-0-ea6ff9e32716@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAO/C92MC/x2NQQqDQAwAvyI5N7BGKNKvlB6yGndz2K0kthTEv 3f1OAzD7OBiKg6PbgeTr7q+a4P+1sGUuSZBnRsDBRoC0YD+iUU3TGXFrLPWhGOUscl7TxygdZF dMBrXKZ9lYd/ETrGaLPq7Zs/XcfwBiRqtm3wAAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.0 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tom Tromey <tromey@adacore.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Make GMP data members private
|
|
Message
Tom Tromey
Feb. 23, 2023, 7:47 p.m. UTC
This series changes the GMP code in gmp-utils.h to add methods and operators, and then to make the data members private. Ages ago I told Simon I'd do this, then I dropped it for years. I've only added exactly the operators that are needed right now. It's simple to add more operators or more overloads as required. Regression tested on x86-64 Fedora 36. Tom --- Tom Tromey (6): Clean up gmp-utils.h includes Add methods and operators to gdb_mpz Rename gdb_mpz::val and make contents private Add operators and methods to gdb_mpq Rename gdb_mpq::val and make contents private Hide the implementation of gdb_mpf gdb/ada-lex.l | 9 +- gdb/dwarf2/read.c | 46 +++---- gdb/gmp-utils.c | 61 ++++----- gdb/gmp-utils.h | 248 ++++++++++++++++++++++++++++++------ gdb/unittests/gmp-utils-selftests.c | 89 +++++++------ gdb/valarith.c | 18 +-- gdb/valops.c | 15 +-- gdb/valprint.c | 2 +- gdb/value.c | 3 +- 9 files changed, 325 insertions(+), 166 deletions(-) --- base-commit: e98a23bfb3088fb129540d7fd26f3205e2de6f2a change-id: 20230223-submit-gmp-hiding-8be8230612a0 Best regards,
Comments
>>>>> "Tom" == Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:
Tom> This series changes the GMP code in gmp-utils.h to add methods and
Tom> operators, and then to make the data members private. Ages ago I told
Tom> Simon I'd do this, then I dropped it for years.
Tom> I've only added exactly the operators that are needed right now. It's
Tom> simple to add more operators or more overloads as required.
Tom> Regression tested on x86-64 Fedora 36.
I rebased this and I am going to check it in now.
Tom