aboutsummaryrefslogtreecommitdiff
path: root/gold/gold.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/gold.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/gold.cc')
-rw-r--r--gold/gold.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index 2700bdb..f455ec8 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -45,6 +45,7 @@
#include "gc.h"
#include "icf.h"
#include "incremental.h"
+#include "timer.h"
namespace gold
{
@@ -487,6 +488,10 @@ queue_middle_tasks(const General_options& options,
Workqueue* workqueue,
Mapfile* mapfile)
{
+ Timer* timer = parameters->timer();
+ if (timer != NULL)
+ timer->stamp(0);
+
// Add any symbols named with -u options to the symbol table.
symtab->add_undefined_symbols_from_command_line(layout);
@@ -786,6 +791,10 @@ queue_final_tasks(const General_options& options,
Workqueue* workqueue,
Output_file* of)
{
+ Timer* timer = parameters->timer();
+ if (timer != NULL)
+ timer->stamp(1);
+
int thread_count = options.thread_count_final();
if (thread_count == 0)
thread_count = std::max(2, input_objects->number_of_input_objects());