This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] gold: remove unused private members


This seems like it might be in the "obvious" category, but I'm not sure
you'll agree.  I think I checked for uses of these under #if conditions I'm
not testing or whatnot, but maybe I missed something.  I'm assuming they
are just leftover cruft after past refactorings.  Note that I did not
change the constructor signatures in the cases where the only use of the
member was to initialize it from a constructor argument.  So if the
implementation of a class does later change to actually use the
information, the member can just be added back without needing to touch all
the callers of the constructor.

OK for trunk and 2.24?


Thanks,
Roland


gold/
	* i386.cc (Target_i386): Remove unused member dynbss_.
	* dwarf_reader.h (Dwarf_info_reader): Remove unused members
	type_signature_, type_offset_.
	* plugin.h (Plugin_hook): Remove unused member layout_.
	* readsyms.h (Add_symbols): Remove unused members dirpath_, dirindex_,
	mapfile_.
	(Read_member): Remove unused members input_objects_, symtab_,
	mapfile_, layout_.
	(Check_library): Remove unused member symtab_.
	* archive.h (Lib_group): Remove unused member lib_.
	* archive.cc (Lib_group::Lib_group): Update initializer.
	* incremental.h	(Incremental_binary): Remove unused member target_.
	(Incremental_script_entry): Removed unused member script_.
	* layout.h (Write_symbols_task): Remove unused member input_objects_.
	* icf.h (Icf): Remove unused member num_tracked_relocs.

--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -1,6 +1,7 @@
 // archive.cc -- archive support for gold

-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013
+// Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.

 // This file is part of gold.
@@ -1130,7 +1131,7 @@ unsigned int Lib_group::total_members;
 unsigned int Lib_group::total_members_loaded;

 Lib_group::Lib_group(const Input_file_lib* lib, Task* task)
-  : Library_base(task), lib_(lib), members_()
+  : Library_base(task), members_()
 {
   this->members_.resize(lib->size());
 }
--- a/gold/archive.h
+++ b/gold/archive.h
@@ -511,8 +511,6 @@ class Lib_group : public Library_base
   void
   do_for_all_unused_symbols(Symbol_visitor_base*) const;

-  // For reading the files.
-  const Input_file_lib* lib_;
   // Table of the objects in the group.
   std::vector<Archive_member> members_;
 };
--- a/gold/dwarf_reader.h
+++ b/gold/dwarf_reader.h
@@ -1,6 +1,7 @@
 // dwarf_reader.h -- parse dwarf2/3 debug information for gold  -*- C++ -*-

-// Copyright 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013
+// Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.

 // This file is part of gold.
@@ -697,8 +698,8 @@ class Dwarf_info_reader
       symtab_size_(symtab_size), shndx_(shndx), reloc_shndx_(reloc_shndx),
       reloc_type_(reloc_type), abbrev_shndx_(0), string_shndx_(0),
       buffer_(NULL), buffer_end_(NULL), cu_offset_(0), cu_length_(0),
-      offset_size_(0), address_size_(0), cu_version_(0), type_signature_(0),
-      type_offset_(0), abbrev_table_(), ranges_table_(this),
+      offset_size_(0), address_size_(0), cu_version_(0),
+      abbrev_table_(), ranges_table_(this),
       reloc_mapper_(NULL), string_buffer_(NULL), string_buffer_end_(NULL),
       owns_string_buffer_(false), string_output_section_offset_(0)
   { }
@@ -895,10 +896,6 @@ class Dwarf_info_reader
   unsigned int address_size_;
   // Compilation unit version number.
   unsigned int cu_version_;
-  // Type signature (for a type unit).
-  uint64_t type_signature_;
-  // Offset from the type unit header to the type DIE (for a type unit).
-  off_t type_offset_;
   // Abbreviations table for current compilation unit.
   Dwarf_abbrev_table abbrev_table_;
   // Ranges table for the current compilation unit.
--- a/gold/i386.cc
+++ b/gold/i386.cc
@@ -337,7 +337,7 @@ class Target_i386 : public Sized_target<32, false>
     : Sized_target<32, false>(info),
       got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL),
       got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL),
-      rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY), dynbss_(NULL),
+      rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY),
       got_mod_index_offset_(-1U), tls_base_symbol_defined_(false)
   { }

@@ -827,8 +827,6 @@ class Target_i386 : public Sized_target<32, false>
   Reloc_section* rel_irelative_;
   // Relocs saved to avoid a COPY reloc.
   Copy_relocs<elfcpp::SHT_REL, 32, false> copy_relocs_;
-  // Space for variables copied with a COPY reloc.
-  Output_data_space* dynbss_;
   // Offset of the GOT entry for the TLS module index.
   unsigned int got_mod_index_offset_;
   // True if the _TLS_MODULE_BASE_ symbol has been defined.
--- a/gold/icf.h
+++ b/gold/icf.h
@@ -1,6 +1,6 @@
 // icf.h --  Identical Code Folding

-// Copyright 2009, 2010 Free Software Foundation, Inc.
+// Copyright 2009, 2010, 2013 Free Software Foundation, Inc.
 // Written by Sriraman Tallam <tmsriram@google.com>.

 // This file is part of gold.
@@ -67,7 +67,7 @@ class Icf
   Icf()
   : id_section_(), section_id_(), kept_section_id_(),
     fptr_section_id_(),
-    num_tracked_relocs(NULL), icf_ready_(false),
+    icf_ready_(false),
     reloc_info_list_()
   { }

@@ -156,7 +156,6 @@ class Icf
   // function is taken in which case it is dangerous to fold
   // this function.
   Secn_fptr_taken_set fptr_section_id_;
-  unsigned int* num_tracked_relocs;
   // Flag to indicate if ICF has been run.
   bool icf_ready_;
   // This list is populated by gc_process_relocs in gc.h.
--- a/gold/incremental.h
+++ b/gold/incremental.h
@@ -1,6 +1,6 @@
 // inremental.h -- incremental linking support for gold   -*- C++ -*-

-// Copyright 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+// Copyright 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
 // Written by Mikolaj Zalewski <mikolajz@google.com>.

 // This file is part of gold.
@@ -304,10 +304,10 @@ class Incremental_script_entry : public
Incremental_input_entry
 {
  public:
   Incremental_script_entry(Stringpool::Key filename_key,
-			   unsigned int arg_serial, Script_info* script,
+			   unsigned int arg_serial, Script_info* /*script*/,
 			   Timespec mtime)
     : Incremental_input_entry(filename_key, arg_serial, mtime),
-      script_(script), objects_()
+      objects_()
   { }

   // Add a member object to the archive.
@@ -341,8 +341,6 @@ class Incremental_script_entry : public
Incremental_input_entry
   { return this; }

  private:
-  // Information about the script file.
-  Script_info* script_;
   // Objects that have been included by this script.
   std::vector<Incremental_input_entry*> objects_;
 };
@@ -1342,9 +1340,9 @@ class Incremental_got_plt_reader
 class Incremental_binary
 {
  public:
-  Incremental_binary(Output_file* output, Target* target)
+  Incremental_binary(Output_file* output, Target* /*target*/)
     : input_args_map_(), library_map_(), script_map_(),
-      output_(output), target_(target)
+      output_(output)
   { }

   virtual
@@ -1582,8 +1580,6 @@ class Incremental_binary
  private:
   // Edited output file object.
   Output_file* output_;
-  // Target of the output file.
-  Target* target_;
 };

 template<int size, bool big_endian>
--- a/gold/layout.h
+++ b/gold/layout.h
@@ -1524,10 +1524,10 @@ class Write_symbols_task : public Task
 {
  public:
   Write_symbols_task(const Layout* layout, const Symbol_table* symtab,
-		     const Input_objects* input_objects,
+		     const Input_objects* /*input_objects*/,
 		     const Stringpool* sympool, const Stringpool* dynpool,
 		     Output_file* of, Task_token* final_blocker)
-    : layout_(layout), symtab_(symtab), input_objects_(input_objects),
+    : layout_(layout), symtab_(symtab),
       sympool_(sympool), dynpool_(dynpool), of_(of),
       final_blocker_(final_blocker)
   { }
@@ -1550,7 +1550,6 @@ class Write_symbols_task : public Task
  private:
   const Layout* layout_;
   const Symbol_table* symtab_;
-  const Input_objects* input_objects_;
   const Stringpool* sympool_;
   const Stringpool* dynpool_;
   Output_file* of_;
--- a/gold/plugin.h
+++ b/gold/plugin.h
@@ -1,6 +1,6 @@
 // plugin.h -- plugin manager for gold      -*- C++ -*-

-// Copyright 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright 2008, 2009, 2010, 2011, 2013 Free Software Foundation, Inc.
 // Written by Cary Coutant <ccoutant@google.com>.

 // This file is part of gold.
@@ -554,11 +554,11 @@ class Plugin_hook : public Task
 {
  public:
   Plugin_hook(const General_options& options, Input_objects* input_objects,
-	      Symbol_table* symtab, Layout* layout, Dirsearch* dirpath,
+	      Symbol_table* symtab, Layout* /*layout*/, Dirsearch* dirpath,
 	      Mapfile* mapfile, Task_token* this_blocker,
 	      Task_token* next_blocker)
     : options_(options), input_objects_(input_objects), symtab_(symtab),
-      layout_(layout), dirpath_(dirpath), mapfile_(mapfile),
+      dirpath_(dirpath), mapfile_(mapfile),
       this_blocker_(this_blocker), next_blocker_(next_blocker)
   { }

@@ -583,7 +583,6 @@ class Plugin_hook : public Task
   const General_options& options_;
   Input_objects* input_objects_;
   Symbol_table* symtab_;
-  Layout* layout_;
   Dirsearch* dirpath_;
   Mapfile* mapfile_;
   Task_token* this_blocker_;
--- a/gold/readsyms.h
+++ b/gold/readsyms.h
@@ -1,6 +1,7 @@
 // readsyms.h -- read input file symbols for gold   -*- C++ -*-

-// Copyright 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011, 2013
+// Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <iant@google.com>.

 // This file is part of gold.
@@ -137,13 +138,12 @@ class Add_symbols : public Task
   // one for the previous input file.  NEXT_BLOCKER is used to prevent
   // the next task from running.
   Add_symbols(Input_objects* input_objects, Symbol_table* symtab,
-	      Layout* layout, Dirsearch* dirpath, int dirindex,
-	      Mapfile* mapfile, const Input_argument* input_argument,
+	      Layout* layout, Dirsearch* /*dirpath*/, int /*dirindex*/,
+	      Mapfile* /*mapfile*/, const Input_argument* input_argument,
 	      Object* object, Incremental_library* library,
 	      Read_symbols_data* sd, Task_token* this_blocker,
 	      Task_token* next_blocker)
     : input_objects_(input_objects), symtab_(symtab), layout_(layout),
-      dirpath_(dirpath), dirindex_(dirindex), mapfile_(mapfile),
       input_argument_(input_argument), object_(object), library_(library),
       sd_(sd), this_blocker_(this_blocker), next_blocker_(next_blocker)
   { }
@@ -169,9 +169,6 @@ private:
   Input_objects* input_objects_;
   Symbol_table* symtab_;
   Layout* layout_;
-  Dirsearch* dirpath_;
-  int dirindex_;
-  Mapfile* mapfile_;
   const Input_argument* input_argument_;
   Object* object_;
   Incremental_library* library_;
@@ -192,12 +189,11 @@ class Read_member : public Task
   // one has completed; it will be NULL for the first task.
   // NEXT_BLOCKER is used to block the next input file from adding
   // symbols.
-  Read_member(Input_objects* input_objects, Symbol_table* symtab,
-	      Layout* layout, Mapfile* mapfile,
+  Read_member(Input_objects* /*input_objects*/, Symbol_table* /*symtab*/,
+	      Layout* /*layout*/, Mapfile* /*mapfile*/,
 	      const Incremental_binary::Input_reader* input_reader,
               Task_token* this_blocker, Task_token* next_blocker)
-    : input_objects_(input_objects), symtab_(symtab), layout_(layout),
-      mapfile_(mapfile), input_reader_(input_reader),
+    : input_reader_(input_reader),
       this_blocker_(this_blocker), next_blocker_(next_blocker)
   { }

@@ -221,10 +217,6 @@ class Read_member : public Task
   }

  private:
-  Input_objects* input_objects_;
-  Symbol_table* symtab_;
-  Layout* layout_;
-  Mapfile* mapfile_;
   const Incremental_binary::Input_reader* input_reader_;
   Task_token* this_blocker_;
   Task_token* next_blocker_;
@@ -282,12 +274,12 @@ class Check_script : public Task
 class Check_library : public Task
 {
  public:
-  Check_library(Symbol_table* symtab, Layout* layout,
+  Check_library(Symbol_table* /*symtab*/, Layout* layout,
 		Incremental_binary* ibase,
 		unsigned int input_file_index,
 		const Incremental_binary::Input_reader* input_reader,
 		Task_token* this_blocker, Task_token* next_blocker)
-    : layout_(layout), symtab_(symtab), ibase_(ibase),
+    : layout_(layout), ibase_(ibase),
       input_file_index_(input_file_index), input_reader_(input_reader),
       this_blocker_(this_blocker), next_blocker_(next_blocker)
   { }
@@ -313,7 +305,6 @@ class Check_library : public Task

  private:
   Layout* layout_;
-  Symbol_table* symtab_;
   Incremental_binary* ibase_;
   unsigned int input_file_index_;
   const Incremental_binary::Input_reader* input_reader_;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]