* gold.h (reserve_unordered_map): Define, three versions, one for
each version of Unordered_map. * layout.cc (Layout::Layout): Remove options parameter. Add number_of_input_files parameter. Don't initialize options_. Initialize number_of_input_files_ and resized_signatures_. Move sections_are_attached_. (Layout::layout_group): Reserve space for group_signatures_. (Layout::find_or_add_kept_section): Change name parameter to be a reference. Resize signatures_ map when it gets large enough. (Layout::layout_eh_frame): Use parameters->options() instead of this->options_. (Layout::make_output_section): Likewise. (Layout::attach_allocated_section_to_segment): Likewise. (Layout::finalize, Layout::create_executable_stack): Likewise. (Layout::set_segment_offsets, Layout::create_interp): Likewise. (Layout::finish_dynamic_section, Layout::write_binary): Likewise. * layout.h (class Layout): Update declarations. Remove options_ field. Add number_of_input_files_ and resized_signatures_ fields. Move sections_are_attached_ field. * main.cc (main): Pass number of input files to Layout constructor. Don't pass options.
This commit is contained in:
parent
e401b04ca7
commit
e55bde5eb0
5 changed files with 85 additions and 33 deletions
|
@ -75,6 +75,8 @@
|
|||
#define Unordered_set std::tr1::unordered_set
|
||||
#define Unordered_map std::tr1::unordered_map
|
||||
|
||||
#define reserve_unordered_map(map, n) ((map)->rehash(n))
|
||||
|
||||
#elif defined(HAVE_EXT_HASH_MAP) && defined(HAVE_EXT_HASH_SET)
|
||||
|
||||
#include <ext/hash_map>
|
||||
|
@ -105,6 +107,8 @@ struct hash<T*>
|
|||
|
||||
}
|
||||
|
||||
#define reserve_unordered_map(map, n) ((map)->resize(n))
|
||||
|
||||
#else
|
||||
|
||||
// The fallback is to just use set and map.
|
||||
|
@ -115,6 +119,8 @@ struct hash<T*>
|
|||
#define Unordered_set std::set
|
||||
#define Unordered_map std::map
|
||||
|
||||
#define reserve_unordered_map(map, n)
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_PREAD
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue