From 791ceafe7e7c0ca0640b64ede4b9cccda4b900e9 Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 9 Jun 2000 21:47:40 +0000 Subject: toplevel: * ggc-none.c, ggc-simple.c, ggc-page.c (ggc_alloc_obj): Rename it ggc_alloc, drop second argument, never clear returned memory. * ggc-common.c (ggc_alloc_string): Use ggc_alloc. (ggc_alloc_cleared): New. * ggc.h: Prototype ggc_alloc and ggc_alloc_cleared, not ggc_alloc_obj. Remove ggc_alloc macro. (ggc_alloc_rtx, ggc_alloc_rtvec, ggc_alloc_tree): Use ggc_alloc. * rtl.c (rtvec_alloc): Clear the vector always. (rtx_alloc): Clear the first word always. Remove dirty obstack tricks (this routine is no longer a bottleneck). * tree.c (make_node): Clear the new node always. (make_tree_vec): Likewise. (tree_cons): Clear the common structure always. (build1): Likewise; also, clear TREE_COMPLEXITY. * gengenrtl.c: Use puts wherever possible. Remove extra newlines. (gendef): Clear the first word of an RTX in the generator function, irrespective of ggc_p. Initialize '0' slots to NULL. (genlegend): Don't generate obstack_alloc_rtx routine, just a thin wrapper macro around obstack_alloc. * stmt.c (expand_fixup): Use ggc_alloc. * c-typeck.c (add_pending_init): Use ggc_alloc. * emit-rtl.c (init_emit_once): Clear CONST_DOUBLE_CHAIN(tem). * varasm.c (immed_double_const): Set CONST_DOUBLE_MEM(r) to const0_rtx when it is created. (immed_real_const_1): Set CONST_DOUBLE_CHAIN(r) to NULL_RTX if we are not in a function. * tree.c (tree_class_check_failed): Make second arg an int. * tree.h: Update prototype. cp: * call.c (add_candidate): Use ggc_alloc_cleared. * decl.c (lookup_label): Likewise. * lex.c (retrofit_lang_decl): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@34478 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ggc.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'gcc/ggc.h') diff --git a/gcc/ggc.h b/gcc/ggc.h index 9ee6c3dd7a9..81e7012dcd6 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -128,20 +128,19 @@ extern void ggc_pop_context PARAMS ((void)); /* Allocation. */ /* The internal primitive. */ -void *ggc_alloc_obj PARAMS ((size_t, int)); +void *ggc_alloc PARAMS ((size_t)); +/* Like ggc_alloc, but allocates cleared memory. */ +void *ggc_alloc_cleared PARAMS ((size_t)); -#define ggc_alloc_rtx(NSLOTS) \ - ((struct rtx_def *) ggc_alloc_obj (sizeof (struct rtx_def) \ - + ((NSLOTS) - 1) * sizeof (rtunion), 1)) +#define ggc_alloc_rtx(NSLOTS) \ + ((struct rtx_def *) ggc_alloc (sizeof (struct rtx_def) \ + + ((NSLOTS) - 1) * sizeof (rtunion))) #define ggc_alloc_rtvec(NELT) \ - ((struct rtvec_def *) ggc_alloc_obj (sizeof (struct rtvec_def) \ - + ((NELT) - 1) * sizeof (rtx), 1)) + ((struct rtvec_def *) ggc_alloc (sizeof (struct rtvec_def) \ + + ((NELT) - 1) * sizeof (rtx))) -#define ggc_alloc_tree(LENGTH) \ - ((union tree_node *) ggc_alloc_obj ((LENGTH), 1)) - -#define ggc_alloc(SIZE) ggc_alloc_obj((SIZE), 0) +#define ggc_alloc_tree(LENGTH) ((union tree_node *) ggc_alloc (LENGTH)) char *ggc_alloc_string PARAMS ((const char *contents, int length)); -- cgit v1.2.1