[0/6] Make GMP data members private

Message ID 20230223-submit-gmp-hiding-v1-0-ea6ff9e32716@adacore.com
Headers
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 Tromey March 14, 2023, 2:15 p.m. UTC | #1
>>>>> "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