* incremental.cc (Sized_incremental_binary::do_file_has_changed):
authorCary Coutant <ccoutant@google.com>
Wed, 6 Jul 2011 22:15:12 +0000 (22:15 +0000)
committerCary Coutant <ccoutant@google.com>
Wed, 6 Jul 2011 22:15:12 +0000 (22:15 +0000)
Check disposition for startup file.
(Incremental_inputs::report_command_line): Ignore
--incremental-startup-unchanged option.
* options.cc (General_options::parse_incremental_startup_unchanged):
New function.
(General_options::General_options): Initialize new data member.
* options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
(General_options): Add --incremental-startup-unchanged option.
(General_options::incremental_startup_disposition): New function.
(General_options::incremental_startup_disposition_): New data member.

gold/ChangeLog
gold/incremental.cc
gold/options.cc
gold/options.h

index 536dea2b940fed37a37983abeaba8ca9756ffb4a..192d6f6a0feae0a809eea1464c59d514be498602 100644 (file)
@@ -1,3 +1,17 @@
+2011-07-06  Cary Coutant  <ccoutant@google.com>
+
+       * incremental.cc (Sized_incremental_binary::do_file_has_changed):
+       Check disposition for startup file.
+       (Incremental_inputs::report_command_line): Ignore
+       --incremental-startup-unchanged option.
+       * options.cc (General_options::parse_incremental_startup_unchanged):
+       New function.
+       (General_options::General_options): Initialize new data member.
+       * options.h (Incremental_disposition): Add INCREMENTAL_STARTUP.
+       (General_options): Add --incremental-startup-unchanged option.
+       (General_options::incremental_startup_disposition): New function.
+       (General_options::incremental_startup_disposition_): New data member.
+
 2011-07-06  Cary Coutant  <ccoutant@google.com>
 
        * incremental.cc (Sized_incremental_binary::setup_readers): Pass
index 0988ed46d55f6f815cce248d9bee83fa531dd234..710effc35149791bcadd74450c8126ba036c836e 100644 (file)
@@ -460,6 +460,12 @@ Sized_incremental_binary<size, big_endian>::do_file_has_changed(
   if (input_argument != NULL)
     disp = input_argument->file().options().incremental_disposition();
 
+  // For files at the beginning of the command line (i.e., those added
+  // implicitly by gcc), check whether the --incremental-startup-unchanged
+  // option was used.
+  if (disp == INCREMENTAL_STARTUP)
+    disp = parameters->options().incremental_startup_disposition();
+
   if (disp != INCREMENTAL_CHECK)
     return disp == INCREMENTAL_CHANGED;
 
@@ -938,6 +944,7 @@ Incremental_inputs::report_command_line(int argc, const char* const* argv)
          || strcmp(argv[i], "--incremental-changed") == 0
          || strcmp(argv[i], "--incremental-unchanged") == 0
          || strcmp(argv[i], "--incremental-unknown") == 0
+         || strcmp(argv[i], "--incremental-startup-unchanged") == 0
          || is_prefix_of("--incremental-base=", argv[i])
          || is_prefix_of("--incremental-patch=", argv[i])
          || is_prefix_of("--debug=", argv[i]))
index 05d6f88dd645d01a5242c31231c69a24cfbaf55b..16699aa7415bb92652e61043073e7ec3c089a8cf 100644 (file)
@@ -397,6 +397,14 @@ General_options::parse_incremental_unknown(const char*, const char*,
   this->incremental_disposition_ = INCREMENTAL_CHECK;
 }
 
+void
+General_options::parse_incremental_startup_unchanged(const char*, const char*,
+                                                    Command_line*)
+{
+  this->implicit_incremental_ = true;
+  this->incremental_startup_disposition_ = INCREMENTAL_UNCHANGED;
+}
+
 void
 General_options::parse_library(const char*, const char* arg,
                                Command_line* cmdline)
@@ -910,7 +918,8 @@ General_options::General_options()
     plugins_(NULL),
     dynamic_list_(),
     incremental_mode_(INCREMENTAL_OFF),
-    incremental_disposition_(INCREMENTAL_CHECK),
+    incremental_disposition_(INCREMENTAL_STARTUP),
+    incremental_startup_disposition_(INCREMENTAL_CHECK),
     implicit_incremental_(false),
     excluded_libs_(),
     symbols_to_retain_(),
index c73bd45444f4ea2cb4b076fd6772353bc2d44c54..230900ab21dcebcd6556ec24efd508e3a7ae8cd1 100644 (file)
@@ -63,6 +63,11 @@ class Script_info;
 
 enum Incremental_disposition
 {
+  // Startup files that appear before the first disposition option.
+  // These will default to INCREMENTAL_CHECK unless the
+  // --incremental-startup-unchanged option is given.
+  // (For files added implicitly by gcc before any user options.)
+  INCREMENTAL_STARTUP,
   // Determine the status from the timestamp (default).
   INCREMENTAL_CHECK,
   // Assume the file changed from the previous build.
@@ -822,6 +827,10 @@ class General_options
   DEFINE_special(incremental_unknown, options::TWO_DASHES, '\0',
                  N_("Use timestamps to check files (default)"), NULL);
 
+  DEFINE_special(incremental_startup_unchanged, options::TWO_DASHES, '\0',
+                 N_("Assume startup files unchanged "
+                   "(files preceding this option)"), NULL);
+
   DEFINE_percent(incremental_patch, options::TWO_DASHES, '\0', 10,
                 N_("Amount of extra space to allocate for patches"),
                 N_("PERCENT"));
@@ -1342,6 +1351,12 @@ class General_options
   incremental_disposition() const
   { return this->incremental_disposition_; }
 
+  // The disposition to use for startup files (those that precede the
+  // first --incremental-changed, etc. option).
+  Incremental_disposition
+  incremental_startup_disposition() const
+  { return this->incremental_startup_disposition_; }
+
   // Return true if S is the name of a library excluded from automatic
   // symbol export.
   bool
@@ -1459,9 +1474,12 @@ class General_options
   // --incremental-unchanged or --incremental-unknown option.  The
   // value may change as we proceed parsing the command line flags.
   Incremental_disposition incremental_disposition_;
+  // The disposition to use for startup files (those marked
+  // INCREMENTAL_STARTUP).
+  Incremental_disposition incremental_startup_disposition_;
   // Whether we have seen one of the options that require incremental
-  // build (--incremental-changed, --incremental-unchanged or
-  // --incremental-unknown)
+  // build (--incremental-changed, --incremental-unchanged,
+  // --incremental-unknown, or --incremental-startup-unchanged).
   bool implicit_incremental_;
   // Libraries excluded from automatic export, via --exclude-libs.
   Unordered_set<std::string> excluded_libs_;
This page took 0.034383 seconds and 4 git commands to generate.