diff options
-rw-r--r-- | gcc/ChangeLog | 26 | ||||
-rw-r--r-- | gcc/bitmap.c | 22 | ||||
-rw-r--r-- | gcc/defaults.h | 9 | ||||
-rw-r--r-- | gcc/hashtable.c | 22 | ||||
-rw-r--r-- | gcc/hashtable.h | 2 | ||||
-rw-r--r-- | gcc/java/jv-scan.c | 20 | ||||
-rw-r--r-- | gcc/java/jvgenmain.c | 19 | ||||
-rw-r--r-- | gcc/java/parse-scan.y | 3 | ||||
-rw-r--r-- | gcc/rtl.h | 4 | ||||
-rw-r--r-- | gcc/tree.c | 23 | ||||
-rw-r--r-- | gcc/tree.h | 9 |
11 files changed, 38 insertions, 121 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 91e9c67..6cf593c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,29 @@ +2003-04-06 Steven Bosscher <steven@gcc.gnu.org> + + * hashtable.c (gcc_obstack_init): Delete this function + and everything related to it. + * hashtable.h: Remove prototype. + * bitmap.c (bitmap_element_allocate): Cleanup redundant + defines. Cleanup some unnecessary whitespace. + * defaults.h (obstack_chunk_alloc): Redefine with + appropriate casts for libiberty obstacks. + (obstack_chunk_free): Ditto. + (OBSTACK_CHUNK_SIZE): Define, default to 0. + (gcc_obstack_init): Define as a call to _obstack_begin. + * tree.c (print_obstack_statistics): Delete this unused + function. + * tree.h (obstack): Don't forward-declare. + (print_obstack_statistics): Delete prototype. + (print_obstack_name): Ditto. + (gcc_obstack_init): Ditto. + * rtl.h (gcc_obstack_init): Ditto. + * java/jv-scan.c (gcc_obstack_init): Delete this + function, its prototype and related defines. + * java/jvgenmain.c (gcc_obstack_init): Delete this + function, and related defines. + * java/parse-scan.y (obstack_chunk_alloc): Don't define. + (obstack_chunk_free): Ditto + 2003-04-06 Geoffrey Keating <geoffk@apple.com> * dbxout.c (dbxout_handle_pch): Move prototype out from diff --git a/gcc/bitmap.c b/gcc/bitmap.c index 4575f62..f631543 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -125,29 +125,17 @@ bitmap_element_allocate (head) if (!bitmap_obstack_init) { bitmap_obstack_init = TRUE; - - /* Let particular systems override the size of a chunk. */ -#ifndef OBSTACK_CHUNK_SIZE -#define OBSTACK_CHUNK_SIZE 0 -#endif - /* Let them override the alloc and free routines too. */ -#ifndef OBSTACK_CHUNK_ALLOC -#define OBSTACK_CHUNK_ALLOC xmalloc -#endif -#ifndef OBSTACK_CHUNK_FREE -#define OBSTACK_CHUNK_FREE free -#endif - + #if !defined(__GNUC__) || (__GNUC__ < 2) #define __alignof__(type) 0 #endif - + obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE, __alignof__ (bitmap_element), - (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC, - (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE); + obstack_chunk_alloc, + obstack_chunk_free); } - + element = (bitmap_element *) obstack_alloc (&bitmap_obstack, sizeof (bitmap_element)); } diff --git a/gcc/defaults.h b/gcc/defaults.h index 129c0d1..05e0c92 100644 --- a/gcc/defaults.h +++ b/gcc/defaults.h @@ -27,8 +27,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) #endif -#define obstack_chunk_alloc xmalloc -#define obstack_chunk_free free +#define obstack_chunk_alloc ((void *(*) (long)) xmalloc) +#define obstack_chunk_free ((void (*) (void *)) free) +#define OBSTACK_CHUNK_SIZE 0 +#define gcc_obstack_init(OBSTACK) \ + _obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \ + obstack_chunk_alloc, \ + obstack_chunk_free) /* Define default standard character escape sequences. */ #ifndef TARGET_BELL diff --git a/gcc/hashtable.c b/gcc/hashtable.c index ae7e589..63df6ff 100644 --- a/gcc/hashtable.c +++ b/gcc/hashtable.c @@ -35,28 +35,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int)); static void ht_expand PARAMS ((hash_table *)); -/* Let particular systems override the size of a chunk. */ -#ifndef OBSTACK_CHUNK_SIZE -#define OBSTACK_CHUNK_SIZE 0 -#endif - /* Let them override the alloc and free routines too. */ -#ifndef OBSTACK_CHUNK_ALLOC -#define OBSTACK_CHUNK_ALLOC xmalloc -#endif -#ifndef OBSTACK_CHUNK_FREE -#define OBSTACK_CHUNK_FREE free -#endif - -/* Initialize an obstack. */ -void -gcc_obstack_init (obstack) - struct obstack *obstack; -{ - _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0, - (void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC, - (void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE); -} - /* Calculate the hash of the string STR of length LEN. */ static unsigned int diff --git a/gcc/hashtable.h b/gcc/hashtable.h index d036704..20445d7 100644 --- a/gcc/hashtable.h +++ b/gcc/hashtable.h @@ -58,8 +58,6 @@ struct ht unsigned int collisions; }; -extern void gcc_obstack_init PARAMS ((struct obstack *)); - /* Initialize the hashtable with 2 ^ order entries. */ extern hash_table *ht_create PARAMS ((unsigned int order)); diff --git a/gcc/java/jv-scan.c b/gcc/java/jv-scan.c index e1bc572..7e0e813 100644 --- a/gcc/java/jv-scan.c +++ b/gcc/java/jv-scan.c @@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */ extern void fatal_error (const char *s, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; void warning (const char *s, ...) ATTRIBUTE_PRINTF_1; -void gcc_obstack_init (struct obstack *obstack); void report (void); static void usage (void) ATTRIBUTE_NORETURN; @@ -262,22 +261,3 @@ warning (const char *s, ...) fputc ('\n', stderr); va_end (ap); } - -void -gcc_obstack_init (struct obstack *obstack) -{ - /* Let particular systems override the size of a chunk. */ -#ifndef OBSTACK_CHUNK_SIZE -#define OBSTACK_CHUNK_SIZE 0 -#endif - /* Let them override the alloc and free routines too. */ -#ifndef OBSTACK_CHUNK_ALLOC -#define OBSTACK_CHUNK_ALLOC xmalloc -#endif -#ifndef OBSTACK_CHUNK_FREE -#define OBSTACK_CHUNK_FREE free -#endif - _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0, - (void *(*) (long)) OBSTACK_CHUNK_ALLOC, - (void (*) (void *)) OBSTACK_CHUNK_FREE); -} diff --git a/gcc/java/jvgenmain.c b/gcc/java/jvgenmain.c index ba3ac88..1bf2d77 100644 --- a/gcc/java/jvgenmain.c +++ b/gcc/java/jvgenmain.c @@ -39,25 +39,6 @@ static char * do_mangle_classname (const char *string); struct obstack name_obstack; struct obstack *mangle_obstack = &name_obstack; -void -gcc_obstack_init (struct obstack *obstack) -{ - /* Let particular systems override the size of a chunk. */ -#ifndef OBSTACK_CHUNK_SIZE -#define OBSTACK_CHUNK_SIZE 0 -#endif - /* Let them override the alloc and free routines too. */ -#ifndef OBSTACK_CHUNK_ALLOC -#define OBSTACK_CHUNK_ALLOC xmalloc -#endif -#ifndef OBSTACK_CHUNK_FREE -#define OBSTACK_CHUNK_FREE free -#endif - _obstack_begin (obstack, OBSTACK_CHUNK_SIZE, 0, - (void *(*) (long)) OBSTACK_CHUNK_ALLOC, - (void (*) (void *)) OBSTACK_CHUNK_FREE); -} - static void usage (const char *) ATTRIBUTE_NORETURN; static void diff --git a/gcc/java/parse-scan.y b/gcc/java/parse-scan.y index 981ed47..0c8795f 100644 --- a/gcc/java/parse-scan.y +++ b/gcc/java/parse-scan.y @@ -45,9 +45,6 @@ definitions and other extensions. */ #include "obstack.h" #include "toplev.h" -#define obstack_chunk_alloc xmalloc -#define obstack_chunk_free free - extern char *input_filename; extern FILE *finput, *out; @@ -1932,10 +1932,6 @@ extern int no_new_pseudos; extern int rtx_to_tree_code PARAMS ((enum rtx_code)); -/* In tree.c */ -struct obstack; -extern void gcc_obstack_init PARAMS ((struct obstack *)); - /* In cse.c */ struct cse_basic_block_data; @@ -4255,29 +4255,6 @@ get_callee_fndecl (call) return NULL_TREE; } -/* Print debugging information about the obstack O, named STR. */ - -void -print_obstack_statistics (str, o) - const char *str; - struct obstack *o; -{ - struct _obstack_chunk *chunk = o->chunk; - int n_chunks = 1; - int n_alloc = 0; - - n_alloc += o->next_free - chunk->contents; - chunk = chunk->prev; - while (chunk) - { - n_chunks += 1; - n_alloc += chunk->limit - &chunk->contents[0]; - chunk = chunk->prev; - } - fprintf (stderr, "obstack %s: %u bytes, %d chunks\n", - str, n_alloc, n_chunks); -} - /* Print debugging information about tree nodes generated during the compile, and any language-specific information. */ @@ -2941,8 +2941,6 @@ extern int alias_sets_conflict_p PARAMS ((HOST_WIDE_INT, extern int readonly_fields_p PARAMS ((tree)); extern int objects_must_conflict_p PARAMS ((tree, tree)); -struct obstack; - /* In tree.c */ extern int really_constant_p PARAMS ((tree)); extern int int_fits_type_p PARAMS ((tree, tree)); @@ -2959,12 +2957,6 @@ extern void type_hash_add PARAMS ((unsigned int, tree)); extern unsigned int type_hash_list PARAMS ((tree)); extern int simple_cst_list_equal PARAMS ((tree, tree)); extern void dump_tree_statistics PARAMS ((void)); -extern void print_obstack_statistics PARAMS ((const char *, - struct obstack *)); -#ifdef BUFSIZ -extern void print_obstack_name PARAMS ((char *, FILE *, - const char *)); -#endif extern void expand_function_end PARAMS ((const char *, int, int)); extern void expand_function_start PARAMS ((tree, int)); extern void expand_pending_sizes PARAMS ((tree)); @@ -2972,7 +2964,6 @@ extern void expand_pending_sizes PARAMS ((tree)); extern int real_onep PARAMS ((tree)); extern int real_twop PARAMS ((tree)); extern int real_minus_onep PARAMS ((tree)); -extern void gcc_obstack_init PARAMS ((struct obstack *)); extern void init_ttree PARAMS ((void)); extern void build_common_tree_nodes PARAMS ((int)); extern void build_common_tree_nodes_2 PARAMS ((int)); |