diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-17 23:06:33 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-17 23:06:33 +0000 |
commit | 881f903ec5acda5da00fc504d859b72fa8005768 (patch) | |
tree | 8d1527effaee14026c419a32b174fb4c0a8ad57b /gcc/ggc.h | |
parent | 0345f05c314708ce008d73014e3415c2d5811a3a (diff) | |
download | gcc-881f903ec5acda5da00fc504d859b72fa8005768.tar.gz |
rm a bunch of _stat allocation functions
Now that we can use c++ default arguments there's no reason to use
functions and wrapper macros.
gcc/ChangeLog:
* dwarf2out.c (tree_add_const_value_attribute): Call
ggc_internal_cleared_alloc instead of ggc_alloc_cleared_atomic.
* gengtype.c (write_typed_alloc_def): Call ggc_internal_<x>alloc
instead of ggc_internal_<x>alloc_stat.
* ggc-common.c (ggc_internal_cleared_alloc): Drop _stat suffix.
(ggc_realloc): Likewise.
* ggc-none.c (ggc_internal_alloc): Likewise.
(ggc_internal_cleared_alloc): Likewise.
* ggc-page.c: Likewise.
* ggc.h (ggc_internal_alloc_stat): Likewise.
(ggc_internal_alloc): Remove macro.
(ggc_internal_cleared_alloc_stat): Drop _stat suffix.
(ggc_internal_cleared_alloc): Remove macro.
(GGC_RESIZEVEC): Adjust.
(ggc_resizevar): Remove macro.
(ggc_internal_vec_alloc_stat): Drop _stat suffix.
(ggc_internal_cleared_vec_alloc_stat): Likewise.
(ggc_internal_vec_cleared_alloc): Remove macro.
(ggc_alloc_atomic_stat): Drop _stat suffix.
(ggc_alloc_atomic): Remove macro.
(ggc_alloc_cleared_atomic): Remove macro.
(ggc_alloc_string_stat): Drop _stat suffix.
(ggc_alloc_string): Remove macro.
(ggc_alloc_rtx_def_stat): Adjust.
(ggc_alloc_tree_node_stat): Likewise.
(ggc_alloc_cleared_tree_node_stat): Likewise.
(ggc_alloc_cleared_gimple_statement_stat): Likewise.
(ggc_alloc_cleared_simd_clone_stat): Likewise.
* gimple.c (gimple_build_omp_for): Likewise.
(gimple_copy): Likewise.
* stringpool.c (ggc_alloc_string_stat): Drop _stat suffix.
* toplev.c (realloc_for_line_map): Adjust.
* tree-data-ref.h (lambda_vector_new): Likewise.
* tree-phinodes.c (allocate_phi_node): Likewise.
* tree.c (grow_tree_vec_stat): Likewise.
* vec.h (va_gc::reserve): Adjust.
gcc/java/ChangeLog:
* constants.c (set_constant_entry): Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210565 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc.h')
-rw-r--r-- | gcc/ggc.h | 65 |
1 files changed, 24 insertions, 41 deletions
diff --git a/gcc/ggc.h b/gcc/ggc.h index 55f3fe9b0bc..9bb0642e610 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -136,59 +136,44 @@ extern void gt_pch_save (FILE *f); /* Allocation. */ /* The internal primitive. */ -extern void *ggc_internal_alloc_stat (size_t MEM_STAT_DECL) - ATTRIBUTE_MALLOC; +extern void *ggc_internal_alloc (size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; extern size_t ggc_round_alloc_size (size_t requested_size); -#define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO) - /* Allocates cleared memory. */ -extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL) +extern void *ggc_internal_cleared_alloc (size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; -#define ggc_internal_cleared_alloc(s) ggc_internal_cleared_alloc_stat (s MEM_STAT_INFO) /* Resize a block. */ -extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL); +extern void *ggc_realloc (void *, size_t CXX_MEM_STAT_INFO); /* Free a block. To be used when known for certain it's not reachable. */ extern void ggc_free (void *); extern void dump_ggc_loc_statistics (bool); -/* Reallocators. */ +/* Reallocator. */ #define GGC_RESIZEVEC(T, P, N) \ - ((T *) ggc_realloc_stat ((P), (N) * sizeof (T) MEM_STAT_INFO)) - -#define GGC_RESIZEVAR(T, P, N) \ - ((T *) ggc_realloc_stat ((P), (N) MEM_STAT_INFO)) + ((T *) ggc_realloc ((P), (N) * sizeof (T) MEM_STAT_INFO)) static inline void * -ggc_internal_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL) +ggc_internal_vec_alloc (size_t s, size_t c CXX_MEM_STAT_INFO) { - return ggc_internal_alloc_stat (c * s PASS_MEM_STAT); + return ggc_internal_alloc (c * s PASS_MEM_STAT); } static inline void * -ggc_internal_cleared_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL) +ggc_internal_cleared_vec_alloc (size_t s, size_t c CXX_MEM_STAT_INFO) { - return ggc_internal_cleared_alloc_stat (c * s PASS_MEM_STAT); + return ggc_internal_cleared_alloc (c * s PASS_MEM_STAT); } -#define ggc_internal_cleared_vec_alloc(s, c) \ - (ggc_internal_cleared_vec_alloc_stat ((s), (c) MEM_STAT_INFO)) - static inline void * -ggc_alloc_atomic_stat (size_t s MEM_STAT_DECL) +ggc_alloc_atomic (size_t s CXX_MEM_STAT_INFO) { - return ggc_internal_alloc_stat (s PASS_MEM_STAT); + return ggc_internal_alloc (s PASS_MEM_STAT); } -#define ggc_alloc_atomic(S) (ggc_alloc_atomic_stat ((S) MEM_STAT_INFO)) - -#define ggc_alloc_cleared_atomic(S) \ - (ggc_internal_cleared_alloc_stat ((S) MEM_STAT_INFO)) - extern void *ggc_cleared_alloc_htab_ignore_args (size_t, size_t) ATTRIBUTE_MALLOC; @@ -213,13 +198,11 @@ extern void ggc_splay_dont_free (void *, void *); /* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS. If LENGTH is -1, then CONTENTS is assumed to be a null-terminated string and the memory sized accordingly. */ -extern const char *ggc_alloc_string_stat (const char *contents, int length - MEM_STAT_DECL); - -#define ggc_alloc_string(c, l) ggc_alloc_string_stat (c, l MEM_STAT_INFO) +extern const char *ggc_alloc_string (const char *contents, int length + CXX_MEM_STAT_INFO); /* Make a copy of S, in GC-able memory. */ -#define ggc_strdup(S) ggc_alloc_string_stat ((S), -1 MEM_STAT_INFO) +#define ggc_strdup(S) ggc_alloc_string ((S), -1 MEM_STAT_INFO) /* Invoke the collector. Garbage collection occurs only when this function is called, not during allocations. */ @@ -253,35 +236,35 @@ extern void init_ggc_heuristics (void); /* Memory statistics passing versions of some allocators. Too few of them to make gengtype produce them, so just define the needed ones here. */ static inline struct rtx_def * -ggc_alloc_rtx_def_stat (size_t s MEM_STAT_DECL) +ggc_alloc_rtx_def_stat (size_t s CXX_MEM_STAT_INFO) { - return (struct rtx_def *) ggc_internal_alloc_stat (s PASS_MEM_STAT); + return (struct rtx_def *) ggc_internal_alloc (s PASS_MEM_STAT); } static inline union tree_node * -ggc_alloc_tree_node_stat (size_t s MEM_STAT_DECL) +ggc_alloc_tree_node_stat (size_t s CXX_MEM_STAT_INFO) { - return (union tree_node *) ggc_internal_alloc_stat (s PASS_MEM_STAT); + return (union tree_node *) ggc_internal_alloc (s PASS_MEM_STAT); } static inline union tree_node * -ggc_alloc_cleared_tree_node_stat (size_t s MEM_STAT_DECL) +ggc_alloc_cleared_tree_node_stat (size_t s CXX_MEM_STAT_INFO) { - return (union tree_node *) ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT); + return (union tree_node *) ggc_internal_cleared_alloc (s PASS_MEM_STAT); } static inline struct gimple_statement_base * -ggc_alloc_cleared_gimple_statement_stat (size_t s MEM_STAT_DECL) +ggc_alloc_cleared_gimple_statement_stat (size_t s CXX_MEM_STAT_INFO) { return (struct gimple_statement_base *) - ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT); + ggc_internal_cleared_alloc (s PASS_MEM_STAT); } static inline struct simd_clone * -ggc_alloc_cleared_simd_clone_stat (size_t s MEM_STAT_DECL) +ggc_alloc_cleared_simd_clone_stat (size_t s CXX_MEM_STAT_INFO) { return (struct simd_clone *) - ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT); + ggc_internal_cleared_alloc (s PASS_MEM_STAT); } #endif |