[v2,0/9] Remove char-based bitfield macros

Message ID 20231027-field-bits-v2-0-cbec64f2136a@adacore.com
Headers
Series Remove char-based bitfield macros |

Message

Tom Tromey Oct. 27, 2023, 5:36 p.m. UTC
  This series removes the char-based bitfield macros from gdbtypes.h,
moving the associated data into 'struct field'.  A few other minor
cleanups are done along the way.

Regression tested on x86-64 Fedora 36.

---
Changes in v2:
- Introduced accessibility enum per review
- Added two new simplification patches
- Link to v1: https://inbox.sourceware.org/gdb-patches/20230921-field-bits-v1-0-201285360900@adacore.com

---
Tom Tromey (9):
      Use .def file to stringify type codes
      Print field accessibility inline
      Remove byte vectors from cplus_struct_type
      Add field::is_public
      Remove some QUIT calls from need_access_label_p
      Remove some type field accessor macros
      Remove char-based bitfield macros
      Use enum accessibility in types and member functions
      Simplify C++ type-printing

 gdb/ada-valprint.c                       |   2 +-
 gdb/c-typeprint.c                        | 145 ++++++-------------------
 gdb/c-varobj.c                           |  39 ++-----
 gdb/compile/compile-cplus-types.c        |   7 +-
 gdb/cp-valprint.c                        |   4 +-
 gdb/dwarf2/read.c                        |  94 ++++------------
 gdb/gdbtypes.c                           | 181 +++++++------------------------
 gdb/gdbtypes.h                           | 162 ++++++++++++---------------
 gdb/p-typeprint.c                        |   6 +-
 gdb/p-valprint.c                         |   4 +-
 gdb/stabsread.c                          | 127 ++++++++--------------
 gdb/testsuite/gdb.base/ptype-offsets.exp |   6 -
 12 files changed, 228 insertions(+), 549 deletions(-)
---
base-commit: 2c1e03b4520e908aa1eb36ecda279047b17bab23
change-id: 20230921-field-bits-9b9f802eb42b

Best regards,
  

Comments

Keith Seitz Nov. 2, 2023, 4:54 p.m. UTC | #1
On 10/27/23 10:36, Tom Tromey wrote:
> This series removes the char-based bitfield macros from gdbtypes.h,
> moving the associated data into 'struct field'.  A few other minor
> cleanups are done along the way.
> 
> Regression tested on x86-64 Fedora 36.

This is a really nice change which demonstrates the wins we can see
with C++. I find the code eminently more readable and understandable.

I know Lancelot reviewed your original patches, but I've looked over
this revision, and I am at a loss to find anything requiring additional
attention.

Reviewed-by: Keith Seitz <keiths@redhat.com>

Keith
  
Simon Marchi Nov. 3, 2023, 4:23 a.m. UTC | #2
On 2023-11-02 12:54, Keith Seitz wrote:
> On 10/27/23 10:36, Tom Tromey wrote:
>> This series removes the char-based bitfield macros from gdbtypes.h,
>> moving the associated data into 'struct field'.  A few other minor
>> cleanups are done along the way.
>>
>> Regression tested on x86-64 Fedora 36.
> 
> This is a really nice change which demonstrates the wins we can see
> with C++. I find the code eminently more readable and understandable.

Agreed, I'm especially glad that you got rid of some more TYPE_
macros.

I only looked at the changes in diagonal, but I like where this is
going, so:

Acked-By: Simon Marchi <simon.marchi@efficios.com>

Simon