diff options
author | Cary Coutant <ccoutant@google.com> | 2011-03-30 21:07:13 +0000 |
---|---|---|
committer | Cary Coutant <ccoutant@google.com> | 2011-03-30 21:07:13 +0000 |
commit | c7975edd9eba42c2bd59948060d8d5c715456517 (patch) | |
tree | 2648d7512cb58f600066d281834f1c4d4aa53398 /gold/options.h | |
parent | ef23e70580c5c6353e916d10f2f94eceba7a70cd (diff) | |
download | gdb-c7975edd9eba42c2bd59948060d8d5c715456517.zip gdb-c7975edd9eba42c2bd59948060d8d5c715456517.tar.gz gdb-c7975edd9eba42c2bd59948060d8d5c715456517.tar.bz2 |
* archive.cc (Archive::include_member): Adjust call to report_object.
(Add_archive_symbols::run): Add script_info to call to
report_archive_begin.
(Lib_group::include_member): Adjust call to report_object.
(Add_lib_group_symbols::run): Adjust call to report_object.
* incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
blocks. Add object count for script input files.
* incremental.cc (Incremental_inputs::report_archive_begin): Add
script_info parameter; change all callers.
(Incremental_inputs::report_object): Add script_info parameter;
change all callers.
(Incremental_inputs::report_script): Store backpointer to
incremental info entry.
(Output_section_incremental_inputs::set_final_data_size): Record
additional information for scripts.
(Output_section_incremental_inputs::write_info_blocks): Likewise.
* incremental.h (Incremental_script_entry::add_object): New function.
(Incremental_script_entry::get_object_count): New function.
(Incremental_script_entry::get_object): New function.
(Incremental_script_entry::objects_): New data member; adjust
constructor.
(Incremental_inputs::report_archive_begin): Add script_info parameter.
(Incremental_inputs::report_object): Add script_info parameter.
(Incremental_inputs_reader::get_object_count): New function.
(Incremental_inputs_reader::get_object_offset): New function.
* options.cc (Input_arguments::add_file): Return reference to
new input argument.
* options.h (Input_argument::set_script_info): New function.
(Input_argument::script_info): New function.
(Input_argument::script_info_): New data member; adjust all
constructors.
(Input_file_group::add_file): Return reference to new input argument.
(Input_file_lib::add_file): Likewise.
(Input_arguments::add_file): Likewise.
* readsyms.cc (Add_symbols::run): Adjust call to report_object.
* script.cc (Parser_closure::Parser_closure): Add script_info
parameter; adjust all callers.
(Parser_closure::script_info): New function.
(Parser_closure::script_info_): New data member.
(read_input_script): Report scripts earlier to incremental info.
(script_add_file): Set script_info in Input_argument.
(script_add_library): Likewise.
* script.h (Script_options::Script_info): Rewrite class.
Diffstat (limited to 'gold/options.h')
-rw-r--r-- | gold/options.h | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/gold/options.h b/gold/options.h index d0e42a1..042b8cf 100644 --- a/gold/options.h +++ b/gold/options.h @@ -1599,17 +1599,17 @@ class Input_argument public: // Create a file or library argument. explicit Input_argument(Input_file_argument file) - : is_file_(true), file_(file), group_(NULL), lib_(NULL) + : is_file_(true), file_(file), group_(NULL), lib_(NULL), script_info_(NULL) { } // Create a group argument. explicit Input_argument(Input_file_group* group) - : is_file_(false), group_(group), lib_(NULL) + : is_file_(false), group_(group), lib_(NULL), script_info_(NULL) { } // Create a lib argument. explicit Input_argument(Input_file_lib* lib) - : is_file_(false), group_(NULL), lib_(lib) + : is_file_(false), group_(NULL), lib_(lib), script_info_(NULL) { } // Return whether this is a file. @@ -1667,11 +1667,22 @@ class Input_argument return this->lib_; } + // If a script generated this argument, store a pointer to the script info. + // Currently used only for recording incremental link information. + void + set_script_info(Script_info* info) + { this->script_info_ = info; } + + Script_info* + script_info() const + { return this->script_info_; } + private: bool is_file_; Input_file_argument file_; Input_file_group* group_; Input_file_lib* lib_; + Script_info* script_info_; }; typedef std::vector<Input_argument> Input_argument_list; @@ -1689,9 +1700,12 @@ class Input_file_group { } // Add a file to the end of the group. - void + Input_argument& add_file(const Input_file_argument& arg) - { this->files_.push_back(Input_argument(arg)); } + { + this->files_.push_back(Input_argument(arg)); + return this->files_.back(); + } // Iterators to iterate over the group contents. @@ -1720,9 +1734,12 @@ class Input_file_lib { } // Add a file to the end of the lib. - void + Input_argument& add_file(const Input_file_argument& arg) - { this->files_.push_back(Input_argument(arg)); } + { + this->files_.push_back(Input_argument(arg)); + return this->files_.back(); + } const Position_dependent_options& options() const @@ -1759,7 +1776,7 @@ class Input_arguments { } // Add a file. - void + Input_argument& add_file(const Input_file_argument& arg); // Start a group (the --start-group option). |