aboutsummaryrefslogtreecommitdiff
path: root/gold/parameters.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2011-10-18 00:06:10 +0000
committerCary Coutant <ccoutant@google.com>2011-10-18 00:06:10 +0000
commitb490c0bbaf81fb741c6751eff30082883343e2ff (patch)
treefbfdd4a8a314245629467b77cc7fa4203fac6a23 /gold/parameters.cc
parent41835e6a39b581ab4f7fba25e02aba01e50a8521 (diff)
downloadgdb-b490c0bbaf81fb741c6751eff30082883343e2ff.zip
gdb-b490c0bbaf81fb741c6751eff30082883343e2ff.tar.gz
gdb-b490c0bbaf81fb741c6751eff30082883343e2ff.tar.bz2
* gold.cc: Include timer.h.
(queue_middle_tasks): Stamp time. (queue_final_tasks): Likewise. * main.cc (main): Store timer in parameters. Print timers for each pass. * parameters.cc (Parameters::Parameters): Initialize timer_. (Parameters::set_timer): New function. (set_parameters_timer): New function. * parameters.h (Parameters::set_timer): New function. (Parameters::timer): New function. (Parameters::timer_): New data member. (set_parameters_timer): New function. * timer.cc (Timer::stamp): New function. (Timer::get_pass_time): New function. * timer.h (Timer::stamp): New function. (Timer::get_pass_time): New function. (Timer::pass_times_): New data member.
Diffstat (limited to 'gold/parameters.cc')
-rw-r--r--gold/parameters.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/gold/parameters.cc b/gold/parameters.cc
index c14bd1e..7fc5730 100644
--- a/gold/parameters.cc
+++ b/gold/parameters.cc
@@ -64,7 +64,7 @@ Set_parameters_target_once set_parameters_target_once(&static_parameters);
// Class Parameters.
Parameters::Parameters()
- : errors_(NULL), options_(NULL), target_(NULL),
+ : errors_(NULL), timer_(NULL), options_(NULL), target_(NULL),
doing_static_link_valid_(false), doing_static_link_(false),
debug_(0), incremental_mode_(General_options::INCREMENTAL_OFF),
set_parameters_target_once_(&set_parameters_target_once)
@@ -79,6 +79,13 @@ Parameters::set_errors(Errors* errors)
}
void
+Parameters::set_timer(Timer* timer)
+{
+ gold_assert(this->timer_ == NULL);
+ this->timer_ = timer;
+}
+
+void
Parameters::set_options(const General_options* options)
{
gold_assert(!this->options_valid());
@@ -270,6 +277,10 @@ set_parameters_errors(Errors* errors)
{ static_parameters.set_errors(errors); }
void
+set_parameters_timer(Timer* timer)
+{ static_parameters.set_timer(timer); }
+
+void
set_parameters_options(const General_options* options)
{ static_parameters.set_options(options); }