Commit 95ec27aa by Steven Bosscher

hashtable.c (gcc_obstack_init): Delete this function and everything related to it.

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

From-SVN: r65308
parent 62e64b0b
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> 2003-04-06 Geoffrey Keating <geoffk@apple.com>
* dbxout.c (dbxout_handle_pch): Move prototype out from * dbxout.c (dbxout_handle_pch): Move prototype out from
......
...@@ -125,29 +125,17 @@ bitmap_element_allocate (head) ...@@ -125,29 +125,17 @@ bitmap_element_allocate (head)
if (!bitmap_obstack_init) if (!bitmap_obstack_init)
{ {
bitmap_obstack_init = TRUE; 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) #if !defined(__GNUC__) || (__GNUC__ < 2)
#define __alignof__(type) 0 #define __alignof__(type) 0
#endif #endif
obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE, obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
__alignof__ (bitmap_element), __alignof__ (bitmap_element),
(void *(*) PARAMS ((long))) OBSTACK_CHUNK_ALLOC, obstack_chunk_alloc,
(void (*) PARAMS ((void *))) OBSTACK_CHUNK_FREE); obstack_chunk_free);
} }
element = (bitmap_element *) obstack_alloc (&bitmap_obstack, element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
sizeof (bitmap_element)); sizeof (bitmap_element));
} }
......
...@@ -27,8 +27,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -27,8 +27,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0) #define GET_ENVIRONMENT(VALUE, NAME) do { (VALUE) = getenv (NAME); } while (0)
#endif #endif
#define obstack_chunk_alloc xmalloc #define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
#define obstack_chunk_free free #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. */ /* Define default standard character escape sequences. */
#ifndef TARGET_BELL #ifndef TARGET_BELL
......
...@@ -35,28 +35,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -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 unsigned int calc_hash PARAMS ((const unsigned char *, unsigned int));
static void ht_expand PARAMS ((hash_table *)); 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. */ /* Calculate the hash of the string STR of length LEN. */
static unsigned int static unsigned int
......
...@@ -58,8 +58,6 @@ struct ht ...@@ -58,8 +58,6 @@ struct ht
unsigned int collisions; unsigned int collisions;
}; };
extern void gcc_obstack_init PARAMS ((struct obstack *));
/* Initialize the hashtable with 2 ^ order entries. */ /* Initialize the hashtable with 2 ^ order entries. */
extern hash_table *ht_create PARAMS ((unsigned int order)); extern hash_table *ht_create PARAMS ((unsigned int order));
......
...@@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */
extern void fatal_error (const char *s, ...) extern void fatal_error (const char *s, ...)
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
void warning (const char *s, ...) ATTRIBUTE_PRINTF_1; void warning (const char *s, ...) ATTRIBUTE_PRINTF_1;
void gcc_obstack_init (struct obstack *obstack);
void report (void); void report (void);
static void usage (void) ATTRIBUTE_NORETURN; static void usage (void) ATTRIBUTE_NORETURN;
...@@ -262,22 +261,3 @@ warning (const char *s, ...) ...@@ -262,22 +261,3 @@ warning (const char *s, ...)
fputc ('\n', stderr); fputc ('\n', stderr);
va_end (ap); 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);
}
...@@ -39,25 +39,6 @@ static char * do_mangle_classname (const char *string); ...@@ -39,25 +39,6 @@ static char * do_mangle_classname (const char *string);
struct obstack name_obstack; struct obstack name_obstack;
struct obstack *mangle_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 usage (const char *) ATTRIBUTE_NORETURN;
static void static void
......
...@@ -45,9 +45,6 @@ definitions and other extensions. */ ...@@ -45,9 +45,6 @@ definitions and other extensions. */
#include "obstack.h" #include "obstack.h"
#include "toplev.h" #include "toplev.h"
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
extern char *input_filename; extern char *input_filename;
extern FILE *finput, *out; extern FILE *finput, *out;
......
...@@ -1932,10 +1932,6 @@ extern int no_new_pseudos; ...@@ -1932,10 +1932,6 @@ extern int no_new_pseudos;
extern int rtx_to_tree_code PARAMS ((enum rtx_code)); 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 */ /* In cse.c */
struct cse_basic_block_data; struct cse_basic_block_data;
......
...@@ -4255,29 +4255,6 @@ get_callee_fndecl (call) ...@@ -4255,29 +4255,6 @@ get_callee_fndecl (call)
return NULL_TREE; 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, /* Print debugging information about tree nodes generated during the compile,
and any language-specific information. */ and any language-specific information. */
......
...@@ -2941,8 +2941,6 @@ extern int alias_sets_conflict_p PARAMS ((HOST_WIDE_INT, ...@@ -2941,8 +2941,6 @@ extern int alias_sets_conflict_p PARAMS ((HOST_WIDE_INT,
extern int readonly_fields_p PARAMS ((tree)); extern int readonly_fields_p PARAMS ((tree));
extern int objects_must_conflict_p PARAMS ((tree, tree)); extern int objects_must_conflict_p PARAMS ((tree, tree));
struct obstack;
/* In tree.c */ /* In tree.c */
extern int really_constant_p PARAMS ((tree)); extern int really_constant_p PARAMS ((tree));
extern int int_fits_type_p PARAMS ((tree, tree)); extern int int_fits_type_p PARAMS ((tree, tree));
...@@ -2959,12 +2957,6 @@ extern void type_hash_add PARAMS ((unsigned int, tree)); ...@@ -2959,12 +2957,6 @@ extern void type_hash_add PARAMS ((unsigned int, tree));
extern unsigned int type_hash_list PARAMS ((tree)); extern unsigned int type_hash_list PARAMS ((tree));
extern int simple_cst_list_equal PARAMS ((tree, tree)); extern int simple_cst_list_equal PARAMS ((tree, tree));
extern void dump_tree_statistics PARAMS ((void)); 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_end PARAMS ((const char *, int, int));
extern void expand_function_start PARAMS ((tree, int)); extern void expand_function_start PARAMS ((tree, int));
extern void expand_pending_sizes PARAMS ((tree)); extern void expand_pending_sizes PARAMS ((tree));
...@@ -2972,7 +2964,6 @@ 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_onep PARAMS ((tree));
extern int real_twop PARAMS ((tree)); extern int real_twop PARAMS ((tree));
extern int real_minus_onep 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 init_ttree PARAMS ((void));
extern void build_common_tree_nodes PARAMS ((int)); extern void build_common_tree_nodes PARAMS ((int));
extern void build_common_tree_nodes_2 PARAMS ((int)); extern void build_common_tree_nodes_2 PARAMS ((int));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment