Commit 1b3459d2 by Zack Weinberg Committed by Zack Weinberg

genopinit.c: Use $ for escape sequences in optab patterns.

	* genopinit.c: Use $ for escape sequences in optab patterns.
	Remove backslashes from optab patterns.  Change $A, $B, $C to
	expand to (int) whatever instead of just whatever; remove
	explicit (int) from all optab patterns.

	* gensupport.c (xmalloc, xrealloc, xstrdup): Provide.
	* genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c,
	genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c,
	genrecog.c: Remove private copies of xmalloc, xrealloc, and

From-SVN: r34000
parent 606b4c94
2000-05-18 Zack Weinberg <zack@wolery.cumb.org>
* genopinit.c: Use $ for escape sequences in optab patterns.
Remove backslashes from optab patterns. Change $A, $B, $C to
expand to (int) whatever instead of just whatever; remove
explicit (int) from all optab patterns.
* gensupport.c (xmalloc, xrealloc, xstrdup): Provide.
* genattr.c, genattrtab.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, genopinit.c, genoutput.c, genpeep.c,
genrecog.c: Remove private copies of xmalloc, xrealloc, and
xstrdup.
2000-05-18 Richard Henderson <rth@cygnus.com>
* jump.c (jump_optimize_1): Base minimum insn count during
......
......@@ -183,32 +183,6 @@ write_units (num_units, multiplicity, simultaneity,
printf ("#define INSN_QUEUE_SIZE %d\n", q_size);
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
int
......
......@@ -5856,32 +5856,6 @@ extend_range (range, min, max)
if (range->max < max) range->max = max;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
static rtx
copy_rtx_unchanging (orig)
register rtx orig;
......
......@@ -45,32 +45,6 @@ gen_insn (insn)
insn_code_number);
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
int
......
......@@ -238,33 +238,6 @@ gen_peephole (peep)
for (i = 0; i < XVECLEN (peep, 0); i++)
walk_insn_part (XVECEXP (peep, 0, i), 1, 0);
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
......
......@@ -738,33 +738,6 @@ output_peephole2_scratches (split)
insn_nr++;
}
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
......
......@@ -340,42 +340,6 @@ print_path (path)
}
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
char *
xstrdup (input)
const char *input;
{
register size_t len = strlen (input) + 1;
register char *output = xmalloc (len);
memcpy (output, input, len);
return output;
}
extern int main PARAMS ((int, char **));
int
......
......@@ -186,33 +186,6 @@ gen_insn (insn)
obstack_grow (obstack_ptr, &insn, sizeof (rtx));
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
......
......@@ -862,32 +862,6 @@ gen_split (split)
place_operands (d);
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
......
......@@ -368,32 +368,6 @@ print_code (code)
for (p1 = GET_RTX_NAME (code); *p1; p1++)
putchar (TOUPPER(*p1));
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
extern int main PARAMS ((int, char **));
......
......@@ -2576,42 +2576,6 @@ record_insn_name (code, name)
insn_name_ptr[code] = new;
}
char *
xstrdup (input)
const char *input;
{
register size_t len = strlen (input) + 1;
register char *output = xmalloc (len);
memcpy (output, input, len);
return output;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
static void
debug_decision_2 (test)
struct decision_test *test;
......
......@@ -847,3 +847,40 @@ read_md_rtx (lineno, seqnr)
return desc;
}
/* Until we can use the versions in libiberty. */
char *
xstrdup (input)
const char *input;
{
register size_t len = strlen (input) + 1;
register char *output = xmalloc (len);
memcpy (output, input, len);
return output;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
{
register PTR ptr;
if (old)
ptr = (PTR) realloc (old, size);
else
ptr = (PTR) malloc (size);
if (!ptr)
fatal ("virtual memory exhausted");
return ptr;
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
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