From 75f2446ec3c13eca3fe0c7cfdbb232e760d36596 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 14 Oct 2007 06:49:14 +0000 Subject: Run all error handling through an Errors object. Delete output file on error. --- gold/main.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'gold/main.cc') diff --git a/gold/main.cc b/gold/main.cc index 49b50b2..eda586b 100644 --- a/gold/main.cc +++ b/gold/main.cc @@ -29,6 +29,7 @@ #include "options.h" #include "parameters.h" +#include "errors.h" #include "dirsearch.h" #include "workqueue.h" #include "object.h" @@ -51,6 +52,8 @@ main(int argc, char** argv) program_name = argv[0]; + Errors errors(program_name); + // Handle the command line options. Command_line command_line; command_line.process(argc - 1, argv + 1); @@ -59,7 +62,7 @@ main(int argc, char** argv) if (command_line.options().print_stats()) start_time = get_run_time(); - initialize_parameters(&command_line.options()); + initialize_parameters(&command_line.options(), &errors); // The work queue. Workqueue workqueue(command_line.options()); @@ -100,5 +103,5 @@ main(int argc, char** argv) program_name, static_cast(layout.output_file_size())); } - gold_exit(true); + gold_exit(errors.error_count() == 0); } -- cgit v1.1