Commit 7de4d004 by Neil Booth Committed by Neil Booth

cpphash.h (_cpp_digraph_spellings, [...]): New library-internal prototypes.

	* cpphash.h (_cpp_digraph_spellings, _cpp_process_directive,
	_cpp_can_paste): New library-internal prototypes.
	* cpplex.c (dump_param_spelling, output_line_command,
	output_token, cpp_scan_buffer, cpp_scan_buffer_nooutput,
	cpp_printf, cpp_output_list): Move to cppoutput.c.
	(process_directive, can_paste, digraph_spellings): Add _cpp_ prefix.
	* cppmacro.c (dump_macro_args, cpp_dump_definition) Move to
	cppoutput.c.
	* cppoutput.c (dump_macro_args, cpp_dump_definition, output_token,
	dump_param_spelling, output_line_command, cpp_scan_buffer,
	cpp_scan_buffer_nooutput, cpp_printf, cpp_output_list): Moved
	from elsewhere.
	* Makefile.in: Add cppoutput.c.
	* po/POTFILES.in: Add cppoutput.c.

From-SVN: r36634
parent dcbd43e0
Mon 25-Sep-2000 23:31:45 BST Neil Booth <neilb@earthling.net>
* cpphash.h (_cpp_digraph_spellings, _cpp_process_directive,
_cpp_can_paste): New library-internal prototypes.
* cpplex.c (dump_param_spelling, output_line_command,
output_token, cpp_scan_buffer, cpp_scan_buffer_nooutput,
cpp_printf, cpp_output_list): Move to cppoutput.c.
(process_directive, can_paste, digraph_spellings): Add _cpp_ prefix.
* cppmacro.c (dump_macro_args, cpp_dump_definition) Move to
cppoutput.c.
* cppoutput.c (dump_macro_args, cpp_dump_definition, output_token,
dump_param_spelling, output_line_command, cpp_scan_buffer,
cpp_scan_buffer_nooutput, cpp_printf, cpp_output_list): Moved
from elsewhere.
* Makefile.in: Add cppoutput.c.
* po/POTFILES.in: Add cppoutput.c.
2000-09-25 Richard Henderson <rth@cygnus.com>
* config/ia64/ia64.c (ia64_print_operand): Define 'e' as 64-n.
......
......@@ -1792,7 +1792,7 @@ PREPROCESSOR_DEFINES = \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\"
LIBCPP_OBJS = cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o \
cpphash.o cpperror.o cppinit.o cppdefault.o \
cpphash.o cpperror.o cppinit.o cppdefault.o cppoutput.o \
mkdeps.o prefix.o version.o mbchar.o @extra_cpp_objs@
LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h
......@@ -1814,6 +1814,7 @@ cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS) defaults.h
cpplex.o: cpplex.c $(CONFIG_H) $(LIBCPP_DEPS)
cppmacro.o: cppmacro.c $(CONFIG_H) $(LIBCPP_DEPS)
cppoutput.o: cppoutput.c $(CONFIG_H) $(LIBCPP_DEPS)
cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H)
cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS) $(OBSTACK_H)
cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(SPLAY_TREE_H) mkdeps.h
......
......@@ -231,6 +231,7 @@ extern void _cpp_pop_file_buffer PARAMS ((cpp_reader *, cpp_buffer *));
extern int _cpp_parse_expr PARAMS ((cpp_reader *));
/* In cpplex.c */
extern const unsigned char *_cpp_digraph_spellings[];
extern void _cpp_skip_rest_of_line PARAMS ((cpp_reader *));
extern void _cpp_free_temp_tokens PARAMS ((cpp_reader *));
extern void _cpp_init_input_buffer PARAMS ((cpp_reader *));
......@@ -247,6 +248,7 @@ extern void _cpp_reserve_name_space PARAMS ((cpp_toklist *, unsigned int));
extern void _cpp_expand_name_space PARAMS ((cpp_toklist *, unsigned int));
extern int _cpp_equiv_tokens PARAMS ((const cpp_token *,
const cpp_token *));
extern void _cpp_process_directive PARAMS ((cpp_reader *, const cpp_token *));
extern void _cpp_run_directive PARAMS ((cpp_reader *,
const struct directive *,
const char *, size_t,
......@@ -257,6 +259,8 @@ extern const cpp_token *_cpp_get_token PARAMS ((cpp_reader *));
extern const cpp_token *_cpp_get_raw_token PARAMS ((cpp_reader *));
extern void _cpp_push_token PARAMS ((cpp_reader *, const cpp_token*));
extern const cpp_token *_cpp_glue_header_name PARAMS ((cpp_reader *));
extern enum cpp_ttype _cpp_can_paste PARAMS ((cpp_reader *, const cpp_token *,
const cpp_token *, int *));
/* In cpplib.c */
extern const struct directive *_cpp_check_directive
......
......@@ -40,7 +40,6 @@ struct macro_info
unsigned char flags;
};
static void dump_macro_args PARAMS ((FILE *, const cpp_toklist *));
static void count_params PARAMS ((cpp_reader *, struct macro_info *));
static int is__va_args__ PARAMS ((cpp_reader *, const cpp_token *));
......@@ -577,57 +576,6 @@ _cpp_create_definition (pfile, hp)
return 1;
}
/* Dump the definition of macro MACRO on FP. The format is suitable
to be read back in again. Caller is expected to generate the
"#define NAME" bit. */
void
cpp_dump_definition (pfile, fp, hp)
cpp_reader *pfile;
FILE *fp;
const cpp_hashnode *hp;
{
const cpp_toklist *list = hp->value.expansion;
if (hp->type != T_MACRO)
{
cpp_ice (pfile, "invalid hash type %d in dump_definition", hp->type);
return;
}
if (list->paramc >= 0)
dump_macro_args (fp, list);
putc (' ', fp);
cpp_output_list (pfile, fp, list, list->tokens);
}
static void
dump_macro_args (fp, list)
FILE *fp;
const cpp_toklist *list;
{
int i;
const U_CHAR *param = list->namebuf;
putc ('(', fp);
for (i = 0; i++ < list->paramc;)
{
unsigned int len;
len = ustrlen (param);
if (!(list->flags & VAR_ARGS) || ustrcmp (param, U"__VA_ARGS__"))
ufputs (param, fp);
if (i < list->paramc)
fputs (", ", fp);
else if (list->flags & VAR_ARGS)
fputs ("...", fp);
param += len + 1;
}
putc (')', fp);
}
/* Warn if a token in `string' matches one of the function macro
arguments in `info'. This function assumes that the macro is a
function macro and not an object macro. */
......
This diff is collapsed. Click to expand it.
......@@ -599,6 +599,7 @@ cpplex.c
cpplib.c
cpplib.h
cppmain.c
cppoutput.c
cppspec.c
#crtstuff.c is part of the GCC library
cse.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment