aboutsummaryrefslogtreecommitdiff
path: root/gold/incremental.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2009-07-06 23:11:21 +0000
committerIan Lance Taylor <ian@airs.com>2009-07-06 23:11:21 +0000
commit98fa85cb4244619f2ecc3cdfd7578a2602addf45 (patch)
tree04f0bdd28145db3e83edf52eefb7081bbcf21754 /gold/incremental.h
parent922d8de8c1bd5cbaa9eadd77437daea021864c1d (diff)
downloadfsf-binutils-gdb-98fa85cb4244619f2ecc3cdfd7578a2602addf45.zip
fsf-binutils-gdb-98fa85cb4244619f2ecc3cdfd7578a2602addf45.tar.gz
fsf-binutils-gdb-98fa85cb4244619f2ecc3cdfd7578a2602addf45.tar.bz2
* fileread.cc (File_read::get_mtime): New method.
* fileread.h (Timespec): New structure. (File_read::get_mtime): New method. * incremental.cc (Incremental_inputs_entry_data::timestamp_usec): Renamed from timestamp_nsec. (Incremental_inputs_entry_write::timestamp_sec): Fix argument to Elf_Xword. (Incremental_inputs_entry_write::timestamp_usec): Renamed from timestamp_nsec. (Incremental_inputs::report_archive): Save mtime; style fix. (Incremental_inputs::report_obejct): Save mtime; style fix. (Incremental_inputs::report_script): Save mtime; style fix. (Incremental_inputs::finalize_inputs): Style fix. (Incremental_inputs::finalize): Style fix. (Incremental_inputs::create_input_section_data): Store inputs mtime. * incremental.h (Incremental_inputs::report_script): Add mtime argument. (Incremental_inputs::Input_info::Input_info): Intialize only one union member. (Incremental_inputs::Input_info::archive): Move to nameless union. (Incremental_inputs::Input_info::obejct): Move to nameless union. (Incremental_inputs::Input_info::script): Move to nameless union. (Incremental_inputs::mtime): New field. * script.cc (read_input_script): Pass file mtime to Incremental_input. * script.h (Script_info::inputs): Style fix.
Diffstat (limited to 'gold/incremental.h')
-rw-r--r--gold/incremental.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/gold/incremental.h b/gold/incremental.h
index ed074ae..4342dcc 100644
--- a/gold/incremental.h
+++ b/gold/incremental.h
@@ -28,6 +28,7 @@
#include "stringpool.h"
#include "workqueue.h"
+#include "fileread.h"
namespace gold
{
@@ -79,7 +80,8 @@ class Incremental_inputs
// Record that the input argument INPUT is to an script SCRIPT.
void
- report_script(const Input_argument* input, Script_info* script);
+ report_script(const Input_argument* input, Timespec mtime,
+ Script_info* script);
// Prepare for layout. Called from Layout::finalize.
void
@@ -114,28 +116,34 @@ class Incremental_inputs
struct Input_info
{
Input_info()
- : type(INCREMENTAL_INPUT_INVALID), archive(NULL), object(NULL),
- script(NULL), filename_key(0), index(0)
+ : type(INCREMENTAL_INPUT_INVALID), archive(NULL), filename_key(0),
+ index(0)
{ }
// Type of the file pointed by this argument.
Incremental_input_type type;
- // Present if type == INCREMENTAL_INPUT_ARCHIVE.
- Archive* archive;
-
- // Present if type == INCREMENTAL_INPUT_OBJECT or
- // INCREMENTAL_INPUT_SHARED_LIBRARY.
- Object* object;
-
- // Present if type == INCREMENTAL_INPUT_SCRIPT.
- Script_info* script;
+ union
+ {
+ // Present if type == INCREMENTAL_INPUT_ARCHIVE.
+ Archive* archive;
+
+ // Present if type == INCREMENTAL_INPUT_OBJECT or
+ // INCREMENTAL_INPUT_SHARED_LIBRARY.
+ Object* object;
+
+ // Present if type == INCREMENTAL_INPUT_SCRIPT.
+ Script_info* script;
+ };
// Key of the filename string in the section stringtable.
Stringpool::Key filename_key;
// Position of the entry information in the output section.
unsigned int index;
+
+ // Last modification time of the file.
+ Timespec mtime;
};
typedef std::map<const Input_argument*, Input_info> Inputs_info_map;