mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-15 23:33:03 +00:00
Let --trace have arguments.
* src/getargs.h (enum trace_e): New. * src/getargs.c (trace_args, trace_types, trace_argmatch): New. (long_options, short_options): --trace/-T takes an optional argument. Change all the uses of trace_flag to reflect the new flags. * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets. Strengthen `stage' portability. * m4/stage.m4 (BISON_PREREQ_STAGE): New. * configure.in: Use it. Don't check for malloc.h and sys/times.h. * src/system.h: Include them when appropriate. * src/main.c (stage): Compile only when mallinfo, struct mallinfo, times and struct tms are available.
This commit is contained in:
13
src/main.c
13
src/main.c
@@ -48,16 +48,11 @@ char *program_name;
|
||||
| Tracking space and time. |
|
||||
`--------------------------*/
|
||||
|
||||
#if HAVE_MALLOC_H & HAVE_SYS_TIMES_H
|
||||
# include <malloc.h>
|
||||
# include <sys/times.h>
|
||||
#endif
|
||||
|
||||
static void
|
||||
stage (const char *title)
|
||||
{
|
||||
#if HAVE_MALLOC_H & HAVE_SYS_TIMES_H
|
||||
if (trace_flag)
|
||||
#if HAVE_MALLINFO && HAVE_STRUCT_MALLINFO & HAVE_TIMES & HAVE_STRUCT_TMS
|
||||
if (trace_flag & trace_resource)
|
||||
{
|
||||
struct mallinfo minfo = mallinfo ();
|
||||
struct tms tinfo;
|
||||
@@ -81,7 +76,7 @@ main (int argc, char *argv[])
|
||||
|
||||
getargs (argc, argv);
|
||||
|
||||
if (trace_flag)
|
||||
if (trace_flag & trace_bitsets)
|
||||
bitset_stats_enable ();
|
||||
|
||||
muscle_init ();
|
||||
@@ -171,7 +166,7 @@ main (int argc, char *argv[])
|
||||
alloca (0);
|
||||
#endif
|
||||
|
||||
if (trace_flag)
|
||||
if (trace_flag & trace_bitsets)
|
||||
bitset_stats_dump (stderr);
|
||||
|
||||
return complain_message_count ? EXIT_FAILURE : EXIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user