diff options
author | Stan Shebs <shebs@codesourcery.com> | 1994-01-26 02:34:20 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1994-01-26 02:34:20 +0000 |
commit | ca7bd5579ab2183c865e3d26f45094fe933eda85 (patch) | |
tree | 1b883c153c013434c52b93a72092669a9a1d0b8f /gas/as.c | |
parent | 9dcf805766d9959c97f0b3eb9b3130a87fa6c4c1 (diff) | |
download | gdb-ca7bd5579ab2183c865e3d26f45094fe933eda85.zip gdb-ca7bd5579ab2183c865e3d26f45094fe933eda85.tar.gz gdb-ca7bd5579ab2183c865e3d26f45094fe933eda85.tar.bz2 |
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.
Diffstat (limited to 'gas/as.c')
-rw-r--r-- | gas/as.c | 32 |
1 files changed, 31 insertions, 1 deletions
@@ -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; |