+2002-08-04 Geoffrey Keating <geoffk@redhat.com>
+
+ * Makefile.in (sdbout.o): Doesn't need $(OBSTACK_H).
+ * collect2.h (permanent_obstack): Delete declaration.
+ * collect2.c (permanent_obstack): Delete definition.
+ (main): Don't initialise permanent_obstack. Use xstrdup instead.
+ * expr.c: Don't include obstack.h.
+ (permanent_obstack): Delete declaration.
+ * function.c: Don't include obstack.h.
+ (permanent_obstack): Delete declaration.
+ * integrate.c: Don't include obstack.h.
+ (function_maybepermanent_obstack): Delete declaration.
+ * print-tree.c (debug_tree): Use x*alloc not permalloc.
+ * sdbout.c (gen_fake_label): Use x*alloc not permalloc.
+ * tlink.c (pfgets): Use xstrdup not permanent_obstack.
+ * toplev.c (lang_independent_init): Rename init_obstacks to init_ttree.
+ * tree.h: Rename init_obstacks to init_ttree. Remove declarations
+ of permalloc, expralloc, perm_calloc.
+ * tree.c (permanent_obstack): Delete definition.
+ (init_ttree): Rename from init_obstacks.
+ (permalloc): Delete.
+ (perm_calloc): Delete.
+ (dump_tree_statistics): Don't print information about
+ permanent_obstack.
+ * varasm.c (assemble_start_function): Use xstrdup instead of
+ permalloc/strcpy.
+ (assemble_variable): Likewise.
+ * config/alpha/alpha.c (unicosmk_need_dex): Use xmalloc instead of
+ permalloc.
+ (unicosmk_add_extern): Likewise.
+ * config/c4x/c4x.c (c4x_external_ref): Likewise.
+ (c4x_global_label): Likewise.
+ * config/frv/frv.c (frv_encode_section_info): Likewise.
+ * config/i386/winnt.c (i386_pe_record_external_function): Likewise.
+ (i386_pe_record_exported_symbol): Likewise.
+ * config/mips/mips.c (mips_output_external): Likewise.
+ (mips_output_external_libcall): Likewise.
+ * config/pa/pa.c: (permanent_obstack): Delete declaration.
+ (output_call): Use ggc_strdup instead of allocating on
+ permanent_obstack.
+ * config/romp/romp.c: Include ggc.h.
+ (get_symref): Don't declare permanent_obstack, use ggc_strdup
+ intead of permanent_obstack.
+ * config/rs6000/aix31.h (ASM_OUTPUT_EXTERNAL): Use concat
+ instead of permalloc.
+ * config/rs6000/rs6000.c (rs6000_gen_section_name): Use xmalloc
+ instead of permalloc
+ * config/rs6000/xcoff.h (ASM_OUTPUT_EXTERNAL): Use concat
+ instead of permalloc.
+ * config/vax/vax.c (vms_check_external): Use xmalloc instead of
+ permalloc.
+
2002-08-04 Bernd Schmidt <bernds@redhat.com>
Contribute a port developed primarily by Michael Meissner,
debug.o : debug.c debug.h $(CONFIG_H) $(SYSTEM_H)
sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) flags.h \
function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
- insn-config.h $(OBSTACK_H) xcoffout.h c-pragma.h ggc.h \
+ insn-config.h xcoffout.h c-pragma.h ggc.h \
sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) dwarf.h \
flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
static struct head frame_tables; /* list of frame unwind info tables */
struct obstack temporary_obstack;
-struct obstack permanent_obstack;
char * temporary_firstobj;
/* Holds the return value of pexecute. */
#endif
obstack_begin (&temporary_obstack, 0);
- obstack_begin (&permanent_obstack, 0);
temporary_firstobj = (char *) obstack_alloc (&temporary_obstack, 0);
current_demangling_style = auto_demangling;
{
const char *q = extract_string (&p);
if (*q == '-' && (q[1] == 'm' || q[1] == 'f'))
- *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+ *c_ptr++ = xstrdup (q);
if (strcmp (q, "-EL") == 0 || strcmp (q, "-EB") == 0)
- *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+ *c_ptr++ = xstrdup (q);
if (strcmp (q, "-shared") == 0)
shared_obj = 1;
if (*q == '-' && q[1] == 'B')
{
- *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+ *c_ptr++ = xstrdup (q);
if (q[2] == 0)
{
q = extract_string (&p);
- *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+ *c_ptr++ = xstrdup (q);
}
}
}
extern const char *ldout;
extern const char *c_file_name;
extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
extern char *temporary_firstobj;
extern int vflag, debug;
struct unicosmk_extern_list *p;
p = (struct unicosmk_extern_list *)
- permalloc (sizeof (struct unicosmk_extern_list));
+ xmalloc (sizeof (struct unicosmk_extern_list));
p->next = unicosmk_extern_head;
p->name = name;
unicosmk_extern_head = p;
--i;
}
- dex = (struct unicosmk_dex *) permalloc (sizeof (struct unicosmk_dex));
+ dex = (struct unicosmk_dex *) xmalloc (sizeof (struct unicosmk_dex));
dex->name = name;
dex->next = unicosmk_dex_list;
unicosmk_dex_list = dex;
return;
p = p->next;
}
- p = (struct name_list *) permalloc (sizeof *p);
+ p = (struct name_list *) xmalloc (sizeof *p);
p->next = global_head;
p->name = name;
global_head = p;
return;
p = p->next;
}
- p = (struct name_list *) permalloc (sizeof *p);
+ p = (struct name_list *) xmalloc (sizeof *p);
p->next = extern_head;
p->name = name;
extern_head = p;
if (is_small)
{
rtx sym_ref = XEXP (DECL_RTL (decl), 0);
- char * str = permalloc (2 + strlen (XSTR (sym_ref, 0)));
+ char * str = xmalloc (2 + strlen (XSTR (sym_ref, 0)));
str[0] = SDATA_FLAG_CHAR;
strcpy (&str[1], XSTR (sym_ref, 0));
{
struct extern_list *p;
- p = (struct extern_list *) permalloc (sizeof *p);
+ p = (struct extern_list *) xmalloc (sizeof *p);
p->next = extern_head;
p->name = name;
extern_head = p;
{
struct export_list *p;
- p = (struct export_list *) permalloc (sizeof *p);
+ p = (struct export_list *) xmalloc (sizeof *p);
p->next = export_head;
p->name = name;
p->is_data = is_data;
|| strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0
|| strcmp (TREE_STRING_POINTER (section_name), ".sdata") == 0))
{
- p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+ p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
p->next = extern_head;
p->name = name;
p->size = len;
bootstrap under Irix 5.1. */
&& strcmp (name, "__builtin_next_arg"))
{
- p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+ p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
p->next = extern_head;
p->name = name;
p->size = -1;
{
register struct extern_list *p;
- p = (struct extern_list *) permalloc (sizeof (struct extern_list));
+ p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
p->next = extern_head;
p->name = name;
p->size = -1;
return "";
}
-extern struct obstack permanent_obstack;
-
/* INSN is either a function call. It may have an unconditional jump
in its delay slot.
i = n_deferred_plabels++;
deferred_plabels[i].internal_label = gen_label_rtx ();
- deferred_plabels[i].name = obstack_alloc (&permanent_obstack,
- strlen (name) + 1);
- strcpy (deferred_plabels[i].name, name);
+ deferred_plabels[i].name = ggc_strdup (name);
/* Gross. We have just implicitly taken the address of this
function, mark it as such. */
#include "tree.h"
#include "function.h"
#include "expr.h"
+#include "ggc.h"
#include "toplev.h"
#include "tm_p.h"
#include "target.h"
get_symref (name)
register const char *name;
{
- extern struct obstack permanent_obstack;
register const char *sp = name;
unsigned int hash = 0;
struct symref_hashent *p, **last_p;
{
/* Ensure SYMBOL_REF will stay around. */
p = *last_p = (struct symref_hashent *)
- permalloc (sizeof (struct symref_hashent));
- p->symref = gen_rtx_SYMBOL_REF (Pmode,
- obstack_copy0 (&permanent_obstack,
- name, strlen (name)));
+ xmalloc (sizeof (struct symref_hashent));
+ p->symref = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (name));
p->next = 0;
}
where we can't, it gets stripped off. */
#undef ASM_OUTPUT_EXTERNAL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
- if ((TREE_CODE (DECL) == VAR_DECL \
- || TREE_CODE (DECL) == FUNCTION_DECL) \
- && (NAME)[strlen (NAME) - 1] != ']') \
- { \
- char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
- strcpy (_name, XSTR (_symref, 0)); \
- strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
- XSTR (_symref, 0) = _name; \
- } \
- fputs ("\t.extern ", FILE); \
- assemble_name (FILE, XSTR (_symref, 0)); \
- if (TREE_CODE (DECL) == FUNCTION_DECL) \
- { \
- fputs ("\n\t.extern .", FILE); \
- RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
- } \
- putc ('\n', FILE); \
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
+ if ((TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == FUNCTION_DECL) \
+ && (NAME)[strlen (NAME) - 1] != ']') \
+ { \
+ XSTR (_symref, 0) = concat (XSTR (_symref, 0), \
+ (TREE_CODE (DECL) == FUNCTION_DECL \
+ ? "[DS]" : "[RW]"), \
+ NULL); \
+ } \
+ fputs ("\t.extern ", FILE); \
+ assemble_name (FILE, XSTR (_symref, 0)); \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ { \
+ fputs ("\n\t.extern .", FILE); \
+ RS6000_OUTPUT_BASENAME (FILE, XSTR (_symref, 0)); \
+ } \
+ putc ('\n', FILE); \
}
/* Similar, but for libcall. We only have to worry about the function name,
}
len = strlen (after_last_slash) + strlen (section_desc) + 2;
- *buf = (char *) permalloc (len);
+ *buf = (char *) xmalloc (len);
p = *buf;
*p++ = '_';
/* This says how to output an external. */
#undef ASM_OUTPUT_EXTERNAL
-#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
-{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
- if ((TREE_CODE (DECL) == VAR_DECL \
- || TREE_CODE (DECL) == FUNCTION_DECL) \
- && (NAME)[strlen (NAME) - 1] != ']') \
- { \
- char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
- strcpy (_name, XSTR (_symref, 0)); \
- strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
- XSTR (_symref, 0) = _name; \
- } \
+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
+{ rtx _symref = XEXP (DECL_RTL (DECL), 0); \
+ if ((TREE_CODE (DECL) == VAR_DECL \
+ || TREE_CODE (DECL) == FUNCTION_DECL) \
+ && (NAME)[strlen (NAME) - 1] != ']') \
+ { \
+ XSTR (_symref, 0) = concat (XSTR (_symref, 0), \
+ (TREE_CODE (DECL) == FUNCTION_DECL \
+ ? "[DS]" : "[RW]"), \
+ NULL); \
+ } \
}
/* This is how to output an internal numbered label where
}
/* Not previously seen; create a new list entry. */
- p = (struct extern_list *)permalloc ((long) sizeof (struct extern_list));
+ p = (struct extern_list *) xmalloc (sizeof (struct extern_list));
p->name = name;
if (pending)
+2002-08-04 Geoffrey Keating <geoffk@redhat.com>
+
+ * cvt.c (ocp_convert): Delete obsolete code.
+ * parse.y (permanent_obstack): Delete declaration.
+ * pt.c (permanent_obstack): Delete declaration.
+ * repo.c (permanent_obstack): Delete declaration.
+ (open_repo_file): Use xmalloc instead of permanent_obstack.
+ (init_repo): Use xstrdup instead of permanent_obstack.
+
2002-08-04 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (VF_DERIVED_VALUE): Remove.
return build_cplus_new (type, ctor);
}
- /* If TYPE or TREE_TYPE (E) is not on the permanent_obstack,
- then it won't be hashed and hence compare as not equal,
- even when it is. */
- if (code == ARRAY_TYPE
- && TREE_TYPE (TREE_TYPE (e)) == TREE_TYPE (type)
- && index_type_equal (TYPE_DOMAIN (TREE_TYPE (e)), TYPE_DOMAIN (type)))
- return e;
-
if (flags & LOOKUP_COMPLAIN)
error ("conversion from `%T' to non-scalar type `%T' requested",
TREE_TYPE (expr), type);
#include "toplev.h"
#include "ggc.h"
-extern struct obstack permanent_obstack;
-
/* Like YYERROR but do call yyerror. */
#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
returning an int. */
typedef int (*tree_fn_t) PARAMS ((tree, void*));
-extern struct obstack permanent_obstack;
-
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
instantiations have been deferred, either because their definitions
were not yet available, or because we were putting off doing the
static char *old_args, *old_dir, *old_main;
static struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_3 (NODE))
#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
if (! p)
p = s + strlen (s);
- obstack_grow (&permanent_obstack, s, p - s);
- repo_name = obstack_copy0 (&permanent_obstack, ".rpo", 4);
+ repo_name = xmalloc (p - s + 5);
+ memcpy (repo_name, s, p - s);
+ memcpy (repo_name + (p - s), ".rpo", 5);
repo_file = fopen (repo_name, "r");
}
switch (buf[0])
{
case 'A':
- old_args = obstack_copy0 (&permanent_obstack, buf + 2,
- strlen (buf + 2));
+ old_args = ggc_strdup (buf + 2);
break;
case 'D':
- old_dir = obstack_copy0 (&permanent_obstack, buf + 2,
- strlen (buf + 2));
+ old_dir = ggc_strdup (buf + 2);
break;
case 'M':
- old_main = obstack_copy0 (&permanent_obstack, buf + 2,
- strlen (buf + 2));
+ old_main = ggc_strdup (buf + 2);
break;
case 'C':
case 'O':
#include "real.h"
#include "rtl.h"
#include "tree.h"
-#include "obstack.h"
#include "flags.h"
#include "regs.h"
#include "hard-reg-set.h"
int reverse;
};
-extern struct obstack permanent_obstack;
-
static rtx enqueue_insn PARAMS ((rtx, rtx));
static unsigned HOST_WIDE_INT move_by_pieces_ninsns
PARAMS ((unsigned HOST_WIDE_INT,
#include "recog.h"
#include "output.h"
#include "basic-block.h"
-#include "obstack.h"
#include "toplev.h"
#include "hashtab.h"
#include "ggc.h"
#endif
}
\f
-extern struct obstack permanent_obstack;
-
/* The PENDING_SIZES represent the sizes of variable-sized types.
Create RTL for the various sizes now (using temporary variables),
so that we can refer to the sizes from the RTL we are generating
#include "target.h"
#include "langhooks.h"
-#include "obstack.h"
-
-extern struct obstack *function_maybepermanent_obstack;
-
/* Similar, but round to the next highest integer that meets the
alignment. */
#define CEIL_ROUND(VALUE,ALIGN) (((VALUE) + (ALIGN) - 1) & ~((ALIGN)- 1))
+2002-08-04 Geoffrey Keating <geoffk@redhat.com>
+
+ * class.c: (permanent_obstack): Delete declaration.
+ * constants.c: (permanent_obstack): Delete declaration.
+ * except.c: (permanent_obstack): Delete declaration.
+ * expr.c: (permanent_obstack): Delete declaration.
+ * jcf-parse.c: (permanent_obstack): Delete declaration.
+ (saveable_obstack): Delete declaration.
+ * parse.h: (permanent_obstack): Delete declaration.
+ * typeck.c: (permanent_obstack): Delete declaration.
+
2002-08-04 Joseph S. Myers <jsm@polyomino.org.uk>
* gcj.texi (version-gcc): Increase to 3.3.
static GTY(()) rtx registerClass_libfunc;
static GTY(()) rtx registerResource_libfunc;
-extern struct obstack permanent_obstack;
struct obstack temporary_obstack;
/* The compiler generates different code depending on whether or not
#include "toplev.h"
#include "ggc.h"
-extern struct obstack permanent_obstack;
-
static void set_constant_entry PARAMS ((CPool *, int, int, jword));
static int find_class_or_string_constant PARAMS ((CPool *, int, tree));
static int find_name_and_type_constant PARAMS ((CPool *, tree, tree));
static void check_start_handlers PARAMS ((struct eh_range *, int));
static void free_eh_ranges PARAMS ((struct eh_range *range));
-extern struct obstack permanent_obstack;
-
struct eh_range *current_method_handlers;
struct eh_range *current_try_block = NULL;
static int get_offset_table_index PARAMS ((tree));
static GTY(()) tree operand_type[59];
-extern struct obstack permanent_obstack;
static GTY(()) tree methods_ident;
static GTY(()) tree ncode_ident;
#include "jcf.h"
-extern struct obstack *saveable_obstack;
extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
/* Set to non-zero value in order to emit class initilization code
before static field references. */
/* Extern global variable declarations */
extern int java_error_count;
extern struct obstack temporary_obstack;
-extern struct obstack permanent_obstack;
extern int quiet_flag;
#ifndef JC1_LITE
static tree build_null_signature PARAMS ((tree));
tree * type_map;
-extern struct obstack permanent_obstack;
/* Set the type of the local variable with index SLOT to TYPE. */
debug_tree (node)
tree node;
{
- table = (struct bucket **) permalloc (HASH_SIZE * sizeof (struct bucket *));
- memset ((char *) table, 0, HASH_SIZE * sizeof (struct bucket *));
+ table = (struct bucket **) xcalloc (HASH_SIZE, sizeof (struct bucket *));
print_node (stderr, "", node, 0);
table = 0;
fprintf (stderr, "\n");
}
/* Add this node to the table. */
- b = (struct bucket *) permalloc (sizeof (struct bucket));
+ b = (struct bucket *) xmalloc (sizeof (struct bucket));
b->node = node;
b->next = table[hash];
table[hash] = b;
char *labelstr;
SDB_GENERATE_FAKE (label, unnamed_struct_number);
unnamed_struct_number++;
- labelstr = (char *) permalloc (strlen (label) + 1);
- strcpy (labelstr, label);
+ labelstr = xstrdup (label);
return labelstr;
}
\f
pfgets (stream)
FILE *stream;
{
- return obstack_fgets (stream, &permanent_obstack);
+ return xstrdup (tfgets (stream));
}
\f
/* Real tlink code. */
init_ggc ();
init_stringpool ();
- init_obstacks ();
+ init_ttree ();
if (no_backend)
return;
nodes of that code.
It is intended to be language-independent, but occasionally
- calls language-dependent routines defined (for C) in typecheck.c.
-
- The low-level allocation routines oballoc and permalloc
- are used also for allocating many other kinds of objects
- by all passes of the compiler. */
+ calls language-dependent routines defined (for C) in typecheck.c. */
#include "config.h"
#include "system.h"
/* obstack.[ch] explicitly declined to prototype this. */
extern int _obstack_allocated_p PARAMS ((struct obstack *h, PTR obj));
-/* Objects allocated on this obstack last forever. */
-
-struct obstack permanent_obstack;
-
#ifdef GATHER_STATISTICS
/* Statistics-gathering stuff. */
typedef enum
tree global_trees[TI_MAX];
tree integer_types[itk_none];
\f
-/* Init the principal obstacks. */
+/* Init tree.c. */
void
-init_obstacks ()
+init_ttree ()
{
- gcc_obstack_init (&permanent_obstack);
-
/* Initialize the hash table of types. */
type_hash_table = htab_create (TYPE_HASH_INITIAL_SIZE, type_hash_hash,
type_hash_eq, 0);
}
\f
-/* Allocate SIZE bytes in the permanent obstack
- and return a pointer to them. */
-
-char *
-permalloc (size)
- int size;
-{
- return (char *) obstack_alloc (&permanent_obstack, size);
-}
-
-/* Allocate NELEM items of SIZE bytes in the permanent obstack
- and return a pointer to them. The storage is cleared before
- returning the value. */
-
-char *
-perm_calloc (nelem, size)
- int nelem;
- long size;
-{
- char *rval = (char *) obstack_alloc (&permanent_obstack, nelem * size);
- memset (rval, 0, nelem * size);
- return rval;
-}
-
/* The name of the object as the assembler will see it (but before any
translations made by ASM_OUTPUT_LABELREF). Often this is the same
as DECL_NAME. It is an IDENTIFIER_NODE. */
#else
fprintf (stderr, "(No per-node statistics)\n");
#endif
- print_obstack_statistics ("permanent_obstack", &permanent_obstack);
print_type_hash_statistics ();
(*lang_hooks.print_statistics) ();
}
statistical reports, not code generation. */
extern double approx_sqrt PARAMS ((double));
-extern char *permalloc PARAMS ((int));
-extern char *expralloc PARAMS ((int));
extern tree decl_assembler_name PARAMS ((tree));
/* Compute the number of bytes occupied by 'node'. This routine only
const char *, tree));
\f
/* In tree.c */
-extern char *perm_calloc PARAMS ((int, long));
extern void clean_symbol_name PARAMS ((char *));
extern tree get_file_function_name_long PARAMS ((const char *));
extern tree get_set_constructor_bits PARAMS ((tree, char *, int));
extern int real_twop PARAMS ((tree));
extern int real_minus_onep PARAMS ((tree));
extern void gcc_obstack_init PARAMS ((struct obstack *));
-extern void init_obstacks PARAMS ((void));
+extern void init_ttree PARAMS ((void));
extern void build_common_tree_nodes PARAMS ((int));
extern void build_common_tree_nodes_2 PARAMS ((int));
char *name;
p = (* targetm.strip_name_encoding) (fnname);
- name = permalloc (strlen (p) + 1);
- strcpy (name, p);
+ name = xstrdup (p);
if (! DECL_WEAK (decl) && ! DECL_ONE_ONLY (decl))
first_global_object_name = name;
char *xname;
p = (* targetm.strip_name_encoding) (name);
- xname = permalloc (strlen (p) + 1);
- strcpy (xname, p);
+ xname = xstrdup (p);
first_global_object_name = xname;
}