aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-10-26 22:27:52 +0000
committerIan Lance Taylor <iant@google.com>2007-10-26 22:27:52 +0000
commite53668912655fc741cb2883f70164d26d84e0327 (patch)
treec5d64c32986e3e6822e3cc600728fcc5f2acb4d5 /gold
parent195e7dc6c1d9ed2d3ea5dca8c7798799383b7341 (diff)
downloadgdb-e53668912655fc741cb2883f70164d26d84e0327.zip
gdb-e53668912655fc741cb2883f70164d26d84e0327.tar.gz
gdb-e53668912655fc741cb2883f70164d26d84e0327.tar.bz2
Simplify some code to avoid extra tests of number of objects.
Diffstat (limited to 'gold')
-rw-r--r--gold/gold.cc24
1 files changed, 6 insertions, 18 deletions
diff --git a/gold/gold.cc b/gold/gold.cc
index b64a97e..9a3a1e6 100644
--- a/gold/gold.cc
+++ b/gold/gold.cc
@@ -114,18 +114,14 @@ queue_initial_tasks(const General_options& options,
Workqueue* workqueue, Input_objects* input_objects,
Symbol_table* symtab, Layout* layout)
{
+ if (cmdline.begin() == cmdline.end())
+ gold_fatal(_("no input files"));
+
int thread_count = options.thread_count_initial();
if (thread_count == 0)
- {
- thread_count = cmdline.number_of_input_files();
- if (thread_count == 0)
- thread_count = 1;
- }
+ thread_count = cmdline.number_of_input_files();
workqueue->set_thread_count(thread_count);
- if (cmdline.begin() == cmdline.end())
- gold_fatal(_("no input files"));
-
// Read the input files. We have to add the symbols to the symbol
// table in order. We do this by creating a separate blocker for
// each input file. We associate the blocker with the following
@@ -170,11 +166,7 @@ queue_middle_tasks(const General_options& options,
int thread_count = options.thread_count_middle();
if (thread_count == 0)
- {
- thread_count = input_objects->number_of_input_objects();
- if (thread_count == 0)
- thread_count = 1;
- }
+ thread_count = input_objects->number_of_input_objects();
workqueue->set_thread_count(thread_count);
// Now we have seen all the input files.
@@ -255,11 +247,7 @@ queue_final_tasks(const General_options& options,
{
int thread_count = options.thread_count_final();
if (thread_count == 0)
- {
- thread_count = input_objects->number_of_input_objects();
- if (thread_count == 0)
- thread_count = 1;
- }
+ thread_count = input_objects->number_of_input_objects();
workqueue->set_thread_count(thread_count);
// Use a blocker to block the final cleanup task.