* arith.c (hollerith2representation): Fix for -Wc++-compat.
* array.c (gfc_get_constructor): Likewise.
* decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data,
create_enum_history, gfc_match_final_decl): Likewise.
* error.c (error_char): Likewise.
* expr.c (gfc_get_expr, gfc_copy_expr): Likewise.
* gfortran.h (gfc_get_charlen, gfc_get_array_spec,
gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist,
gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface,
gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref,
gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator,
gfc_get_alloc, gfc_get_wide_string): Likewise.
* interface.c (count_types_test): Likewise.
* intrinsic.c (add_char_conversions, gfc_intrinsic_init_1):
Likewise.
* io.c (gfc_match_open, gfc_match_close, match_filepos, match_io,
gfc_match_inquire, gfc_match_wait): Likewise.
* match.c (gfc_match, match_forall_iterator): Likewise.
* module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup,
add_true_name, parse_string, write_atom, quote_string,
mio_symtree_ref, mio_gmp_real, write_common_0): Likewise.
* options.c (gfc_post_options): Likewise.
* primary.c (match_integer_constant, match_hollerith_constant,
match_boz_constant, match_real_constant,
gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise.
* scanner.c (gfc_widechar_to_char, add_path_to_list,
add_file_change, load_line, get_file, preprocessor_line,
load_file, unescape_filename, gfc_read_orig_filename): Likewise.
* simplify.c (gfc_simplify_ibits, gfc_simplify_ishft,
gfc_simplify_ishftc): Likewise.
* symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree,
gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol):
Likewise.
* target-memory.c (gfc_target_interpret_expr): Likewise.
* trans-const.c (gfc_build_wide_string_const): Likewise.
* trans-expr.c (gfc_add_interface_mapping): Likewise.
* trans-intrinsic.c (gfc_conv_intrinsic_conversion,
gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function,
gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime,
gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char,
gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify,
gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise.
* trans.c (gfc_get_backend_locus): Likewise.
* trans.h (gfc_get_ss): Likewise.
From-SVN: r136982
+2008-06-20 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * arith.c (hollerith2representation): Fix for -Wc++-compat.
+ * array.c (gfc_get_constructor): Likewise.
+ * decl.c (gfc_get_data_variable, gfc_get_data_value, gfc_get_data,
+ create_enum_history, gfc_match_final_decl): Likewise.
+ * error.c (error_char): Likewise.
+ * expr.c (gfc_get_expr, gfc_copy_expr): Likewise.
+ * gfortran.h (gfc_get_charlen, gfc_get_array_spec,
+ gfc_get_component, gfc_get_formal_arglist, gfc_get_actual_arglist,
+ gfc_get_namelist, gfc_get_omp_clauses, gfc_get_interface,
+ gfc_get_common_head, gfc_get_dt_list, gfc_get_array_ref,
+ gfc_get_ref, gfc_get_equiv, gfc_get_case, gfc_get_iterator,
+ gfc_get_alloc, gfc_get_wide_string): Likewise.
+ * interface.c (count_types_test): Likewise.
+ * intrinsic.c (add_char_conversions, gfc_intrinsic_init_1):
+ Likewise.
+ * io.c (gfc_match_open, gfc_match_close, match_filepos, match_io,
+ gfc_match_inquire, gfc_match_wait): Likewise.
+ * match.c (gfc_match, match_forall_iterator): Likewise.
+ * module.c (gfc_get_pointer_info, gfc_get_use_rename, add_fixup,
+ add_true_name, parse_string, write_atom, quote_string,
+ mio_symtree_ref, mio_gmp_real, write_common_0): Likewise.
+ * options.c (gfc_post_options): Likewise.
+ * primary.c (match_integer_constant, match_hollerith_constant,
+ match_boz_constant, match_real_constant,
+ gfc_get_structure_ctor_component, gfc_match_structure_constructor): Likewise.
+ * scanner.c (gfc_widechar_to_char, add_path_to_list,
+ add_file_change, load_line, get_file, preprocessor_line,
+ load_file, unescape_filename, gfc_read_orig_filename): Likewise.
+ * simplify.c (gfc_simplify_ibits, gfc_simplify_ishft,
+ gfc_simplify_ishftc): Likewise.
+ * symbol.c (gfc_get_st_label, gfc_get_namespace, gfc_new_symtree,
+ gfc_get_uop, gfc_new_symbol, save_symbol_data, gfc_get_gsymbol):
+ Likewise.
+ * target-memory.c (gfc_target_interpret_expr): Likewise.
+ * trans-const.c (gfc_build_wide_string_const): Likewise.
+ * trans-expr.c (gfc_add_interface_mapping): Likewise.
+ * trans-intrinsic.c (gfc_conv_intrinsic_conversion,
+ gfc_conv_intrinsic_int, gfc_conv_intrinsic_lib_function,
+ gfc_conv_intrinsic_cmplx, gfc_conv_intrinsic_ctime,
+ gfc_conv_intrinsic_fdate, gfc_conv_intrinsic_ttynam,
+ gfc_conv_intrinsic_minmax, gfc_conv_intrinsic_minmax_char,
+ gfc_conv_intrinsic_ishftc, gfc_conv_intrinsic_index_scan_verify,
+ gfc_conv_intrinsic_merge, gfc_conv_intrinsic_trim): Likewise.
+ * trans.c (gfc_get_backend_locus): Likewise.
+ * trans.h (gfc_get_ss): Likewise.
+
2008-06-18 Daniel Kraft <d@domob.eu>
PR fortran/36517, fortran/36492
&src->where, gfc_typename(&result->ts));
}
- result->representation.string = gfc_getmem (result_len + 1);
+ result->representation.string = XCNEWVEC (char, result_len + 1);
memcpy (result->representation.string, src->representation.string,
MIN (result_len, src_len));
{
gfc_constructor *c;
- c = gfc_getmem (sizeof(gfc_constructor));
+ c = XCNEW (gfc_constructor);
c->expr = NULL;
c->iterator = NULL;
c->next = NULL;
/* Macros to access allocate memory for gfc_data_variable,
gfc_data_value and gfc_data. */
-#define gfc_get_data_variable() gfc_getmem (sizeof (gfc_data_variable))
-#define gfc_get_data_value() gfc_getmem (sizeof (gfc_data_value))
-#define gfc_get_data() gfc_getmem( sizeof (gfc_data))
+#define gfc_get_data_variable() XCNEW (gfc_data_variable)
+#define gfc_get_data_value() XCNEW (gfc_data_value)
+#define gfc_get_data() XCNEW (gfc_data)
/* This flag is set if an old-style length selector is matched
enumerator_history *new_enum_history;
gcc_assert (sym != NULL && init != NULL);
- new_enum_history = gfc_getmem (sizeof (enumerator_history));
+ new_enum_history = XCNEW (enumerator_history);
new_enum_history->sym = sym;
new_enum_history->initializer = init;
/* Add this symbol to the list of finalizers. */
gcc_assert (gfc_current_block ()->f2k_derived);
++sym->refs;
- f = gfc_getmem (sizeof (gfc_finalizer));
+ f = XCNEW (gfc_finalizer);
f->procedure = sym;
f->where = gfc_current_locus;
f->next = gfc_current_block ()->f2k_derived->finalizers;
{
cur_error_buffer->allocated = cur_error_buffer->allocated
? cur_error_buffer->allocated * 2 : 1000;
- cur_error_buffer->message = xrealloc (cur_error_buffer->message,
- cur_error_buffer->allocated);
+ cur_error_buffer->message = XRESIZEVEC (char, cur_error_buffer->message,
+ cur_error_buffer->allocated);
}
cur_error_buffer->message[cur_error_buffer->index++] = c;
}
if (index + 1 >= allocated)
{
allocated = allocated ? allocated * 2 : 1000;
- line = xrealloc (line, allocated);
+ line = XRESIZEVEC (char, line, allocated);
}
line[index++] = c;
if (c == '\n')
{
gfc_expr *e;
- e = gfc_getmem (sizeof (gfc_expr));
+ e = XCNEW (gfc_expr);
gfc_clear_ts (&e->ts);
e->shape = NULL;
e->ref = NULL;
/* Copy target representation, if it exists. */
if (p->representation.string)
{
- c = gfc_getmem (p->representation.length + 1);
+ c = XCNEWVEC (char, p->representation.length + 1);
q->representation.string = c;
memcpy (c, p->representation.string, (p->representation.length + 1));
}
}
gfc_charlen;
-#define gfc_get_charlen() gfc_getmem(sizeof(gfc_charlen))
+#define gfc_get_charlen() XCNEW (gfc_charlen)
/* Type specification structure. FIXME: derived and cl could be union??? */
typedef struct
}
gfc_array_spec;
-#define gfc_get_array_spec() gfc_getmem(sizeof(gfc_array_spec))
+#define gfc_get_array_spec() XCNEW (gfc_array_spec)
/* Components of derived types. */
}
gfc_component;
-#define gfc_get_component() gfc_getmem(sizeof(gfc_component))
+#define gfc_get_component() XCNEW (gfc_component)
/* Formal argument lists are lists of symbols. */
typedef struct gfc_formal_arglist
}
gfc_formal_arglist;
-#define gfc_get_formal_arglist() gfc_getmem(sizeof(gfc_formal_arglist))
+#define gfc_get_formal_arglist() XCNEW (gfc_formal_arglist)
/* The gfc_actual_arglist structure is for actual arguments. */
}
gfc_actual_arglist;
-#define gfc_get_actual_arglist() gfc_getmem(sizeof(gfc_actual_arglist))
+#define gfc_get_actual_arglist() XCNEW (gfc_actual_arglist)
/* Because a symbol can belong to multiple namelists, they must be
}
gfc_namelist;
-#define gfc_get_namelist() gfc_getmem(sizeof(gfc_namelist))
+#define gfc_get_namelist() XCNEW (gfc_namelist)
enum
{
}
gfc_omp_clauses;
-#define gfc_get_omp_clauses() gfc_getmem(sizeof(gfc_omp_clauses))
+#define gfc_get_omp_clauses() XCNEW (gfc_omp_clauses)
/* The gfc_st_label structure is a doubly linked list attached to a
}
gfc_interface;
-#define gfc_get_interface() gfc_getmem(sizeof(gfc_interface))
+#define gfc_get_interface() XCNEW (gfc_interface)
/* User operator nodes. These are like stripped down symbols. */
}
gfc_common_head;
-#define gfc_get_common_head() gfc_getmem(sizeof(gfc_common_head))
+#define gfc_get_common_head() XCNEW (gfc_common_head)
/* A list of all the alternate entry points for a procedure. */
}
gfc_dt_list;
-#define gfc_get_dt_list() gfc_getmem(sizeof(gfc_dt_list))
+#define gfc_get_dt_list() XCNEW (gfc_dt_list)
/* A list of all derived types. */
extern gfc_dt_list *gfc_derived_types;
}
gfc_array_ref;
-#define gfc_get_array_ref() gfc_getmem(sizeof(gfc_array_ref))
+#define gfc_get_array_ref() XCNEW (gfc_array_ref)
/* Component reference nodes. A variable is stored as an expression
}
gfc_ref;
-#define gfc_get_ref() gfc_getmem(sizeof(gfc_ref))
+#define gfc_get_ref() XCNEW (gfc_ref)
/* Structures representing intrinsic symbols and their arguments lists. */
}
gfc_equiv;
-#define gfc_get_equiv() gfc_getmem(sizeof(gfc_equiv))
+#define gfc_get_equiv() XCNEW (gfc_equiv)
/* Holds a single equivalence member after processing. */
typedef struct gfc_equiv_info
}
gfc_case;
-#define gfc_get_case() gfc_getmem(sizeof(gfc_case))
+#define gfc_get_case() XCNEW (gfc_case)
typedef struct
}
gfc_iterator;
-#define gfc_get_iterator() gfc_getmem(sizeof(gfc_iterator))
+#define gfc_get_iterator() XCNEW (gfc_iterator)
/* Allocation structure for ALLOCATE, DEALLOCATE and NULLIFY statements. */
}
gfc_alloc;
-#define gfc_get_alloc() gfc_getmem(sizeof(gfc_alloc))
+#define gfc_get_alloc() XCNEW (gfc_alloc)
typedef struct
char *gfc_widechar_to_char (const gfc_char_t *, int);
gfc_char_t *gfc_char_to_widechar (const char *);
-#define gfc_get_wide_string(n) gfc_getmem((n) * sizeof(gfc_char_t))
+#define gfc_get_wide_string(n) XCNEWVEC (gfc_char_t, n)
void gfc_skip_comments (void);
gfc_char_t gfc_next_char_literal (int);
/* Build an array of integers that gives the same integer to
arguments of the same type/rank. */
- arg = gfc_getmem (n1 * sizeof (arginfo));
+ arg = XCNEWVEC (arginfo, n1);
f = f1;
for (i = 0; i < n1; i++, f = f->next)
ncharconv++;
/* Allocate memory. */
- char_conversions = gfc_getmem (sizeof (gfc_intrinsic_sym) * ncharconv);
+ char_conversions = XCNEWVEC (gfc_intrinsic_sym, ncharconv);
/* Add the conversions themselves. */
n = 0;
sizing = SZ_CONVS;
add_conversions ();
- functions = gfc_getmem (sizeof (gfc_intrinsic_sym) * (nfunc + nsub)
- + sizeof (gfc_intrinsic_arg) * nargs);
+ functions = XCNEWVAR (struct gfc_intrinsic_sym,
+ sizeof (gfc_intrinsic_sym) * (nfunc + nsub)
+ + sizeof (gfc_intrinsic_arg) * nargs);
next_sym = functions;
subroutines = functions + nfunc;
- conversion = gfc_getmem (sizeof (gfc_intrinsic_sym) * nconv);
+ conversion = XCNEWVEC (gfc_intrinsic_sym, nconv);
next_arg = ((gfc_intrinsic_arg *) (subroutines + nsub)) - 1;
if (m == MATCH_NO)
return m;
- open = gfc_getmem (sizeof (gfc_open));
+ open = XCNEW (gfc_open);
m = match_open_element (open);
if (m == MATCH_NO)
return m;
- close = gfc_getmem (sizeof (gfc_close));
+ close = XCNEW (gfc_close);
m = match_close_element (close);
gfc_filepos *fp;
match m;
- fp = gfc_getmem (sizeof (gfc_filepos));
+ fp = XCNEW (gfc_filepos);
if (gfc_match_char ('(') == MATCH_NO)
{
where = gfc_current_locus;
comma_flag = 0;
- current_dt = dt = gfc_getmem (sizeof (gfc_dt));
+ current_dt = dt = XCNEW (gfc_dt);
m = gfc_match_char ('(');
if (m == MATCH_NO)
{
if (m == MATCH_NO)
return m;
- inquire = gfc_getmem (sizeof (gfc_inquire));
+ inquire = XCNEW (gfc_inquire);
loc = gfc_current_locus;
if (m == MATCH_NO)
return m;
- wait = gfc_getmem (sizeof (gfc_wait));
+ wait = XCNEW (gfc_wait);
loc = gfc_current_locus;
case 'e':
case 'v':
vp = va_arg (argp, void **);
- gfc_free_expr (*vp);
+ gfc_free_expr ((struct gfc_expr *)*vp);
*vp = NULL;
break;
}
match m;
where = gfc_current_locus;
- iter = gfc_getmem (sizeof (gfc_forall_iterator));
+ iter = XCNEW (gfc_forall_iterator);
m = gfc_match_expr (&iter->var);
if (m != MATCH_YES)
}
pointer_info;
-#define gfc_get_pointer_info() gfc_getmem(sizeof(pointer_info))
+#define gfc_get_pointer_info() XCNEW (pointer_info)
/* Lists of rename info for the USE statement. */
}
gfc_use_rename;
-#define gfc_get_use_rename() gfc_getmem(sizeof(gfc_use_rename))
+#define gfc_get_use_rename() XCNEW (gfc_use_rename);
/* Local variables */
if (p->integer == 0 || p->u.pointer != NULL)
{
- cp = gp;
- *cp = p->u.pointer;
+ cp = (char **) gp;
+ *cp = (char *) p->u.pointer;
}
else
{
- f = gfc_getmem (sizeof (fixup_t));
+ f = XCNEW (fixup_t);
f->next = p->fixup;
p->fixup = f;
- f->pointer = gp;
+ f->pointer = (void **) gp;
}
return p;
{
true_name *t;
- t = gfc_getmem (sizeof (true_name));
+ t = XCNEW (true_name);
t->sym = sym;
gfc_insert_bbt (&true_name_root, t, compare_true_names);
set_module_locus (&start);
- atom_string = p = gfc_getmem (len + 1);
+ atom_string = p = XCNEWVEC (char, len + 1);
for (; len > 0; len--)
{
{
case ATOM_STRING:
case ATOM_NAME:
- p = v;
+ p = (const char *) v;
break;
case ATOM_LPAREN:
len++;
}
- q = res = gfc_getmem (len + 1);
+ q = res = XCNEWVEC (char, len + 1);
for (p = s, i = 0; i < slength; p++, i++)
{
if (*p == '\\')
}
else
{
- f = gfc_getmem (sizeof (fixup_t));
+ f = XCNEW (fixup_t);
f->next = p->u.rsym.stfixup;
p->u.rsym.stfixup = f;
return;
}
- atom_string = gfc_getmem (strlen (p) + 20);
+ atom_string = XCNEWVEC (char, strlen (p) + 20);
sprintf (atom_string, "0.%s@%ld", p, exponent);
mio_rparen ();
/* Record that we have written this common. */
- w = gfc_getmem (sizeof (struct written_common));
+ w = XCNEW (struct written_common);
w->name = p->name;
w->label = label;
gfc_insert_bbt (&written_commons, w, compare_written_commons);
if (i != 0)
{
- source_path = alloca (i + 1);
+ source_path = (char *) alloca (i + 1);
memcpy (source_path, canon_source_file, i);
source_path[i] = 0;
gfc_add_include_path (source_path, true);
if (length == -1)
return MATCH_NO;
- buffer = alloca (length + 1);
+ buffer = (char *) alloca (length + 1);
memset (buffer, '\0', length + 1);
gfc_gobble_whitespace ();
e = gfc_constant_result (BT_HOLLERITH, gfc_default_character_kind,
&gfc_current_locus);
- e->representation.string = gfc_getmem (num + 1);
+ e->representation.string = XCNEWVEC (char, num + 1);
for (i = 0; i < num; i++)
{
gfc_current_locus = old_loc;
- buffer = alloca (length + 1);
+ buffer = (char *) alloca (length + 1);
memset (buffer, '\0', length + 1);
match_digits (0, radix, buffer);
gfc_current_locus = old_loc;
gfc_gobble_whitespace ();
- buffer = alloca (count + 1);
+ buffer = (char *) alloca (count + 1);
memset (buffer, '\0', count + 1);
p = buffer;
}
gfc_structure_ctor_component;
-#define gfc_get_structure_ctor_component() \
- gfc_getmem(sizeof(gfc_structure_ctor_component))
+#define gfc_get_structure_ctor_component() XCNEW (gfc_structure_ctor_component)
static void
gfc_free_structure_ctor_component (gfc_structure_ctor_component *comp)
comp_tail->next = gfc_get_structure_ctor_component ();
comp_tail = comp_tail->next;
}
- comp_tail->name = gfc_getmem(GFC_MAX_SYMBOL_LEN + 1);
+ comp_tail->name = XCNEWVEC (char, GFC_MAX_SYMBOL_LEN + 1);
comp_tail->val = NULL;
comp_tail->where = gfc_current_locus;
/* Passing a negative length is used to indicate that length should be
calculated using gfc_wide_strlen(). */
len = (length >= 0 ? (size_t) length : gfc_wide_strlen (s));
- res = gfc_getmem (len + 1);
+ res = XNEWVEC (char, len + 1);
for (i = 0; i < len; i++)
{
dir = *list;
if (!dir)
- dir = *list = gfc_getmem (sizeof (gfc_directorylist));
+ dir = *list = XCNEW (gfc_directorylist);
else
{
while (dir->next)
dir = dir->next;
- dir->next = gfc_getmem (sizeof (gfc_directorylist));
+ dir->next = XCNEW (gfc_directorylist);
dir = dir->next;
}
dir->next = NULL;
dir->use_for_modules = use_for_modules;
- dir->path = gfc_getmem (strlen (p) + 2);
+ dir->path = XCNEWVEC (char, strlen (p) + 2);
strcpy (dir->path, p);
strcat (dir->path, "/"); /* make '/' last character */
}
file_changes_allocated *= 2;
else
file_changes_allocated = 16;
- file_changes
- = xrealloc (file_changes,
- file_changes_allocated * sizeof (*file_changes));
+ file_changes = XRESIZEVEC (struct gfc_file_change, file_changes,
+ file_changes_allocated);
}
file_changes[file_changes_count].filename = filename;
file_changes[file_changes_count].lb = NULL;
/* Reallocate line buffer to double size to hold the
overlong line. */
buflen = buflen * 2;
- *pbuf = xrealloc (*pbuf, (buflen + 1) * sizeof (gfc_char_t));
+ *pbuf = XRESIZEVEC (gfc_char_t, *pbuf, (buflen + 1));
buffer = (*pbuf) + i;
}
}
{
gfc_file *f;
- f = gfc_getmem (sizeof (gfc_file));
+ f = XCNEW (gfc_file);
- f->filename = gfc_getmem (strlen (name) + 1);
- strcpy (f->filename, name);
+ f->filename = xstrdup (name);
f->next = file_head;
file_head = f;
if (strcmp (current_file->filename, filename) != 0)
{
gfc_free (current_file->filename);
- current_file->filename = gfc_getmem (strlen (filename) + 1);
- strcpy (current_file->filename, filename);
+ current_file->filename = xstrdup (filename);
}
/* Set new line number. */
/* Add line. */
- b = gfc_getmem (gfc_linebuf_header_size
- + (len + 1) * sizeof (gfc_char_t));
+ b = (gfc_linebuf *) gfc_getmem (gfc_linebuf_header_size
+ + (len + 1) * sizeof (gfc_char_t));
b->location
= linemap_line_start (line_table, current_file->line++, 120);
/* Undo effects of cpp_quote_string. */
s = ptr;
- d = gfc_getmem (p + 1 - ptr - unescape);
+ d = XCNEWVEC (char, p + 1 - ptr - unescape);
ret = d;
while (s != p)
if (! IS_ABSOLUTE_PATH (filename))
{
- char *p = gfc_getmem (len + strlen (filename));
+ char *p = XCNEWVEC (char, len + strlen (filename));
memcpy (p, dirname, len - 2);
p[len - 2] = '/';
convert_mpz_to_unsigned (result->value.integer,
gfc_integer_kinds[k].bit_size);
- bits = gfc_getmem (bitsize * sizeof (int));
+ bits = XCNEWVEC (int, bitsize);
for (i = 0; i < bitsize; i++)
bits[i] = 0;
return range_check (result, "ISHFT");
}
- bits = gfc_getmem (isize * sizeof (int));
+ bits = XCNEWVEC (int, isize);
for (i = 0; i < isize; i++)
bits[i] = mpz_tstbit (e->value.integer, i);
convert_mpz_to_unsigned (result->value.integer, isize);
- bits = gfc_getmem (ssize * sizeof (int));
+ bits = XCNEWVEC (int, ssize);
for (i = 0; i < ssize; i++)
bits[i] = mpz_tstbit (e->value.integer, i);
{
gfc_code *c;
- c = gfc_getmem (sizeof (gfc_code));
+ c = XCNEW (gfc_code);
c->loc = gfc_current_locus;
return c;
}
lp = lp->right;
}
- lp = gfc_getmem (sizeof (gfc_st_label));
+ lp = XCNEW (gfc_st_label);
lp->value = labelno;
lp->defined = ST_LABEL_UNKNOWN;
gfc_intrinsic_op in;
int i;
- ns = gfc_getmem (sizeof (gfc_namespace));
+ ns = XCNEW (gfc_namespace);
ns->sym_root = NULL;
ns->uop_root = NULL;
ns->finalizers = NULL;
{
gfc_symtree *st;
- st = gfc_getmem (sizeof (gfc_symtree));
+ st = XCNEW (gfc_symtree);
st->name = gfc_get_string (name);
gfc_insert_bbt (root, st, compare_symtree);
st = gfc_new_symtree (&gfc_current_ns->uop_root, name);
- uop = st->n.uop = gfc_getmem (sizeof (gfc_user_op));
+ uop = st->n.uop = XCNEW (gfc_user_op);
uop->name = gfc_get_string (name);
uop->access = ACCESS_UNKNOWN;
uop->ns = gfc_current_ns;
{
gfc_symbol *p;
- p = gfc_getmem (sizeof (gfc_symbol));
+ p = XCNEW (gfc_symbol);
gfc_clear_ts (&p->ts);
gfc_clear_attr (&p->attr);
if (sym->new || sym->old_symbol != NULL)
return;
- sym->old_symbol = gfc_getmem (sizeof (gfc_symbol));
+ sym->old_symbol = XCNEW (gfc_symbol);
*(sym->old_symbol) = *sym;
sym->tlink = changed_syms;
if (s != NULL)
return s;
- s = gfc_getmem (sizeof (gfc_gsymbol));
+ s = XCNEW (gfc_gsymbol);
s->type = GSYM_UNKNOWN;
s->name = gfc_get_string (name);
else
{
result->representation.string =
- gfc_getmem (result->representation.length + 1);
+ (char *) gfc_getmem (result->representation.length + 1);
memcpy (result->representation.string, buffer,
result->representation.length);
result->representation.string[result->representation.length] = '\0';
i = gfc_validate_kind (BT_CHARACTER, kind, false);
size = length * gfc_character_kinds[i].bit_size / 8;
- s = gfc_getmem (size);
+ s = XCNEWVAR (char, size);
gfc_encode_character (kind, length, string, (unsigned char *) s, size);
str = build_string (size, s);
gcc_assert (new_symtree == root);
/* Create a dummy->actual mapping. */
- sm = gfc_getmem (sizeof (*sm));
+ sm = XCNEW (gfc_interface_sym_mapping);
sm->next = mapping->syms;
sm->old = sym;
sm->new = new_symtree;
int nargs;
nargs = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * nargs);
+ args = (tree *) alloca (sizeof (tree) * nargs);
/* Evaluate all the arguments passed. Whilst we're only interested in the
first one here, there are other parts of the front-end that assume this
int nargs;
nargs = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * nargs);
+ args = (tree *) alloca (sizeof (tree) * nargs);
/* Evaluate the argument, we process all arguments even though we only
use the first one for code generation purposes. */
/* Get the decl and generate the call. */
num_args = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
gfc_conv_intrinsic_function_args (se, expr, args, num_args);
fndecl = gfc_get_intrinsic_lib_fndecl (m, expr);
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
type = gfc_typenode_for_spec (&expr->ts);
gfc_conv_intrinsic_function_args (se, expr, args, num_args);
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr) + 2;
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
var = gfc_create_var (pchar_type_node, "pstr");
len = gfc_create_var (gfc_get_int_type (8), "len");
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr) + 2;
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
var = gfc_create_var (pchar_type_node, "pstr");
len = gfc_create_var (gfc_get_int_type (4), "len");
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr) + 2;
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
var = gfc_create_var (pchar_type_node, "pstr");
len = gfc_create_var (gfc_get_int_type (4), "len");
unsigned int i, nargs;
nargs = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * nargs);
+ args = (tree *) alloca (sizeof (tree) * nargs);
gfc_conv_intrinsic_function_args (se, expr, args, nargs);
type = gfc_typenode_for_spec (&expr->ts);
unsigned int nargs;
nargs = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * (nargs + 4));
+ args = (tree *) alloca (sizeof (tree) * (nargs + 4));
gfc_conv_intrinsic_function_args (se, expr, &args[4], nargs);
/* Create the result variables. */
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
gfc_conv_intrinsic_function_args (se, expr, args, num_args);
tree *args;
unsigned int num_args;
- args = alloca (sizeof (tree) * 5);
+ args = (tree *) alloca (sizeof (tree) * 5);
/* Get number of arguments; characters count double due to the
string length argument. Kind= is not passed to the libary
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr);
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
gfc_conv_intrinsic_function_args (se, expr, args, num_args);
if (expr->ts.type != BT_CHARACTER)
unsigned int num_args;
num_args = gfc_intrinsic_argument_list_length (expr) + 2;
- args = alloca (sizeof (tree) * num_args);
+ args = (tree *) alloca (sizeof (tree) * num_args);
var = gfc_create_var (gfc_get_pchar_type (expr->ts.kind), "pstr");
addr = gfc_build_addr_expr (ppvoid_type_node, var);
void
gfc_get_backend_locus (locus * loc)
{
- loc->lb = gfc_getmem (sizeof (gfc_linebuf));
+ loc->lb = XCNEW (gfc_linebuf);
loc->lb->location = input_location;
loc->lb->file = gfc_current_backend_file;
}
unsigned useflags:2, where:1;
}
gfc_ss;
-#define gfc_get_ss() gfc_getmem(sizeof(gfc_ss))
+#define gfc_get_ss() XCNEW (gfc_ss)
/* The contents of this aren't actually used. A NULL SS chain indicates a
scalar expression, so this pointer is used to terminate SS chains. */