summaryrefslogtreecommitdiff
path: root/gcc/rtl.c
diff options
context:
space:
mode:
authordj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-16 15:19:01 +0000
committerdj <dj@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-16 15:19:01 +0000
commit3a25d181ba999da4de7ba8ea475b3ad8ce485f85 (patch)
treee6c08d191a7b37ea863449df2f5678ff741b0852 /gcc/rtl.c
parenta22e2a97034344374260d199c49a7a46ff8ab034 (diff)
downloadgcc-3a25d181ba999da4de7ba8ea475b3ad8ce485f85.tar.gz
* rtl.c (read_rtx): Provide suitable names for unnamed
define_insn and define_insn_and_split patterns, based on file and line numbers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37499 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/rtl.c')
-rw-r--r--gcc/rtl.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/rtl.c b/gcc/rtl.c
index bb986e998b9..1ad5b3c4b82 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -1038,6 +1038,7 @@ read_rtx (infile)
{
int saw_paren = 0;
register char *stringbuf;
+ int saw_anything = 0;
c = read_skip_spaces (infile);
if (c == '(')
@@ -1070,6 +1071,28 @@ read_rtx (infile)
break;
obstack_1grow (&rtl_obstack, c);
+ saw_anything = 1;
+ }
+
+ /* For insn patterns, we want to provide a default name
+ based on the file and line, like "*foo.md:12", if the
+ given name is blank. These are only for define_insn and
+ define_insn_and_split, to aid debugging. */
+ if (!saw_anything
+ && i == 0
+ && (GET_CODE (return_rtx) == DEFINE_INSN
+ || GET_CODE (return_rtx) == DEFINE_INSN_AND_SPLIT))
+ {
+ char line_name[20];
+ const char *fn = (read_rtx_filename ? read_rtx_filename : "rtx");
+ char *slash;
+ for (slash = fn; *slash; slash ++)
+ if (*slash == '/' || *slash == '\\' || *slash == ':')
+ fn = slash + 1;
+ obstack_1grow (&rtl_obstack, '*');
+ obstack_grow (&rtl_obstack, fn, strlen (fn));
+ sprintf (line_name, ":%d", read_rtx_lineno);
+ obstack_grow (&rtl_obstack, line_name, strlen (line_name));
}
obstack_1grow (&rtl_obstack, 0);