This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Replace ggc_alloc_string (X, -1) with ggc_strdup.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 29 Jun 2003 00:25:00 -0400 (EDT)
- Subject: [patch] Replace ggc_alloc_string (X, -1) with ggc_strdup.
Hi,
Attached is a patch to replace ggc_alloc_string (X, -1) with
ggc_strdup (X).
Committed as obvious.
Kazu Hirata
2003-06-29 Kazu Hirata <kazu@cs.umass.edu>
* dwarf2out.c (add_AT_string): Replace ggc_alloc_string (X,
-1) with ggc_strdup.
* stmt.c (expand_asm_operands): Likewise.
* config/rs6000/rs6000.md (builtin_setjmp_receiver): Likewise.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.436
diff -u -r1.436 dwarf2out.c
--- dwarf2out.c 25 Jun 2003 06:10:26 -0000 1.436
+++ dwarf2out.c 29 Jun 2003 02:04:39 -0000
@@ -4703,7 +4703,7 @@
if (*slot == NULL)
*slot = ggc_alloc_cleared (sizeof (struct indirect_string_node));
node = (struct indirect_string_node *) *slot;
- node->str = ggc_alloc_string (str, -1);
+ node->str = ggc_strdup (str);
node->refcount++;
attr->dw_attr_next = NULL;
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stmt.c,v
retrieving revision 1.311
diff -u -r1.311 stmt.c
--- stmt.c 27 Jun 2003 09:49:36 -0000 1.311
+++ stmt.c 29 Jun 2003 02:04:51 -0000
@@ -1830,7 +1830,7 @@
sprintf (buffer, "%d", j);
ASM_OPERANDS_INPUT_CONSTRAINT_EXP (body, ninputs - ninout + i)
- = gen_rtx_ASM_INPUT (inout_mode[i], ggc_alloc_string (buffer, -1));
+ = gen_rtx_ASM_INPUT (inout_mode[i], ggc_strdup (buffer));
}
generating_concat_p = old_generating_concat_p;
Index: config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.259
diff -u -r1.259 rs6000.md
--- config/rs6000/rs6000.md 9 Jun 2003 17:16:14 -0000 1.259
+++ config/rs6000/rs6000.md 29 Jun 2003 02:04:54 -0000
@@ -10141,14 +10141,14 @@
if (DEFAULT_ABI == ABI_DARWIN)
{
const char *picbase = machopic_function_base_name ();
- rtx picrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
+ rtx picrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (picbase));
rtx picreg = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
rtx tmplabrtx;
char tmplab[20];
ASM_GENERATE_INTERNAL_LABEL(tmplab, \"LSJR\",
CODE_LABEL_NUMBER (operands[0]));
- tmplabrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (tmplab, -1));
+ tmplabrtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (tmplab));
emit_insn (gen_load_macho_picbase (picreg, tmplabrtx));
emit_insn (gen_macho_correct_pic (picreg, picreg, picrtx, tmplabrtx));