From ca7bd5579ab2183c865e3d26f45094fe933eda85 Mon Sep 17 00:00:00 2001 From: Stan Shebs Date: Wed, 26 Jan 1994 02:34:20 +0000 Subject: [PATCH] Tue Jan 25 18:30:34 1994 Stan Shebs (shebs@andros.cygnus.com) * as.c (quiet_flag): New flag. (main): If -noquiet given, display execution time and memory used. --- gas/ChangeLog | 5 +++++ gas/as.c | 32 +++++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 751a333db0f..c7e60f268b0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +Tue Jan 25 18:30:34 1994 Stan Shebs (shebs@andros.cygnus.com) + + * as.c (quiet_flag): New flag. + (main): If -noquiet given, display execution time and memory used. + Tue Jan 25 15:53:11 1994 Jeffrey A. Law (law@snake.cs.utah.edu) * doc/{all.texi,as.texinfo}: Add documentation for HPPA port. diff --git a/gas/as.c b/gas/as.c index d38301c16a3..cf34a67f23d 100644 --- a/gas/as.c +++ b/gas/as.c @@ -1,5 +1,5 @@ /* as.c - GAS main program. - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright (C) 1987, 1990, 1991, 1992, 1994 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -72,6 +72,11 @@ char *myname; /* argv[0] */ segT reg_section, expr_section; segT text_section, data_section, bss_section; #endif + +/* This is true if the assembler should not produce any timing info. */ + +static int quiet_flag = 1; + void print_version_id () @@ -98,6 +103,7 @@ main (argc, argv) char *arg; /* an arg to program */ char a; /* an arg flag (after -) */ int keep_it; + long start_time = get_run_time (); #if 0 /* do we need any of this?? */ { @@ -266,6 +272,18 @@ main (argc, argv) arg = ""; /* Finished with this arg. */ break; + case 'n': + if (*arg && strcmp(arg, "oquiet") == 0) + quiet_flag = 0; + else if (*arg && strcmp(arg, "ocpp") == 0) + ; + else + { + as_warn ("Unknown option `-n%s' ignored", arg); + arg += strlen (arg); + break; + } + case 'R': /* -R means put data into text segment */ flag_readonly_data_in_text = 1; @@ -363,6 +381,18 @@ main (argc, argv) md_end (); #endif + if (!quiet_flag) + { + extern char **environ; + char *lim = (char *) sbrk (0); + long run_time = get_run_time () - start_time; + + fprintf (stderr, "%s: total time in assembly: %d.%06d\n", + myname, run_time / 1000000, run_time % 1000000); + fprintf (stderr, "%s: data size %ld\n", + myname, (long) (lim - (char *) &environ)); + } + if ((had_warnings () && flagseen['Z']) || had_errors () > 0) return EXIT_FAILURE; -- 2.30.2