Commit d2a3ce4e by Richard Sandiford Committed by Richard Sandiford

read-md.h (read_rtx_lineno): Rename to...

gcc/
	* read-md.h (read_rtx_lineno): Rename to...
	(read_md_lineno): ...this.
	(read_rtx_filename): Rename to...
	(read_md_filename): ...this.
	(copy_rtx_ptr_loc): Rename to...
	(copy_md_ptr_loc): ...this.
	(print_rtx_ptr_loc): Rename to...
	(print_md_ptr_loc): ...this.
	* read-md.c: Likewise.  Update references after renaming.
	(string_obstack): Replace RTL with MD in comment.
	(set_rtx_ptr_loc): Rename to...
	(set_md_ptr_loc): ...this.
	(get_rtx_ptr_loc): Rename to...
	(get_md_ptr_loc): ...this.
	* genconditions.c: Update references after renaming.
	* genemit.c: Likewise.
	* genoutput.c: Likewise.
	* genpreds.c: Likewise.
	* gensupport.c: Likewise.
	* read-rtl.c: Likewise.

From-SVN: r160571
parent 10692477
2010-06-10 Richard Sandiford <rdsandiford@googlemail.com> 2010-06-10 Richard Sandiford <rdsandiford@googlemail.com>
* read-md.h (read_rtx_lineno): Rename to...
(read_md_lineno): ...this.
(read_rtx_filename): Rename to...
(read_md_filename): ...this.
(copy_rtx_ptr_loc): Rename to...
(copy_md_ptr_loc): ...this.
(print_rtx_ptr_loc): Rename to...
(print_md_ptr_loc): ...this.
* read-md.c: Likewise. Update references after renaming.
(string_obstack): Replace RTL with MD in comment.
(set_rtx_ptr_loc): Rename to...
(set_md_ptr_loc): ...this.
(get_rtx_ptr_loc): Rename to...
(get_md_ptr_loc): ...this.
* genconditions.c: Update references after renaming.
* genemit.c: Likewise.
* genoutput.c: Likewise.
* genpreds.c: Likewise.
* gensupport.c: Likewise.
* read-rtl.c: Likewise.
2010-06-10 Richard Sandiford <rdsandiford@googlemail.com>
* Makefile.in (READ_MD_H): New variable. * Makefile.in (READ_MD_H): New variable.
(BUILD_RTL): Add build/read-md.o. (BUILD_RTL): Add build/read-md.o.
(lto-wrapper.o): Depend on coretypes.h instead of defaults.h. (lto-wrapper.o): Depend on coretypes.h instead of defaults.h.
......
...@@ -117,7 +117,7 @@ write_one_condition (void **slot, void * ARG_UNUSED (dummy)) ...@@ -117,7 +117,7 @@ write_one_condition (void **slot, void * ARG_UNUSED (dummy))
const struct c_test *test = * (const struct c_test **) slot; const struct c_test *test = * (const struct c_test **) slot;
const char *p; const char *p;
print_rtx_ptr_loc (test->expr); print_md_ptr_loc (test->expr);
fputs (" { \"", stdout); fputs (" { \"", stdout);
for (p = test->expr; *p; p++) for (p = test->expr; *p; p++)
{ {
......
...@@ -399,7 +399,7 @@ gen_insn (rtx insn, int lineno) ...@@ -399,7 +399,7 @@ gen_insn (rtx insn, int lineno)
if (XSTR (insn, 0)[0] == 0 || XSTR (insn, 0)[0] == '*') if (XSTR (insn, 0)[0] == 0 || XSTR (insn, 0)[0] == '*')
return; return;
printf ("/* %s:%d */\n", read_rtx_filename, lineno); printf ("/* %s:%d */\n", read_md_filename, lineno);
/* Find out how many operands this function has. */ /* Find out how many operands this function has. */
operands = max_operand_vec (insn, 1); operands = max_operand_vec (insn, 1);
...@@ -514,7 +514,7 @@ gen_expand (rtx expand) ...@@ -514,7 +514,7 @@ gen_expand (rtx expand)
/* Output the special code to be executed before the sequence /* Output the special code to be executed before the sequence
is generated. */ is generated. */
print_rtx_ptr_loc (XSTR (expand, 3)); print_md_ptr_loc (XSTR (expand, 3));
printf ("%s\n", XSTR (expand, 3)); printf ("%s\n", XSTR (expand, 3));
/* Output code to copy the arguments back out of `operands' /* Output code to copy the arguments back out of `operands'
...@@ -643,7 +643,7 @@ gen_split (rtx split) ...@@ -643,7 +643,7 @@ gen_split (rtx split)
if (XSTR (split, 3)) if (XSTR (split, 3))
{ {
print_rtx_ptr_loc (XSTR (split, 3)); print_md_ptr_loc (XSTR (split, 3));
printf ("%s\n", XSTR (split, 3)); printf ("%s\n", XSTR (split, 3));
} }
...@@ -888,17 +888,17 @@ from the machine description file `md'. */\n\n"); ...@@ -888,17 +888,17 @@ from the machine description file `md'. */\n\n");
break; break;
case DEFINE_EXPAND: case DEFINE_EXPAND:
printf ("/* %s:%d */\n", read_rtx_filename, line_no); printf ("/* %s:%d */\n", read_md_filename, line_no);
gen_expand (desc); gen_expand (desc);
break; break;
case DEFINE_SPLIT: case DEFINE_SPLIT:
printf ("/* %s:%d */\n", read_rtx_filename, line_no); printf ("/* %s:%d */\n", read_md_filename, line_no);
gen_split (desc); gen_split (desc);
break; break;
case DEFINE_PEEPHOLE2: case DEFINE_PEEPHOLE2:
printf ("/* %s:%d */\n", read_rtx_filename, line_no); printf ("/* %s:%d */\n", read_md_filename, line_no);
gen_split (desc); gen_split (desc);
break; break;
......
...@@ -673,7 +673,7 @@ process_template (struct data *d, const char *template_code) ...@@ -673,7 +673,7 @@ process_template (struct data *d, const char *template_code)
printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n", printf ("output_%d (rtx *operands ATTRIBUTE_UNUSED, rtx insn ATTRIBUTE_UNUSED)\n",
d->code_number); d->code_number);
puts ("{"); puts ("{");
print_rtx_ptr_loc (template_code); print_md_ptr_loc (template_code);
puts (template_code + 1); puts (template_code + 1);
puts ("}"); puts ("}");
} }
...@@ -861,7 +861,7 @@ gen_insn (rtx insn, int lineno) ...@@ -861,7 +861,7 @@ gen_insn (rtx insn, int lineno)
d->code_number = next_code_number; d->code_number = next_code_number;
d->index_number = next_index_number; d->index_number = next_index_number;
d->filename = read_rtx_filename; d->filename = read_md_filename;
d->lineno = lineno; d->lineno = lineno;
if (XSTR (insn, 0)[0]) if (XSTR (insn, 0)[0])
d->name = XSTR (insn, 0); d->name = XSTR (insn, 0);
...@@ -906,7 +906,7 @@ gen_peephole (rtx peep, int lineno) ...@@ -906,7 +906,7 @@ gen_peephole (rtx peep, int lineno)
d->code_number = next_code_number; d->code_number = next_code_number;
d->index_number = next_index_number; d->index_number = next_index_number;
d->filename = read_rtx_filename; d->filename = read_md_filename;
d->lineno = lineno; d->lineno = lineno;
d->name = 0; d->name = 0;
...@@ -945,7 +945,7 @@ gen_expand (rtx insn, int lineno) ...@@ -945,7 +945,7 @@ gen_expand (rtx insn, int lineno)
d->code_number = next_code_number; d->code_number = next_code_number;
d->index_number = next_index_number; d->index_number = next_index_number;
d->filename = read_rtx_filename; d->filename = read_md_filename;
d->lineno = lineno; d->lineno = lineno;
if (XSTR (insn, 0)[0]) if (XSTR (insn, 0)[0])
d->name = XSTR (insn, 0); d->name = XSTR (insn, 0);
...@@ -990,7 +990,7 @@ gen_split (rtx split, int lineno) ...@@ -990,7 +990,7 @@ gen_split (rtx split, int lineno)
d->code_number = next_code_number; d->code_number = next_code_number;
d->index_number = next_index_number; d->index_number = next_index_number;
d->filename = read_rtx_filename; d->filename = read_md_filename;
d->lineno = lineno; d->lineno = lineno;
d->name = 0; d->name = 0;
......
...@@ -184,7 +184,7 @@ write_predicate_subfunction (struct pred_data *p) ...@@ -184,7 +184,7 @@ write_predicate_subfunction (struct pred_data *p)
printf ("static inline int\n" printf ("static inline int\n"
"%s_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)\n", "%s_1 (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)\n",
p->name); p->name);
print_rtx_ptr_loc (p->c_block); print_md_ptr_loc (p->c_block);
if (p->c_block[0] == '{') if (p->c_block[0] == '{')
fputs (p->c_block, stdout); fputs (p->c_block, stdout);
else else
......
...@@ -230,11 +230,11 @@ process_include (rtx desc, int lineno) ...@@ -230,11 +230,11 @@ process_include (rtx desc, int lineno)
/* Save old cursor; setup new for the new file. Note that "lineno" the /* Save old cursor; setup new for the new file. Note that "lineno" the
argument to this function is the beginning of the include statement, argument to this function is the beginning of the include statement,
while read_rtx_lineno has already been advanced. */ while read_md_lineno has already been advanced. */
old_filename = read_rtx_filename; old_filename = read_md_filename;
old_lineno = read_rtx_lineno; old_lineno = read_md_lineno;
read_rtx_filename = pathname; read_md_filename = pathname;
read_rtx_lineno = 1; read_md_lineno = 1;
if (include_callback) if (include_callback)
include_callback (pathname); include_callback (pathname);
...@@ -246,8 +246,8 @@ process_include (rtx desc, int lineno) ...@@ -246,8 +246,8 @@ process_include (rtx desc, int lineno)
/* Do not free pathname. It is attached to the various rtx queue /* Do not free pathname. It is attached to the various rtx queue
elements. */ elements. */
read_rtx_filename = old_filename; read_md_filename = old_filename;
read_rtx_lineno = old_lineno; read_md_lineno = old_lineno;
fclose (input_file); fclose (input_file);
} }
...@@ -260,15 +260,15 @@ process_rtx (rtx desc, int lineno) ...@@ -260,15 +260,15 @@ process_rtx (rtx desc, int lineno)
switch (GET_CODE (desc)) switch (GET_CODE (desc))
{ {
case DEFINE_INSN: case DEFINE_INSN:
queue_pattern (desc, &define_insn_tail, read_rtx_filename, lineno); queue_pattern (desc, &define_insn_tail, read_md_filename, lineno);
break; break;
case DEFINE_COND_EXEC: case DEFINE_COND_EXEC:
queue_pattern (desc, &define_cond_exec_tail, read_rtx_filename, lineno); queue_pattern (desc, &define_cond_exec_tail, read_md_filename, lineno);
break; break;
case DEFINE_ATTR: case DEFINE_ATTR:
queue_pattern (desc, &define_attr_tail, read_rtx_filename, lineno); queue_pattern (desc, &define_attr_tail, read_md_filename, lineno);
break; break;
case DEFINE_PREDICATE: case DEFINE_PREDICATE:
...@@ -277,7 +277,7 @@ process_rtx (rtx desc, int lineno) ...@@ -277,7 +277,7 @@ process_rtx (rtx desc, int lineno)
case DEFINE_REGISTER_CONSTRAINT: case DEFINE_REGISTER_CONSTRAINT:
case DEFINE_MEMORY_CONSTRAINT: case DEFINE_MEMORY_CONSTRAINT:
case DEFINE_ADDRESS_CONSTRAINT: case DEFINE_ADDRESS_CONSTRAINT:
queue_pattern (desc, &define_pred_tail, read_rtx_filename, lineno); queue_pattern (desc, &define_pred_tail, read_md_filename, lineno);
break; break;
case INCLUDE: case INCLUDE:
...@@ -309,7 +309,7 @@ process_rtx (rtx desc, int lineno) ...@@ -309,7 +309,7 @@ process_rtx (rtx desc, int lineno)
split_cond = XSTR (desc, 4); split_cond = XSTR (desc, 4);
if (split_cond[0] == '&' && split_cond[1] == '&') if (split_cond[0] == '&' && split_cond[1] == '&')
{ {
copy_rtx_ptr_loc (split_cond + 2, split_cond); copy_md_ptr_loc (split_cond + 2, split_cond);
split_cond = join_c_conditions (XSTR (desc, 2), split_cond + 2); split_cond = join_c_conditions (XSTR (desc, 2), split_cond + 2);
} }
XSTR (split, 1) = split_cond; XSTR (split, 1) = split_cond;
...@@ -323,16 +323,16 @@ process_rtx (rtx desc, int lineno) ...@@ -323,16 +323,16 @@ process_rtx (rtx desc, int lineno)
/* Queue them. */ /* Queue them. */
insn_elem insn_elem
= queue_pattern (desc, &define_insn_tail, read_rtx_filename, = queue_pattern (desc, &define_insn_tail, read_md_filename,
lineno); lineno);
split_elem split_elem
= queue_pattern (split, &other_tail, read_rtx_filename, lineno); = queue_pattern (split, &other_tail, read_md_filename, lineno);
insn_elem->split = split_elem; insn_elem->split = split_elem;
break; break;
} }
default: default:
queue_pattern (desc, &other_tail, read_rtx_filename, lineno); queue_pattern (desc, &other_tail, read_md_filename, lineno);
break; break;
} }
} }
...@@ -865,7 +865,7 @@ process_one_cond_exec (struct queue_elem *ce_elem) ...@@ -865,7 +865,7 @@ process_one_cond_exec (struct queue_elem *ce_elem)
XVECEXP (split, 2, i) = pattern; XVECEXP (split, 2, i) = pattern;
} }
/* Add the new split to the queue. */ /* Add the new split to the queue. */
queue_pattern (split, &other_tail, read_rtx_filename, queue_pattern (split, &other_tail, read_md_filename,
insn_elem->split->lineno); insn_elem->split->lineno);
} }
} }
...@@ -988,8 +988,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *)) ...@@ -988,8 +988,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *))
fatal ("cannot read standard input twice"); fatal ("cannot read standard input twice");
base_dir = NULL; base_dir = NULL;
read_rtx_filename = in_fname = "<stdin>"; read_md_filename = in_fname = "<stdin>";
read_rtx_lineno = 1; read_md_lineno = 1;
input_file = stdin; input_file = stdin;
already_read_stdin = true; already_read_stdin = true;
...@@ -1018,8 +1018,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *)) ...@@ -1018,8 +1018,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *))
else else
base_dir = NULL; base_dir = NULL;
read_rtx_filename = in_fname; read_md_filename = in_fname;
read_rtx_lineno = 1; read_md_lineno = 1;
input_file = fopen (in_fname, "r"); input_file = fopen (in_fname, "r");
if (input_file == 0) if (input_file == 0)
{ {
...@@ -1037,8 +1037,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *)) ...@@ -1037,8 +1037,8 @@ init_md_reader_args_cb (int argc, char **argv, bool (*parse_opt)(const char *))
if (!in_fname) if (!in_fname)
{ {
base_dir = NULL; base_dir = NULL;
read_rtx_filename = in_fname = "<stdin>"; read_md_filename = in_fname = "<stdin>";
read_rtx_lineno = 1; read_md_lineno = 1;
input_file = stdin; input_file = stdin;
while (read_rtx (input_file, &desc, &lineno)) while (read_rtx (input_file, &desc, &lineno))
...@@ -1086,7 +1086,7 @@ read_md_rtx (int *lineno, int *seqnr) ...@@ -1086,7 +1086,7 @@ read_md_rtx (int *lineno, int *seqnr)
elem = *queue; elem = *queue;
*queue = elem->next; *queue = elem->next;
desc = elem->data; desc = elem->data;
read_rtx_filename = elem->filename; read_md_filename = elem->filename;
*lineno = elem->lineno; *lineno = elem->lineno;
*seqnr = sequence_num; *seqnr = sequence_num;
......
...@@ -33,7 +33,7 @@ struct ptr_loc { ...@@ -33,7 +33,7 @@ struct ptr_loc {
int lineno; int lineno;
}; };
/* Obstack used for allocating RTL strings. */ /* Obstack used for allocating MD strings. */
struct obstack string_obstack; struct obstack string_obstack;
/* A table of ptr_locs, hashed on the PTR field. */ /* A table of ptr_locs, hashed on the PTR field. */
...@@ -45,7 +45,7 @@ static struct obstack ptr_loc_obstack; ...@@ -45,7 +45,7 @@ static struct obstack ptr_loc_obstack;
/* A hash table of triples (A, B, C), where each of A, B and C is a condition /* A hash table of triples (A, B, C), where each of A, B and C is a condition
and A is equivalent to "B && C". This is used to keep track of the source and A is equivalent to "B && C". This is used to keep track of the source
of conditions that are made up of separate rtx strings (such as the split of conditions that are made up of separate MD strings (such as the split
condition of a define_insn_and_split). */ condition of a define_insn_and_split). */
static htab_t joined_conditions; static htab_t joined_conditions;
...@@ -53,10 +53,10 @@ static htab_t joined_conditions; ...@@ -53,10 +53,10 @@ static htab_t joined_conditions;
static struct obstack joined_conditions_obstack; static struct obstack joined_conditions_obstack;
/* The current line number for the file. */ /* The current line number for the file. */
int read_rtx_lineno = 1; int read_md_lineno = 1;
/* The filename for error reporting. */ /* The filename for error reporting. */
const char *read_rtx_filename = "<unknown>"; const char *read_md_filename = "<unknown>";
/* Return a hash value for the pointer pointed to by DEF. */ /* Return a hash value for the pointer pointed to by DEF. */
...@@ -77,7 +77,7 @@ leading_ptr_eq_p (const void *def1, const void *def2) ...@@ -77,7 +77,7 @@ leading_ptr_eq_p (const void *def1, const void *def2)
/* Associate PTR with the file position given by FILENAME and LINENO. */ /* Associate PTR with the file position given by FILENAME and LINENO. */
static void static void
set_rtx_ptr_loc (const void *ptr, const char *filename, int lineno) set_md_ptr_loc (const void *ptr, const char *filename, int lineno)
{ {
struct ptr_loc *loc; struct ptr_loc *loc;
...@@ -93,7 +93,7 @@ set_rtx_ptr_loc (const void *ptr, const char *filename, int lineno) ...@@ -93,7 +93,7 @@ set_rtx_ptr_loc (const void *ptr, const char *filename, int lineno)
position was set. */ position was set. */
static const struct ptr_loc * static const struct ptr_loc *
get_rtx_ptr_loc (const void *ptr) get_md_ptr_loc (const void *ptr)
{ {
return (const struct ptr_loc *) htab_find (ptr_locs, &ptr); return (const struct ptr_loc *) htab_find (ptr_locs, &ptr);
} }
...@@ -101,20 +101,20 @@ get_rtx_ptr_loc (const void *ptr) ...@@ -101,20 +101,20 @@ get_rtx_ptr_loc (const void *ptr)
/* Associate NEW_PTR with the same file position as OLD_PTR. */ /* Associate NEW_PTR with the same file position as OLD_PTR. */
void void
copy_rtx_ptr_loc (const void *new_ptr, const void *old_ptr) copy_md_ptr_loc (const void *new_ptr, const void *old_ptr)
{ {
const struct ptr_loc *loc = get_rtx_ptr_loc (old_ptr); const struct ptr_loc *loc = get_md_ptr_loc (old_ptr);
if (loc != 0) if (loc != 0)
set_rtx_ptr_loc (new_ptr, loc->filename, loc->lineno); set_md_ptr_loc (new_ptr, loc->filename, loc->lineno);
} }
/* If PTR is associated with a known file position, print a #line /* If PTR is associated with a known file position, print a #line
directive for it. */ directive for it. */
void void
print_rtx_ptr_loc (const void *ptr) print_md_ptr_loc (const void *ptr)
{ {
const struct ptr_loc *loc = get_rtx_ptr_loc (ptr); const struct ptr_loc *loc = get_md_ptr_loc (ptr);
if (loc != 0) if (loc != 0)
printf ("#line %d \"%s\"\n", loc->lineno, loc->filename); printf ("#line %d \"%s\"\n", loc->lineno, loc->filename);
} }
...@@ -166,7 +166,7 @@ print_c_condition (const char *cond) ...@@ -166,7 +166,7 @@ print_c_condition (const char *cond)
else else
{ {
putc ('\n', stdout); putc ('\n', stdout);
print_rtx_ptr_loc (cond); print_md_ptr_loc (cond);
printf ("(%s)", cond); printf ("(%s)", cond);
} }
} }
...@@ -181,7 +181,7 @@ message_with_line (int lineno, const char *msg, ...) ...@@ -181,7 +181,7 @@ message_with_line (int lineno, const char *msg, ...)
va_start (ap, msg); va_start (ap, msg);
fprintf (stderr, "%s:%d: ", read_rtx_filename, lineno); fprintf (stderr, "%s:%d: ", read_md_filename, lineno);
vfprintf (stderr, msg, ap); vfprintf (stderr, msg, ap);
fputc ('\n', stderr); fputc ('\n', stderr);
...@@ -201,7 +201,7 @@ fatal_with_file_and_line (FILE *infile, const char *msg, ...) ...@@ -201,7 +201,7 @@ fatal_with_file_and_line (FILE *infile, const char *msg, ...)
va_start (ap, msg); va_start (ap, msg);
fprintf (stderr, "%s:%d: ", read_rtx_filename, read_rtx_lineno); fprintf (stderr, "%s:%d: ", read_md_filename, read_md_lineno);
vfprintf (stderr, msg, ap); vfprintf (stderr, msg, ap);
putc ('\n', stderr); putc ('\n', stderr);
...@@ -218,7 +218,7 @@ fatal_with_file_and_line (FILE *infile, const char *msg, ...) ...@@ -218,7 +218,7 @@ fatal_with_file_and_line (FILE *infile, const char *msg, ...)
context[i] = '\0'; context[i] = '\0';
fprintf (stderr, "%s:%d: following context is `%s'\n", fprintf (stderr, "%s:%d: following context is `%s'\n",
read_rtx_filename, read_rtx_lineno, context); read_md_filename, read_md_lineno, context);
va_end (ap); va_end (ap);
exit (1); exit (1);
...@@ -253,7 +253,7 @@ read_skip_spaces (FILE *infile) ...@@ -253,7 +253,7 @@ read_skip_spaces (FILE *infile)
switch (c) switch (c)
{ {
case '\n': case '\n':
read_rtx_lineno++; read_md_lineno++;
break; break;
case ' ': case '\t': case '\f': case '\r': case ' ': case '\t': case '\f': case '\r':
...@@ -263,7 +263,7 @@ read_skip_spaces (FILE *infile) ...@@ -263,7 +263,7 @@ read_skip_spaces (FILE *infile)
do do
c = getc (infile); c = getc (infile);
while (c != '\n' && c != EOF); while (c != '\n' && c != EOF);
read_rtx_lineno++; read_md_lineno++;
break; break;
case '/': case '/':
...@@ -277,7 +277,7 @@ read_skip_spaces (FILE *infile) ...@@ -277,7 +277,7 @@ read_skip_spaces (FILE *infile)
while ((c = getc (infile)) && c != EOF) while ((c = getc (infile)) && c != EOF)
{ {
if (c == '\n') if (c == '\n')
read_rtx_lineno++; read_md_lineno++;
else if (prevc == '*' && c == '/') else if (prevc == '*' && c == '/')
break; break;
prevc = c; prevc = c;
...@@ -303,7 +303,7 @@ read_escape (FILE *infile) ...@@ -303,7 +303,7 @@ read_escape (FILE *infile)
{ {
/* Backslash-newline is replaced by nothing, as in C. */ /* Backslash-newline is replaced by nothing, as in C. */
case '\n': case '\n':
read_rtx_lineno++; read_md_lineno++;
return; return;
/* \" \' \\ are replaced by the second character. */ /* \" \' \\ are replaced by the second character. */
...@@ -336,7 +336,7 @@ read_escape (FILE *infile) ...@@ -336,7 +336,7 @@ read_escape (FILE *infile)
/* pass anything else through, but issue a warning. */ /* pass anything else through, but issue a warning. */
default: default:
fprintf (stderr, "%s:%d: warning: unrecognized escape \\%c\n", fprintf (stderr, "%s:%d: warning: unrecognized escape \\%c\n",
read_rtx_filename, read_rtx_lineno, c); read_md_filename, read_md_lineno, c);
obstack_1grow (&string_obstack, '\\'); obstack_1grow (&string_obstack, '\\');
break; break;
} }
...@@ -356,7 +356,7 @@ read_quoted_string (FILE *infile) ...@@ -356,7 +356,7 @@ read_quoted_string (FILE *infile)
{ {
c = getc (infile); /* Read the string */ c = getc (infile); /* Read the string */
if (c == '\n') if (c == '\n')
read_rtx_lineno++; read_md_lineno++;
else if (c == '\\') else if (c == '\\')
{ {
read_escape (infile); read_escape (infile);
...@@ -381,7 +381,7 @@ read_braced_string (FILE *infile) ...@@ -381,7 +381,7 @@ read_braced_string (FILE *infile)
{ {
int c; int c;
int brace_depth = 1; /* caller-processed */ int brace_depth = 1; /* caller-processed */
unsigned long starting_read_rtx_lineno = read_rtx_lineno; unsigned long starting_read_md_lineno = read_md_lineno;
obstack_1grow (&string_obstack, '{'); obstack_1grow (&string_obstack, '{');
while (brace_depth) while (brace_depth)
...@@ -389,7 +389,7 @@ read_braced_string (FILE *infile) ...@@ -389,7 +389,7 @@ read_braced_string (FILE *infile)
c = getc (infile); /* Read the string */ c = getc (infile); /* Read the string */
if (c == '\n') if (c == '\n')
read_rtx_lineno++; read_md_lineno++;
else if (c == '{') else if (c == '{')
brace_depth++; brace_depth++;
else if (c == '}') else if (c == '}')
...@@ -402,7 +402,7 @@ read_braced_string (FILE *infile) ...@@ -402,7 +402,7 @@ read_braced_string (FILE *infile)
else if (c == EOF) else if (c == EOF)
fatal_with_file_and_line fatal_with_file_and_line
(infile, "missing closing } for opening brace on line %lu", (infile, "missing closing } for opening brace on line %lu",
starting_read_rtx_lineno); starting_read_md_lineno);
obstack_1grow (&string_obstack, c); obstack_1grow (&string_obstack, c);
} }
...@@ -429,7 +429,7 @@ read_string (FILE *infile, int star_if_braced) ...@@ -429,7 +429,7 @@ read_string (FILE *infile, int star_if_braced)
c = read_skip_spaces (infile); c = read_skip_spaces (infile);
} }
old_lineno = read_rtx_lineno; old_lineno = read_md_lineno;
if (c == '"') if (c == '"')
stringbuf = read_quoted_string (infile); stringbuf = read_quoted_string (infile);
else if (c == '{') else if (c == '{')
...@@ -448,7 +448,7 @@ read_string (FILE *infile, int star_if_braced) ...@@ -448,7 +448,7 @@ read_string (FILE *infile, int star_if_braced)
fatal_expected_char (infile, ')', c); fatal_expected_char (infile, ')', c);
} }
set_rtx_ptr_loc (stringbuf, read_rtx_filename, old_lineno); set_md_ptr_loc (stringbuf, read_md_filename, old_lineno);
return stringbuf; return stringbuf;
} }
......
...@@ -21,12 +21,12 @@ along with GCC; see the file COPYING3. If not see ...@@ -21,12 +21,12 @@ along with GCC; see the file COPYING3. If not see
#include "obstack.h" #include "obstack.h"
extern int read_rtx_lineno; extern int read_md_lineno;
extern const char *read_rtx_filename; extern const char *read_md_filename;
extern struct obstack string_obstack; extern struct obstack string_obstack;
extern void copy_rtx_ptr_loc (const void *, const void *); extern void copy_md_ptr_loc (const void *, const void *);
extern void print_rtx_ptr_loc (const void *); extern void print_md_ptr_loc (const void *);
extern const char *join_c_conditions (const char *, const char *); extern const char *join_c_conditions (const char *, const char *);
extern void print_c_condition (const char *); extern void print_c_condition (const char *);
extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2; extern void message_with_line (int, const char *, ...) ATTRIBUTE_PRINTF_2;
......
...@@ -319,7 +319,7 @@ apply_iterator_to_string (const char *string, struct mapping *iterator, int valu ...@@ -319,7 +319,7 @@ apply_iterator_to_string (const char *string, struct mapping *iterator, int valu
{ {
obstack_grow (&string_obstack, base, strlen (base) + 1); obstack_grow (&string_obstack, base, strlen (base) + 1);
copy = XOBFINISH (&string_obstack, char *); copy = XOBFINISH (&string_obstack, char *);
copy_rtx_ptr_loc (copy, string); copy_md_ptr_loc (copy, string);
return copy; return copy;
} }
return string; return string;
...@@ -647,7 +647,7 @@ read_name (char *str, FILE *infile) ...@@ -647,7 +647,7 @@ read_name (char *str, FILE *infile)
if (p == str) if (p == str)
fatal_with_file_and_line (infile, "missing name or number"); fatal_with_file_and_line (infile, "missing name or number");
if (c == '\n') if (c == '\n')
read_rtx_lineno++; read_md_lineno++;
*p = 0; *p = 0;
...@@ -999,7 +999,7 @@ read_rtx (FILE *infile, rtx *x, int *lineno) ...@@ -999,7 +999,7 @@ read_rtx (FILE *infile, rtx *x, int *lineno)
return false; return false;
ungetc (c, infile); ungetc (c, infile);
queue_lineno = read_rtx_lineno; queue_lineno = read_md_lineno;
mode_maps = 0; mode_maps = 0;
from_file = read_rtx_1 (infile, &mode_maps); from_file = read_rtx_1 (infile, &mode_maps);
if (from_file == 0) if (from_file == 0)
...@@ -1229,14 +1229,14 @@ read_rtx_1 (FILE *infile, struct map_value **mode_maps) ...@@ -1229,14 +1229,14 @@ read_rtx_1 (FILE *infile, struct map_value **mode_maps)
|| GET_CODE (return_rtx) == DEFINE_INSN_AND_SPLIT)) || GET_CODE (return_rtx) == DEFINE_INSN_AND_SPLIT))
{ {
char line_name[20]; char line_name[20];
const char *fn = (read_rtx_filename ? read_rtx_filename : "rtx"); const char *fn = (read_md_filename ? read_md_filename : "rtx");
const char *slash; const char *slash;
for (slash = fn; *slash; slash ++) for (slash = fn; *slash; slash ++)
if (*slash == '/' || *slash == '\\' || *slash == ':') if (*slash == '/' || *slash == '\\' || *slash == ':')
fn = slash + 1; fn = slash + 1;
obstack_1grow (&string_obstack, '*'); obstack_1grow (&string_obstack, '*');
obstack_grow (&string_obstack, fn, strlen (fn)); obstack_grow (&string_obstack, fn, strlen (fn));
sprintf (line_name, ":%d", read_rtx_lineno); sprintf (line_name, ":%d", read_md_lineno);
obstack_grow (&string_obstack, line_name, strlen (line_name)+1); obstack_grow (&string_obstack, line_name, strlen (line_name)+1);
stringbuf = XOBFINISH (&string_obstack, char *); stringbuf = XOBFINISH (&string_obstack, char *);
} }
......
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