summaryrefslogtreecommitdiffstats
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-25 20:43:23 +0000
committerbernie <bernie@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-25 20:43:23 +0000
commit9318f22c615651d01d70b7311bff88ba220173d6 (patch)
treed0ebdb183f6e1572fbcf9e7c4fd5488f5016e704 /gcc/c-typeck.c
parentbf2df78f1b9a2bcfd18251abc218e969f34a40c9 (diff)
downloadppe42-gcc-9318f22c615651d01d70b7311bff88ba220173d6.tar.gz
ppe42-gcc-9318f22c615651d01d70b7311bff88ba220173d6.zip
* bitmap.c: Use type-safe memory allocation macros from libiberty.
* c-common.c: Likewise. * c-decl.c: Likewise. * c-lang.c: Likewise. * c-lex.c: Likewise. * c-opts.c: Likewise. * c-parse.in: Likewise. * c-typeck.c: Likewise. * genconditions.c: Likewise. * gengtype-lex.l: Likewise. * gengtype-yacc.y: Likewise. * gengtype.c: Likewise. * genmodes.c: Likewise. * gensupport.c: Likewise. * read-rtl.c: Likewise. * read-rtl.c (read_constants): Use INSERT instead of TRUE in call to htab_find_slot(). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85163 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 50ac48dee5d..0f4211c0e1f 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -3756,10 +3756,10 @@ static int spelling_size; /* Size of the spelling stack. */
{ \
spelling_size += 10; \
if (spelling_base == 0) \
- spelling_base = xmalloc (spelling_size * sizeof (struct spelling)); \
+ spelling_base = XNEWVEC (struct spelling, spelling_size); \
else \
- spelling_base = xrealloc (spelling_base, \
- spelling_size * sizeof (struct spelling)); \
+ spelling_base = XRESIZEVEC (struct spelling, spelling_base, \
+ spelling_size); \
RESTORE_SPELLING_DEPTH (depth); \
} \
\
@@ -4309,7 +4309,7 @@ void
start_init (tree decl, tree asmspec_tree, int top_level)
{
const char *locus;
- struct initializer_stack *p = xmalloc (sizeof (struct initializer_stack));
+ struct initializer_stack *p = XNEW (struct initializer_stack);
const char *asmspec = 0;
if (asmspec_tree)
@@ -4411,7 +4411,7 @@ finish_init (void)
void
really_start_incremental_init (tree type)
{
- struct constructor_stack *p = xmalloc (sizeof (struct constructor_stack));
+ struct constructor_stack *p = XNEW (struct constructor_stack);
if (type == 0)
type = TREE_TYPE (constructor_decl);
@@ -4548,7 +4548,7 @@ push_init_level (int implicit)
value = find_init_member (constructor_index);
}
- p = xmalloc (sizeof (struct constructor_stack));
+ p = XNEW (struct constructor_stack);
p->type = constructor_type;
p->fields = constructor_fields;
p->index = constructor_index;
@@ -4941,7 +4941,7 @@ push_range_stack (tree range_end)
{
struct constructor_range_stack *p;
- p = ggc_alloc (sizeof (struct constructor_range_stack));
+ p = GGC_NEW (struct constructor_range_stack);
p->prev = constructor_range_stack;
p->next = 0;
p->fields = constructor_fields;
@@ -5122,7 +5122,7 @@ add_pending_init (tree purpose, tree value)
}
}
- r = ggc_alloc (sizeof (struct init_node));
+ r = GGC_NEW (struct init_node);
r->purpose = purpose;
r->value = value;
@@ -6391,8 +6391,9 @@ c_start_case (tree exp)
}
/* Add this new SWITCH_STMT to the stack. */
- cs = xmalloc (sizeof (*cs));
- cs->switch_stmt = build_stmt (SWITCH_STMT, exp, NULL_TREE, orig_type);
+ cs = XNEW (struct c_switch);
+ cs->switch_stmt = build_stmt ((enum tree_code) SWITCH_STMT, exp, NULL_TREE,
+ orig_type);
cs->orig_type = orig_type;
cs->cases = splay_tree_new (case_compare, NULL, NULL);
cs->next = c_switch_stack;
@@ -6440,7 +6441,7 @@ c_finish_case (tree body)
/* Pop the stack. */
c_switch_stack = cs->next;
splay_tree_delete (cs->cases);
- free (cs);
+ XDELETE (cs);
}
/* Emit an if statement. IF_LOCUS is the location of the 'if'. COND,
OpenPOWER on IntegriCloud