summaryrefslogtreecommitdiff
path: root/gcc/gensupport.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-18 22:05:15 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-05-18 22:05:15 +0000
commitf950cdc797e920041b0672a1a7100fd266457cc4 (patch)
treec1e02b20d60f15a0aa07b56f35bf635004419b92 /gcc/gensupport.c
parent3788a7be01ee099f28786ecc490bc6ca2a87919f (diff)
downloadgcc-f950cdc797e920041b0672a1a7100fd266457cc4.tar.gz
* 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 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34000 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gensupport.c')
-rw-r--r--gcc/gensupport.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 534f5531df5..120614bcdfc 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -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;
+}