aboutsummaryrefslogtreecommitdiff
path: root/gold/incremental.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-04-24 15:44:02 +0000
committerIan Lance Taylor <ian@airs.com>2009-04-24 15:44:02 +0000
commit3ce2c28e3f647d0771a197b76477ddc8cbb611b2 (patch)
tree14d493e1d69102339db0ded1b5e365584dd79986 /gold/incremental.h
parentf50230ae440d80638167b5520afbe4dc6480df4f (diff)
downloadfsf-binutils-gdb-3ce2c28e3f647d0771a197b76477ddc8cbb611b2.zip
fsf-binutils-gdb-3ce2c28e3f647d0771a197b76477ddc8cbb611b2.tar.gz
fsf-binutils-gdb-3ce2c28e3f647d0771a197b76477ddc8cbb611b2.tar.bz2
* incremental.cc (Incremental_inputs_header_data): Renamed from
Incremental_input_header_data. (Incremental_inputs_header_data::data_size): New field. (Incremental_inputs_header_data::put_input_file_count): Renamed from input_file_count. (Incremental_inputs_header_data::put_command_line_offset): Renamed from command_line_offset. (Incremental_inputs_header_data::put_reserved): Renamed from put_reserved. (Incremental_inputs_entry_data): Renamed from Incremental_input_entry_data. (Incremental_inputs_entry_data::data_size): New field. (Incremental_inputs::report_command_line): New method. (Incremental_inputs::finalize): New method. (Incremental_inputs::create_incremental_inputs_data): New method. (Incremental_inputs::sized_create_incremental_inputs_data): New method. * incremental.h: New file. * layout.cc (Layout::Layout): Handle new incremental_inputs_. (Layout::finalize): Create incremental inputs section in incremental builds. (Layout::create_incremental_info_sections): New method. * layout.h (Layout::incremental_inputs): New method. (Layout::create_incremental_info_sections): New method. (Layout::incremental_inputs_): New field. * main.cc (main): Notify Incremental_input of the command line.
Diffstat (limited to 'gold/incremental.h')
-rw-r--r--gold/incremental.h82
1 files changed, 82 insertions, 0 deletions
diff --git a/gold/incremental.h b/gold/incremental.h
new file mode 100644
index 0000000..dd9ebc5
--- /dev/null
+++ b/gold/incremental.h
@@ -0,0 +1,82 @@
+// inremental.h -- incremental linking support for gold -*- C++ -*-
+
+// Copyright 2009 Free Software Foundation, Inc.
+// Written by Mikolaj Zalewski <mikolajz@google.com>.
+
+// This file is part of gold.
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 3 of the License, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+// MA 02110-1301, USA.
+
+#ifndef GOLD_INCREMENTAL_H
+#define GOLD_INCREMENTAL_H
+
+#include <vector>
+
+#include "stringpool.h"
+#include "workqueue.h"
+
+namespace gold
+{
+
+class Archive;
+class Input_argument;
+class Incremental_inputs_checker;
+class Object;
+class Output_section_data;
+
+// This class contains the information needed during an incremental
+// build about the inputs necessary to build the .gnu_incremental_inputs.
+class Incremental_inputs
+{
+ public:
+ Incremental_inputs()
+ : command_line_key_(0), strtab_(new Stringpool())
+ { }
+ ~Incremental_inputs() { delete this->strtab_; }
+
+ // Record the command line.
+ void
+ report_command_line(int argc, const char* const* argv);
+
+ // Prepare for layout. Called from Layout::finalize.
+ void
+ finalize();
+
+ // Create the content of the .gnu_incremental_inputs section.
+ Output_section_data*
+ create_incremental_inputs_section_data();
+
+ // Return the .gnu_incremental_strtab stringpool.
+ Stringpool*
+ get_stringpool()
+ { return this->strtab_; }
+
+ private:
+ // Code for each of the four possible variants of create_inputs_section_data.
+ template<int size, bool big_endian>
+ Output_section_data*
+ sized_create_inputs_section_data();
+
+ // The key of the command line string in the string pool.
+ Stringpool::Key command_line_key_;
+ // The .gnu_incremental_strtab string pool associated with the
+ // .gnu_incremental_inputs.
+ Stringpool* strtab_;
+};
+
+} // End namespace gold.
+
+#endif // !defined(GOLD_INCREMENTAL_H)