diff options
author | Zack Weinberg <zack@rabi.columbia.edu> | 1999-04-19 11:55:04 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 1999-04-19 11:55:04 +0000 |
commit | 80e9dcb4b2227b960b43f5356531a004a8565fe1 (patch) | |
tree | ebb02ccf6b002d0d03abebf1a917eaf581d86c4b /gcc/cppinit.c | |
parent | a3f406ce4c9fe47d97f951a48bc1488285f995a9 (diff) | |
download | gcc-80e9dcb4b2227b960b43f5356531a004a8565fe1.zip gcc-80e9dcb4b2227b960b43f5356531a004a8565fe1.tar.gz gcc-80e9dcb4b2227b960b43f5356531a004a8565fe1.tar.bz2 |
cpplib.c (output_line_command): Drop CONDITIONAL argument.
1999-04-19 14:51 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* cpplib.c (output_line_command): Drop CONDITIONAL argument.
We can omit unnecessary line commands if file_change ==
same_file and pfile->lineno != 0. All callers changed.
(cpp_get_token [case '\n']): Don't bump pfile->lineno if
CPP_OPTIONS (pfile)->no_line_commands is set.
* cpplib.h: Fix prototype of output_line_command.
From-SVN: r26547
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index d02a1f9..9b2ecca 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -505,7 +505,7 @@ dump_special_to_buffer (pfile, macro_name) { static char define_directive[] = "#define "; int macro_name_length = strlen (macro_name); - output_line_command (pfile, 0, same_file); + output_line_command (pfile, same_file); CPP_RESERVE (pfile, sizeof(define_directive) + macro_name_length); CPP_PUTS_Q (pfile, define_directive, sizeof(define_directive)-1); CPP_PUTS_Q (pfile, macro_name, macro_name_length); @@ -814,7 +814,7 @@ cpp_start_read (pfile, fname) while (p) { if (opts->debug_output) - output_line_command (pfile, 0, same_file); + output_line_command (pfile, same_file); if (p->undef) cpp_undef (pfile, p->arg); else @@ -829,7 +829,7 @@ cpp_start_read (pfile, fname) while (p) { if (opts->debug_output) - output_line_command (pfile, 0, same_file); + output_line_command (pfile, same_file); if (p->undef) cpp_unassert (pfile, p->arg); else @@ -980,7 +980,7 @@ cpp_start_read (pfile, fname) ih_fake->limit = 0; if (!finclude (pfile, f, ih_fake)) return 0; - output_line_command (pfile, 0, same_file); + output_line_command (pfile, same_file); pfile->only_seen_white = 2; /* The -imacros files can be scanned now, but the -include files @@ -1043,7 +1043,7 @@ cpp_start_read (pfile, fname) ih_fake->buf = (char *)-1; ih_fake->limit = 0; if (finclude (pfile, fd, ih_fake)) - output_line_command (pfile, 0, enter_file); + output_line_command (pfile, enter_file); q = p->next; free (p); @@ -1094,6 +1094,25 @@ cpp_finish (pfile) } } } + + if (opts->dump_macros == dump_only) + { + int i; + HASHNODE *h; + MACRODEF m; + for (i = HASHSIZE; --i >= 0;) + { + for (h = pfile->hashtab[i]; h; h = h->next) + if (h->type == T_MACRO) + { + m.defn = h->value.defn; + m.symnam = h->name; + m.symlen = h->length; + dump_definition (pfile, m); + CPP_PUTC (pfile, '\n'); + } + } + } } /* Handle one command-line option in (argc, argv). |