aboutsummaryrefslogtreecommitdiff
path: root/gold/output.h
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-01-20 17:29:52 +0000
committerDoug Kwan <dougkwan@google.com>2010-01-20 17:29:52 +0000
commit5ac169d4b6e2d88c670298a3246fc2a5d8a94aa4 (patch)
tree02c188debc6532be6476d7de9cb86cc6309ea963 /gold/output.h
parenta21620630edb456511a2467466814ecffa158b2f (diff)
downloadgdb-5ac169d4b6e2d88c670298a3246fc2a5d8a94aa4.zip
gdb-5ac169d4b6e2d88c670298a3246fc2a5d8a94aa4.tar.gz
gdb-5ac169d4b6e2d88c670298a3246fc2a5d8a94aa4.tar.bz2
2010-01-20 Doug Kwan <dougkwan@google.com>
* arm.cc (Target_arm::Arm_input_section_map): Change key type from Input_section_specifier to Section_id. (Target_arm::new_arm_input_section: Adjust code for change of key type. (Target_arm::find_arm_input_section): Ditto. * gc.h (object.h): Include for Section_id nand Section_id_hash. (Section_id): Remove. (Garbage_collection::Section_id_hash): Remove. * icf.h (object.h): Include for Section_id nand Section_id_hash. (Section_id): Remove. (Icf::Section_id_hash): Remove. * object.h (Section_id, Const_section_id, Section_id_hash, Const_section_id_hash): New type definitions. * output.cc (Output_section::add_relaxed_input_section): Change to use Const_section_id instead of Input_section_specifier as key type. (Output_section::add_merge_input_section): Ditto. (Output_section::build_relaxation_map): Change to use Section_id instead of Input_section_specifier as key type. (Output_section::convert_input_sections_in_list_to_relaxed_sections): Ditto. (Output_section::convert_input_sections_to_relaxed_sections): Change to use Const_section_id instead of Input_section_specifier as key type. (Output_section::find_merge_section): Ditto. (Output_section::find_relaxed_input_section): Ditto. * output.h (Input_section_specifier): Remove class. (Output_section::Output_section_data_by_input_section_map): Change key type to Const_section_id. (Output_section::Output_relaxed_input_section_by_input_section_map): Ditto. (Output_section::Relaxation_map): Change key type to Section_id.
Diffstat (limited to 'gold/output.h')
-rw-r--r--gold/output.h79
1 files changed, 9 insertions, 70 deletions
diff --git a/gold/output.h b/gold/output.h
index 7a35652..ec16ca3 100644
--- a/gold/output.h
+++ b/gold/output.h
@@ -47,62 +47,6 @@ class Sized_target;
template<int size, bool big_endian>
class Sized_relobj;
-// This class specifies an input section. It is used as a key type
-// for maps.
-
-class Input_section_specifier
-{
- public:
- Input_section_specifier(const Relobj* relobj, unsigned int shndx)
- : relobj_(relobj), shndx_(shndx)
- { }
-
- // Return Relobj of this.
- const Relobj*
- relobj() const
- { return this->relobj_; }
-
- // Return section index of this.
- unsigned int
- shndx() const
- { return this->shndx_; }
-
- // Whether this equals to another specifier ISS.
- bool
- eq(const Input_section_specifier& iss) const
- { return this->relobj_ == iss.relobj_ && this->shndx_ == iss.shndx_; }
-
- // Compute a hash value of this.
- size_t
- hash_value() const
- {
- return (gold::string_hash<char>(this->relobj_->name().c_str())
- ^ this->shndx_);
- }
-
- // Functors for containers.
- struct equal_to
- {
- bool
- operator()(const Input_section_specifier& iss1,
- const Input_section_specifier& iss2) const
- { return iss1.eq(iss2); }
- };
-
- struct hash
- {
- size_t
- operator()(const Input_section_specifier& iss) const
- { return iss.hash_value(); }
- };
-
- private:
- // An object.
- const Relobj* relobj_;
- // A section index.
- unsigned int shndx_;
-};
-
// An abtract class for data which has to go into the output file.
class Output_data
@@ -3396,25 +3340,20 @@ class Output_section : public Output_data
Merge_section_properties::equal_to>
Merge_section_by_properties_map;
- // Map that link Input_section_specifier to Output_section_data.
- typedef Unordered_map<Input_section_specifier, Output_section_data*,
- Input_section_specifier::hash,
- Input_section_specifier::equal_to>
+ // Map that link Const_section_id to Output_section_data.
+ typedef Unordered_map<Const_section_id, Output_section_data*,
+ Const_section_id_hash>
Output_section_data_by_input_section_map;
- // Map that link Input_section_specifier to Output_relaxed_input_section.
- typedef Unordered_map<Input_section_specifier, Output_relaxed_input_section*,
- Input_section_specifier::hash,
- Input_section_specifier::equal_to>
+ // Map that link Const_section_id to Output_relaxed_input_section.
+ typedef Unordered_map<Const_section_id, Output_relaxed_input_section*,
+ Const_section_id_hash>
Output_relaxed_input_section_by_input_section_map;
// Map used during relaxation of existing sections. This map
- // an input section specifier to an input section list index.
- // We assume that Input_section_list is a vector.
- typedef Unordered_map<Input_section_specifier, size_t,
- Input_section_specifier::hash,
- Input_section_specifier::equal_to>
- Relaxation_map;
+ // a section id an input section list index. We assume that
+ // Input_section_list is a vector.
+ typedef Unordered_map<Section_id, size_t, Section_id_hash> Relaxation_map;
// Add a new output section by Input_section.
void