gdb/dwarf: rename dwarf2_per_cu_data -> dwarf2_per_cu

Message ID 20250226042042.2267150-1-simon.marchi@polymtl.ca
State New
Headers
Series gdb/dwarf: rename dwarf2_per_cu_data -> dwarf2_per_cu |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply

Commit Message

Simon Marchi Feb. 26, 2025, 4:20 a.m. UTC
  From: Simon Marchi <simon.marchi@efficios.com>

This scratches an itch I had for a while.  I don't know why this struct
type has "data" in its name.  Others like "dwarf2_per_objfile" and
"dwarf2_per_bfd" don't.  The primary job of a structure is to hold data,
there's no need to specify it.  It also makes the name a bit shorter,
which is always nice.

Rename related types too.

Change-Id: Ifb63195ff105809fc15b502f639c0bb4d18a675e
---
 gdb/compile/compile-loc2c.c   |   6 +-
 gdb/compile/compile.h         |   6 +-
 gdb/dwarf2/aranges.c          |   5 +-
 gdb/dwarf2/call-site.h        |   6 +-
 gdb/dwarf2/cooked-index.c     |  18 ++-
 gdb/dwarf2/cooked-index.h     |  24 ++--
 gdb/dwarf2/cu.c               |   5 +-
 gdb/dwarf2/cu.h               |  15 ++-
 gdb/dwarf2/expr.c             |  15 ++-
 gdb/dwarf2/expr.h             |   4 +-
 gdb/dwarf2/frame.c            |   5 +-
 gdb/dwarf2/frame.h            |   7 +-
 gdb/dwarf2/index-write.c      |  19 ++-
 gdb/dwarf2/loc.c              |  35 +++---
 gdb/dwarf2/loc.h              |  12 +-
 gdb/dwarf2/mapped-index.h     |   2 +-
 gdb/dwarf2/read-debug-names.c |   2 +-
 gdb/dwarf2/read-gdb-index.c   |  14 +--
 gdb/dwarf2/read.c             | 231 +++++++++++++++-------------------
 gdb/dwarf2/read.h             | 123 +++++++++---------
 gdb/gdbtypes.h                |   2 +-
 21 files changed, 258 insertions(+), 298 deletions(-)


base-commit: 2f0521c0d6f6ea6fecef96cf825656263abb570d
  

Comments

Guinevere Larsen Feb. 26, 2025, 2:50 p.m. UTC | #1
On 2/26/25 1:20 AM, simon.marchi@polymtl.ca wrote:
> From: Simon Marchi <simon.marchi@efficios.com>
>
> This scratches an itch I had for a while.  I don't know why this struct
> type has "data" in its name.  Others like "dwarf2_per_objfile" and
> "dwarf2_per_bfd" don't.  The primary job of a structure is to hold data,
> there's no need to specify it.  It also makes the name a bit shorter,
> which is always nice.
>
> Rename related types too.
>
> Change-Id: Ifb63195ff105809fc15b502f639c0bb4d18a675e

I took a look over the patch and ran a quick test, everything looks ok, 
and this is a good change!

Reviewed-By: Guinevere Larsen <guinevere@redhat.com>

> ---
>   gdb/compile/compile-loc2c.c   |   6 +-
>   gdb/compile/compile.h         |   6 +-
>   gdb/dwarf2/aranges.c          |   5 +-
>   gdb/dwarf2/call-site.h        |   6 +-
>   gdb/dwarf2/cooked-index.c     |  18 ++-
>   gdb/dwarf2/cooked-index.h     |  24 ++--
>   gdb/dwarf2/cu.c               |   5 +-
>   gdb/dwarf2/cu.h               |  15 ++-
>   gdb/dwarf2/expr.c             |  15 ++-
>   gdb/dwarf2/expr.h             |   4 +-
>   gdb/dwarf2/frame.c            |   5 +-
>   gdb/dwarf2/frame.h            |   7 +-
>   gdb/dwarf2/index-write.c      |  19 ++-
>   gdb/dwarf2/loc.c              |  35 +++---
>   gdb/dwarf2/loc.h              |  12 +-
>   gdb/dwarf2/mapped-index.h     |   2 +-
>   gdb/dwarf2/read-debug-names.c |   2 +-
>   gdb/dwarf2/read-gdb-index.c   |  14 +--
>   gdb/dwarf2/read.c             | 231 +++++++++++++++-------------------
>   gdb/dwarf2/read.h             | 123 +++++++++---------
>   gdb/gdbtypes.h                |   2 +-
>   21 files changed, 258 insertions(+), 298 deletions(-)
>
> diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c
> index df05c0140f05..2f5d85f0c3af 100644
> --- a/gdb/compile/compile-loc2c.c
> +++ b/gdb/compile/compile-loc2c.c
> @@ -597,7 +597,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
>   			    unsigned int addr_size,
>   			    const gdb_byte *op_ptr, const gdb_byte *op_end,
>   			    CORE_ADDR *initial,
> -			    dwarf2_per_cu_data *per_cu,
> +			    dwarf2_per_cu *per_cu,
>   			    dwarf2_per_objfile *per_objfile)
>   {
>     /* We keep a counter so that labels and other objects we create have
> @@ -1147,7 +1147,7 @@ compile_dwarf_expr_to_c (string_file *stream, const char *result_name,
>   			 std::vector<bool> &registers_used,
>   			 unsigned int addr_size,
>   			 const gdb_byte *op_ptr, const gdb_byte *op_end,
> -			 dwarf2_per_cu_data *per_cu,
> +			 dwarf2_per_cu *per_cu,
>   			 dwarf2_per_objfile *per_objfile)
>   {
>     do_compile_dwarf_expr_to_c (2, stream, GCC_UINTPTR, result_name, sym, pc,
> @@ -1166,7 +1166,7 @@ compile_dwarf_bounds_to_c (string_file *stream,
>   			   std::vector<bool> &registers_used,
>   			   unsigned int addr_size,
>   			   const gdb_byte *op_ptr, const gdb_byte *op_end,
> -			   dwarf2_per_cu_data *per_cu,
> +			   dwarf2_per_cu *per_cu,
>   			   dwarf2_per_objfile *per_objfile)
>   {
>     do_compile_dwarf_expr_to_c (2, stream, "unsigned long ", result_name,
> diff --git a/gdb/compile/compile.h b/gdb/compile/compile.h
> index 7d03d3c9bf1c..e18b5bcc764a 100644
> --- a/gdb/compile/compile.h
> +++ b/gdb/compile/compile.h
> @@ -23,7 +23,7 @@
>   
>   struct ui_file;
>   struct gdbarch;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct dwarf2_per_objfile;
>   struct symbol;
>   struct dynamic_prop;
> @@ -215,7 +215,7 @@ extern void compile_dwarf_expr_to_c (string_file *stream,
>   				     unsigned int addr_size,
>   				     const gdb_byte *op_ptr,
>   				     const gdb_byte *op_end,
> -				     dwarf2_per_cu_data *per_cu,
> +				     dwarf2_per_cu *per_cu,
>   				     dwarf2_per_objfile *per_objfile);
>   
>   /* Compile a DWARF bounds expression to C, suitable for use by the
> @@ -254,7 +254,7 @@ extern void compile_dwarf_bounds_to_c (string_file *stream,
>   				       unsigned int addr_size,
>   				       const gdb_byte *op_ptr,
>   				       const gdb_byte *op_end,
> -				       dwarf2_per_cu_data *per_cu,
> +				       dwarf2_per_cu *per_cu,
>   				       dwarf2_per_objfile *per_objfile);
>   
>   extern void compile_print_value (struct value *val, void *data_voidp);
> diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c
> index b9903084416f..1be67852b43a 100644
> --- a/gdb/dwarf2/aranges.c
> +++ b/gdb/dwarf2/aranges.c
> @@ -39,8 +39,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
>     struct gdbarch *gdbarch = objfile->arch ();
>     dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
>   
> -  gdb::unordered_map<sect_offset, dwarf2_per_cu_data *>
> -    debug_info_offset_to_per_cu;
> +  gdb::unordered_map<sect_offset, dwarf2_per_cu *> debug_info_offset_to_per_cu;
>     for (const auto &per_cu : per_bfd->all_units)
>       {
>         /* A TU will not need aranges, and skipping them here is an easy
> @@ -123,7 +122,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
>   		      sect_offset_str (sect_offset (debug_info_offset)));
>   	  return false;
>   	}
> -      dwarf2_per_cu_data *const per_cu = per_cu_it->second;
> +      dwarf2_per_cu *const per_cu = per_cu_it->second;
>   
>         const uint8_t address_size = *addr++;
>         if (address_size < 1 || address_size > 8)
> diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h
> index 32cf673332b0..ffade3bc1530 100644
> --- a/gdb/dwarf2/call-site.h
> +++ b/gdb/dwarf2/call-site.h
> @@ -28,7 +28,7 @@
>   #include "gdbsupport/unordered_set.h"
>   
>   struct dwarf2_locexpr_baton;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct dwarf2_per_objfile;
>   
>   /* struct call_site_parameter can be referenced in callees by several ways.  */
> @@ -164,7 +164,7 @@ struct call_site_parameter
>   
>   struct call_site
>   {
> -  call_site (unrelocated_addr pc, dwarf2_per_cu_data *per_cu,
> +  call_site (unrelocated_addr pc, dwarf2_per_cu *per_cu,
>   	     dwarf2_per_objfile *per_objfile)
>       : per_cu (per_cu), per_objfile (per_objfile), m_unrelocated_pc (pc)
>     {}
> @@ -209,7 +209,7 @@ struct call_site
>     /* * CU of the function where the call is located.  It gets used
>        for DWARF blocks execution in the parameter array below.  */
>   
> -  dwarf2_per_cu_data *const per_cu = nullptr;
> +  dwarf2_per_cu *const per_cu = nullptr;
>   
>     /* objfile of the function where the call is located.  */
>   
> diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
> index 6c6839cde9ba..e609a2a9d461 100644
> --- a/gdb/dwarf2/cooked-index.c
> +++ b/gdb/dwarf2/cooked-index.c
> @@ -273,9 +273,8 @@ cooked_index_entry::write_scope (struct obstack *storage,
>   cooked_index_entry *
>   cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
>   			 cooked_index_flag flags, enum language lang,
> -			 const char *name,
> -			 cooked_index_entry_ref parent_entry,
> -			 dwarf2_per_cu_data *per_cu)
> +			 const char *name, cooked_index_entry_ref parent_entry,
> +			 dwarf2_per_cu *per_cu)
>   {
>     cooked_index_entry *result = create (die_offset, tag, flags, lang, name,
>   				       parent_entry, per_cu);
> @@ -691,14 +690,14 @@ cooked_index::~cooked_index ()
>   
>   /* See cooked-index.h.  */
>   
> -dwarf2_per_cu_data *
> +dwarf2_per_cu *
>   cooked_index::lookup (unrelocated_addr addr)
>   {
>     /* Ensure that the address maps are ready.  */
>     wait (cooked_state::MAIN_AVAILABLE, true);
>     for (const auto &shard : m_shards)
>       {
> -      dwarf2_per_cu_data *result = shard->lookup (addr);
> +      dwarf2_per_cu *result = shard->lookup (addr);
>         if (result != nullptr)
>   	return result;
>       }
> @@ -857,14 +856,13 @@ cooked_index::dump (gdbarch *arch)
>   
>   	  if (obj != nullptr)
>   	    {
> -	      const dwarf2_per_cu_data *per_cu
> -		= static_cast<const dwarf2_per_cu_data *> (obj);
> -	      gdb_printf ("      [%s] ((dwarf2_per_cu_data *) %p)\n",
> +	      const dwarf2_per_cu *per_cu
> +		= static_cast<const dwarf2_per_cu *> (obj);
> +	      gdb_printf ("      [%s] ((dwarf2_per_cu *) %p)\n",
>   			  start_addr_str, per_cu);
>   	    }
>   	  else
> -	    gdb_printf ("      [%s] ((dwarf2_per_cu_data *) 0)\n",
> -			start_addr_str);
> +	    gdb_printf ("      [%s] ((dwarf2_per_cu *) 0)\n", start_addr_str);
>   
>   	  return 0;
>   	});
> diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
> index d642c132f8af..a1d174e0e88c 100644
> --- a/gdb/dwarf2/cooked-index.h
> +++ b/gdb/dwarf2/cooked-index.h
> @@ -40,7 +40,7 @@
>   #include <condition_variable>
>   #endif /* CXX_STD_THREAD */
>   
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct dwarf2_per_bfd;
>   struct index_cache_store_context;
>   struct cooked_index_entry;
> @@ -105,7 +105,7 @@ struct cooked_index_entry : public allocate_on_obstack<cooked_index_entry>
>   		      cooked_index_flag flags_,
>   		      enum language lang_, const char *name_,
>   		      cooked_index_entry_ref parent_entry_,
> -		      dwarf2_per_cu_data *per_cu_)
> +		      dwarf2_per_cu *per_cu_)
>       : name (name_),
>         tag (tag_),
>         flags (flags_),
> @@ -241,7 +241,7 @@ struct cooked_index_entry : public allocate_on_obstack<cooked_index_entry>
>     /* The offset of this DIE.  */
>     sect_offset die_offset;
>     /* The CU from which this entry originates.  */
> -  dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>   
>   private:
>   
> @@ -279,7 +279,7 @@ class cooked_index_shard
>   			   cooked_index_flag flags, enum language lang,
>   			   const char *name,
>   			   cooked_index_entry_ref parent_entry,
> -			   dwarf2_per_cu_data *per_cu);
> +			   dwarf2_per_cu *per_cu);
>   
>     /* Install a new fixed addrmap from the given mutable addrmap.  */
>     void install_addrmap (addrmap_mutable *map)
> @@ -317,13 +317,12 @@ class cooked_index_shard
>     /* Look up ADDR in the address map, and return either the
>        corresponding CU, or nullptr if the address could not be
>        found.  */
> -  dwarf2_per_cu_data *lookup (unrelocated_addr addr)
> +  dwarf2_per_cu *lookup (unrelocated_addr addr)
>     {
>       if (m_addrmap == nullptr)
>         return nullptr;
>   
> -    return (static_cast<dwarf2_per_cu_data *>
> -	    (m_addrmap->find ((CORE_ADDR) addr)));
> +    return (static_cast<dwarf2_per_cu *> (m_addrmap->find ((CORE_ADDR) addr)));
>     }
>   
>     /* Create a new cooked_index_entry and register it with this object.
> @@ -334,7 +333,7 @@ class cooked_index_shard
>   			      enum language lang,
>   			      const char *name,
>   			      cooked_index_entry_ref parent_entry,
> -			      dwarf2_per_cu_data *per_cu)
> +			      dwarf2_per_cu *per_cu)
>     {
>       return new (&m_storage) cooked_index_entry (die_offset, tag, flags,
>   						lang, name, parent_entry,
> @@ -360,8 +359,7 @@ class cooked_index_shard
>     std::vector<cooked_index_entry *> m_entries;
>     /* If we found an entry with 'is_main' set, store it here.  */
>     cooked_index_entry *m_main = nullptr;
> -  /* The addrmap.  This maps address ranges to dwarf2_per_cu_data
> -     objects.  */
> +  /* The addrmap.  This maps address ranges to dwarf2_per_cu objects.  */
>     addrmap_fixed *m_addrmap = nullptr;
>     /* Storage for canonical names.  */
>     std::vector<gdb::unique_xmalloc_ptr<char>> m_names;
> @@ -389,7 +387,7 @@ class cooked_index_storage
>   
>     /* Return the DIE reader corresponding to PER_CU.  If no such reader
>        has been registered, return NULL.  */
> -  cutu_reader *get_reader (dwarf2_per_cu_data *per_cu);
> +  cutu_reader *get_reader (dwarf2_per_cu *per_cu);
>   
>     /* Preserve READER by storing it in the local hash table.  */
>     cutu_reader *preserve (cutu_reader_up reader);
> @@ -400,7 +398,7 @@ class cooked_index_storage
>   			   cooked_index_flag flags,
>   			   const char *name,
>   			   cooked_index_entry_ref parent_entry,
> -			   dwarf2_per_cu_data *per_cu)
> +			   dwarf2_per_cu *per_cu)
>     {
>       return m_shard->add (die_offset, tag, flags, per_cu->lang (),
>   			 name, parent_entry, per_cu);
> @@ -671,7 +669,7 @@ class cooked_index : public dwarf_scanner_base
>     /* Look up ADDR in the address map, and return either the
>        corresponding CU, or nullptr if the address could not be
>        found.  */
> -  dwarf2_per_cu_data *lookup (unrelocated_addr addr) override;
> +  dwarf2_per_cu *lookup (unrelocated_addr addr) override;
>   
>     /* Return a new vector of all the addrmaps used by all the indexes
>        held by this object.
> diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c
> index 89f52825240e..0e17b73dfc43 100644
> --- a/gdb/dwarf2/cu.c
> +++ b/gdb/dwarf2/cu.c
> @@ -26,8 +26,7 @@
>   
>   /* Initialize dwarf2_cu to read PER_CU, in the context of PER_OBJFILE.  */
>   
> -dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu,
> -		      dwarf2_per_objfile *per_objfile)
> +dwarf2_cu::dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
>     : per_cu (per_cu),
>       per_objfile (per_objfile),
>       m_mark (false),
> @@ -141,7 +140,7 @@ dwarf2_cu::mark ()
>   
>     m_mark = true;
>   
> -  for (dwarf2_per_cu_data *per_cu : m_dependencies)
> +  for (dwarf2_per_cu *per_cu : m_dependencies)
>       {
>         /* cu->m_dependencies references may not yet have been ever
>   	 read if QUIT aborts reading of the chain.  As such
> diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h
> index b97a5403dc84..6979b7cd2765 100644
> --- a/gdb/dwarf2/cu.h
> +++ b/gdb/dwarf2/cu.h
> @@ -50,8 +50,7 @@ struct delayed_method_info
>   /* Internal state when decoding a particular compilation unit.  */
>   struct dwarf2_cu
>   {
> -  explicit dwarf2_cu (dwarf2_per_cu_data *per_cu,
> -		      dwarf2_per_objfile *per_objfile);
> +  explicit dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile);
>   
>     DISABLE_COPY_AND_ASSIGN (dwarf2_cu);
>   
> @@ -97,7 +96,7 @@ struct dwarf2_cu
>     }
>   
>     /* Add a dependence relationship from this cu to REF_PER_CU.  */
> -  void add_dependence (struct dwarf2_per_cu_data *ref_per_cu)
> +  void add_dependence (dwarf2_per_cu *ref_per_cu)
>     { m_dependencies.emplace (ref_per_cu); }
>   
>     /* The header of the compilation unit.  */
> @@ -268,10 +267,10 @@ struct dwarf2_cu
>        symbols are being read.  */
>     buildsym_compunit_up m_builder;
>   
> -  /* A set of pointers to dwarf2_per_cu_data objects for compilation
> -     units referenced by this one.  Only used during full symbol processing;
> -     partial symbol tables do not have dependencies.  */
> -  gdb::unordered_set<dwarf2_per_cu_data *> m_dependencies;
> +  /* A set of pointers to dwarf2_per_cu objects for compilation units referenced
> +     by this one.  Only used during full symbol processing; partial symbol
> +     tables do not have dependencies.  */
> +  gdb::unordered_set<dwarf2_per_cu *> m_dependencies;
>   
>   public:
>     /* The generic symbol table building routines have separate lists for
> @@ -290,7 +289,7 @@ struct dwarf2_cu
>     auto_obstack comp_unit_obstack;
>   
>     /* Backlink to our per_cu entry.  */
> -  struct dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>   
>     /* The dwarf2_per_objfile that owns this.  */
>     dwarf2_per_objfile *per_objfile;
> diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
> index 0977cfcab546..3a6165af86c8 100644
> --- a/gdb/dwarf2/expr.c
> +++ b/gdb/dwarf2/expr.c
> @@ -60,7 +60,7 @@ ensure_have_frame (const frame_info_ptr &frame, const char *op_name)
>   /* Ensure that a PER_CU is defined and throw an exception otherwise.  */
>   
>   static void
> -ensure_have_per_cu (dwarf2_per_cu_data *per_cu, const char* op_name)
> +ensure_have_per_cu (dwarf2_per_cu *per_cu, const char *op_name)
>   {
>     if (per_cu == nullptr)
>       throw_error (GENERIC_ERROR,
> @@ -96,7 +96,7 @@ struct piece_closure
>     dwarf2_per_objfile *per_objfile = nullptr;
>   
>     /* The CU from which this closure's expression came.  */
> -  dwarf2_per_cu_data *per_cu = nullptr;
> +  dwarf2_per_cu *per_cu = nullptr;
>   
>     /* The pieces describing this variable.  */
>     std::vector<dwarf_expr_piece> pieces;
> @@ -110,8 +110,7 @@ struct piece_closure
>      PIECES.  */
>   
>   static piece_closure *
> -allocate_piece_closure (dwarf2_per_cu_data *per_cu,
> -			dwarf2_per_objfile *per_objfile,
> +allocate_piece_closure (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>   			std::vector<dwarf_expr_piece> &&pieces,
>   			const frame_info_ptr &frame)
>   {
> @@ -670,8 +669,7 @@ static const struct lval_funcs pieced_value_funcs = {
>      found at SECT_OFF.  */
>   
>   static value *
> -sect_variable_value (sect_offset sect_off,
> -		     dwarf2_per_cu_data *per_cu,
> +sect_variable_value (sect_offset sect_off, dwarf2_per_cu *per_cu,
>   		     dwarf2_per_objfile *per_objfile)
>   {
>     const char *var_name = nullptr;
> @@ -890,7 +888,7 @@ dwarf_expr_context::push_dwarf_reg_entry_value (call_site_parameter_kind kind,
>     ensure_have_per_cu (this->m_per_cu, "DW_OP_entry_value");
>     ensure_have_frame (this->m_frame, "DW_OP_entry_value");
>   
> -  dwarf2_per_cu_data *caller_per_cu;
> +  dwarf2_per_cu *caller_per_cu;
>     dwarf2_per_objfile *caller_per_objfile;
>     frame_info_ptr caller_frame = get_prev_frame (this->m_frame);
>     call_site_parameter *parameter
> @@ -1096,7 +1094,8 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
>   
>   value *
>   dwarf_expr_context::evaluate (const gdb_byte *addr, size_t len, bool as_lval,
> -			      dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
> +			      dwarf2_per_cu *per_cu,
> +			      const frame_info_ptr &frame,
>   			      const struct property_addr_info *addr_info,
>   			      struct type *type, struct type *subobj_type,
>   			      LONGEST subobj_offset)
> diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h
> index 1b1653e07682..4ef2e3ad17d8 100644
> --- a/gdb/dwarf2/expr.h
> +++ b/gdb/dwarf2/expr.h
> @@ -141,7 +141,7 @@ struct dwarf_expr_context
>        The ADDR_INFO property can be specified to override the range of
>        memory addresses with the passed in buffer.  */
>     value *evaluate (const gdb_byte *addr, size_t len, bool as_lval,
> -		   dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
> +		   dwarf2_per_cu *per_cu, const frame_info_ptr &frame,
>   		   const struct property_addr_info *addr_info = nullptr,
>   		   struct type *type = nullptr,
>   		   struct type *subobj_type = nullptr,
> @@ -203,7 +203,7 @@ struct dwarf_expr_context
>     frame_info_ptr m_frame = nullptr;
>   
>     /* Compilation unit used for the evaluation.  */
> -  dwarf2_per_cu_data *m_per_cu = nullptr;
> +  dwarf2_per_cu *m_per_cu = nullptr;
>   
>     /* Property address info used for the evaluation.  */
>     const struct property_addr_info *m_addr_info = nullptr;
> diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
> index c11e45bc2bfe..a602f2db1db1 100644
> --- a/gdb/dwarf2/frame.c
> +++ b/gdb/dwarf2/frame.c
> @@ -772,9 +772,8 @@ dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs,
>   
>   int
>   dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
> -		       struct dwarf2_per_cu_data *data,
> -		       int *regnum_out, LONGEST *offset_out,
> -		       CORE_ADDR *text_offset_out,
> +		       dwarf2_per_cu *data, int *regnum_out,
> +		       LONGEST *offset_out, CORE_ADDR *text_offset_out,
>   		       const gdb_byte **cfa_start_out,
>   		       const gdb_byte **cfa_end_out)
>   {
> diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h
> index 7ff31904da7e..15d89eae7b98 100644
> --- a/gdb/dwarf2/frame.h
> +++ b/gdb/dwarf2/frame.h
> @@ -24,7 +24,7 @@
>   
>   struct gdbarch;
>   class frame_info_ptr;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct agent_expr;
>   struct axs_value;
>   
> @@ -251,13 +251,12 @@ CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame);
>      in other cases.  These are only used when 0 is returned.  */
>   
>   extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
> -				  struct dwarf2_per_cu_data *data,
> -				  int *regnum_out, LONGEST *offset_out,
> +				  dwarf2_per_cu *data, int *regnum_out,
> +				  LONGEST *offset_out,
>   				  CORE_ADDR *text_offset_out,
>   				  const gdb_byte **cfa_start_out,
>   				  const gdb_byte **cfa_end_out);
>   
> -
>   /* Allocate a new instance of the function unique data.
>   
>      The main purpose of this custom function data object is to allow caching the
> diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
> index cba10f9588f2..174eb220df68 100644
> --- a/gdb/dwarf2/index-write.c
> +++ b/gdb/dwarf2/index-write.c
> @@ -562,8 +562,7 @@ write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
>       }
>   }
>   
> -using cu_index_map
> -  = gdb::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
> +using cu_index_map = gdb::unordered_map<const dwarf2_per_cu *, unsigned int>;
>   
>   /* Helper struct for building the address table.  */
>   struct addrmap_index_data
> @@ -604,8 +603,7 @@ add_address_entry (data_buf &addr_vec,
>   int
>   addrmap_index_data::operator() (CORE_ADDR start_addr, const void *obj)
>   {
> -  const dwarf2_per_cu_data *per_cu
> -    = static_cast<const dwarf2_per_cu_data *> (obj);
> +  const dwarf2_per_cu *per_cu = static_cast<const dwarf2_per_cu *> (obj);
>   
>     if (previous_valid)
>       add_address_entry (addr_vec,
> @@ -874,7 +872,7 @@ class debug_names
>       m_debugstrlookup.file_write (file_str);
>     }
>   
> -  void add_cu (dwarf2_per_cu_data *per_cu, offset_type index)
> +  void add_cu (dwarf2_per_cu *per_cu, offset_type index)
>     {
>       m_cu_index_htab.emplace (per_cu, index);
>     }
> @@ -1306,10 +1304,9 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
>     data_buf objfile_cu_list;
>     data_buf dwz_cu_list;
>   
> -  /* While we're scanning CU's create a table that maps a dwarf2_per_cu_data
> -     (which is what addrmap records) to its index (which is what is recorded
> -     in the index file).  This will later be needed to write the address
> -     table.  */
> +  /* While we're scanning CU's create a table that maps a dwarf2_per_cu (which
> +     is what addrmap records) to its index (which is what is recorded in the
> +     index file).  This will later be needed to write the address table.  */
>     cu_index_map cu_index_htab;
>     cu_index_htab.reserve (per_bfd->all_units.size ());
>   
> @@ -1322,7 +1319,7 @@ write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
>     int counter = 0;
>     for (int i = 0; i < per_bfd->all_units.size (); ++i)
>       {
> -      dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
> +      dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
>   
>         const auto insertpair = cu_index_htab.emplace (per_cu, counter);
>         gdb_assert (insertpair.second);
> @@ -1405,7 +1402,7 @@ write_debug_names (dwarf2_per_bfd *per_bfd, cooked_index *table,
>     int types_counter = 0;
>     for (int i = 0; i < per_bfd->all_units.size (); ++i)
>       {
> -      dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
> +      dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
>   
>         int &this_counter = per_cu->is_debug_types ? types_counter : counter;
>         data_buf &this_list = per_cu->is_debug_types ? types_cu_list : cu_list;
> diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
> index 585b5de8c9d8..398c2b1b3522 100644
> --- a/gdb/dwarf2/loc.c
> +++ b/gdb/dwarf2/loc.c
> @@ -49,7 +49,7 @@
>   
>   static struct value *dwarf2_evaluate_loc_desc_full
>     (struct type *type, const frame_info_ptr &frame, const gdb_byte *data,
> -   size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
> +   size_t size, dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>      struct type *subobj_type, LONGEST subobj_byte_offset, bool as_lval = true);
>   
>   /* Until these have formal names, we define these here.
> @@ -153,7 +153,7 @@ decode_debug_loc_addresses (const gdb_byte *loc_ptr, const gdb_byte *buf_end,
>      The result indicates the kind of entry found.  */
>   
>   static enum debug_loc_kind
> -decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
> +decode_debug_loclists_addresses (dwarf2_per_cu *per_cu,
>   				 dwarf2_per_objfile *per_objfile,
>   				 const gdb_byte *loc_ptr,
>   				 const gdb_byte *buf_end,
> @@ -288,7 +288,7 @@ decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
>      The result indicates the kind of entry found.  */
>   
>   static enum debug_loc_kind
> -decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu,
> +decode_debug_loc_dwo_addresses (dwarf2_per_cu *per_cu,
>   				dwarf2_per_objfile *per_objfile,
>   				const gdb_byte *loc_ptr,
>   				const gdb_byte *buf_end,
> @@ -1137,7 +1137,7 @@ struct call_site_parameter *
>   dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame,
>   				   call_site_parameter_kind kind,
>   				   call_site_parameter_u kind_u,
> -				   dwarf2_per_cu_data **per_cu_return,
> +				   dwarf2_per_cu **per_cu_return,
>   				   dwarf2_per_objfile **per_objfile_return)
>   {
>     CORE_ADDR func_addr, caller_pc;
> @@ -1259,7 +1259,7 @@ static struct value *
>   dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
>   				CORE_ADDR deref_size, struct type *type,
>   				const frame_info_ptr &caller_frame,
> -				dwarf2_per_cu_data *per_cu,
> +				dwarf2_per_cu *per_cu,
>   				dwarf2_per_objfile *per_objfile)
>   {
>     const gdb_byte *data_src;
> @@ -1343,7 +1343,7 @@ value_of_dwarf_reg_entry (struct type *type, const frame_info_ptr &frame,
>     frame_info_ptr caller_frame = get_prev_frame (frame);
>     struct value *outer_val, *target_val, *val;
>     struct call_site_parameter *parameter;
> -  dwarf2_per_cu_data *caller_per_cu;
> +  dwarf2_per_cu *caller_per_cu;
>     dwarf2_per_objfile *caller_per_objfile;
>   
>     parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
> @@ -1416,7 +1416,7 @@ value_of_dwarf_block_entry (struct type *type, const frame_info_ptr &frame,
>   
>   static struct value *
>   fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
> -					  dwarf2_per_cu_data *per_cu,
> +					  dwarf2_per_cu *per_cu,
>   					  dwarf2_per_objfile *per_objfile,
>   					  struct type *type)
>   {
> @@ -1449,7 +1449,7 @@ fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
>   
>   struct value *
>   indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
> -			    dwarf2_per_cu_data *per_cu,
> +			    dwarf2_per_cu *per_cu,
>   			    dwarf2_per_objfile *per_objfile,
>   			    const frame_info_ptr &frame, struct type *type,
>   			    bool resolve_abstract_p)
> @@ -1493,7 +1493,7 @@ indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
>   static struct value *
>   dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
>   			       const gdb_byte *data, size_t size,
> -			       dwarf2_per_cu_data *per_cu,
> +			       dwarf2_per_cu *per_cu,
>   			       dwarf2_per_objfile *per_objfile,
>   			       struct type *subobj_type,
>   			       LONGEST subobj_byte_offset,
> @@ -1558,7 +1558,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
>   struct value *
>   dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame,
>   			  const gdb_byte *data, size_t size,
> -			  dwarf2_per_cu_data *per_cu,
> +			  dwarf2_per_cu *per_cu,
>   			  dwarf2_per_objfile *per_objfile, bool as_lval)
>   {
>     return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu,
> @@ -1589,7 +1589,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
>       return 0;
>   
>     dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;
> -  dwarf2_per_cu_data *per_cu = dlbaton->per_cu;
> +  dwarf2_per_cu *per_cu = dlbaton->per_cu;
>     dwarf_expr_context ctx (per_objfile, per_cu->addr_size ());
>   
>     value *result;
> @@ -1787,7 +1787,7 @@ dwarf2_compile_property_to_c (string_file *stream,
>     const dwarf2_property_baton *baton = prop->baton ();
>     const gdb_byte *data;
>     size_t size;
> -  dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>     dwarf2_per_objfile *per_objfile;
>   
>     if (prop->kind () == PROP_LOCEXPR)
> @@ -1820,7 +1820,7 @@ dwarf2_compile_property_to_c (string_file *stream,
>   
>   static enum symbol_needs_kind
>   dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
> -			      dwarf2_per_cu_data *per_cu,
> +			      dwarf2_per_cu *per_cu,
>   			      dwarf2_per_objfile *per_objfile,
>   			      bfd_endian byte_order,
>   			      int addr_size,
> @@ -2371,8 +2371,7 @@ access_memory (struct gdbarch *arch, struct agent_expr *expr, ULONGEST nbits)
>   static void
>   dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
>   			   unsigned int addr_size, const gdb_byte *op_ptr,
> -			   const gdb_byte *op_end,
> -			   dwarf2_per_cu_data *per_cu,
> +			   const gdb_byte *op_end, dwarf2_per_cu *per_cu,
>   			   dwarf2_per_objfile *per_objfile)
>   {
>     gdbarch *arch = expr->gdbarch;
> @@ -3134,7 +3133,7 @@ locexpr_regname (struct gdbarch *gdbarch, int dwarf_regnum)
>   
>   static const gdb_byte *
>   locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
> -				 CORE_ADDR addr, dwarf2_per_cu_data *per_cu,
> +				 CORE_ADDR addr, dwarf2_per_cu *per_cu,
>   				 dwarf2_per_objfile *per_objfile,
>   				 const gdb_byte *data, const gdb_byte *end,
>   				 unsigned int addr_size)
> @@ -3314,7 +3313,7 @@ disassemble_dwarf_expression (struct ui_file *stream,
>   			      int offset_size, const gdb_byte *start,
>   			      const gdb_byte *data, const gdb_byte *end,
>   			      int indent, int all,
> -			      dwarf2_per_cu_data *per_cu,
> +			      dwarf2_per_cu *per_cu,
>   			      dwarf2_per_objfile *per_objfile)
>   {
>     while (data < end
> @@ -3720,7 +3719,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
>   			     struct ui_file *stream,
>   			     const gdb_byte *data, size_t size,
>   			     unsigned int addr_size,
> -			     int offset_size, dwarf2_per_cu_data *per_cu,
> +			     int offset_size, dwarf2_per_cu *per_cu,
>   			     dwarf2_per_objfile *per_objfile)
>   {
>     const gdb_byte *end = data + size;
> diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
> index 78635682d944..5c7330e43a09 100644
> --- a/gdb/dwarf2/loc.h
> +++ b/gdb/dwarf2/loc.h
> @@ -24,7 +24,7 @@
>   
>   struct symbol_computed_ops;
>   struct dwarf2_per_objfile;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct dwarf2_loclist_baton;
>   struct agent_expr;
>   struct axs_value;
> @@ -67,7 +67,7 @@ value *compute_var_value (const char *name);
>   
>   call_site_parameter *dwarf_expr_reg_to_entry_parameter
>     (const frame_info_ptr &frame, call_site_parameter_kind kind,
> -   call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return,
> +   call_site_parameter_u kind_u, dwarf2_per_cu **per_cu_return,
>      dwarf2_per_objfile **per_objfile_return);
>   
>   
> @@ -78,7 +78,7 @@ call_site_parameter *dwarf_expr_reg_to_entry_parameter
>   
>   value *dwarf2_evaluate_loc_desc (type *type, const frame_info_ptr &frame,
>   				 const gdb_byte *data, size_t size,
> -				 dwarf2_per_cu_data *per_cu,
> +				 dwarf2_per_cu *per_cu,
>   				 dwarf2_per_objfile *per_objfile,
>   				 bool as_lval = true);
>   
> @@ -172,7 +172,7 @@ struct dwarf2_locexpr_baton
>   
>     /* The compilation unit containing the symbol whose location
>        we're computing.  */
> -  struct dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>   };
>   
>   struct dwarf2_loclist_baton
> @@ -192,7 +192,7 @@ struct dwarf2_loclist_baton
>   
>     /* The compilation unit containing the symbol whose location
>        we're computing.  */
> -  struct dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>   
>     /* Non-zero if the location list lives in .debug_loc.dwo.
>        The format of entries in this section are different.  */
> @@ -293,7 +293,7 @@ extern void invalid_synthetic_pointer ();
>   /* Fetch the value pointed to by a synthetic pointer.  */
>   
>   extern struct value *indirect_synthetic_pointer
> -  (sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu,
> +  (sect_offset die, LONGEST byte_offset, dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile, const frame_info_ptr &frame,
>      struct type *type, bool resolve_abstract_p = false);
>   
> diff --git a/gdb/dwarf2/mapped-index.h b/gdb/dwarf2/mapped-index.h
> index 3117df260bc6..15677ec71abe 100644
> --- a/gdb/dwarf2/mapped-index.h
> +++ b/gdb/dwarf2/mapped-index.h
> @@ -65,7 +65,7 @@ struct dwarf_scanner_base
>   
>     /* Look up ADDR, and return either the corresponding CU, or nullptr
>        if the address could not be found.  */
> -  virtual dwarf2_per_cu_data *lookup (unrelocated_addr addr)
> +  virtual dwarf2_per_cu *lookup (unrelocated_addr addr)
>     { return nullptr; }
>   };
>   
> diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c
> index 924b570a5f40..34db3dbee79f 100644
> --- a/gdb/dwarf2/read-debug-names.c
> +++ b/gdb/dwarf2/read-debug-names.c
> @@ -174,7 +174,7 @@ mapped_debug_names_reader::scan_one_entry (const char *name,
>     cooked_index_flag flags = 0;
>     sect_offset die_offset {};
>     enum language lang = language_unknown;
> -  dwarf2_per_cu_data *per_cu = nullptr;
> +  dwarf2_per_cu *per_cu = nullptr;
>     for (const auto &attr : indexval.attr_vec)
>       {
>         ULONGEST ull;
> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
> index ff60e9b862c6..f6886c1ce97d 100644
> --- a/gdb/dwarf2/read-gdb-index.c
> +++ b/gdb/dwarf2/read-gdb-index.c
> @@ -129,7 +129,7 @@ struct mapped_gdb_index : public dwarf_scanner_base
>     /* The shortcut table data.  */
>     gdb::array_view<const gdb_byte> shortcut_table;
>   
> -  /* An address map that maps from PC to dwarf2_per_cu_data.  */
> +  /* An address map that maps from PC to dwarf2_per_cu.  */
>     addrmap_fixed *index_addrmap = nullptr;
>   
>     /* Return the index into the constant pool of the name of the IDXth
> @@ -186,13 +186,13 @@ struct mapped_gdb_index : public dwarf_scanner_base
>       return version >= 8;
>     }
>   
> -  dwarf2_per_cu_data *lookup (unrelocated_addr addr) override
> +  dwarf2_per_cu *lookup (unrelocated_addr addr) override
>     {
>       if (index_addrmap == nullptr)
>         return nullptr;
>   
>       void *obj = index_addrmap->find (static_cast<CORE_ADDR> (addr));
> -    return static_cast<dwarf2_per_cu_data *> (obj);
> +    return static_cast<dwarf2_per_cu *> (obj);
>     }
>   
>     cooked_index *index_for_writing () override
> @@ -1113,7 +1113,8 @@ dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
>   	  continue;
>   	}
>   
> -      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (cu_index);
> +      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (cu_index);
> +
>         if (!dw2_expand_symtabs_matching_one (per_cu, per_objfile, file_matcher,
>   					    expansion_notify, lang_matcher))
>   	return false;
> @@ -1141,8 +1142,7 @@ dwarf2_gdb_index::expand_symtabs_matching
>     gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
>     if (lookup_name == nullptr)
>       {
> -      for (dwarf2_per_cu_data *per_cu
> -	     : all_units_range (per_objfile->per_bfd))
> +      for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
>   	{
>   	  QUIT;
>   
> @@ -1324,7 +1324,7 @@ create_cus_from_gdb_index_list (dwarf2_per_bfd *per_bfd,
>         ULONGEST length = extract_unsigned_integer (cu_list + 8, 8, BFD_ENDIAN_LITTLE);
>         cu_list += 2 * 8;
>   
> -      dwarf2_per_cu_data_up per_cu
> +      dwarf2_per_cu_up per_cu
>   	= create_cu_from_index_list (per_bfd, section, is_dwz, sect_off,
>   				     length);
>         per_bfd->all_units.push_back (std::move (per_cu));
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index e044d1eb0e4d..e1ad0946883e 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -320,7 +320,7 @@ struct dwo_unit
>     /* The section this CU/TU lives in, in the DWO file.  */
>     struct dwarf2_section_info *section;
>   
> -  /* Same as dwarf2_per_cu_data:{sect_off,length} but in the DWO section.  */
> +  /* Same as dwarf2_per_cu::{sect_off,length} but in the DWO section.  */
>     sect_offset sect_off;
>     unsigned int length;
>   
> @@ -588,7 +588,7 @@ class cutu_reader : public die_reader_specs
>   {
>   public:
>   
> -  cutu_reader (dwarf2_per_cu_data *this_cu,
> +  cutu_reader (dwarf2_per_cu *this_cu,
>   	       dwarf2_per_objfile *per_objfile,
>   	       const struct abbrev_table *abbrev_table,
>   	       dwarf2_cu *existing_cu,
> @@ -596,7 +596,7 @@ class cutu_reader : public die_reader_specs
>   	       enum language pretend_language,
>   	       const abbrev_table_cache *cache = nullptr);
>   
> -  cutu_reader (dwarf2_per_cu_data *this_cu,
> +  cutu_reader (dwarf2_per_cu *this_cu,
>   	       dwarf2_per_objfile *per_objfile,
>   	       enum language pretend_language,
>   	       struct dwarf2_cu *parent_cu = nullptr,
> @@ -622,7 +622,7 @@ class cutu_reader : public die_reader_specs
>     }
>   
>   private:
> -  void init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
> +  void init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
>   				  dwarf2_per_objfile *per_objfile,
>   				  dwarf2_cu *existing_cu,
>   				  enum language pretend_language);
> @@ -630,7 +630,7 @@ class cutu_reader : public die_reader_specs
>     void prepare_one_comp_unit (struct dwarf2_cu *cu,
>   			      enum language pretend_language);
>   
> -  struct dwarf2_per_cu_data *m_this_cu;
> +  dwarf2_per_cu *m_this_cu;
>     dwarf2_cu_up m_new_cu;
>   
>     /* The ordinary abbreviation table.  */
> @@ -1026,7 +1026,7 @@ static struct type *get_DW_AT_signature_type (struct die_info *,
>   					      const struct attribute *,
>   					      struct dwarf2_cu *);
>   
> -static void load_full_type_unit (dwarf2_per_cu_data *per_cu,
> +static void load_full_type_unit (dwarf2_per_cu *per_cu,
>   				 dwarf2_per_objfile *per_objfile);
>   
>   static void read_signatured_type (signatured_type *sig_type,
> @@ -1056,14 +1056,14 @@ static const gdb_byte *skip_one_die (const struct die_reader_specs *reader,
>   				     const struct abbrev_info *abbrev,
>   				     bool do_skip_children = true);
>   
> -static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit
> +static dwarf2_per_cu *dwarf2_find_containing_comp_unit
>     (sect_offset sect_off, unsigned int offset_in_dwz,
>      dwarf2_per_bfd *per_bfd);
>   
>   static struct type *set_die_type (struct die_info *, struct type *,
>   				  struct dwarf2_cu *, bool = false);
>   
> -static void load_full_comp_unit (dwarf2_per_cu_data *per_cu,
> +static void load_full_comp_unit (dwarf2_per_cu *per_cu,
>   				 dwarf2_per_objfile *per_objfile,
>   				 dwarf2_cu *existing_cu,
>   				 bool skip_partial,
> @@ -1076,12 +1076,12 @@ static void process_full_type_unit (dwarf2_cu *cu,
>   				    enum language pretend_language);
>   
>   static struct type *get_die_type_at_offset (sect_offset,
> -					    dwarf2_per_cu_data *per_cu,
> +					    dwarf2_per_cu *per_cu,
>   					    dwarf2_per_objfile *per_objfile);
>   
>   static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
>   
> -static void queue_comp_unit (dwarf2_per_cu_data *per_cu,
> +static void queue_comp_unit (dwarf2_per_cu *per_cu,
>   			     dwarf2_per_objfile *per_objfile,
>   			     enum language pretend_language);
>   
> @@ -1135,7 +1135,7 @@ dwarf2_queue_item::~dwarf2_queue_item ()
>   /* See dwarf2/read.h.  */
>   
>   void
> -dwarf2_per_cu_data_deleter::operator() (dwarf2_per_cu_data *data)
> +dwarf2_per_cu_deleter::operator() (dwarf2_per_cu *data)
>   {
>     if (data->is_debug_types)
>       delete static_cast<signatured_type *> (data);
> @@ -1314,7 +1314,7 @@ class free_cached_comp_units
>   /* See read.h.  */
>   
>   bool
> -dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu_data *per_cu) const
> +dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu *per_cu) const
>   {
>     if (per_cu->index < this->m_symtabs.size ())
>       return this->m_symtabs[per_cu->index] != nullptr;
> @@ -1324,7 +1324,7 @@ dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu_data *per_cu) const
>   /* See read.h.  */
>   
>   compunit_symtab *
> -dwarf2_per_objfile::get_symtab (const dwarf2_per_cu_data *per_cu) const
> +dwarf2_per_objfile::get_symtab (const dwarf2_per_cu *per_cu) const
>   {
>     if (per_cu->index < this->m_symtabs.size ())
>       return this->m_symtabs[per_cu->index];
> @@ -1334,7 +1334,7 @@ dwarf2_per_objfile::get_symtab (const dwarf2_per_cu_data *per_cu) const
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_objfile::set_symtab (const dwarf2_per_cu_data *per_cu,
> +dwarf2_per_objfile::set_symtab (const dwarf2_per_cu *per_cu,
>   				compunit_symtab *symtab)
>   {
>     if (per_cu->index >= this->m_symtabs.size ())
> @@ -1738,7 +1738,7 @@ create_quick_file_names_table (unsigned int nr_initial_entries)
>      You should call age_cached_comp_units after processing the CU.  */
>   
>   static dwarf2_cu *
> -load_cu (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
> +load_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>   	 bool skip_partial)
>   {
>     if (per_cu->is_debug_types)
> @@ -1759,7 +1759,7 @@ load_cu (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
>   /* Read in the symbols for PER_CU in the context of PER_OBJFILE.  */
>   
>   static void
> -dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
> +dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
>   			   dwarf2_per_objfile *per_objfile, bool skip_partial)
>   {
>     {
> @@ -1800,8 +1800,7 @@ dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
>      Returns the resulting symbol table.  */
>   
>   static struct compunit_symtab *
> -dw2_instantiate_symtab (dwarf2_per_cu_data *per_cu,
> -			dwarf2_per_objfile *per_objfile,
> +dw2_instantiate_symtab (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>   			bool skip_partial)
>   {
>     if (!per_objfile->symtab_set_p (per_cu))
> @@ -1817,12 +1816,11 @@ dw2_instantiate_symtab (dwarf2_per_cu_data *per_cu,
>   
>   /* See read.h.  */
>   
> -dwarf2_per_cu_data_up
> +dwarf2_per_cu_up
>   dwarf2_per_bfd::allocate_per_cu (dwarf2_section_info *section,
>   				 sect_offset sect_off)
>   {
> -  dwarf2_per_cu_data_up result (new dwarf2_per_cu_data (this, section,
> -							sect_off));
> +  dwarf2_per_cu_up result (new dwarf2_per_cu (this, section, sect_off));
>     result->index = all_units.size ();
>     return result;
>   }
> @@ -1843,13 +1841,13 @@ dwarf2_per_bfd::allocate_signatured_type (dwarf2_section_info *section,
>   
>   /* See read.h.  */
>   
> -dwarf2_per_cu_data_up
> +dwarf2_per_cu_up
>   create_cu_from_index_list (dwarf2_per_bfd *per_bfd,
>   			   struct dwarf2_section_info *section,
>   			   int is_dwz,
>   			   sect_offset sect_off, ULONGEST length)
>   {
> -  dwarf2_per_cu_data_up the_cu = per_bfd->allocate_per_cu (section, sect_off);
> +  dwarf2_per_cu_up the_cu = per_bfd->allocate_per_cu (section, sect_off);
>     the_cu->set_length (length);
>     the_cu->is_dwz = is_dwz;
>     return the_cu;
> @@ -1862,9 +1860,8 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
>   			   struct die_info *comp_unit_die)
>   {
>     struct dwarf2_cu *cu = reader->cu;
> -  struct dwarf2_per_cu_data *this_cu = cu->per_cu;
> +  dwarf2_per_cu *this_cu = cu->per_cu;
>     dwarf2_per_objfile *per_objfile = cu->per_objfile;
> -  struct dwarf2_per_cu_data *lh_cu;
>     struct attribute *attr;
>     void **slot;
>     struct quick_file_names *qfn;
> @@ -1877,7 +1874,7 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
>     if (comp_unit_die->tag == DW_TAG_partial_unit)
>       return;
>   
> -  lh_cu = this_cu;
> +  dwarf2_per_cu *lh_cu = this_cu;
>     slot = NULL;
>   
>     line_header_up lh;
> @@ -1957,8 +1954,7 @@ dw2_get_file_names_reader (const struct die_reader_specs *reader,
>      table for THIS_CU.  */
>   
>   static struct quick_file_names *
> -dw2_get_file_names (dwarf2_per_cu_data *this_cu,
> -		    dwarf2_per_objfile *per_objfile)
> +dw2_get_file_names (dwarf2_per_cu *this_cu, dwarf2_per_objfile *per_objfile)
>   {
>     /* This should never be called for TUs.  */
>     gdb_assert (! this_cu->is_debug_types);
> @@ -2004,8 +2000,7 @@ struct symtab *
>   dwarf2_base_index_functions::find_last_source_symtab (struct objfile *objfile)
>   {
>     dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
> -  dwarf2_per_cu_data *dwarf_cu
> -    = per_objfile->per_bfd->all_units.back ().get ();
> +  dwarf2_per_cu *dwarf_cu = per_objfile->per_bfd->all_units.back ().get ();
>     compunit_symtab *cust = dw2_instantiate_symtab (dwarf_cu, per_objfile, false);
>   
>     if (cust == NULL)
> @@ -2017,7 +2012,7 @@ dwarf2_base_index_functions::find_last_source_symtab (struct objfile *objfile)
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_cu_data::free_cached_file_names ()
> +dwarf2_per_cu::free_cached_file_names ()
>   {
>     if (fnd != nullptr)
>       fnd->forget_fullname ();
> @@ -2059,7 +2054,7 @@ dwarf2_base_index_functions::print_stats (struct objfile *objfile,
>   
>     for (int i = 0; i < total; ++i)
>       {
> -      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
> +      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
>   
>         if (!per_objfile->symtab_set_p (per_cu))
>   	++count;
> @@ -2076,7 +2071,7 @@ dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
>   
>     for (int i = 0; i < total_units; ++i)
>       {
> -      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
> +      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
>   
>         /* We don't want to directly expand a partial CU, because if we
>   	 read it with the wrong language, then assertion failures can
> @@ -2091,7 +2086,7 @@ dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
>   
>   bool
>   dw2_expand_symtabs_matching_one
> -  (dwarf2_per_cu_data *per_cu,
> +  (dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile,
>      expand_symtabs_file_matcher file_matcher,
>      expand_symtabs_expansion_listener expansion_notify,
> @@ -2259,7 +2254,7 @@ dwarf2_base_index_functions::find_pc_sect_compunit_symtab
>       return nullptr;
>   
>     CORE_ADDR baseaddr = objfile->text_section_offset ();
> -  struct dwarf2_per_cu_data *data
> +  dwarf2_per_cu *data
>       = per_bfd->index_table->lookup ((unrelocated_addr) (pc - baseaddr));
>     if (data == nullptr)
>       return nullptr;
> @@ -2305,8 +2300,7 @@ dwarf2_base_index_functions::map_symbol_filenames (objfile *objfile,
>   	}
>       }
>   
> -  for (dwarf2_per_cu_data *per_cu
> -	 : all_units_range (per_objfile->per_bfd))
> +  for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
>       {
>         /* We only need to look at symtabs not already expanded.  */
>         if (per_cu->is_debug_types || per_objfile->symtab_set_p (per_cu))
> @@ -2528,7 +2522,7 @@ dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu)
>      THIS_CU.  */
>   
>   static struct dwarf2_section_info *
> -get_abbrev_section_for_cu (struct dwarf2_per_cu_data *this_cu)
> +get_abbrev_section_for_cu (dwarf2_per_cu *this_cu)
>   {
>     struct dwarf2_section_info *abbrev;
>     dwarf2_per_bfd *per_bfd = this_cu->per_bfd;
> @@ -2924,7 +2918,7 @@ read_cutu_die_from_dwo (dwarf2_cu *cu,
>   			abbrev_table_up *result_dwo_abbrev_table)
>   {
>     dwarf2_per_objfile *per_objfile = cu->per_objfile;
> -  dwarf2_per_cu_data *per_cu = cu->per_cu;
> +  dwarf2_per_cu *per_cu = cu->per_cu;
>     struct objfile *objfile = per_objfile->objfile;
>     bfd *abfd;
>     const gdb_byte *begin_info_ptr, *info_ptr;
> @@ -3090,7 +3084,7 @@ lookup_dwo_unit (dwarf2_cu *cu, die_info *comp_unit_die, const char *dwo_name)
>     std::lock_guard<std::mutex> guard (dwo_lock);
>   #endif
>   
> -  dwarf2_per_cu_data *per_cu = cu->per_cu;
> +  dwarf2_per_cu *per_cu = cu->per_cu;
>     struct dwo_unit *dwo_unit;
>     const char *comp_dir;
>   
> @@ -3123,7 +3117,7 @@ lookup_dwo_unit (dwarf2_cu *cu, die_info *comp_unit_die, const char *dwo_name)
>      Read a TU directly from a DWO file, bypassing the stub.  */
>   
>   void
> -cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
> +cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
>   					dwarf2_per_objfile *per_objfile,
>   					dwarf2_cu *existing_cu,
>   					enum language pretend_language)
> @@ -3182,7 +3176,7 @@ cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
>      If EXISTING_CU is non-NULL, then use it.  Otherwise, a new CU is
>      allocated.  */
>   
> -cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
> +cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
>   			  dwarf2_per_objfile *per_objfile,
>   			  const struct abbrev_table *abbrev_table,
>   			  dwarf2_cu *existing_cu,
> @@ -3419,7 +3413,7 @@ cutu_reader::keep ()
>      When parent_cu is passed, it is used to provide a default value for
>      str_offsets_base and addr_base from the parent.  */
>   
> -cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
> +cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
>   			  dwarf2_per_objfile *per_objfile,
>   			  enum language pretend_language,
>   			  struct dwarf2_cu *parent_cu,
> @@ -3605,7 +3599,7 @@ cooked_index_storage::cooked_index_storage ()
>   }
>   
>   cutu_reader *
> -cooked_index_storage::get_reader (dwarf2_per_cu_data *per_cu)
> +cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
>   {
>     int index = per_cu->index;
>     return (cutu_reader *) htab_find_with_hash (m_reader_hash.get (),
> @@ -3714,9 +3708,7 @@ parent_map_map::dump (dwarf2_per_bfd *per_bfd) const
>   class cooked_indexer
>   {
>   public:
> -
> -  cooked_indexer (cooked_index_storage *storage,
> -		  dwarf2_per_cu_data *per_cu,
> +  cooked_indexer (cooked_index_storage *storage, dwarf2_per_cu *per_cu,
>   		  enum language language)
>       : m_index_storage (storage),
>         m_per_cu (per_cu),
> @@ -3760,7 +3752,7 @@ class cooked_indexer
>   
>     /* Scan the attributes for a given DIE and update the out
>        parameters.  Returns a pointer to the byte after the DIE.  */
> -  const gdb_byte *scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
> +  const gdb_byte *scan_attributes (dwarf2_per_cu *scanning_per_cu,
>   				   cutu_reader *reader,
>   				   const gdb_byte *watermark_ptr,
>   				   const gdb_byte *info_ptr,
> @@ -3795,7 +3787,7 @@ class cooked_indexer
>        asked to index one CU but to treat the results as if they come
>        from some including CU; in this case the including CU would be
>        recorded here.  */
> -  dwarf2_per_cu_data *m_per_cu;
> +  dwarf2_per_cu *m_per_cu;
>     /* The language that we're assuming when reading.  */
>     enum language m_language;
>   
> @@ -3807,7 +3799,7 @@ class cooked_indexer
>      Process compilation unit THIS_CU for a psymtab.  */
>   
>   static void
> -process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
> +process_psymtab_comp_unit (dwarf2_per_cu *this_cu,
>   			   dwarf2_per_objfile *per_objfile,
>   			   cooked_index_storage *storage)
>   {
> @@ -3849,7 +3841,7 @@ build_type_psymtabs_reader (cutu_reader *reader,
>   			    cooked_index_storage *storage)
>   {
>     struct dwarf2_cu *cu = reader->cu;
> -  struct dwarf2_per_cu_data *per_cu = cu->per_cu;
> +  dwarf2_per_cu *per_cu = cu->per_cu;
>     struct die_info *type_unit_die = reader->comp_unit_die;
>   
>     gdb_assert (per_cu->is_debug_types);
> @@ -4108,7 +4100,7 @@ class cooked_index_worker_debug_info : public cooked_index_worker
>     void done_reading ();
>   
>     /* An iterator for the comp units.  */
> -  typedef std::vector<dwarf2_per_cu_data_up>::iterator unit_iterator;
> +  using unit_iterator = std::vector<dwarf2_per_cu_up>::iterator;
>   
>     /* Process a batch of CUs.  This may be called multiple times in
>        separate threads.  TASK_NUMBER indicates which task this is --
> @@ -4135,7 +4127,8 @@ cooked_index_worker_debug_info::process_cus (size_t task_number, unit_iterator f
>     cooked_index_storage thread_storage;
>     for (auto inner = first; inner != end; ++inner)
>       {
> -      dwarf2_per_cu_data *per_cu = inner->get ();
> +      dwarf2_per_cu *per_cu = inner->get ();
> +
>         try
>   	{
>   	  process_psymtab_comp_unit (per_cu, m_per_objfile, &thread_storage);
> @@ -4274,7 +4267,7 @@ read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
>   
>     while (info_ptr < section->buffer + section->size)
>       {
> -      dwarf2_per_cu_data_up this_cu;
> +      dwarf2_per_cu_up this_cu;
>   
>         sect_offset sect_off = (sect_offset) (info_ptr - section->buffer);
>   
> @@ -4323,7 +4316,7 @@ finalize_all_units (dwarf2_per_bfd *per_bfd)
>   {
>     size_t nr_tus = per_bfd->tu_stats.nr_tus;
>     size_t nr_cus = per_bfd->all_units.size () - nr_tus;
> -  gdb::array_view<dwarf2_per_cu_data_up> tmp = per_bfd->all_units;
> +  gdb::array_view<dwarf2_per_cu_up> tmp = per_bfd->all_units;
>     per_bfd->all_comp_units = tmp.slice (0, nr_cus);
>     per_bfd->all_type_units = tmp.slice (nr_cus, nr_tus);
>   }
> @@ -4604,8 +4597,7 @@ skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
>   /* Add PER_CU to the queue.  */
>   
>   static void
> -queue_comp_unit (dwarf2_per_cu_data *per_cu,
> -		 dwarf2_per_objfile *per_objfile,
> +queue_comp_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>   		 enum language pretend_language)
>   {
>     per_cu->queued = 1;
> @@ -4640,8 +4632,7 @@ queue_comp_unit (dwarf2_per_cu_data *per_cu,
>      that by calling `dwarf2_per_objfile::get_cu` instead.  */
>   
>   static bool
> -maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu,
> -		       dwarf2_per_cu_data *per_cu,
> +maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu, dwarf2_per_cu *per_cu,
>   		       dwarf2_per_objfile *per_objfile,
>   		       enum language pretend_language)
>   {
> @@ -4706,7 +4697,7 @@ process_queue (dwarf2_per_objfile *per_objfile)
>     while (!per_objfile->queue->empty ())
>       {
>         dwarf2_queue_item &item = per_objfile->queue->front ();
> -      dwarf2_per_cu_data *per_cu = item.per_cu;
> +      dwarf2_per_cu *per_cu = item.per_cu;
>   
>         if (!per_objfile->symtab_set_p (per_cu))
>   	{
> @@ -4781,7 +4772,7 @@ process_queue (dwarf2_per_objfile *per_objfile)
>      rather than creating a new one.  */
>   
>   static void
> -load_full_comp_unit (dwarf2_per_cu_data *this_cu,
> +load_full_comp_unit (dwarf2_per_cu *this_cu,
>   		     dwarf2_per_objfile *per_objfile,
>   		     dwarf2_cu *existing_cu,
>   		     bool skip_partial,
> @@ -5329,9 +5320,9 @@ void dwarf2_per_objfile::set_type_for_signatured_type
>   static void
>   recursively_compute_inclusions
>        (std::vector<compunit_symtab *> *result,
> -      gdb::unordered_set<dwarf2_per_cu_data *> &all_children,
> +      gdb::unordered_set<dwarf2_per_cu *> &all_children,
>         gdb::unordered_set<compunit_symtab *> &all_type_symtabs,
> -      dwarf2_per_cu_data *per_cu,
> +      dwarf2_per_cu *per_cu,
>         dwarf2_per_objfile *per_objfile,
>         struct compunit_symtab *immediate_parent)
>   {
> @@ -5366,7 +5357,7 @@ recursively_compute_inclusions
>   	}
>       }
>   
> -  for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
> +  for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
>       recursively_compute_inclusions (result, all_children,
>   				    all_type_symtabs, ptr, per_objfile,
>   				    cust);
> @@ -5376,7 +5367,7 @@ recursively_compute_inclusions
>      PER_CU.  */
>   
>   static void
> -compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
> +compute_compunit_symtab_includes (dwarf2_per_cu *per_cu,
>   				  dwarf2_per_objfile *per_objfile)
>   {
>     gdb_assert (! per_cu->is_debug_types);
> @@ -5391,10 +5382,10 @@ compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
>         if (cust == NULL)
>   	return;
>   
> -      gdb::unordered_set<dwarf2_per_cu_data *> all_children;
> +      gdb::unordered_set<dwarf2_per_cu *> all_children;
>         gdb::unordered_set<compunit_symtab *> all_type_symtabs;
>   
> -      for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
> +      for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
>   	recursively_compute_inclusions (&result_symtabs, all_children,
>   					all_type_symtabs, ptr,
>   					per_objfile, cust);
> @@ -5416,7 +5407,7 @@ compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
>   static void
>   process_cu_includes (dwarf2_per_objfile *per_objfile)
>   {
> -  for (dwarf2_per_cu_data *iter : per_objfile->per_bfd->just_read_cus)
> +  for (dwarf2_per_cu *iter : per_objfile->per_bfd->just_read_cus)
>       {
>         if (! iter->is_debug_types)
>   	compute_compunit_symtab_includes (iter, per_objfile);
> @@ -5626,7 +5617,7 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
>         sect_offset sect_off = attr->get_ref_die_offset ();
>         bool is_dwz = (attr->form == DW_FORM_GNU_ref_alt || cu->per_cu->is_dwz);
>         dwarf2_per_objfile *per_objfile = cu->per_objfile;
> -      dwarf2_per_cu_data *per_cu
> +      dwarf2_per_cu *per_cu
>   	= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
>   					    per_objfile->per_bfd);
>   
> @@ -7065,7 +7056,7 @@ create_cus_hash_table (dwarf2_per_objfile *per_objfile,
>         void **slot;
>         sect_offset sect_off = (sect_offset) (info_ptr - section.buffer);
>   
> -      dwarf2_per_cu_data per_cu (per_bfd, &section, sect_off);
> +      dwarf2_per_cu per_cu (per_bfd, &section, sect_off);
>   
>         cutu_reader reader (&per_cu, per_objfile, language_minimal,
>   			  cu, &dwo_file);
> @@ -15322,7 +15313,7 @@ cooked_indexer::ensure_cu_exists (cutu_reader *reader,
>         && reader->cu->header.offset_in_cu_p (sect_off))
>       return reader;
>   
> -  dwarf2_per_cu_data *per_cu
> +  dwarf2_per_cu *per_cu
>       = dwarf2_find_containing_comp_unit (sect_off, is_dwz,
>   					per_objfile->per_bfd);
>   
> @@ -15361,7 +15352,7 @@ cooked_indexer::ensure_cu_exists (cutu_reader *reader,
>   }
>   
>   const gdb_byte *
> -cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
> +cooked_indexer::scan_attributes (dwarf2_per_cu *scanning_per_cu,
>   				 cutu_reader *reader,
>   				 const gdb_byte *watermark_ptr,
>   				 const gdb_byte *info_ptr,
> @@ -15927,7 +15918,7 @@ cooked_index_functions::find_compunit_symtab_by_address
>     cooked_index *table = wait (objfile, true);
>   
>     CORE_ADDR baseaddr = objfile->data_section_offset ();
> -  dwarf2_per_cu_data *per_cu
> +  dwarf2_per_cu *per_cu
>       = table->lookup ((unrelocated_addr) (address - baseaddr));
>     if (per_cu == nullptr)
>       return nullptr;
> @@ -15956,8 +15947,7 @@ cooked_index_functions::expand_symtabs_matching
>     gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
>     if (lookup_name == nullptr)
>       {
> -      for (dwarf2_per_cu_data *per_cu
> -	     : all_units_range (per_objfile->per_bfd))
> +      for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
>   	{
>   	  QUIT;
>   
> @@ -16789,8 +16779,7 @@ read_addr_index_from_leb128 (struct dwarf2_cu *cu, const gdb_byte *info_ptr,
>   /* See read.h.  */
>   
>   unrelocated_addr
> -dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
> -			dwarf2_per_objfile *per_objfile,
> +dwarf2_read_addr_index (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
>   			unsigned int addr_index)
>   {
>     struct dwarf2_cu *cu = per_objfile->get_cu (per_cu);
> @@ -18996,11 +18985,10 @@ lookup_die_type (struct die_info *die, const struct attribute *attr,
>   
>     if (attr->form == DW_FORM_GNU_ref_alt)
>       {
> -      struct dwarf2_per_cu_data *per_cu;
>         sect_offset sect_off = attr->get_ref_die_offset ();
> +      dwarf2_per_cu *per_cu
> +	= dwarf2_find_containing_comp_unit (sect_off, 1, per_objfile->per_bfd);
>   
> -      per_cu = dwarf2_find_containing_comp_unit (sect_off, 1,
> -						 per_objfile->per_bfd);
>         this_type = get_die_type_at_offset (sect_off, per_cu, per_objfile);
>       }
>     else if (attr->form_is_ref ())
> @@ -19726,10 +19714,9 @@ follow_die_offset (sect_offset sect_off, int offset_in_dwz,
>     else if (offset_in_dwz != cu->per_cu->is_dwz
>   	   || !cu->header.offset_in_cu_p (sect_off))
>       {
> -      struct dwarf2_per_cu_data *per_cu;
> -
> -      per_cu = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
> -						 per_objfile->per_bfd);
> +      dwarf2_per_cu *per_cu
> +	= dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
> +					    per_objfile->per_bfd);
>   
>         dwarf_read_debug_printf_v ("target CU offset: %s, "
>   				 "target CU DIEs loaded: %d",
> @@ -19801,8 +19788,7 @@ follow_die_ref (struct die_info *src_die, const struct attribute *attr,
>   /* See read.h.  */
>   
>   struct dwarf2_locexpr_baton
> -dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
> -			       dwarf2_per_cu_data *per_cu,
> +dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
>   			       dwarf2_per_objfile *per_objfile,
>   			       gdb::function_view<CORE_ADDR ()> get_frame_pc,
>   			       bool resolve_abstract_p)
> @@ -19907,8 +19893,7 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
>   /* See read.h.  */
>   
>   struct dwarf2_locexpr_baton
> -dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu,
> -			     dwarf2_per_cu_data *per_cu,
> +dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
>   			     dwarf2_per_objfile *per_objfile,
>   			     gdb::function_view<CORE_ADDR ()> get_frame_pc)
>   {
> @@ -19941,7 +19926,7 @@ write_constant_as_bytes (struct obstack *obstack,
>   
>   const gdb_byte *
>   dwarf2_fetch_constant_bytes (sect_offset sect_off,
> -			     dwarf2_per_cu_data *per_cu,
> +			     dwarf2_per_cu *per_cu,
>   			     dwarf2_per_objfile *per_objfile,
>   			     obstack *obstack,
>   			     LONGEST *len)
> @@ -20080,8 +20065,7 @@ dwarf2_fetch_constant_bytes (sect_offset sect_off,
>   /* See read.h.  */
>   
>   struct type *
> -dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
> -				dwarf2_per_cu_data *per_cu,
> +dwarf2_fetch_die_type_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
>   				dwarf2_per_objfile *per_objfile,
>   				const char **var_name)
>   {
> @@ -20106,8 +20090,7 @@ dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
>   /* See read.h.  */
>   
>   struct type *
> -dwarf2_get_die_type (cu_offset die_offset,
> -		     dwarf2_per_cu_data *per_cu,
> +dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
>   		     dwarf2_per_objfile *per_objfile)
>   {
>     sect_offset die_offset_sect = per_cu->sect_off + to_underlying (die_offset);
> @@ -20302,8 +20285,7 @@ get_DW_AT_signature_type (struct die_info *die, const struct attribute *attr,
>   /* Load the DIEs associated with type unit PER_CU into memory.  */
>   
>   static void
> -load_full_type_unit (dwarf2_per_cu_data *per_cu,
> -		     dwarf2_per_objfile *per_objfile)
> +load_full_type_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
>   {
>     struct signatured_type *sig_type;
>   
> @@ -20789,7 +20771,7 @@ dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
>   /* See read.h.  */
>   
>   const comp_unit_head *
> -dwarf2_per_cu_data::get_header () const
> +dwarf2_per_cu::get_header () const
>   {
>     if (!m_header_read_in)
>       {
> @@ -20808,7 +20790,7 @@ dwarf2_per_cu_data::get_header () const
>   /* See read.h.  */
>   
>   int
> -dwarf2_per_cu_data::addr_size () const
> +dwarf2_per_cu::addr_size () const
>   {
>     return this->get_header ()->addr_size;
>   }
> @@ -20816,7 +20798,7 @@ dwarf2_per_cu_data::addr_size () const
>   /* See read.h.  */
>   
>   int
> -dwarf2_per_cu_data::offset_size () const
> +dwarf2_per_cu::offset_size () const
>   {
>     return this->get_header ()->offset_size;
>   }
> @@ -20824,7 +20806,7 @@ dwarf2_per_cu_data::offset_size () const
>   /* See read.h.  */
>   
>   int
> -dwarf2_per_cu_data::ref_addr_size () const
> +dwarf2_per_cu::ref_addr_size () const
>   {
>     const comp_unit_head *header = this->get_header ();
>   
> @@ -20837,8 +20819,7 @@ dwarf2_per_cu_data::ref_addr_size () const
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_cu_data::set_lang (enum language lang,
> -			      dwarf_source_language dw_lang)
> +dwarf2_per_cu::set_lang (enum language lang, dwarf_source_language dw_lang)
>   {
>     if (unit_type () == DW_UT_partial)
>       return;
> @@ -20859,7 +20840,7 @@ dwarf2_per_cu_data::set_lang (enum language lang,
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_cu_data::ensure_lang (dwarf2_per_objfile *per_objfile)
> +dwarf2_per_cu::ensure_lang (dwarf2_per_objfile *per_objfile)
>   {
>     if (lang (false) != language_unknown)
>       return;
> @@ -20879,7 +20860,7 @@ static int
>   dwarf2_find_containing_comp_unit
>     (sect_offset sect_off,
>      unsigned int offset_in_dwz,
> -   const std::vector<dwarf2_per_cu_data_up> &all_units)
> +   const std::vector<dwarf2_per_cu_up> &all_units)
>   {
>     int low, high;
>   
> @@ -20887,10 +20868,9 @@ dwarf2_find_containing_comp_unit
>     high = all_units.size () - 1;
>     while (high > low)
>       {
> -      struct dwarf2_per_cu_data *mid_cu;
>         int mid = low + (high - low) / 2;
> +      dwarf2_per_cu *mid_cu = all_units[mid].get ();
>   
> -      mid_cu = all_units[mid].get ();
>         if (mid_cu->is_dwz > offset_in_dwz
>   	  || (mid_cu->is_dwz == offset_in_dwz
>   	      && mid_cu->sect_off + mid_cu->length () > sect_off))
> @@ -20905,14 +20885,14 @@ dwarf2_find_containing_comp_unit
>   /* Locate the .debug_info compilation unit from CU's objfile which contains
>      the DIE at OFFSET.  Raises an error on failure.  */
>   
> -static struct dwarf2_per_cu_data *
> +static dwarf2_per_cu *
>   dwarf2_find_containing_comp_unit (sect_offset sect_off,
>   				  unsigned int offset_in_dwz,
>   				  dwarf2_per_bfd *per_bfd)
>   {
>     int low = dwarf2_find_containing_comp_unit
>       (sect_off, offset_in_dwz, per_bfd->all_units);
> -  dwarf2_per_cu_data *this_cu = per_bfd->all_units[low].get ();
> +  dwarf2_per_cu *this_cu = per_bfd->all_units[low].get ();
>   
>     if (this_cu->is_dwz != offset_in_dwz || this_cu->sect_off > sect_off)
>       {
> @@ -20944,20 +20924,19 @@ namespace find_containing_comp_unit {
>   static void
>   run_test ()
>   {
> -  const auto create_dummy_per_cu = [] ()
> -    {
> -      return (dwarf2_per_cu_data_up
> -	      (new dwarf2_per_cu_data (nullptr, nullptr, sect_offset {})));
> -    };
> +  const auto create_dummy_per_cu = [] () {
> +    return dwarf2_per_cu_up (new dwarf2_per_cu (nullptr, nullptr,
> +						sect_offset {}));
> +  };
>   
> -  dwarf2_per_cu_data_up one = create_dummy_per_cu ();
> -  dwarf2_per_cu_data *one_ptr = one.get ();
> -  dwarf2_per_cu_data_up two = create_dummy_per_cu ();
> -  dwarf2_per_cu_data *two_ptr = two.get ();
> -  dwarf2_per_cu_data_up three = create_dummy_per_cu ();
> -  dwarf2_per_cu_data *three_ptr = three.get ();
> -  dwarf2_per_cu_data_up four = create_dummy_per_cu ();
> -  dwarf2_per_cu_data *four_ptr = four.get ();
> +  dwarf2_per_cu_up one = create_dummy_per_cu ();
> +  dwarf2_per_cu *one_ptr = one.get ();
> +  dwarf2_per_cu_up two = create_dummy_per_cu ();
> +  dwarf2_per_cu *two_ptr = two.get ();
> +  dwarf2_per_cu_up three = create_dummy_per_cu ();
> +  dwarf2_per_cu *three_ptr = three.get ();
> +  dwarf2_per_cu_up four = create_dummy_per_cu ();
> +  dwarf2_per_cu *four_ptr = four.get ();
>   
>     one->set_length (5);
>     two->sect_off = sect_offset (one->length ());
> @@ -20969,7 +20948,7 @@ run_test ()
>     four->set_length (7);
>     four->is_dwz = 1;
>   
> -  std::vector<dwarf2_per_cu_data_up> units;
> +  std::vector<dwarf2_per_cu_up> units;
>     units.push_back (std::move (one));
>     units.push_back (std::move (two));
>     units.push_back (std::move (three));
> @@ -21080,7 +21059,7 @@ cutu_reader::prepare_one_comp_unit (struct dwarf2_cu *cu,
>   /* See read.h.  */
>   
>   dwarf2_cu *
> -dwarf2_per_objfile::get_cu (dwarf2_per_cu_data *per_cu)
> +dwarf2_per_objfile::get_cu (dwarf2_per_cu *per_cu)
>   {
>     auto it = m_dwarf2_cus.find (per_cu);
>     if (it == m_dwarf2_cus.end ())
> @@ -21092,8 +21071,7 @@ dwarf2_per_objfile::get_cu (dwarf2_per_cu_data *per_cu)
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_objfile::set_cu (dwarf2_per_cu_data *per_cu,
> -			    dwarf2_cu_up cu)
> +dwarf2_per_objfile::set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu)
>   {
>     gdb_assert (this->get_cu (per_cu) == nullptr);
>   
> @@ -21148,7 +21126,7 @@ dwarf2_per_objfile::age_comp_units ()
>   /* See read.h.  */
>   
>   void
> -dwarf2_per_objfile::remove_cu (dwarf2_per_cu_data *per_cu)
> +dwarf2_per_objfile::remove_cu (dwarf2_per_cu *per_cu)
>   {
>     auto it = m_dwarf2_cus.find (per_cu);
>     if (it == m_dwarf2_cus.end ())
> @@ -21254,8 +21232,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
>      or return NULL if the die does not have a saved type.  */
>   
>   static struct type *
> -get_die_type_at_offset (sect_offset sect_off,
> -			dwarf2_per_cu_data *per_cu,
> +get_die_type_at_offset (sect_offset sect_off, dwarf2_per_cu *per_cu,
>   			dwarf2_per_objfile *per_objfile)
>   {
>     auto it = per_objfile->die_type_hash.find ({per_cu, sect_off});
> diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
> index e0c0e1fe3f0a..ccebfe6f223f 100644
> --- a/gdb/dwarf2/read.h
> +++ b/gdb/dwarf2/read.h
> @@ -49,7 +49,7 @@ struct tu_stats
>   struct dwarf2_cu;
>   struct dwarf2_debug_sections;
>   struct dwarf2_per_bfd;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct mapped_index;
>   struct mapped_debug_names;
>   struct signatured_type;
> @@ -59,7 +59,7 @@ struct type_unit_group;
>      for.  */
>   struct dwarf2_queue_item
>   {
> -  dwarf2_queue_item (dwarf2_per_cu_data *cu, dwarf2_per_objfile *per_objfile,
> +  dwarf2_queue_item (dwarf2_per_cu *cu, dwarf2_per_objfile *per_objfile,
>   		     enum language lang)
>       : per_cu (cu),
>         per_objfile (per_objfile),
> @@ -71,33 +71,31 @@ struct dwarf2_queue_item
>   
>     DISABLE_COPY_AND_ASSIGN (dwarf2_queue_item);
>   
> -  dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>     dwarf2_per_objfile *per_objfile;
>     enum language pretend_language;
>   };
>   
> -/* A deleter for dwarf2_per_cu_data that knows to downcast to
> -   signatured_type as appropriate.  This approach lets us avoid a
> -   virtual destructor, which saves a bit of space.  */
> +/* A deleter for dwarf2_per_cu that knows to downcast to signatured_type as
> +   appropriate.  This approach lets us avoid a virtual destructor, which saves
> +   a bit of space.  */
>   
> -struct dwarf2_per_cu_data_deleter
> +struct dwarf2_per_cu_deleter
>   {
> -  void operator() (dwarf2_per_cu_data *data);
> +  void operator() (dwarf2_per_cu *data);
>   };
>   
> -/* A specialization of unique_ptr for dwarf2_per_cu_data and
> -   subclasses.  */
> -using dwarf2_per_cu_data_up
> -  = std::unique_ptr<dwarf2_per_cu_data, dwarf2_per_cu_data_deleter>;
> +/* A specialization of unique_ptr for dwarf2_per_cu and subclasses.  */
> +using dwarf2_per_cu_up = std::unique_ptr<dwarf2_per_cu, dwarf2_per_cu_deleter>;
>   
>   /* Persistent data held for a compilation unit, even when not
>      processing it.  We put a pointer to this structure in the
>      psymtab.  */
>   
> -struct dwarf2_per_cu_data
> +struct dwarf2_per_cu
>   {
> -  dwarf2_per_cu_data (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
> -		      sect_offset sect_off)
> +  dwarf2_per_cu (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
> +		 sect_offset sect_off)
>       : sect_off (sect_off),
>         is_debug_types (false),
>         is_dwz (false),
> @@ -131,7 +129,7 @@ struct dwarf2_per_cu_data
>   
>   public:
>     /* Non-zero if this CU is from .debug_types.
> -     Struct dwarf2_per_cu_data is contained in struct signatured_type iff
> +     Struct dwarf2_per_cu is contained in struct signatured_type iff
>        this is non-zero.  */
>     unsigned int is_debug_types : 1;
>   
> @@ -219,7 +217,7 @@ struct dwarf2_per_cu_data
>   
>     /* DWARF header of this CU.  Note that dwarf2_cu reads its own version of the
>        header, which may differ from this one, since it may pass rcuh_kind::TYPE
> -     to read_comp_unit_head, whereas for dwarf2_per_cu_data we always pass
> +     to read_comp_unit_head, whereas for dwarf2_per_cu we always pass
>        rcuh_kind::COMPILE.
>   
>        Don't access this field directly, use the get_header method instead.  It
> @@ -252,7 +250,7 @@ struct dwarf2_per_cu_data
>        to.  Concurrently with this change gdb was modified to emit version 8
>        indices so we only pay a price for gold generated indices.
>        http://sourceware.org/bugzilla/show_bug.cgi?id=15021.  */
> -  std::vector<dwarf2_per_cu_data *> imported_symtabs;
> +  std::vector<dwarf2_per_cu *> imported_symtabs;
>   
>     /* Get the header of this per_cu, reading it if necessary.  */
>     const comp_unit_head *get_header () const;
> @@ -371,11 +369,11 @@ struct dwarf2_per_cu_data
>   
>   /* Entry in the signatured_types hash table.  */
>   
> -struct signatured_type : public dwarf2_per_cu_data
> +struct signatured_type : public dwarf2_per_cu
>   {
>     signatured_type (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
>   		   sect_offset sect_off, ULONGEST signature)
> -    : dwarf2_per_cu_data (per_bfd, section, sect_off),
> +    : dwarf2_per_cu (per_bfd, section, sect_off),
>         signature (signature)
>     {
>       this->is_debug_types = true;
> @@ -466,13 +464,13 @@ struct dwarf2_per_bfd
>     DISABLE_COPY_AND_ASSIGN (dwarf2_per_bfd);
>   
>     /* Return the CU given its index.  */
> -  dwarf2_per_cu_data *get_cu (int index) const
> +  dwarf2_per_cu *get_cu (int index) const
>     {
>       return this->all_units[index].get ();
>     }
>   
>     /* Return the CU given its index in the CU table in the index.  */
> -  dwarf2_per_cu_data *get_index_cu (int index) const
> +  dwarf2_per_cu *get_index_cu (int index) const
>     {
>       if (this->all_comp_units_index_cus.empty ())
>         return get_cu (index);
> @@ -480,16 +478,16 @@ struct dwarf2_per_bfd
>       return this->all_comp_units_index_cus[index];
>     }
>   
> -  dwarf2_per_cu_data *get_index_tu (int index) const
> +  dwarf2_per_cu *get_index_tu (int index) const
>     {
>       return this->all_comp_units_index_tus[index];
>     }
>   
> -  /* A convenience function to allocate a dwarf2_per_cu_data.  The
> -     returned object has its "index" field set properly.  The object
> -     is allocated on the dwarf2_per_bfd obstack.  */
> -  dwarf2_per_cu_data_up allocate_per_cu (dwarf2_section_info *section,
> -					 sect_offset sect_off);
> +  /* A convenience function to allocate a dwarf2_per_cu.  The returned object
> +     has its "index" field set properly.  The object is allocated on the
> +     dwarf2_per_bfd obstack.  */
> +  dwarf2_per_cu_up allocate_per_cu (dwarf2_section_info *section,
> +				    sect_offset sect_off);
>   
>     /* A convenience function to allocate a signatured_type.  The
>        returned object has its "index" field set properly.  The object
> @@ -545,15 +543,15 @@ struct dwarf2_per_bfd
>   
>     /* Table of all the compilation units.  This is used to locate
>        the target compilation unit of a particular reference.  */
> -  std::vector<dwarf2_per_cu_data_up> all_units;
> +  std::vector<dwarf2_per_cu_up> all_units;
>   
>     /* The all_units vector contains both CUs and TUs.  Provide views on the
>        vector that are limited to either the CU part or the TU part.  */
> -  gdb::array_view<dwarf2_per_cu_data_up> all_comp_units;
> -  gdb::array_view<dwarf2_per_cu_data_up> all_type_units;
> +  gdb::array_view<dwarf2_per_cu_up> all_comp_units;
> +  gdb::array_view<dwarf2_per_cu_up> all_type_units;
>   
> -  std::vector<dwarf2_per_cu_data*> all_comp_units_index_cus;
> -  std::vector<dwarf2_per_cu_data*> all_comp_units_index_tus;
> +  std::vector<dwarf2_per_cu *> all_comp_units_index_cus;
> +  std::vector<dwarf2_per_cu *> all_comp_units_index_tus;
>   
>     /* Table of struct type_unit_group objects.
>        The hash key is the DW_AT_stmt_list value.  */
> @@ -600,7 +598,7 @@ struct dwarf2_per_bfd
>     htab_up quick_file_names_table;
>   
>     /* The CUs we recently read.  */
> -  std::vector<dwarf2_per_cu_data *> just_read_cus;
> +  std::vector<dwarf2_per_cu *> just_read_cus;
>   
>     /* If we loaded the index from an external file, this contains the
>        resources associated to the open file, memory mapping, etc.  */
> @@ -638,7 +636,7 @@ class all_units_iterator
>       return *this;
>     }
>   
> -  dwarf2_per_cu_data *operator* () const
> +  dwarf2_per_cu *operator* () const
>     {
>       return m_per_bfd->get_cu (m_index);
>     }
> @@ -714,7 +712,7 @@ using type_unit_group_unshareable_up
>   
>   struct per_cu_and_offset
>   {
> -  dwarf2_per_cu_data *per_cu;
> +  dwarf2_per_cu *per_cu;
>     sect_offset offset;
>   
>     bool operator== (const per_cu_and_offset &other) const noexcept
> @@ -727,7 +725,7 @@ struct per_cu_and_offset_hash
>   {
>     std::uint64_t operator() (const per_cu_and_offset &key) const noexcept
>     {
> -    return (std::hash<dwarf2_per_cu_data *> () (key.per_cu)
> +    return (std::hash<dwarf2_per_cu *> () (key.per_cu)
>   	    + std::hash<sect_offset> () (key.offset));
>     }
>   };
> @@ -760,13 +758,13 @@ struct dwarf2_per_objfile
>   
>     /* Return true if the symtab corresponding to PER_CU has been set,
>        false otherwise.  */
> -  bool symtab_set_p (const dwarf2_per_cu_data *per_cu) const;
> +  bool symtab_set_p (const dwarf2_per_cu *per_cu) const;
>   
>     /* Return the compunit_symtab associated to PER_CU, if it has been created.  */
> -  compunit_symtab *get_symtab (const dwarf2_per_cu_data *per_cu) const;
> +  compunit_symtab *get_symtab (const dwarf2_per_cu *per_cu) const;
>   
>     /* Set the compunit_symtab associated to PER_CU.  */
> -  void set_symtab (const dwarf2_per_cu_data *per_cu, compunit_symtab *symtab);
> +  void set_symtab (const dwarf2_per_cu *per_cu, compunit_symtab *symtab);
>   
>     /* Get the type_unit_group_unshareable corresponding to TU_GROUP.  If one
>        does not exist, create it.  */
> @@ -779,13 +777,13 @@ struct dwarf2_per_objfile
>   				     struct type *type);
>   
>     /* Get the dwarf2_cu matching PER_CU for this objfile.  */
> -  dwarf2_cu *get_cu (dwarf2_per_cu_data *per_cu);
> +  dwarf2_cu *get_cu (dwarf2_per_cu *per_cu);
>   
>     /* Set the dwarf2_cu matching PER_CU for this objfile.  */
> -  void set_cu (dwarf2_per_cu_data *per_cu, dwarf2_cu_up cu);
> +  void set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu);
>   
>     /* Remove/free the dwarf2_cu matching PER_CU for this objfile.  */
> -  void remove_cu (dwarf2_per_cu_data *per_cu);
> +  void remove_cu (dwarf2_per_cu *per_cu);
>   
>     /* Free all cached compilation units.  */
>     void remove_all_cus ();
> @@ -816,7 +814,7 @@ struct dwarf2_per_objfile
>        or the type may come from a DWO file.  Furthermore, while it's more logical
>        to use per_cu->section+offset, with Fission the section with the data is in
>        the DWO file but we don't know that section at the point we need it.
> -     We have to use something in dwarf2_per_cu_data (or the pointer to it)
> +     We have to use something in dwarf2_per_cu (or the pointer to it)
>        because we can enter the lookup routine, get_die_type_at_offset, from
>        outside this file, and thus won't necessarily have PER_CU->cu.
>        Fortunately, PER_CU is stable for the life of the objfile.  */
> @@ -833,9 +831,9 @@ struct dwarf2_per_objfile
>     std::optional<std::queue<dwarf2_queue_item>> queue;
>   
>   private:
> -  /* Hold the corresponding compunit_symtab for each CU or TU.  This
> -     is indexed by dwarf2_per_cu_data::index.  A NULL value means
> -     that the CU/TU has not been expanded yet.  */
> +  /* Hold the corresponding compunit_symtab for each CU or TU.  This is indexed
> +     by dwarf2_per_cu::index.  A NULL value means that the CU/TU has not been
> +     expanded yet.  */
>     std::vector<compunit_symtab *> m_symtabs;
>   
>     /* Map from a type unit group to the corresponding unshared
> @@ -846,9 +844,9 @@ struct dwarf2_per_objfile
>     /* Map from signatured types to the corresponding struct type.  */
>     gdb::unordered_map<signatured_type *, struct type *> m_type_map;
>   
> -  /* Map from the objfile-independent dwarf2_per_cu_data instances to the
> +  /* Map from the objfile-independent dwarf2_per_cu instances to the
>        corresponding objfile-dependent dwarf2_cu instances.  */
> -  gdb::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
> +  gdb::unordered_map<dwarf2_per_cu *, dwarf2_cu_up> m_dwarf2_cus;
>   };
>   
>   /* Converts DWARF language names to GDB language names.  */
> @@ -862,8 +860,7 @@ dwarf2_per_objfile *get_dwarf2_per_objfile (struct objfile *objfile);
>   /* Return the type of the DIE at DIE_OFFSET in the CU named by
>      PER_CU.  */
>   
> -struct type *dwarf2_get_die_type (cu_offset die_offset,
> -				  dwarf2_per_cu_data *per_cu,
> +struct type *dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
>   				  dwarf2_per_objfile *per_objfile);
>   
>   /* Given an index in .debug_addr, fetch the value.
> @@ -871,7 +868,7 @@ struct type *dwarf2_get_die_type (cu_offset die_offset,
>      long after the debug information has been read, and thus per_cu->cu
>      may no longer exist.  */
>   
> -unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
> +unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu *per_cu,
>   					 dwarf2_per_objfile *per_objfile,
>   					 unsigned int addr_index);
>   
> @@ -881,7 +878,7 @@ unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
>      PER_CU->DWARF2_PER_OBJFILE->OBJFILE.  */
>   
>   struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
> -  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
> +  (sect_offset sect_off, dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile,
>      gdb::function_view<CORE_ADDR ()> get_frame_pc,
>      bool resolve_abstract_p = false);
> @@ -890,7 +887,7 @@ struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
>      offset.  */
>   
>   struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
> -  (cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu,
> +  (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile,
>      gdb::function_view<CORE_ADDR ()> get_frame_pc);
>   
> @@ -900,7 +897,7 @@ struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
>      does not have a DW_AT_const_value, return NULL.  */
>   
>   extern const gdb_byte *dwarf2_fetch_constant_bytes
> -  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
> +  (sect_offset sect_off, dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile, obstack *obstack,
>      LONGEST *len);
>   
> @@ -909,10 +906,10 @@ extern const gdb_byte *dwarf2_fetch_constant_bytes
>      the DIE in question is a variable declaration (definitions are
>      excluded), then *VAR_NAME is set to the variable's name.  */
>   
> -struct type *dwarf2_fetch_die_type_sect_off
> -  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
> -   dwarf2_per_objfile *per_objfile,
> -   const char **var_name = nullptr);
> +type *dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
> +				      dwarf2_per_cu *per_cu,
> +				      dwarf2_per_objfile *per_objfile,
> +				      const char **var_name = nullptr);
>   
>   /* When non-zero, dump line number entries as they are read in.  */
>   extern unsigned int dwarf_line_debug;
> @@ -974,7 +971,7 @@ struct dwarf2_base_index_functions : public quick_symbol_functions
>      EXPANSION_NOTIFY on it.  */
>   
>   extern bool dw2_expand_symtabs_matching_one
> -  (dwarf2_per_cu_data *per_cu,
> +  (dwarf2_per_cu *per_cu,
>      dwarf2_per_objfile *per_objfile,
>      expand_symtabs_file_matcher file_matcher,
>      expand_symtabs_expansion_listener expansion_notify,
> @@ -993,10 +990,10 @@ extern void dw_expand_symtabs_matching_file_matcher
>   extern const char *read_indirect_string_at_offset
>     (dwarf2_per_objfile *per_objfile, LONGEST str_offset);
>   
> -/* Return a new dwarf2_per_cu_data allocated on the per-bfd
> -   obstack, and constructed with the specified field values.  */
> +/* Return a new dwarf2_per_cu allocated on the per-bfd obstack, and constructed
> +   with the specified field values.  */
>   
> -extern dwarf2_per_cu_data_up create_cu_from_index_list
> +extern dwarf2_per_cu_up create_cu_from_index_list
>     (dwarf2_per_bfd *per_bfd, struct dwarf2_section_info *section,
>      int is_dwz, sect_offset sect_off, ULONGEST length);
>   
> diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
> index 8b00fec59a18..0cc97aea330b 100644
> --- a/gdb/gdbtypes.h
> +++ b/gdb/gdbtypes.h
> @@ -56,7 +56,7 @@ struct field;
>   struct block;
>   struct value_print_options;
>   struct language_defn;
> -struct dwarf2_per_cu_data;
> +struct dwarf2_per_cu;
>   struct dwarf2_per_objfile;
>   struct dwarf2_property_baton;
>   
>
> base-commit: 2f0521c0d6f6ea6fecef96cf825656263abb570d
  
Simon Marchi Feb. 26, 2025, 5:02 p.m. UTC | #2
On 2/26/25 9:50 AM, Guinevere Larsen wrote:
> On 2/26/25 1:20 AM, simon.marchi@polymtl.ca wrote:
>> From: Simon Marchi <simon.marchi@efficios.com>
>>
>> This scratches an itch I had for a while.  I don't know why this struct
>> type has "data" in its name.  Others like "dwarf2_per_objfile" and
>> "dwarf2_per_bfd" don't.  The primary job of a structure is to hold data,
>> there's no need to specify it.  It also makes the name a bit shorter,
>> which is always nice.
>>
>> Rename related types too.
>>
>> Change-Id: Ifb63195ff105809fc15b502f639c0bb4d18a675e
> 
> I took a look over the patch and ran a quick test, everything looks ok, and this is a good change!
> 
> Reviewed-By: Guinevere Larsen <guinevere@redhat.com>

Thanks for reviewing.  I'll wait for an ack from Tom Tromey, as the
de facto DWARF subsystem maintainer.

Simon
  
Tom Tromey March 3, 2025, 8:32 p.m. UTC | #3
>>>>> "simon" == simon marchi <simon.marchi@polymtl.ca> writes:

Simon> This scratches an itch I had for a while.  I don't know why this struct
Simon> type has "data" in its name.  Others like "dwarf2_per_objfile" and
Simon> "dwarf2_per_bfd" don't.  The primary job of a structure is to hold data,
Simon> there's no need to specify it.  It also makes the name a bit shorter,
Simon> which is always nice.

It's fine by me but I wonder if this is really the best final naming, as
now we have dwarf2_cu and dwarf2_per_cu.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Simon Marchi March 3, 2025, 8:55 p.m. UTC | #4
On 3/3/25 3:32 PM, Tom Tromey wrote:
>>>>>> "simon" == simon marchi <simon.marchi@polymtl.ca> writes:
> 
> Simon> This scratches an itch I had for a while.  I don't know why this struct
> Simon> type has "data" in its name.  Others like "dwarf2_per_objfile" and
> Simon> "dwarf2_per_bfd" don't.  The primary job of a structure is to hold data,
> Simon> there's no need to specify it.  It also makes the name a bit shorter,
> Simon> which is always nice.
> 
> It's fine by me but I wonder if this is really the best final naming, as
> now we have dwarf2_cu and dwarf2_per_cu.

At least, dwarf2_per_cu is consistent with dwarf2_per_objfile and
dwarf2_per_bfd, and first nicely in the "dwarf2_per_objfile ->
dwarf2_per_bfd -> dwarf2_per_cu" hierarchy.

If I had to rename one, I would probably rename "dwarf2_cu", but I don't
know to what, because I have a hard time expressing what it is exactly.
Anyway, even if dwarf2_per_cu changes again in the future, I don't think
it's the end of the world to have this intermediary step.

> Approved-By: Tom Tromey <tom@tromey.com>

Thanks, will push.

Simon
  

Patch

diff --git a/gdb/compile/compile-loc2c.c b/gdb/compile/compile-loc2c.c
index df05c0140f05..2f5d85f0c3af 100644
--- a/gdb/compile/compile-loc2c.c
+++ b/gdb/compile/compile-loc2c.c
@@ -597,7 +597,7 @@  do_compile_dwarf_expr_to_c (int indent, string_file *stream,
 			    unsigned int addr_size,
 			    const gdb_byte *op_ptr, const gdb_byte *op_end,
 			    CORE_ADDR *initial,
-			    dwarf2_per_cu_data *per_cu,
+			    dwarf2_per_cu *per_cu,
 			    dwarf2_per_objfile *per_objfile)
 {
   /* We keep a counter so that labels and other objects we create have
@@ -1147,7 +1147,7 @@  compile_dwarf_expr_to_c (string_file *stream, const char *result_name,
 			 std::vector<bool> &registers_used,
 			 unsigned int addr_size,
 			 const gdb_byte *op_ptr, const gdb_byte *op_end,
-			 dwarf2_per_cu_data *per_cu,
+			 dwarf2_per_cu *per_cu,
 			 dwarf2_per_objfile *per_objfile)
 {
   do_compile_dwarf_expr_to_c (2, stream, GCC_UINTPTR, result_name, sym, pc,
@@ -1166,7 +1166,7 @@  compile_dwarf_bounds_to_c (string_file *stream,
 			   std::vector<bool> &registers_used,
 			   unsigned int addr_size,
 			   const gdb_byte *op_ptr, const gdb_byte *op_end,
-			   dwarf2_per_cu_data *per_cu,
+			   dwarf2_per_cu *per_cu,
 			   dwarf2_per_objfile *per_objfile)
 {
   do_compile_dwarf_expr_to_c (2, stream, "unsigned long ", result_name,
diff --git a/gdb/compile/compile.h b/gdb/compile/compile.h
index 7d03d3c9bf1c..e18b5bcc764a 100644
--- a/gdb/compile/compile.h
+++ b/gdb/compile/compile.h
@@ -23,7 +23,7 @@ 
 
 struct ui_file;
 struct gdbarch;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct dwarf2_per_objfile;
 struct symbol;
 struct dynamic_prop;
@@ -215,7 +215,7 @@  extern void compile_dwarf_expr_to_c (string_file *stream,
 				     unsigned int addr_size,
 				     const gdb_byte *op_ptr,
 				     const gdb_byte *op_end,
-				     dwarf2_per_cu_data *per_cu,
+				     dwarf2_per_cu *per_cu,
 				     dwarf2_per_objfile *per_objfile);
 
 /* Compile a DWARF bounds expression to C, suitable for use by the
@@ -254,7 +254,7 @@  extern void compile_dwarf_bounds_to_c (string_file *stream,
 				       unsigned int addr_size,
 				       const gdb_byte *op_ptr,
 				       const gdb_byte *op_end,
-				       dwarf2_per_cu_data *per_cu,
+				       dwarf2_per_cu *per_cu,
 				       dwarf2_per_objfile *per_objfile);
 
 extern void compile_print_value (struct value *val, void *data_voidp);
diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c
index b9903084416f..1be67852b43a 100644
--- a/gdb/dwarf2/aranges.c
+++ b/gdb/dwarf2/aranges.c
@@ -39,8 +39,7 @@  read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
   struct gdbarch *gdbarch = objfile->arch ();
   dwarf2_per_bfd *per_bfd = per_objfile->per_bfd;
 
-  gdb::unordered_map<sect_offset, dwarf2_per_cu_data *>
-    debug_info_offset_to_per_cu;
+  gdb::unordered_map<sect_offset, dwarf2_per_cu *> debug_info_offset_to_per_cu;
   for (const auto &per_cu : per_bfd->all_units)
     {
       /* A TU will not need aranges, and skipping them here is an easy
@@ -123,7 +122,7 @@  read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
 		      sect_offset_str (sect_offset (debug_info_offset)));
 	  return false;
 	}
-      dwarf2_per_cu_data *const per_cu = per_cu_it->second;
+      dwarf2_per_cu *const per_cu = per_cu_it->second;
 
       const uint8_t address_size = *addr++;
       if (address_size < 1 || address_size > 8)
diff --git a/gdb/dwarf2/call-site.h b/gdb/dwarf2/call-site.h
index 32cf673332b0..ffade3bc1530 100644
--- a/gdb/dwarf2/call-site.h
+++ b/gdb/dwarf2/call-site.h
@@ -28,7 +28,7 @@ 
 #include "gdbsupport/unordered_set.h"
 
 struct dwarf2_locexpr_baton;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct dwarf2_per_objfile;
 
 /* struct call_site_parameter can be referenced in callees by several ways.  */
@@ -164,7 +164,7 @@  struct call_site_parameter
 
 struct call_site
 {
-  call_site (unrelocated_addr pc, dwarf2_per_cu_data *per_cu,
+  call_site (unrelocated_addr pc, dwarf2_per_cu *per_cu,
 	     dwarf2_per_objfile *per_objfile)
     : per_cu (per_cu), per_objfile (per_objfile), m_unrelocated_pc (pc)
   {}
@@ -209,7 +209,7 @@  struct call_site
   /* * CU of the function where the call is located.  It gets used
      for DWARF blocks execution in the parameter array below.  */
 
-  dwarf2_per_cu_data *const per_cu = nullptr;
+  dwarf2_per_cu *const per_cu = nullptr;
 
   /* objfile of the function where the call is located.  */
 
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 6c6839cde9ba..e609a2a9d461 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -273,9 +273,8 @@  cooked_index_entry::write_scope (struct obstack *storage,
 cooked_index_entry *
 cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
 			 cooked_index_flag flags, enum language lang,
-			 const char *name,
-			 cooked_index_entry_ref parent_entry,
-			 dwarf2_per_cu_data *per_cu)
+			 const char *name, cooked_index_entry_ref parent_entry,
+			 dwarf2_per_cu *per_cu)
 {
   cooked_index_entry *result = create (die_offset, tag, flags, lang, name,
 				       parent_entry, per_cu);
@@ -691,14 +690,14 @@  cooked_index::~cooked_index ()
 
 /* See cooked-index.h.  */
 
-dwarf2_per_cu_data *
+dwarf2_per_cu *
 cooked_index::lookup (unrelocated_addr addr)
 {
   /* Ensure that the address maps are ready.  */
   wait (cooked_state::MAIN_AVAILABLE, true);
   for (const auto &shard : m_shards)
     {
-      dwarf2_per_cu_data *result = shard->lookup (addr);
+      dwarf2_per_cu *result = shard->lookup (addr);
       if (result != nullptr)
 	return result;
     }
@@ -857,14 +856,13 @@  cooked_index::dump (gdbarch *arch)
 
 	  if (obj != nullptr)
 	    {
-	      const dwarf2_per_cu_data *per_cu
-		= static_cast<const dwarf2_per_cu_data *> (obj);
-	      gdb_printf ("      [%s] ((dwarf2_per_cu_data *) %p)\n",
+	      const dwarf2_per_cu *per_cu
+		= static_cast<const dwarf2_per_cu *> (obj);
+	      gdb_printf ("      [%s] ((dwarf2_per_cu *) %p)\n",
 			  start_addr_str, per_cu);
 	    }
 	  else
-	    gdb_printf ("      [%s] ((dwarf2_per_cu_data *) 0)\n",
-			start_addr_str);
+	    gdb_printf ("      [%s] ((dwarf2_per_cu *) 0)\n", start_addr_str);
 
 	  return 0;
 	});
diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index d642c132f8af..a1d174e0e88c 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -40,7 +40,7 @@ 
 #include <condition_variable>
 #endif /* CXX_STD_THREAD */
 
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct dwarf2_per_bfd;
 struct index_cache_store_context;
 struct cooked_index_entry;
@@ -105,7 +105,7 @@  struct cooked_index_entry : public allocate_on_obstack<cooked_index_entry>
 		      cooked_index_flag flags_,
 		      enum language lang_, const char *name_,
 		      cooked_index_entry_ref parent_entry_,
-		      dwarf2_per_cu_data *per_cu_)
+		      dwarf2_per_cu *per_cu_)
     : name (name_),
       tag (tag_),
       flags (flags_),
@@ -241,7 +241,7 @@  struct cooked_index_entry : public allocate_on_obstack<cooked_index_entry>
   /* The offset of this DIE.  */
   sect_offset die_offset;
   /* The CU from which this entry originates.  */
-  dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
 
 private:
 
@@ -279,7 +279,7 @@  class cooked_index_shard
 			   cooked_index_flag flags, enum language lang,
 			   const char *name,
 			   cooked_index_entry_ref parent_entry,
-			   dwarf2_per_cu_data *per_cu);
+			   dwarf2_per_cu *per_cu);
 
   /* Install a new fixed addrmap from the given mutable addrmap.  */
   void install_addrmap (addrmap_mutable *map)
@@ -317,13 +317,12 @@  class cooked_index_shard
   /* Look up ADDR in the address map, and return either the
      corresponding CU, or nullptr if the address could not be
      found.  */
-  dwarf2_per_cu_data *lookup (unrelocated_addr addr)
+  dwarf2_per_cu *lookup (unrelocated_addr addr)
   {
     if (m_addrmap == nullptr)
       return nullptr;
 
-    return (static_cast<dwarf2_per_cu_data *>
-	    (m_addrmap->find ((CORE_ADDR) addr)));
+    return (static_cast<dwarf2_per_cu *> (m_addrmap->find ((CORE_ADDR) addr)));
   }
 
   /* Create a new cooked_index_entry and register it with this object.
@@ -334,7 +333,7 @@  class cooked_index_shard
 			      enum language lang,
 			      const char *name,
 			      cooked_index_entry_ref parent_entry,
-			      dwarf2_per_cu_data *per_cu)
+			      dwarf2_per_cu *per_cu)
   {
     return new (&m_storage) cooked_index_entry (die_offset, tag, flags,
 						lang, name, parent_entry,
@@ -360,8 +359,7 @@  class cooked_index_shard
   std::vector<cooked_index_entry *> m_entries;
   /* If we found an entry with 'is_main' set, store it here.  */
   cooked_index_entry *m_main = nullptr;
-  /* The addrmap.  This maps address ranges to dwarf2_per_cu_data
-     objects.  */
+  /* The addrmap.  This maps address ranges to dwarf2_per_cu objects.  */
   addrmap_fixed *m_addrmap = nullptr;
   /* Storage for canonical names.  */
   std::vector<gdb::unique_xmalloc_ptr<char>> m_names;
@@ -389,7 +387,7 @@  class cooked_index_storage
 
   /* Return the DIE reader corresponding to PER_CU.  If no such reader
      has been registered, return NULL.  */
-  cutu_reader *get_reader (dwarf2_per_cu_data *per_cu);
+  cutu_reader *get_reader (dwarf2_per_cu *per_cu);
 
   /* Preserve READER by storing it in the local hash table.  */
   cutu_reader *preserve (cutu_reader_up reader);
@@ -400,7 +398,7 @@  class cooked_index_storage
 			   cooked_index_flag flags,
 			   const char *name,
 			   cooked_index_entry_ref parent_entry,
-			   dwarf2_per_cu_data *per_cu)
+			   dwarf2_per_cu *per_cu)
   {
     return m_shard->add (die_offset, tag, flags, per_cu->lang (),
 			 name, parent_entry, per_cu);
@@ -671,7 +669,7 @@  class cooked_index : public dwarf_scanner_base
   /* Look up ADDR in the address map, and return either the
      corresponding CU, or nullptr if the address could not be
      found.  */
-  dwarf2_per_cu_data *lookup (unrelocated_addr addr) override;
+  dwarf2_per_cu *lookup (unrelocated_addr addr) override;
 
   /* Return a new vector of all the addrmaps used by all the indexes
      held by this object.
diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c
index 89f52825240e..0e17b73dfc43 100644
--- a/gdb/dwarf2/cu.c
+++ b/gdb/dwarf2/cu.c
@@ -26,8 +26,7 @@ 
 
 /* Initialize dwarf2_cu to read PER_CU, in the context of PER_OBJFILE.  */
 
-dwarf2_cu::dwarf2_cu (dwarf2_per_cu_data *per_cu,
-		      dwarf2_per_objfile *per_objfile)
+dwarf2_cu::dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
   : per_cu (per_cu),
     per_objfile (per_objfile),
     m_mark (false),
@@ -141,7 +140,7 @@  dwarf2_cu::mark ()
 
   m_mark = true;
 
-  for (dwarf2_per_cu_data *per_cu : m_dependencies)
+  for (dwarf2_per_cu *per_cu : m_dependencies)
     {
       /* cu->m_dependencies references may not yet have been ever
 	 read if QUIT aborts reading of the chain.  As such
diff --git a/gdb/dwarf2/cu.h b/gdb/dwarf2/cu.h
index b97a5403dc84..6979b7cd2765 100644
--- a/gdb/dwarf2/cu.h
+++ b/gdb/dwarf2/cu.h
@@ -50,8 +50,7 @@  struct delayed_method_info
 /* Internal state when decoding a particular compilation unit.  */
 struct dwarf2_cu
 {
-  explicit dwarf2_cu (dwarf2_per_cu_data *per_cu,
-		      dwarf2_per_objfile *per_objfile);
+  explicit dwarf2_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile);
 
   DISABLE_COPY_AND_ASSIGN (dwarf2_cu);
 
@@ -97,7 +96,7 @@  struct dwarf2_cu
   }
 
   /* Add a dependence relationship from this cu to REF_PER_CU.  */
-  void add_dependence (struct dwarf2_per_cu_data *ref_per_cu)
+  void add_dependence (dwarf2_per_cu *ref_per_cu)
   { m_dependencies.emplace (ref_per_cu); }
 
   /* The header of the compilation unit.  */
@@ -268,10 +267,10 @@  struct dwarf2_cu
      symbols are being read.  */
   buildsym_compunit_up m_builder;
 
-  /* A set of pointers to dwarf2_per_cu_data objects for compilation
-     units referenced by this one.  Only used during full symbol processing;
-     partial symbol tables do not have dependencies.  */
-  gdb::unordered_set<dwarf2_per_cu_data *> m_dependencies;
+  /* A set of pointers to dwarf2_per_cu objects for compilation units referenced
+     by this one.  Only used during full symbol processing; partial symbol
+     tables do not have dependencies.  */
+  gdb::unordered_set<dwarf2_per_cu *> m_dependencies;
 
 public:
   /* The generic symbol table building routines have separate lists for
@@ -290,7 +289,7 @@  struct dwarf2_cu
   auto_obstack comp_unit_obstack;
 
   /* Backlink to our per_cu entry.  */
-  struct dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
 
   /* The dwarf2_per_objfile that owns this.  */
   dwarf2_per_objfile *per_objfile;
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index 0977cfcab546..3a6165af86c8 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -60,7 +60,7 @@  ensure_have_frame (const frame_info_ptr &frame, const char *op_name)
 /* Ensure that a PER_CU is defined and throw an exception otherwise.  */
 
 static void
-ensure_have_per_cu (dwarf2_per_cu_data *per_cu, const char* op_name)
+ensure_have_per_cu (dwarf2_per_cu *per_cu, const char *op_name)
 {
   if (per_cu == nullptr)
     throw_error (GENERIC_ERROR,
@@ -96,7 +96,7 @@  struct piece_closure
   dwarf2_per_objfile *per_objfile = nullptr;
 
   /* The CU from which this closure's expression came.  */
-  dwarf2_per_cu_data *per_cu = nullptr;
+  dwarf2_per_cu *per_cu = nullptr;
 
   /* The pieces describing this variable.  */
   std::vector<dwarf_expr_piece> pieces;
@@ -110,8 +110,7 @@  struct piece_closure
    PIECES.  */
 
 static piece_closure *
-allocate_piece_closure (dwarf2_per_cu_data *per_cu,
-			dwarf2_per_objfile *per_objfile,
+allocate_piece_closure (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 			std::vector<dwarf_expr_piece> &&pieces,
 			const frame_info_ptr &frame)
 {
@@ -670,8 +669,7 @@  static const struct lval_funcs pieced_value_funcs = {
    found at SECT_OFF.  */
 
 static value *
-sect_variable_value (sect_offset sect_off,
-		     dwarf2_per_cu_data *per_cu,
+sect_variable_value (sect_offset sect_off, dwarf2_per_cu *per_cu,
 		     dwarf2_per_objfile *per_objfile)
 {
   const char *var_name = nullptr;
@@ -890,7 +888,7 @@  dwarf_expr_context::push_dwarf_reg_entry_value (call_site_parameter_kind kind,
   ensure_have_per_cu (this->m_per_cu, "DW_OP_entry_value");
   ensure_have_frame (this->m_frame, "DW_OP_entry_value");
 
-  dwarf2_per_cu_data *caller_per_cu;
+  dwarf2_per_cu *caller_per_cu;
   dwarf2_per_objfile *caller_per_objfile;
   frame_info_ptr caller_frame = get_prev_frame (this->m_frame);
   call_site_parameter *parameter
@@ -1096,7 +1094,8 @@  dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
 
 value *
 dwarf_expr_context::evaluate (const gdb_byte *addr, size_t len, bool as_lval,
-			      dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
+			      dwarf2_per_cu *per_cu,
+			      const frame_info_ptr &frame,
 			      const struct property_addr_info *addr_info,
 			      struct type *type, struct type *subobj_type,
 			      LONGEST subobj_offset)
diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h
index 1b1653e07682..4ef2e3ad17d8 100644
--- a/gdb/dwarf2/expr.h
+++ b/gdb/dwarf2/expr.h
@@ -141,7 +141,7 @@  struct dwarf_expr_context
      The ADDR_INFO property can be specified to override the range of
      memory addresses with the passed in buffer.  */
   value *evaluate (const gdb_byte *addr, size_t len, bool as_lval,
-		   dwarf2_per_cu_data *per_cu, const frame_info_ptr &frame,
+		   dwarf2_per_cu *per_cu, const frame_info_ptr &frame,
 		   const struct property_addr_info *addr_info = nullptr,
 		   struct type *type = nullptr,
 		   struct type *subobj_type = nullptr,
@@ -203,7 +203,7 @@  struct dwarf_expr_context
   frame_info_ptr m_frame = nullptr;
 
   /* Compilation unit used for the evaluation.  */
-  dwarf2_per_cu_data *m_per_cu = nullptr;
+  dwarf2_per_cu *m_per_cu = nullptr;
 
   /* Property address info used for the evaluation.  */
   const struct property_addr_info *m_addr_info = nullptr;
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
index c11e45bc2bfe..a602f2db1db1 100644
--- a/gdb/dwarf2/frame.c
+++ b/gdb/dwarf2/frame.c
@@ -772,9 +772,8 @@  dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs,
 
 int
 dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
-		       struct dwarf2_per_cu_data *data,
-		       int *regnum_out, LONGEST *offset_out,
-		       CORE_ADDR *text_offset_out,
+		       dwarf2_per_cu *data, int *regnum_out,
+		       LONGEST *offset_out, CORE_ADDR *text_offset_out,
 		       const gdb_byte **cfa_start_out,
 		       const gdb_byte **cfa_end_out)
 {
diff --git a/gdb/dwarf2/frame.h b/gdb/dwarf2/frame.h
index 7ff31904da7e..15d89eae7b98 100644
--- a/gdb/dwarf2/frame.h
+++ b/gdb/dwarf2/frame.h
@@ -24,7 +24,7 @@ 
 
 struct gdbarch;
 class frame_info_ptr;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct agent_expr;
 struct axs_value;
 
@@ -251,13 +251,12 @@  CORE_ADDR dwarf2_frame_cfa (const frame_info_ptr &this_frame);
    in other cases.  These are only used when 0 is returned.  */
 
 extern int dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
-				  struct dwarf2_per_cu_data *data,
-				  int *regnum_out, LONGEST *offset_out,
+				  dwarf2_per_cu *data, int *regnum_out,
+				  LONGEST *offset_out,
 				  CORE_ADDR *text_offset_out,
 				  const gdb_byte **cfa_start_out,
 				  const gdb_byte **cfa_end_out);
 
-
 /* Allocate a new instance of the function unique data.
 
    The main purpose of this custom function data object is to allow caching the
diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
index cba10f9588f2..174eb220df68 100644
--- a/gdb/dwarf2/index-write.c
+++ b/gdb/dwarf2/index-write.c
@@ -562,8 +562,7 @@  write_hash_table (mapped_symtab *symtab, data_buf &output, data_buf &cpool)
     }
 }
 
-using cu_index_map
-  = gdb::unordered_map<const dwarf2_per_cu_data *, unsigned int>;
+using cu_index_map = gdb::unordered_map<const dwarf2_per_cu *, unsigned int>;
 
 /* Helper struct for building the address table.  */
 struct addrmap_index_data
@@ -604,8 +603,7 @@  add_address_entry (data_buf &addr_vec,
 int
 addrmap_index_data::operator() (CORE_ADDR start_addr, const void *obj)
 {
-  const dwarf2_per_cu_data *per_cu
-    = static_cast<const dwarf2_per_cu_data *> (obj);
+  const dwarf2_per_cu *per_cu = static_cast<const dwarf2_per_cu *> (obj);
 
   if (previous_valid)
     add_address_entry (addr_vec,
@@ -874,7 +872,7 @@  class debug_names
     m_debugstrlookup.file_write (file_str);
   }
 
-  void add_cu (dwarf2_per_cu_data *per_cu, offset_type index)
+  void add_cu (dwarf2_per_cu *per_cu, offset_type index)
   {
     m_cu_index_htab.emplace (per_cu, index);
   }
@@ -1306,10 +1304,9 @@  write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
   data_buf objfile_cu_list;
   data_buf dwz_cu_list;
 
-  /* While we're scanning CU's create a table that maps a dwarf2_per_cu_data
-     (which is what addrmap records) to its index (which is what is recorded
-     in the index file).  This will later be needed to write the address
-     table.  */
+  /* While we're scanning CU's create a table that maps a dwarf2_per_cu (which
+     is what addrmap records) to its index (which is what is recorded in the
+     index file).  This will later be needed to write the address table.  */
   cu_index_map cu_index_htab;
   cu_index_htab.reserve (per_bfd->all_units.size ());
 
@@ -1322,7 +1319,7 @@  write_gdbindex (dwarf2_per_bfd *per_bfd, cooked_index *table,
   int counter = 0;
   for (int i = 0; i < per_bfd->all_units.size (); ++i)
     {
-      dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
+      dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
 
       const auto insertpair = cu_index_htab.emplace (per_cu, counter);
       gdb_assert (insertpair.second);
@@ -1405,7 +1402,7 @@  write_debug_names (dwarf2_per_bfd *per_bfd, cooked_index *table,
   int types_counter = 0;
   for (int i = 0; i < per_bfd->all_units.size (); ++i)
     {
-      dwarf2_per_cu_data *per_cu = per_bfd->all_units[i].get ();
+      dwarf2_per_cu *per_cu = per_bfd->all_units[i].get ();
 
       int &this_counter = per_cu->is_debug_types ? types_counter : counter;
       data_buf &this_list = per_cu->is_debug_types ? types_cu_list : cu_list;
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 585b5de8c9d8..398c2b1b3522 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -49,7 +49,7 @@ 
 
 static struct value *dwarf2_evaluate_loc_desc_full
   (struct type *type, const frame_info_ptr &frame, const gdb_byte *data,
-   size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+   size_t size, dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
    struct type *subobj_type, LONGEST subobj_byte_offset, bool as_lval = true);
 
 /* Until these have formal names, we define these here.
@@ -153,7 +153,7 @@  decode_debug_loc_addresses (const gdb_byte *loc_ptr, const gdb_byte *buf_end,
    The result indicates the kind of entry found.  */
 
 static enum debug_loc_kind
-decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
+decode_debug_loclists_addresses (dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile,
 				 const gdb_byte *loc_ptr,
 				 const gdb_byte *buf_end,
@@ -288,7 +288,7 @@  decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
    The result indicates the kind of entry found.  */
 
 static enum debug_loc_kind
-decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu,
+decode_debug_loc_dwo_addresses (dwarf2_per_cu *per_cu,
 				dwarf2_per_objfile *per_objfile,
 				const gdb_byte *loc_ptr,
 				const gdb_byte *buf_end,
@@ -1137,7 +1137,7 @@  struct call_site_parameter *
 dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame,
 				   call_site_parameter_kind kind,
 				   call_site_parameter_u kind_u,
-				   dwarf2_per_cu_data **per_cu_return,
+				   dwarf2_per_cu **per_cu_return,
 				   dwarf2_per_objfile **per_objfile_return)
 {
   CORE_ADDR func_addr, caller_pc;
@@ -1259,7 +1259,7 @@  static struct value *
 dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
 				CORE_ADDR deref_size, struct type *type,
 				const frame_info_ptr &caller_frame,
-				dwarf2_per_cu_data *per_cu,
+				dwarf2_per_cu *per_cu,
 				dwarf2_per_objfile *per_objfile)
 {
   const gdb_byte *data_src;
@@ -1343,7 +1343,7 @@  value_of_dwarf_reg_entry (struct type *type, const frame_info_ptr &frame,
   frame_info_ptr caller_frame = get_prev_frame (frame);
   struct value *outer_val, *target_val, *val;
   struct call_site_parameter *parameter;
-  dwarf2_per_cu_data *caller_per_cu;
+  dwarf2_per_cu *caller_per_cu;
   dwarf2_per_objfile *caller_per_objfile;
 
   parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
@@ -1416,7 +1416,7 @@  value_of_dwarf_block_entry (struct type *type, const frame_info_ptr &frame,
 
 static struct value *
 fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
-					  dwarf2_per_cu_data *per_cu,
+					  dwarf2_per_cu *per_cu,
 					  dwarf2_per_objfile *per_objfile,
 					  struct type *type)
 {
@@ -1449,7 +1449,7 @@  fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
 
 struct value *
 indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
-			    dwarf2_per_cu_data *per_cu,
+			    dwarf2_per_cu *per_cu,
 			    dwarf2_per_objfile *per_objfile,
 			    const frame_info_ptr &frame, struct type *type,
 			    bool resolve_abstract_p)
@@ -1493,7 +1493,7 @@  indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
 static struct value *
 dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
 			       const gdb_byte *data, size_t size,
-			       dwarf2_per_cu_data *per_cu,
+			       dwarf2_per_cu *per_cu,
 			       dwarf2_per_objfile *per_objfile,
 			       struct type *subobj_type,
 			       LONGEST subobj_byte_offset,
@@ -1558,7 +1558,7 @@  dwarf2_evaluate_loc_desc_full (struct type *type, const frame_info_ptr &frame,
 struct value *
 dwarf2_evaluate_loc_desc (struct type *type, const frame_info_ptr &frame,
 			  const gdb_byte *data, size_t size,
-			  dwarf2_per_cu_data *per_cu,
+			  dwarf2_per_cu *per_cu,
 			  dwarf2_per_objfile *per_objfile, bool as_lval)
 {
   return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu,
@@ -1589,7 +1589,7 @@  dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
     return 0;
 
   dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;
-  dwarf2_per_cu_data *per_cu = dlbaton->per_cu;
+  dwarf2_per_cu *per_cu = dlbaton->per_cu;
   dwarf_expr_context ctx (per_objfile, per_cu->addr_size ());
 
   value *result;
@@ -1787,7 +1787,7 @@  dwarf2_compile_property_to_c (string_file *stream,
   const dwarf2_property_baton *baton = prop->baton ();
   const gdb_byte *data;
   size_t size;
-  dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
   dwarf2_per_objfile *per_objfile;
 
   if (prop->kind () == PROP_LOCEXPR)
@@ -1820,7 +1820,7 @@  dwarf2_compile_property_to_c (string_file *stream,
 
 static enum symbol_needs_kind
 dwarf2_get_symbol_read_needs (gdb::array_view<const gdb_byte> expr,
-			      dwarf2_per_cu_data *per_cu,
+			      dwarf2_per_cu *per_cu,
 			      dwarf2_per_objfile *per_objfile,
 			      bfd_endian byte_order,
 			      int addr_size,
@@ -2371,8 +2371,7 @@  access_memory (struct gdbarch *arch, struct agent_expr *expr, ULONGEST nbits)
 static void
 dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
 			   unsigned int addr_size, const gdb_byte *op_ptr,
-			   const gdb_byte *op_end,
-			   dwarf2_per_cu_data *per_cu,
+			   const gdb_byte *op_end, dwarf2_per_cu *per_cu,
 			   dwarf2_per_objfile *per_objfile)
 {
   gdbarch *arch = expr->gdbarch;
@@ -3134,7 +3133,7 @@  locexpr_regname (struct gdbarch *gdbarch, int dwarf_regnum)
 
 static const gdb_byte *
 locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
-				 CORE_ADDR addr, dwarf2_per_cu_data *per_cu,
+				 CORE_ADDR addr, dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile,
 				 const gdb_byte *data, const gdb_byte *end,
 				 unsigned int addr_size)
@@ -3314,7 +3313,7 @@  disassemble_dwarf_expression (struct ui_file *stream,
 			      int offset_size, const gdb_byte *start,
 			      const gdb_byte *data, const gdb_byte *end,
 			      int indent, int all,
-			      dwarf2_per_cu_data *per_cu,
+			      dwarf2_per_cu *per_cu,
 			      dwarf2_per_objfile *per_objfile)
 {
   while (data < end
@@ -3720,7 +3719,7 @@  locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
 			     struct ui_file *stream,
 			     const gdb_byte *data, size_t size,
 			     unsigned int addr_size,
-			     int offset_size, dwarf2_per_cu_data *per_cu,
+			     int offset_size, dwarf2_per_cu *per_cu,
 			     dwarf2_per_objfile *per_objfile)
 {
   const gdb_byte *end = data + size;
diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h
index 78635682d944..5c7330e43a09 100644
--- a/gdb/dwarf2/loc.h
+++ b/gdb/dwarf2/loc.h
@@ -24,7 +24,7 @@ 
 
 struct symbol_computed_ops;
 struct dwarf2_per_objfile;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct dwarf2_loclist_baton;
 struct agent_expr;
 struct axs_value;
@@ -67,7 +67,7 @@  value *compute_var_value (const char *name);
 
 call_site_parameter *dwarf_expr_reg_to_entry_parameter
   (const frame_info_ptr &frame, call_site_parameter_kind kind,
-   call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return,
+   call_site_parameter_u kind_u, dwarf2_per_cu **per_cu_return,
    dwarf2_per_objfile **per_objfile_return);
 
 
@@ -78,7 +78,7 @@  call_site_parameter *dwarf_expr_reg_to_entry_parameter
 
 value *dwarf2_evaluate_loc_desc (type *type, const frame_info_ptr &frame,
 				 const gdb_byte *data, size_t size,
-				 dwarf2_per_cu_data *per_cu,
+				 dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile,
 				 bool as_lval = true);
 
@@ -172,7 +172,7 @@  struct dwarf2_locexpr_baton
 
   /* The compilation unit containing the symbol whose location
      we're computing.  */
-  struct dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
 };
 
 struct dwarf2_loclist_baton
@@ -192,7 +192,7 @@  struct dwarf2_loclist_baton
 
   /* The compilation unit containing the symbol whose location
      we're computing.  */
-  struct dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
 
   /* Non-zero if the location list lives in .debug_loc.dwo.
      The format of entries in this section are different.  */
@@ -293,7 +293,7 @@  extern void invalid_synthetic_pointer ();
 /* Fetch the value pointed to by a synthetic pointer.  */
 
 extern struct value *indirect_synthetic_pointer
-  (sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu,
+  (sect_offset die, LONGEST byte_offset, dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile, const frame_info_ptr &frame,
    struct type *type, bool resolve_abstract_p = false);
 
diff --git a/gdb/dwarf2/mapped-index.h b/gdb/dwarf2/mapped-index.h
index 3117df260bc6..15677ec71abe 100644
--- a/gdb/dwarf2/mapped-index.h
+++ b/gdb/dwarf2/mapped-index.h
@@ -65,7 +65,7 @@  struct dwarf_scanner_base
 
   /* Look up ADDR, and return either the corresponding CU, or nullptr
      if the address could not be found.  */
-  virtual dwarf2_per_cu_data *lookup (unrelocated_addr addr)
+  virtual dwarf2_per_cu *lookup (unrelocated_addr addr)
   { return nullptr; }
 };
 
diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c
index 924b570a5f40..34db3dbee79f 100644
--- a/gdb/dwarf2/read-debug-names.c
+++ b/gdb/dwarf2/read-debug-names.c
@@ -174,7 +174,7 @@  mapped_debug_names_reader::scan_one_entry (const char *name,
   cooked_index_flag flags = 0;
   sect_offset die_offset {};
   enum language lang = language_unknown;
-  dwarf2_per_cu_data *per_cu = nullptr;
+  dwarf2_per_cu *per_cu = nullptr;
   for (const auto &attr : indexval.attr_vec)
     {
       ULONGEST ull;
diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
index ff60e9b862c6..f6886c1ce97d 100644
--- a/gdb/dwarf2/read-gdb-index.c
+++ b/gdb/dwarf2/read-gdb-index.c
@@ -129,7 +129,7 @@  struct mapped_gdb_index : public dwarf_scanner_base
   /* The shortcut table data.  */
   gdb::array_view<const gdb_byte> shortcut_table;
 
-  /* An address map that maps from PC to dwarf2_per_cu_data.  */
+  /* An address map that maps from PC to dwarf2_per_cu.  */
   addrmap_fixed *index_addrmap = nullptr;
 
   /* Return the index into the constant pool of the name of the IDXth
@@ -186,13 +186,13 @@  struct mapped_gdb_index : public dwarf_scanner_base
     return version >= 8;
   }
 
-  dwarf2_per_cu_data *lookup (unrelocated_addr addr) override
+  dwarf2_per_cu *lookup (unrelocated_addr addr) override
   {
     if (index_addrmap == nullptr)
       return nullptr;
 
     void *obj = index_addrmap->find (static_cast<CORE_ADDR> (addr));
-    return static_cast<dwarf2_per_cu_data *> (obj);
+    return static_cast<dwarf2_per_cu *> (obj);
   }
 
   cooked_index *index_for_writing () override
@@ -1113,7 +1113,8 @@  dw2_expand_marked_cus (dwarf2_per_objfile *per_objfile, offset_type idx,
 	  continue;
 	}
 
-      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (cu_index);
+      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (cu_index);
+
       if (!dw2_expand_symtabs_matching_one (per_cu, per_objfile, file_matcher,
 					    expansion_notify, lang_matcher))
 	return false;
@@ -1141,8 +1142,7 @@  dwarf2_gdb_index::expand_symtabs_matching
   gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
   if (lookup_name == nullptr)
     {
-      for (dwarf2_per_cu_data *per_cu
-	     : all_units_range (per_objfile->per_bfd))
+      for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
 	{
 	  QUIT;
 
@@ -1324,7 +1324,7 @@  create_cus_from_gdb_index_list (dwarf2_per_bfd *per_bfd,
       ULONGEST length = extract_unsigned_integer (cu_list + 8, 8, BFD_ENDIAN_LITTLE);
       cu_list += 2 * 8;
 
-      dwarf2_per_cu_data_up per_cu
+      dwarf2_per_cu_up per_cu
 	= create_cu_from_index_list (per_bfd, section, is_dwz, sect_off,
 				     length);
       per_bfd->all_units.push_back (std::move (per_cu));
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index e044d1eb0e4d..e1ad0946883e 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -320,7 +320,7 @@  struct dwo_unit
   /* The section this CU/TU lives in, in the DWO file.  */
   struct dwarf2_section_info *section;
 
-  /* Same as dwarf2_per_cu_data:{sect_off,length} but in the DWO section.  */
+  /* Same as dwarf2_per_cu::{sect_off,length} but in the DWO section.  */
   sect_offset sect_off;
   unsigned int length;
 
@@ -588,7 +588,7 @@  class cutu_reader : public die_reader_specs
 {
 public:
 
-  cutu_reader (dwarf2_per_cu_data *this_cu,
+  cutu_reader (dwarf2_per_cu *this_cu,
 	       dwarf2_per_objfile *per_objfile,
 	       const struct abbrev_table *abbrev_table,
 	       dwarf2_cu *existing_cu,
@@ -596,7 +596,7 @@  class cutu_reader : public die_reader_specs
 	       enum language pretend_language,
 	       const abbrev_table_cache *cache = nullptr);
 
-  cutu_reader (dwarf2_per_cu_data *this_cu,
+  cutu_reader (dwarf2_per_cu *this_cu,
 	       dwarf2_per_objfile *per_objfile,
 	       enum language pretend_language,
 	       struct dwarf2_cu *parent_cu = nullptr,
@@ -622,7 +622,7 @@  class cutu_reader : public die_reader_specs
   }
 
 private:
-  void init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
+  void init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
 				  dwarf2_per_objfile *per_objfile,
 				  dwarf2_cu *existing_cu,
 				  enum language pretend_language);
@@ -630,7 +630,7 @@  class cutu_reader : public die_reader_specs
   void prepare_one_comp_unit (struct dwarf2_cu *cu,
 			      enum language pretend_language);
 
-  struct dwarf2_per_cu_data *m_this_cu;
+  dwarf2_per_cu *m_this_cu;
   dwarf2_cu_up m_new_cu;
 
   /* The ordinary abbreviation table.  */
@@ -1026,7 +1026,7 @@  static struct type *get_DW_AT_signature_type (struct die_info *,
 					      const struct attribute *,
 					      struct dwarf2_cu *);
 
-static void load_full_type_unit (dwarf2_per_cu_data *per_cu,
+static void load_full_type_unit (dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile);
 
 static void read_signatured_type (signatured_type *sig_type,
@@ -1056,14 +1056,14 @@  static const gdb_byte *skip_one_die (const struct die_reader_specs *reader,
 				     const struct abbrev_info *abbrev,
 				     bool do_skip_children = true);
 
-static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit
+static dwarf2_per_cu *dwarf2_find_containing_comp_unit
   (sect_offset sect_off, unsigned int offset_in_dwz,
    dwarf2_per_bfd *per_bfd);
 
 static struct type *set_die_type (struct die_info *, struct type *,
 				  struct dwarf2_cu *, bool = false);
 
-static void load_full_comp_unit (dwarf2_per_cu_data *per_cu,
+static void load_full_comp_unit (dwarf2_per_cu *per_cu,
 				 dwarf2_per_objfile *per_objfile,
 				 dwarf2_cu *existing_cu,
 				 bool skip_partial,
@@ -1076,12 +1076,12 @@  static void process_full_type_unit (dwarf2_cu *cu,
 				    enum language pretend_language);
 
 static struct type *get_die_type_at_offset (sect_offset,
-					    dwarf2_per_cu_data *per_cu,
+					    dwarf2_per_cu *per_cu,
 					    dwarf2_per_objfile *per_objfile);
 
 static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu);
 
-static void queue_comp_unit (dwarf2_per_cu_data *per_cu,
+static void queue_comp_unit (dwarf2_per_cu *per_cu,
 			     dwarf2_per_objfile *per_objfile,
 			     enum language pretend_language);
 
@@ -1135,7 +1135,7 @@  dwarf2_queue_item::~dwarf2_queue_item ()
 /* See dwarf2/read.h.  */
 
 void
-dwarf2_per_cu_data_deleter::operator() (dwarf2_per_cu_data *data)
+dwarf2_per_cu_deleter::operator() (dwarf2_per_cu *data)
 {
   if (data->is_debug_types)
     delete static_cast<signatured_type *> (data);
@@ -1314,7 +1314,7 @@  class free_cached_comp_units
 /* See read.h.  */
 
 bool
-dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu_data *per_cu) const
+dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu *per_cu) const
 {
   if (per_cu->index < this->m_symtabs.size ())
     return this->m_symtabs[per_cu->index] != nullptr;
@@ -1324,7 +1324,7 @@  dwarf2_per_objfile::symtab_set_p (const dwarf2_per_cu_data *per_cu) const
 /* See read.h.  */
 
 compunit_symtab *
-dwarf2_per_objfile::get_symtab (const dwarf2_per_cu_data *per_cu) const
+dwarf2_per_objfile::get_symtab (const dwarf2_per_cu *per_cu) const
 {
   if (per_cu->index < this->m_symtabs.size ())
     return this->m_symtabs[per_cu->index];
@@ -1334,7 +1334,7 @@  dwarf2_per_objfile::get_symtab (const dwarf2_per_cu_data *per_cu) const
 /* See read.h.  */
 
 void
-dwarf2_per_objfile::set_symtab (const dwarf2_per_cu_data *per_cu,
+dwarf2_per_objfile::set_symtab (const dwarf2_per_cu *per_cu,
 				compunit_symtab *symtab)
 {
   if (per_cu->index >= this->m_symtabs.size ())
@@ -1738,7 +1738,7 @@  create_quick_file_names_table (unsigned int nr_initial_entries)
    You should call age_cached_comp_units after processing the CU.  */
 
 static dwarf2_cu *
-load_cu (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+load_cu (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 	 bool skip_partial)
 {
   if (per_cu->is_debug_types)
@@ -1759,7 +1759,7 @@  load_cu (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
 /* Read in the symbols for PER_CU in the context of PER_OBJFILE.  */
 
 static void
-dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
+dw2_do_instantiate_symtab (dwarf2_per_cu *per_cu,
 			   dwarf2_per_objfile *per_objfile, bool skip_partial)
 {
   {
@@ -1800,8 +1800,7 @@  dw2_do_instantiate_symtab (dwarf2_per_cu_data *per_cu,
    Returns the resulting symbol table.  */
 
 static struct compunit_symtab *
-dw2_instantiate_symtab (dwarf2_per_cu_data *per_cu,
-			dwarf2_per_objfile *per_objfile,
+dw2_instantiate_symtab (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 			bool skip_partial)
 {
   if (!per_objfile->symtab_set_p (per_cu))
@@ -1817,12 +1816,11 @@  dw2_instantiate_symtab (dwarf2_per_cu_data *per_cu,
 
 /* See read.h.  */
 
-dwarf2_per_cu_data_up
+dwarf2_per_cu_up
 dwarf2_per_bfd::allocate_per_cu (dwarf2_section_info *section,
 				 sect_offset sect_off)
 {
-  dwarf2_per_cu_data_up result (new dwarf2_per_cu_data (this, section,
-							sect_off));
+  dwarf2_per_cu_up result (new dwarf2_per_cu (this, section, sect_off));
   result->index = all_units.size ();
   return result;
 }
@@ -1843,13 +1841,13 @@  dwarf2_per_bfd::allocate_signatured_type (dwarf2_section_info *section,
 
 /* See read.h.  */
 
-dwarf2_per_cu_data_up
+dwarf2_per_cu_up
 create_cu_from_index_list (dwarf2_per_bfd *per_bfd,
 			   struct dwarf2_section_info *section,
 			   int is_dwz,
 			   sect_offset sect_off, ULONGEST length)
 {
-  dwarf2_per_cu_data_up the_cu = per_bfd->allocate_per_cu (section, sect_off);
+  dwarf2_per_cu_up the_cu = per_bfd->allocate_per_cu (section, sect_off);
   the_cu->set_length (length);
   the_cu->is_dwz = is_dwz;
   return the_cu;
@@ -1862,9 +1860,8 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
 			   struct die_info *comp_unit_die)
 {
   struct dwarf2_cu *cu = reader->cu;
-  struct dwarf2_per_cu_data *this_cu = cu->per_cu;
+  dwarf2_per_cu *this_cu = cu->per_cu;
   dwarf2_per_objfile *per_objfile = cu->per_objfile;
-  struct dwarf2_per_cu_data *lh_cu;
   struct attribute *attr;
   void **slot;
   struct quick_file_names *qfn;
@@ -1877,7 +1874,7 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
   if (comp_unit_die->tag == DW_TAG_partial_unit)
     return;
 
-  lh_cu = this_cu;
+  dwarf2_per_cu *lh_cu = this_cu;
   slot = NULL;
 
   line_header_up lh;
@@ -1957,8 +1954,7 @@  dw2_get_file_names_reader (const struct die_reader_specs *reader,
    table for THIS_CU.  */
 
 static struct quick_file_names *
-dw2_get_file_names (dwarf2_per_cu_data *this_cu,
-		    dwarf2_per_objfile *per_objfile)
+dw2_get_file_names (dwarf2_per_cu *this_cu, dwarf2_per_objfile *per_objfile)
 {
   /* This should never be called for TUs.  */
   gdb_assert (! this_cu->is_debug_types);
@@ -2004,8 +2000,7 @@  struct symtab *
 dwarf2_base_index_functions::find_last_source_symtab (struct objfile *objfile)
 {
   dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
-  dwarf2_per_cu_data *dwarf_cu
-    = per_objfile->per_bfd->all_units.back ().get ();
+  dwarf2_per_cu *dwarf_cu = per_objfile->per_bfd->all_units.back ().get ();
   compunit_symtab *cust = dw2_instantiate_symtab (dwarf_cu, per_objfile, false);
 
   if (cust == NULL)
@@ -2017,7 +2012,7 @@  dwarf2_base_index_functions::find_last_source_symtab (struct objfile *objfile)
 /* See read.h.  */
 
 void
-dwarf2_per_cu_data::free_cached_file_names ()
+dwarf2_per_cu::free_cached_file_names ()
 {
   if (fnd != nullptr)
     fnd->forget_fullname ();
@@ -2059,7 +2054,7 @@  dwarf2_base_index_functions::print_stats (struct objfile *objfile,
 
   for (int i = 0; i < total; ++i)
     {
-      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
+      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
 
       if (!per_objfile->symtab_set_p (per_cu))
 	++count;
@@ -2076,7 +2071,7 @@  dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
 
   for (int i = 0; i < total_units; ++i)
     {
-      dwarf2_per_cu_data *per_cu = per_objfile->per_bfd->get_cu (i);
+      dwarf2_per_cu *per_cu = per_objfile->per_bfd->get_cu (i);
 
       /* We don't want to directly expand a partial CU, because if we
 	 read it with the wrong language, then assertion failures can
@@ -2091,7 +2086,7 @@  dwarf2_base_index_functions::expand_all_symtabs (struct objfile *objfile)
 
 bool
 dw2_expand_symtabs_matching_one
-  (dwarf2_per_cu_data *per_cu,
+  (dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    expand_symtabs_file_matcher file_matcher,
    expand_symtabs_expansion_listener expansion_notify,
@@ -2259,7 +2254,7 @@  dwarf2_base_index_functions::find_pc_sect_compunit_symtab
     return nullptr;
 
   CORE_ADDR baseaddr = objfile->text_section_offset ();
-  struct dwarf2_per_cu_data *data
+  dwarf2_per_cu *data
     = per_bfd->index_table->lookup ((unrelocated_addr) (pc - baseaddr));
   if (data == nullptr)
     return nullptr;
@@ -2305,8 +2300,7 @@  dwarf2_base_index_functions::map_symbol_filenames (objfile *objfile,
 	}
     }
 
-  for (dwarf2_per_cu_data *per_cu
-	 : all_units_range (per_objfile->per_bfd))
+  for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
     {
       /* We only need to look at symtabs not already expanded.  */
       if (per_cu->is_debug_types || per_objfile->symtab_set_p (per_cu))
@@ -2528,7 +2522,7 @@  dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu)
    THIS_CU.  */
 
 static struct dwarf2_section_info *
-get_abbrev_section_for_cu (struct dwarf2_per_cu_data *this_cu)
+get_abbrev_section_for_cu (dwarf2_per_cu *this_cu)
 {
   struct dwarf2_section_info *abbrev;
   dwarf2_per_bfd *per_bfd = this_cu->per_bfd;
@@ -2924,7 +2918,7 @@  read_cutu_die_from_dwo (dwarf2_cu *cu,
 			abbrev_table_up *result_dwo_abbrev_table)
 {
   dwarf2_per_objfile *per_objfile = cu->per_objfile;
-  dwarf2_per_cu_data *per_cu = cu->per_cu;
+  dwarf2_per_cu *per_cu = cu->per_cu;
   struct objfile *objfile = per_objfile->objfile;
   bfd *abfd;
   const gdb_byte *begin_info_ptr, *info_ptr;
@@ -3090,7 +3084,7 @@  lookup_dwo_unit (dwarf2_cu *cu, die_info *comp_unit_die, const char *dwo_name)
   std::lock_guard<std::mutex> guard (dwo_lock);
 #endif
 
-  dwarf2_per_cu_data *per_cu = cu->per_cu;
+  dwarf2_per_cu *per_cu = cu->per_cu;
   struct dwo_unit *dwo_unit;
   const char *comp_dir;
 
@@ -3123,7 +3117,7 @@  lookup_dwo_unit (dwarf2_cu *cu, die_info *comp_unit_die, const char *dwo_name)
    Read a TU directly from a DWO file, bypassing the stub.  */
 
 void
-cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
+cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu *this_cu,
 					dwarf2_per_objfile *per_objfile,
 					dwarf2_cu *existing_cu,
 					enum language pretend_language)
@@ -3182,7 +3176,7 @@  cutu_reader::init_tu_and_read_dwo_dies (dwarf2_per_cu_data *this_cu,
    If EXISTING_CU is non-NULL, then use it.  Otherwise, a new CU is
    allocated.  */
 
-cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
+cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
 			  dwarf2_per_objfile *per_objfile,
 			  const struct abbrev_table *abbrev_table,
 			  dwarf2_cu *existing_cu,
@@ -3419,7 +3413,7 @@  cutu_reader::keep ()
    When parent_cu is passed, it is used to provide a default value for
    str_offsets_base and addr_base from the parent.  */
 
-cutu_reader::cutu_reader (dwarf2_per_cu_data *this_cu,
+cutu_reader::cutu_reader (dwarf2_per_cu *this_cu,
 			  dwarf2_per_objfile *per_objfile,
 			  enum language pretend_language,
 			  struct dwarf2_cu *parent_cu,
@@ -3605,7 +3599,7 @@  cooked_index_storage::cooked_index_storage ()
 }
 
 cutu_reader *
-cooked_index_storage::get_reader (dwarf2_per_cu_data *per_cu)
+cooked_index_storage::get_reader (dwarf2_per_cu *per_cu)
 {
   int index = per_cu->index;
   return (cutu_reader *) htab_find_with_hash (m_reader_hash.get (),
@@ -3714,9 +3708,7 @@  parent_map_map::dump (dwarf2_per_bfd *per_bfd) const
 class cooked_indexer
 {
 public:
-
-  cooked_indexer (cooked_index_storage *storage,
-		  dwarf2_per_cu_data *per_cu,
+  cooked_indexer (cooked_index_storage *storage, dwarf2_per_cu *per_cu,
 		  enum language language)
     : m_index_storage (storage),
       m_per_cu (per_cu),
@@ -3760,7 +3752,7 @@  class cooked_indexer
 
   /* Scan the attributes for a given DIE and update the out
      parameters.  Returns a pointer to the byte after the DIE.  */
-  const gdb_byte *scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
+  const gdb_byte *scan_attributes (dwarf2_per_cu *scanning_per_cu,
 				   cutu_reader *reader,
 				   const gdb_byte *watermark_ptr,
 				   const gdb_byte *info_ptr,
@@ -3795,7 +3787,7 @@  class cooked_indexer
      asked to index one CU but to treat the results as if they come
      from some including CU; in this case the including CU would be
      recorded here.  */
-  dwarf2_per_cu_data *m_per_cu;
+  dwarf2_per_cu *m_per_cu;
   /* The language that we're assuming when reading.  */
   enum language m_language;
 
@@ -3807,7 +3799,7 @@  class cooked_indexer
    Process compilation unit THIS_CU for a psymtab.  */
 
 static void
-process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
+process_psymtab_comp_unit (dwarf2_per_cu *this_cu,
 			   dwarf2_per_objfile *per_objfile,
 			   cooked_index_storage *storage)
 {
@@ -3849,7 +3841,7 @@  build_type_psymtabs_reader (cutu_reader *reader,
 			    cooked_index_storage *storage)
 {
   struct dwarf2_cu *cu = reader->cu;
-  struct dwarf2_per_cu_data *per_cu = cu->per_cu;
+  dwarf2_per_cu *per_cu = cu->per_cu;
   struct die_info *type_unit_die = reader->comp_unit_die;
 
   gdb_assert (per_cu->is_debug_types);
@@ -4108,7 +4100,7 @@  class cooked_index_worker_debug_info : public cooked_index_worker
   void done_reading ();
 
   /* An iterator for the comp units.  */
-  typedef std::vector<dwarf2_per_cu_data_up>::iterator unit_iterator;
+  using unit_iterator = std::vector<dwarf2_per_cu_up>::iterator;
 
   /* Process a batch of CUs.  This may be called multiple times in
      separate threads.  TASK_NUMBER indicates which task this is --
@@ -4135,7 +4127,8 @@  cooked_index_worker_debug_info::process_cus (size_t task_number, unit_iterator f
   cooked_index_storage thread_storage;
   for (auto inner = first; inner != end; ++inner)
     {
-      dwarf2_per_cu_data *per_cu = inner->get ();
+      dwarf2_per_cu *per_cu = inner->get ();
+
       try
 	{
 	  process_psymtab_comp_unit (per_cu, m_per_objfile, &thread_storage);
@@ -4274,7 +4267,7 @@  read_comp_units_from_section (dwarf2_per_objfile *per_objfile,
 
   while (info_ptr < section->buffer + section->size)
     {
-      dwarf2_per_cu_data_up this_cu;
+      dwarf2_per_cu_up this_cu;
 
       sect_offset sect_off = (sect_offset) (info_ptr - section->buffer);
 
@@ -4323,7 +4316,7 @@  finalize_all_units (dwarf2_per_bfd *per_bfd)
 {
   size_t nr_tus = per_bfd->tu_stats.nr_tus;
   size_t nr_cus = per_bfd->all_units.size () - nr_tus;
-  gdb::array_view<dwarf2_per_cu_data_up> tmp = per_bfd->all_units;
+  gdb::array_view<dwarf2_per_cu_up> tmp = per_bfd->all_units;
   per_bfd->all_comp_units = tmp.slice (0, nr_cus);
   per_bfd->all_type_units = tmp.slice (nr_cus, nr_tus);
 }
@@ -4604,8 +4597,7 @@  skip_one_die (const struct die_reader_specs *reader, const gdb_byte *info_ptr,
 /* Add PER_CU to the queue.  */
 
 static void
-queue_comp_unit (dwarf2_per_cu_data *per_cu,
-		 dwarf2_per_objfile *per_objfile,
+queue_comp_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 		 enum language pretend_language)
 {
   per_cu->queued = 1;
@@ -4640,8 +4632,7 @@  queue_comp_unit (dwarf2_per_cu_data *per_cu,
    that by calling `dwarf2_per_objfile::get_cu` instead.  */
 
 static bool
-maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu,
-		       dwarf2_per_cu_data *per_cu,
+maybe_queue_comp_unit (struct dwarf2_cu *dependent_cu, dwarf2_per_cu *per_cu,
 		       dwarf2_per_objfile *per_objfile,
 		       enum language pretend_language)
 {
@@ -4706,7 +4697,7 @@  process_queue (dwarf2_per_objfile *per_objfile)
   while (!per_objfile->queue->empty ())
     {
       dwarf2_queue_item &item = per_objfile->queue->front ();
-      dwarf2_per_cu_data *per_cu = item.per_cu;
+      dwarf2_per_cu *per_cu = item.per_cu;
 
       if (!per_objfile->symtab_set_p (per_cu))
 	{
@@ -4781,7 +4772,7 @@  process_queue (dwarf2_per_objfile *per_objfile)
    rather than creating a new one.  */
 
 static void
-load_full_comp_unit (dwarf2_per_cu_data *this_cu,
+load_full_comp_unit (dwarf2_per_cu *this_cu,
 		     dwarf2_per_objfile *per_objfile,
 		     dwarf2_cu *existing_cu,
 		     bool skip_partial,
@@ -5329,9 +5320,9 @@  void dwarf2_per_objfile::set_type_for_signatured_type
 static void
 recursively_compute_inclusions
      (std::vector<compunit_symtab *> *result,
-      gdb::unordered_set<dwarf2_per_cu_data *> &all_children,
+      gdb::unordered_set<dwarf2_per_cu *> &all_children,
       gdb::unordered_set<compunit_symtab *> &all_type_symtabs,
-      dwarf2_per_cu_data *per_cu,
+      dwarf2_per_cu *per_cu,
       dwarf2_per_objfile *per_objfile,
       struct compunit_symtab *immediate_parent)
 {
@@ -5366,7 +5357,7 @@  recursively_compute_inclusions
 	}
     }
 
-  for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+  for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
     recursively_compute_inclusions (result, all_children,
 				    all_type_symtabs, ptr, per_objfile,
 				    cust);
@@ -5376,7 +5367,7 @@  recursively_compute_inclusions
    PER_CU.  */
 
 static void
-compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
+compute_compunit_symtab_includes (dwarf2_per_cu *per_cu,
 				  dwarf2_per_objfile *per_objfile)
 {
   gdb_assert (! per_cu->is_debug_types);
@@ -5391,10 +5382,10 @@  compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
       if (cust == NULL)
 	return;
 
-      gdb::unordered_set<dwarf2_per_cu_data *> all_children;
+      gdb::unordered_set<dwarf2_per_cu *> all_children;
       gdb::unordered_set<compunit_symtab *> all_type_symtabs;
 
-      for (dwarf2_per_cu_data *ptr : per_cu->imported_symtabs)
+      for (dwarf2_per_cu *ptr : per_cu->imported_symtabs)
 	recursively_compute_inclusions (&result_symtabs, all_children,
 					all_type_symtabs, ptr,
 					per_objfile, cust);
@@ -5416,7 +5407,7 @@  compute_compunit_symtab_includes (dwarf2_per_cu_data *per_cu,
 static void
 process_cu_includes (dwarf2_per_objfile *per_objfile)
 {
-  for (dwarf2_per_cu_data *iter : per_objfile->per_bfd->just_read_cus)
+  for (dwarf2_per_cu *iter : per_objfile->per_bfd->just_read_cus)
     {
       if (! iter->is_debug_types)
 	compute_compunit_symtab_includes (iter, per_objfile);
@@ -5626,7 +5617,7 @@  process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu)
       sect_offset sect_off = attr->get_ref_die_offset ();
       bool is_dwz = (attr->form == DW_FORM_GNU_ref_alt || cu->per_cu->is_dwz);
       dwarf2_per_objfile *per_objfile = cu->per_objfile;
-      dwarf2_per_cu_data *per_cu
+      dwarf2_per_cu *per_cu
 	= dwarf2_find_containing_comp_unit (sect_off, is_dwz,
 					    per_objfile->per_bfd);
 
@@ -7065,7 +7056,7 @@  create_cus_hash_table (dwarf2_per_objfile *per_objfile,
       void **slot;
       sect_offset sect_off = (sect_offset) (info_ptr - section.buffer);
 
-      dwarf2_per_cu_data per_cu (per_bfd, &section, sect_off);
+      dwarf2_per_cu per_cu (per_bfd, &section, sect_off);
 
       cutu_reader reader (&per_cu, per_objfile, language_minimal,
 			  cu, &dwo_file);
@@ -15322,7 +15313,7 @@  cooked_indexer::ensure_cu_exists (cutu_reader *reader,
       && reader->cu->header.offset_in_cu_p (sect_off))
     return reader;
 
-  dwarf2_per_cu_data *per_cu
+  dwarf2_per_cu *per_cu
     = dwarf2_find_containing_comp_unit (sect_off, is_dwz,
 					per_objfile->per_bfd);
 
@@ -15361,7 +15352,7 @@  cooked_indexer::ensure_cu_exists (cutu_reader *reader,
 }
 
 const gdb_byte *
-cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu,
+cooked_indexer::scan_attributes (dwarf2_per_cu *scanning_per_cu,
 				 cutu_reader *reader,
 				 const gdb_byte *watermark_ptr,
 				 const gdb_byte *info_ptr,
@@ -15927,7 +15918,7 @@  cooked_index_functions::find_compunit_symtab_by_address
   cooked_index *table = wait (objfile, true);
 
   CORE_ADDR baseaddr = objfile->data_section_offset ();
-  dwarf2_per_cu_data *per_cu
+  dwarf2_per_cu *per_cu
     = table->lookup ((unrelocated_addr) (address - baseaddr));
   if (per_cu == nullptr)
     return nullptr;
@@ -15956,8 +15947,7 @@  cooked_index_functions::expand_symtabs_matching
   gdb_assert (lookup_name != nullptr || symbol_matcher == nullptr);
   if (lookup_name == nullptr)
     {
-      for (dwarf2_per_cu_data *per_cu
-	     : all_units_range (per_objfile->per_bfd))
+      for (dwarf2_per_cu *per_cu : all_units_range (per_objfile->per_bfd))
 	{
 	  QUIT;
 
@@ -16789,8 +16779,7 @@  read_addr_index_from_leb128 (struct dwarf2_cu *cu, const gdb_byte *info_ptr,
 /* See read.h.  */
 
 unrelocated_addr
-dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
-			dwarf2_per_objfile *per_objfile,
+dwarf2_read_addr_index (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile,
 			unsigned int addr_index)
 {
   struct dwarf2_cu *cu = per_objfile->get_cu (per_cu);
@@ -18996,11 +18985,10 @@  lookup_die_type (struct die_info *die, const struct attribute *attr,
 
   if (attr->form == DW_FORM_GNU_ref_alt)
     {
-      struct dwarf2_per_cu_data *per_cu;
       sect_offset sect_off = attr->get_ref_die_offset ();
+      dwarf2_per_cu *per_cu
+	= dwarf2_find_containing_comp_unit (sect_off, 1, per_objfile->per_bfd);
 
-      per_cu = dwarf2_find_containing_comp_unit (sect_off, 1,
-						 per_objfile->per_bfd);
       this_type = get_die_type_at_offset (sect_off, per_cu, per_objfile);
     }
   else if (attr->form_is_ref ())
@@ -19726,10 +19714,9 @@  follow_die_offset (sect_offset sect_off, int offset_in_dwz,
   else if (offset_in_dwz != cu->per_cu->is_dwz
 	   || !cu->header.offset_in_cu_p (sect_off))
     {
-      struct dwarf2_per_cu_data *per_cu;
-
-      per_cu = dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
-						 per_objfile->per_bfd);
+      dwarf2_per_cu *per_cu
+	= dwarf2_find_containing_comp_unit (sect_off, offset_in_dwz,
+					    per_objfile->per_bfd);
 
       dwarf_read_debug_printf_v ("target CU offset: %s, "
 				 "target CU DIEs loaded: %d",
@@ -19801,8 +19788,7 @@  follow_die_ref (struct die_info *src_die, const struct attribute *attr,
 /* See read.h.  */
 
 struct dwarf2_locexpr_baton
-dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
-			       dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
 			       dwarf2_per_objfile *per_objfile,
 			       gdb::function_view<CORE_ADDR ()> get_frame_pc,
 			       bool resolve_abstract_p)
@@ -19907,8 +19893,7 @@  dwarf2_fetch_die_loc_sect_off (sect_offset sect_off,
 /* See read.h.  */
 
 struct dwarf2_locexpr_baton
-dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu,
-			     dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
 			     dwarf2_per_objfile *per_objfile,
 			     gdb::function_view<CORE_ADDR ()> get_frame_pc)
 {
@@ -19941,7 +19926,7 @@  write_constant_as_bytes (struct obstack *obstack,
 
 const gdb_byte *
 dwarf2_fetch_constant_bytes (sect_offset sect_off,
-			     dwarf2_per_cu_data *per_cu,
+			     dwarf2_per_cu *per_cu,
 			     dwarf2_per_objfile *per_objfile,
 			     obstack *obstack,
 			     LONGEST *len)
@@ -20080,8 +20065,7 @@  dwarf2_fetch_constant_bytes (sect_offset sect_off,
 /* See read.h.  */
 
 struct type *
-dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
-				dwarf2_per_cu_data *per_cu,
+dwarf2_fetch_die_type_sect_off (sect_offset sect_off, dwarf2_per_cu *per_cu,
 				dwarf2_per_objfile *per_objfile,
 				const char **var_name)
 {
@@ -20106,8 +20090,7 @@  dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
 /* See read.h.  */
 
 struct type *
-dwarf2_get_die_type (cu_offset die_offset,
-		     dwarf2_per_cu_data *per_cu,
+dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
 		     dwarf2_per_objfile *per_objfile)
 {
   sect_offset die_offset_sect = per_cu->sect_off + to_underlying (die_offset);
@@ -20302,8 +20285,7 @@  get_DW_AT_signature_type (struct die_info *die, const struct attribute *attr,
 /* Load the DIEs associated with type unit PER_CU into memory.  */
 
 static void
-load_full_type_unit (dwarf2_per_cu_data *per_cu,
-		     dwarf2_per_objfile *per_objfile)
+load_full_type_unit (dwarf2_per_cu *per_cu, dwarf2_per_objfile *per_objfile)
 {
   struct signatured_type *sig_type;
 
@@ -20789,7 +20771,7 @@  dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym,
 /* See read.h.  */
 
 const comp_unit_head *
-dwarf2_per_cu_data::get_header () const
+dwarf2_per_cu::get_header () const
 {
   if (!m_header_read_in)
     {
@@ -20808,7 +20790,7 @@  dwarf2_per_cu_data::get_header () const
 /* See read.h.  */
 
 int
-dwarf2_per_cu_data::addr_size () const
+dwarf2_per_cu::addr_size () const
 {
   return this->get_header ()->addr_size;
 }
@@ -20816,7 +20798,7 @@  dwarf2_per_cu_data::addr_size () const
 /* See read.h.  */
 
 int
-dwarf2_per_cu_data::offset_size () const
+dwarf2_per_cu::offset_size () const
 {
   return this->get_header ()->offset_size;
 }
@@ -20824,7 +20806,7 @@  dwarf2_per_cu_data::offset_size () const
 /* See read.h.  */
 
 int
-dwarf2_per_cu_data::ref_addr_size () const
+dwarf2_per_cu::ref_addr_size () const
 {
   const comp_unit_head *header = this->get_header ();
 
@@ -20837,8 +20819,7 @@  dwarf2_per_cu_data::ref_addr_size () const
 /* See read.h.  */
 
 void
-dwarf2_per_cu_data::set_lang (enum language lang,
-			      dwarf_source_language dw_lang)
+dwarf2_per_cu::set_lang (enum language lang, dwarf_source_language dw_lang)
 {
   if (unit_type () == DW_UT_partial)
     return;
@@ -20859,7 +20840,7 @@  dwarf2_per_cu_data::set_lang (enum language lang,
 /* See read.h.  */
 
 void
-dwarf2_per_cu_data::ensure_lang (dwarf2_per_objfile *per_objfile)
+dwarf2_per_cu::ensure_lang (dwarf2_per_objfile *per_objfile)
 {
   if (lang (false) != language_unknown)
     return;
@@ -20879,7 +20860,7 @@  static int
 dwarf2_find_containing_comp_unit
   (sect_offset sect_off,
    unsigned int offset_in_dwz,
-   const std::vector<dwarf2_per_cu_data_up> &all_units)
+   const std::vector<dwarf2_per_cu_up> &all_units)
 {
   int low, high;
 
@@ -20887,10 +20868,9 @@  dwarf2_find_containing_comp_unit
   high = all_units.size () - 1;
   while (high > low)
     {
-      struct dwarf2_per_cu_data *mid_cu;
       int mid = low + (high - low) / 2;
+      dwarf2_per_cu *mid_cu = all_units[mid].get ();
 
-      mid_cu = all_units[mid].get ();
       if (mid_cu->is_dwz > offset_in_dwz
 	  || (mid_cu->is_dwz == offset_in_dwz
 	      && mid_cu->sect_off + mid_cu->length () > sect_off))
@@ -20905,14 +20885,14 @@  dwarf2_find_containing_comp_unit
 /* Locate the .debug_info compilation unit from CU's objfile which contains
    the DIE at OFFSET.  Raises an error on failure.  */
 
-static struct dwarf2_per_cu_data *
+static dwarf2_per_cu *
 dwarf2_find_containing_comp_unit (sect_offset sect_off,
 				  unsigned int offset_in_dwz,
 				  dwarf2_per_bfd *per_bfd)
 {
   int low = dwarf2_find_containing_comp_unit
     (sect_off, offset_in_dwz, per_bfd->all_units);
-  dwarf2_per_cu_data *this_cu = per_bfd->all_units[low].get ();
+  dwarf2_per_cu *this_cu = per_bfd->all_units[low].get ();
 
   if (this_cu->is_dwz != offset_in_dwz || this_cu->sect_off > sect_off)
     {
@@ -20944,20 +20924,19 @@  namespace find_containing_comp_unit {
 static void
 run_test ()
 {
-  const auto create_dummy_per_cu = [] ()
-    {
-      return (dwarf2_per_cu_data_up
-	      (new dwarf2_per_cu_data (nullptr, nullptr, sect_offset {})));
-    };
+  const auto create_dummy_per_cu = [] () {
+    return dwarf2_per_cu_up (new dwarf2_per_cu (nullptr, nullptr,
+						sect_offset {}));
+  };
 
-  dwarf2_per_cu_data_up one = create_dummy_per_cu ();
-  dwarf2_per_cu_data *one_ptr = one.get ();
-  dwarf2_per_cu_data_up two = create_dummy_per_cu ();
-  dwarf2_per_cu_data *two_ptr = two.get ();
-  dwarf2_per_cu_data_up three = create_dummy_per_cu ();
-  dwarf2_per_cu_data *three_ptr = three.get ();
-  dwarf2_per_cu_data_up four = create_dummy_per_cu ();
-  dwarf2_per_cu_data *four_ptr = four.get ();
+  dwarf2_per_cu_up one = create_dummy_per_cu ();
+  dwarf2_per_cu *one_ptr = one.get ();
+  dwarf2_per_cu_up two = create_dummy_per_cu ();
+  dwarf2_per_cu *two_ptr = two.get ();
+  dwarf2_per_cu_up three = create_dummy_per_cu ();
+  dwarf2_per_cu *three_ptr = three.get ();
+  dwarf2_per_cu_up four = create_dummy_per_cu ();
+  dwarf2_per_cu *four_ptr = four.get ();
 
   one->set_length (5);
   two->sect_off = sect_offset (one->length ());
@@ -20969,7 +20948,7 @@  run_test ()
   four->set_length (7);
   four->is_dwz = 1;
 
-  std::vector<dwarf2_per_cu_data_up> units;
+  std::vector<dwarf2_per_cu_up> units;
   units.push_back (std::move (one));
   units.push_back (std::move (two));
   units.push_back (std::move (three));
@@ -21080,7 +21059,7 @@  cutu_reader::prepare_one_comp_unit (struct dwarf2_cu *cu,
 /* See read.h.  */
 
 dwarf2_cu *
-dwarf2_per_objfile::get_cu (dwarf2_per_cu_data *per_cu)
+dwarf2_per_objfile::get_cu (dwarf2_per_cu *per_cu)
 {
   auto it = m_dwarf2_cus.find (per_cu);
   if (it == m_dwarf2_cus.end ())
@@ -21092,8 +21071,7 @@  dwarf2_per_objfile::get_cu (dwarf2_per_cu_data *per_cu)
 /* See read.h.  */
 
 void
-dwarf2_per_objfile::set_cu (dwarf2_per_cu_data *per_cu,
-			    dwarf2_cu_up cu)
+dwarf2_per_objfile::set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu)
 {
   gdb_assert (this->get_cu (per_cu) == nullptr);
 
@@ -21148,7 +21126,7 @@  dwarf2_per_objfile::age_comp_units ()
 /* See read.h.  */
 
 void
-dwarf2_per_objfile::remove_cu (dwarf2_per_cu_data *per_cu)
+dwarf2_per_objfile::remove_cu (dwarf2_per_cu *per_cu)
 {
   auto it = m_dwarf2_cus.find (per_cu);
   if (it == m_dwarf2_cus.end ())
@@ -21254,8 +21232,7 @@  set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu,
    or return NULL if the die does not have a saved type.  */
 
 static struct type *
-get_die_type_at_offset (sect_offset sect_off,
-			dwarf2_per_cu_data *per_cu,
+get_die_type_at_offset (sect_offset sect_off, dwarf2_per_cu *per_cu,
 			dwarf2_per_objfile *per_objfile)
 {
   auto it = per_objfile->die_type_hash.find ({per_cu, sect_off});
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index e0c0e1fe3f0a..ccebfe6f223f 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -49,7 +49,7 @@  struct tu_stats
 struct dwarf2_cu;
 struct dwarf2_debug_sections;
 struct dwarf2_per_bfd;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct mapped_index;
 struct mapped_debug_names;
 struct signatured_type;
@@ -59,7 +59,7 @@  struct type_unit_group;
    for.  */
 struct dwarf2_queue_item
 {
-  dwarf2_queue_item (dwarf2_per_cu_data *cu, dwarf2_per_objfile *per_objfile,
+  dwarf2_queue_item (dwarf2_per_cu *cu, dwarf2_per_objfile *per_objfile,
 		     enum language lang)
     : per_cu (cu),
       per_objfile (per_objfile),
@@ -71,33 +71,31 @@  struct dwarf2_queue_item
 
   DISABLE_COPY_AND_ASSIGN (dwarf2_queue_item);
 
-  dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
   dwarf2_per_objfile *per_objfile;
   enum language pretend_language;
 };
 
-/* A deleter for dwarf2_per_cu_data that knows to downcast to
-   signatured_type as appropriate.  This approach lets us avoid a
-   virtual destructor, which saves a bit of space.  */
+/* A deleter for dwarf2_per_cu that knows to downcast to signatured_type as
+   appropriate.  This approach lets us avoid a virtual destructor, which saves
+   a bit of space.  */
 
-struct dwarf2_per_cu_data_deleter
+struct dwarf2_per_cu_deleter
 {
-  void operator() (dwarf2_per_cu_data *data);
+  void operator() (dwarf2_per_cu *data);
 };
 
-/* A specialization of unique_ptr for dwarf2_per_cu_data and
-   subclasses.  */
-using dwarf2_per_cu_data_up
-  = std::unique_ptr<dwarf2_per_cu_data, dwarf2_per_cu_data_deleter>;
+/* A specialization of unique_ptr for dwarf2_per_cu and subclasses.  */
+using dwarf2_per_cu_up = std::unique_ptr<dwarf2_per_cu, dwarf2_per_cu_deleter>;
 
 /* Persistent data held for a compilation unit, even when not
    processing it.  We put a pointer to this structure in the
    psymtab.  */
 
-struct dwarf2_per_cu_data
+struct dwarf2_per_cu
 {
-  dwarf2_per_cu_data (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
-		      sect_offset sect_off)
+  dwarf2_per_cu (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
+		 sect_offset sect_off)
     : sect_off (sect_off),
       is_debug_types (false),
       is_dwz (false),
@@ -131,7 +129,7 @@  struct dwarf2_per_cu_data
 
 public:
   /* Non-zero if this CU is from .debug_types.
-     Struct dwarf2_per_cu_data is contained in struct signatured_type iff
+     Struct dwarf2_per_cu is contained in struct signatured_type iff
      this is non-zero.  */
   unsigned int is_debug_types : 1;
 
@@ -219,7 +217,7 @@  struct dwarf2_per_cu_data
 
   /* DWARF header of this CU.  Note that dwarf2_cu reads its own version of the
      header, which may differ from this one, since it may pass rcuh_kind::TYPE
-     to read_comp_unit_head, whereas for dwarf2_per_cu_data we always pass
+     to read_comp_unit_head, whereas for dwarf2_per_cu we always pass
      rcuh_kind::COMPILE.
 
      Don't access this field directly, use the get_header method instead.  It
@@ -252,7 +250,7 @@  struct dwarf2_per_cu_data
      to.  Concurrently with this change gdb was modified to emit version 8
      indices so we only pay a price for gold generated indices.
      http://sourceware.org/bugzilla/show_bug.cgi?id=15021.  */
-  std::vector<dwarf2_per_cu_data *> imported_symtabs;
+  std::vector<dwarf2_per_cu *> imported_symtabs;
 
   /* Get the header of this per_cu, reading it if necessary.  */
   const comp_unit_head *get_header () const;
@@ -371,11 +369,11 @@  struct dwarf2_per_cu_data
 
 /* Entry in the signatured_types hash table.  */
 
-struct signatured_type : public dwarf2_per_cu_data
+struct signatured_type : public dwarf2_per_cu
 {
   signatured_type (dwarf2_per_bfd *per_bfd, dwarf2_section_info *section,
 		   sect_offset sect_off, ULONGEST signature)
-    : dwarf2_per_cu_data (per_bfd, section, sect_off),
+    : dwarf2_per_cu (per_bfd, section, sect_off),
       signature (signature)
   {
     this->is_debug_types = true;
@@ -466,13 +464,13 @@  struct dwarf2_per_bfd
   DISABLE_COPY_AND_ASSIGN (dwarf2_per_bfd);
 
   /* Return the CU given its index.  */
-  dwarf2_per_cu_data *get_cu (int index) const
+  dwarf2_per_cu *get_cu (int index) const
   {
     return this->all_units[index].get ();
   }
 
   /* Return the CU given its index in the CU table in the index.  */
-  dwarf2_per_cu_data *get_index_cu (int index) const
+  dwarf2_per_cu *get_index_cu (int index) const
   {
     if (this->all_comp_units_index_cus.empty ())
       return get_cu (index);
@@ -480,16 +478,16 @@  struct dwarf2_per_bfd
     return this->all_comp_units_index_cus[index];
   }
 
-  dwarf2_per_cu_data *get_index_tu (int index) const
+  dwarf2_per_cu *get_index_tu (int index) const
   {
     return this->all_comp_units_index_tus[index];
   }
 
-  /* A convenience function to allocate a dwarf2_per_cu_data.  The
-     returned object has its "index" field set properly.  The object
-     is allocated on the dwarf2_per_bfd obstack.  */
-  dwarf2_per_cu_data_up allocate_per_cu (dwarf2_section_info *section,
-					 sect_offset sect_off);
+  /* A convenience function to allocate a dwarf2_per_cu.  The returned object
+     has its "index" field set properly.  The object is allocated on the
+     dwarf2_per_bfd obstack.  */
+  dwarf2_per_cu_up allocate_per_cu (dwarf2_section_info *section,
+				    sect_offset sect_off);
 
   /* A convenience function to allocate a signatured_type.  The
      returned object has its "index" field set properly.  The object
@@ -545,15 +543,15 @@  struct dwarf2_per_bfd
 
   /* Table of all the compilation units.  This is used to locate
      the target compilation unit of a particular reference.  */
-  std::vector<dwarf2_per_cu_data_up> all_units;
+  std::vector<dwarf2_per_cu_up> all_units;
 
   /* The all_units vector contains both CUs and TUs.  Provide views on the
      vector that are limited to either the CU part or the TU part.  */
-  gdb::array_view<dwarf2_per_cu_data_up> all_comp_units;
-  gdb::array_view<dwarf2_per_cu_data_up> all_type_units;
+  gdb::array_view<dwarf2_per_cu_up> all_comp_units;
+  gdb::array_view<dwarf2_per_cu_up> all_type_units;
 
-  std::vector<dwarf2_per_cu_data*> all_comp_units_index_cus;
-  std::vector<dwarf2_per_cu_data*> all_comp_units_index_tus;
+  std::vector<dwarf2_per_cu *> all_comp_units_index_cus;
+  std::vector<dwarf2_per_cu *> all_comp_units_index_tus;
 
   /* Table of struct type_unit_group objects.
      The hash key is the DW_AT_stmt_list value.  */
@@ -600,7 +598,7 @@  struct dwarf2_per_bfd
   htab_up quick_file_names_table;
 
   /* The CUs we recently read.  */
-  std::vector<dwarf2_per_cu_data *> just_read_cus;
+  std::vector<dwarf2_per_cu *> just_read_cus;
 
   /* If we loaded the index from an external file, this contains the
      resources associated to the open file, memory mapping, etc.  */
@@ -638,7 +636,7 @@  class all_units_iterator
     return *this;
   }
 
-  dwarf2_per_cu_data *operator* () const
+  dwarf2_per_cu *operator* () const
   {
     return m_per_bfd->get_cu (m_index);
   }
@@ -714,7 +712,7 @@  using type_unit_group_unshareable_up
 
 struct per_cu_and_offset
 {
-  dwarf2_per_cu_data *per_cu;
+  dwarf2_per_cu *per_cu;
   sect_offset offset;
 
   bool operator== (const per_cu_and_offset &other) const noexcept
@@ -727,7 +725,7 @@  struct per_cu_and_offset_hash
 {
   std::uint64_t operator() (const per_cu_and_offset &key) const noexcept
   {
-    return (std::hash<dwarf2_per_cu_data *> () (key.per_cu)
+    return (std::hash<dwarf2_per_cu *> () (key.per_cu)
 	    + std::hash<sect_offset> () (key.offset));
   }
 };
@@ -760,13 +758,13 @@  struct dwarf2_per_objfile
 
   /* Return true if the symtab corresponding to PER_CU has been set,
      false otherwise.  */
-  bool symtab_set_p (const dwarf2_per_cu_data *per_cu) const;
+  bool symtab_set_p (const dwarf2_per_cu *per_cu) const;
 
   /* Return the compunit_symtab associated to PER_CU, if it has been created.  */
-  compunit_symtab *get_symtab (const dwarf2_per_cu_data *per_cu) const;
+  compunit_symtab *get_symtab (const dwarf2_per_cu *per_cu) const;
 
   /* Set the compunit_symtab associated to PER_CU.  */
-  void set_symtab (const dwarf2_per_cu_data *per_cu, compunit_symtab *symtab);
+  void set_symtab (const dwarf2_per_cu *per_cu, compunit_symtab *symtab);
 
   /* Get the type_unit_group_unshareable corresponding to TU_GROUP.  If one
      does not exist, create it.  */
@@ -779,13 +777,13 @@  struct dwarf2_per_objfile
 				     struct type *type);
 
   /* Get the dwarf2_cu matching PER_CU for this objfile.  */
-  dwarf2_cu *get_cu (dwarf2_per_cu_data *per_cu);
+  dwarf2_cu *get_cu (dwarf2_per_cu *per_cu);
 
   /* Set the dwarf2_cu matching PER_CU for this objfile.  */
-  void set_cu (dwarf2_per_cu_data *per_cu, dwarf2_cu_up cu);
+  void set_cu (dwarf2_per_cu *per_cu, dwarf2_cu_up cu);
 
   /* Remove/free the dwarf2_cu matching PER_CU for this objfile.  */
-  void remove_cu (dwarf2_per_cu_data *per_cu);
+  void remove_cu (dwarf2_per_cu *per_cu);
 
   /* Free all cached compilation units.  */
   void remove_all_cus ();
@@ -816,7 +814,7 @@  struct dwarf2_per_objfile
      or the type may come from a DWO file.  Furthermore, while it's more logical
      to use per_cu->section+offset, with Fission the section with the data is in
      the DWO file but we don't know that section at the point we need it.
-     We have to use something in dwarf2_per_cu_data (or the pointer to it)
+     We have to use something in dwarf2_per_cu (or the pointer to it)
      because we can enter the lookup routine, get_die_type_at_offset, from
      outside this file, and thus won't necessarily have PER_CU->cu.
      Fortunately, PER_CU is stable for the life of the objfile.  */
@@ -833,9 +831,9 @@  struct dwarf2_per_objfile
   std::optional<std::queue<dwarf2_queue_item>> queue;
 
 private:
-  /* Hold the corresponding compunit_symtab for each CU or TU.  This
-     is indexed by dwarf2_per_cu_data::index.  A NULL value means
-     that the CU/TU has not been expanded yet.  */
+  /* Hold the corresponding compunit_symtab for each CU or TU.  This is indexed
+     by dwarf2_per_cu::index.  A NULL value means that the CU/TU has not been
+     expanded yet.  */
   std::vector<compunit_symtab *> m_symtabs;
 
   /* Map from a type unit group to the corresponding unshared
@@ -846,9 +844,9 @@  struct dwarf2_per_objfile
   /* Map from signatured types to the corresponding struct type.  */
   gdb::unordered_map<signatured_type *, struct type *> m_type_map;
 
-  /* Map from the objfile-independent dwarf2_per_cu_data instances to the
+  /* Map from the objfile-independent dwarf2_per_cu instances to the
      corresponding objfile-dependent dwarf2_cu instances.  */
-  gdb::unordered_map<dwarf2_per_cu_data *, dwarf2_cu_up> m_dwarf2_cus;
+  gdb::unordered_map<dwarf2_per_cu *, dwarf2_cu_up> m_dwarf2_cus;
 };
 
 /* Converts DWARF language names to GDB language names.  */
@@ -862,8 +860,7 @@  dwarf2_per_objfile *get_dwarf2_per_objfile (struct objfile *objfile);
 /* Return the type of the DIE at DIE_OFFSET in the CU named by
    PER_CU.  */
 
-struct type *dwarf2_get_die_type (cu_offset die_offset,
-				  dwarf2_per_cu_data *per_cu,
+struct type *dwarf2_get_die_type (cu_offset die_offset, dwarf2_per_cu *per_cu,
 				  dwarf2_per_objfile *per_objfile);
 
 /* Given an index in .debug_addr, fetch the value.
@@ -871,7 +868,7 @@  struct type *dwarf2_get_die_type (cu_offset die_offset,
    long after the debug information has been read, and thus per_cu->cu
    may no longer exist.  */
 
-unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
+unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu *per_cu,
 					 dwarf2_per_objfile *per_objfile,
 					 unsigned int addr_index);
 
@@ -881,7 +878,7 @@  unrelocated_addr dwarf2_read_addr_index (dwarf2_per_cu_data *per_cu,
    PER_CU->DWARF2_PER_OBJFILE->OBJFILE.  */
 
 struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
-  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
+  (sect_offset sect_off, dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    gdb::function_view<CORE_ADDR ()> get_frame_pc,
    bool resolve_abstract_p = false);
@@ -890,7 +887,7 @@  struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off
    offset.  */
 
 struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
-  (cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu,
+  (cu_offset offset_in_cu, dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    gdb::function_view<CORE_ADDR ()> get_frame_pc);
 
@@ -900,7 +897,7 @@  struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off
    does not have a DW_AT_const_value, return NULL.  */
 
 extern const gdb_byte *dwarf2_fetch_constant_bytes
-  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
+  (sect_offset sect_off, dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile, obstack *obstack,
    LONGEST *len);
 
@@ -909,10 +906,10 @@  extern const gdb_byte *dwarf2_fetch_constant_bytes
    the DIE in question is a variable declaration (definitions are
    excluded), then *VAR_NAME is set to the variable's name.  */
 
-struct type *dwarf2_fetch_die_type_sect_off
-  (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
-   dwarf2_per_objfile *per_objfile,
-   const char **var_name = nullptr);
+type *dwarf2_fetch_die_type_sect_off (sect_offset sect_off,
+				      dwarf2_per_cu *per_cu,
+				      dwarf2_per_objfile *per_objfile,
+				      const char **var_name = nullptr);
 
 /* When non-zero, dump line number entries as they are read in.  */
 extern unsigned int dwarf_line_debug;
@@ -974,7 +971,7 @@  struct dwarf2_base_index_functions : public quick_symbol_functions
    EXPANSION_NOTIFY on it.  */
 
 extern bool dw2_expand_symtabs_matching_one
-  (dwarf2_per_cu_data *per_cu,
+  (dwarf2_per_cu *per_cu,
    dwarf2_per_objfile *per_objfile,
    expand_symtabs_file_matcher file_matcher,
    expand_symtabs_expansion_listener expansion_notify,
@@ -993,10 +990,10 @@  extern void dw_expand_symtabs_matching_file_matcher
 extern const char *read_indirect_string_at_offset
   (dwarf2_per_objfile *per_objfile, LONGEST str_offset);
 
-/* Return a new dwarf2_per_cu_data allocated on the per-bfd
-   obstack, and constructed with the specified field values.  */
+/* Return a new dwarf2_per_cu allocated on the per-bfd obstack, and constructed
+   with the specified field values.  */
 
-extern dwarf2_per_cu_data_up create_cu_from_index_list
+extern dwarf2_per_cu_up create_cu_from_index_list
   (dwarf2_per_bfd *per_bfd, struct dwarf2_section_info *section,
    int is_dwz, sect_offset sect_off, ULONGEST length);
 
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 8b00fec59a18..0cc97aea330b 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -56,7 +56,7 @@  struct field;
 struct block;
 struct value_print_options;
 struct language_defn;
-struct dwarf2_per_cu_data;
+struct dwarf2_per_cu;
 struct dwarf2_per_objfile;
 struct dwarf2_property_baton;