diff options
author | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-06-01 22:47:20 -0400 |
---|---|---|
committer | Rafael Ávila de Espíndola <rafael.espindola@gmail.com> | 2015-06-01 22:47:20 -0400 |
commit | 400f89447b72cbd48a2fc8b016a09cbc4e590d81 (patch) | |
tree | eeaaf15255ef967ae2120c96520ac8b5b755e096 /gold/merge.h | |
parent | d78b6450515fb163b00bc8874a15469df797ef17 (diff) | |
download | gdb-400f89447b72cbd48a2fc8b016a09cbc4e590d81.zip gdb-400f89447b72cbd48a2fc8b016a09cbc4e590d81.tar.gz gdb-400f89447b72cbd48a2fc8b016a09cbc4e590d81.tar.bz2 |
Use a std::vector instead of a std::map to hold Input_merge_map.
A std::map is hardly the best data structure for a small map from small
integers.
Diffstat (limited to 'gold/merge.h')
-rw-r--r-- | gold/merge.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/gold/merge.h b/gold/merge.h index 54caed8..53846ee 100644 --- a/gold/merge.h +++ b/gold/merge.h @@ -42,9 +42,7 @@ class Object_merge_map { public: Object_merge_map() - : first_shnum_(-1U), first_map_(), - second_shnum_(-1U), second_map_(), - section_merge_maps_() + : section_merge_maps_() { } ~Object_merge_map(); @@ -152,7 +150,8 @@ class Object_merge_map }; // Map input section indices to merge maps. - typedef std::map<unsigned int, Input_merge_map*> Section_merge_maps; + typedef std::vector<std::pair<unsigned int, Input_merge_map*> > + Section_merge_maps; // Return a pointer to the Input_merge_map to use for the input // section SHNDX, or NULL. @@ -165,15 +164,6 @@ class Object_merge_map this)->get_input_merge_map(shndx)); } - // Any given object file will normally only have a couple of input - // sections with mergeable contents. So we keep the first two input - // section numbers inline, and push any further ones into a map. A - // value of -1U in first_shnum_ or second_shnum_ means that we don't - // have a corresponding entry. - unsigned int first_shnum_; - Input_merge_map first_map_; - unsigned int second_shnum_; - Input_merge_map second_map_; Section_merge_maps section_merge_maps_; }; |