summaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-27 12:35:12 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2004-05-27 12:35:12 +0000
commitcbb9e6aa60312ced2492aedccb38dc1a587fe570 (patch)
tree3c7af6dcd25c3b7df4df9f719eb578e68eb49801 /gcc/fortran/symbol.c
parent03b3b504d8a295cb6b50da00bddd55f186c6d512 (diff)
downloadgcc-cbb9e6aa60312ced2492aedccb38dc1a587fe570.tar.gz
* gfortran.h (gfc_current_locus, gfc_set_locus): Remove.
(gfc_current_locus): Declare new global variable. * scanner.c (gfc_current_locus, gfc_set_locus): Remove. (gfc_current_locus1): Rename ... (gfc_current_locus): ... to this. (gfc_at_eof, gfc_at_bol, gfc_at_eol, gfc_advance_line, next_char, skip_fixed_comments, skip_free_comments, gfc_next_char_literal, gfc_peek_char, gfc_gobble_whitespace, gfc_new_file): Use gfc_current_locus instead of gfc_current_locus1, gfc_set_locus() and gfc_current_locus(), respectively. * array.c (match_subscript, gfc_match_array_ref, match_array_list, match_array_cons_element, gfc_match_array_constructor): Read/modify gfc_current_locus instead of calling gfc_set_locus() and gfc_current_locus(). * decl.c (gfc_match_null, variable_decl, gfc_match_kind_spec, match_attr_spec, gfc_match_function_decl, gfc_match_end, attr_decl1, gfc_match_save): Likewise. * error.c (error_print, gfc_internal_error): Likewise. * expr.c (gfc_int_expr, gfc_default_logical_kind): Likewise. * interface.c (gfc_add_interface): Likewise. * io.c (gfc_match_format, match_dt_format, match_dt_element, match_io_iterator, match_io): Likewise. * match.c (gfc_match_space, gfc_match_eos, gfc_match_small_literal_int, gfc_match_st_label, gfc_match_strings, gfc_match_name, gfc_match_iterator, gfc_match_char, gfc_match, gfc_match_assignment, gfc_match_pointer_assignment, gfc_match_if, gfc_match_do, gfc_match_nullify, gfc_match_call, match_implicit_range, gfc_match_implicit, gfc_match_data, match_case_selector, gfc_match_case, match_forall_iterator): Likewise. * matchexp.c (gfc_match_defined_op_name, next_operator, match_level_1, match_mult_operand, match_ext_mult_operand, match_add_operand, match_ext_add_operand, match_level_2, match_level_3, match_level_4, match_and_operand, match_or_operand, match_equiv_operand, match_level_5, gfc_match_expr): Likewise. * module.c (gfc_match_use, mio_array_ref, mio_expr): Likewise. * parse.c (match_word, decode_statement, next_free, next_fixed, add_statement, verify_st_order, parse_if_block, gfc_parse_file): Likewise. * primary.c (match_digits, match_integer_constant, match_boz_constant, match_real_constant, match_substring, next_string_char, match_charkind_name, match_string_constant, match_logical_constant, match_const_complex_part, match_complex_constant, match_actual_arg, match_keyword_arg, gfc_match_actual_arglist, gfc_match_structure_constructor, gfc_match_rvalue, gfc_match_variable): Likewise. * st.c (gfc_get_code): Likewise. * symbol.c (check_conflict, check_used, check_done, duplicate_attr, add_flavor, gfc_add_procedure, gfc_add_intent, gfc_add_access, gfc_add_explicit_interface, gfc_add_type, gfc_add_component, gfc_reference_st_label, gfc_new_symbol): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82320 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 0d78c032114..6cdd23b4542 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -272,7 +272,7 @@ check_conflict (symbol_attribute * attr, locus * where)
const char *a1, *a2;
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
if (attr->pointer && attr->intent != INTENT_UNKNOWN)
{
@@ -484,7 +484,7 @@ check_used (symbol_attribute * attr, locus * where)
return 0;
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("Cannot change attributes of USE-associated symbol at %L",
where);
@@ -506,7 +506,7 @@ check_done (symbol_attribute * attr, locus * where)
return 0;
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("Cannot change attributes of symbol at %L"
" after it has been used", where);
@@ -522,7 +522,7 @@ duplicate_attr (const char *attr, locus * where)
{
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("Duplicate %s attribute specified at %L", attr, where);
}
@@ -886,7 +886,7 @@ gfc_add_flavor (symbol_attribute * attr, sym_flavor f, locus * where)
if (attr->flavor != FL_UNKNOWN)
{
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("%s attribute conflicts with %s attribute at %L",
gfc_code2string (flavors, attr->flavor),
@@ -913,7 +913,7 @@ gfc_add_procedure (symbol_attribute * attr, procedure_type t, locus * where)
return FAILURE;
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
if (attr->proc != PROC_UNKNOWN)
{
@@ -951,7 +951,7 @@ gfc_add_intent (symbol_attribute * attr, sym_intent intent, locus * where)
}
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("INTENT (%s) conflicts with INTENT(%s) at %L",
gfc_intent_string (attr->intent),
@@ -974,7 +974,7 @@ gfc_add_access (symbol_attribute * attr, gfc_access access, locus * where)
}
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
gfc_error ("ACCESS specification at %L was already specified", where);
return FAILURE;
@@ -990,7 +990,7 @@ gfc_add_explicit_interface (gfc_symbol * sym, ifsrc source,
return FAILURE;
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
if (sym->attr.if_source != IFSRC_UNKNOWN
&& sym->attr.if_source != IFSRC_DECL)
@@ -1019,7 +1019,7 @@ gfc_add_type (gfc_symbol * sym, gfc_typespec * ts, locus * where)
return FAILURE;*/
if (where == NULL)
- where = gfc_current_locus ();
+ where = &gfc_current_locus;
if (sym->ts.type != BT_UNKNOWN)
{
@@ -1221,7 +1221,7 @@ gfc_add_component (gfc_symbol * sym, const char *name, gfc_component ** componen
tail->next = p;
strcpy (p->name, name);
- p->loc = *gfc_current_locus ();
+ p->loc = gfc_current_locus;
*component = p;
return SUCCESS;
@@ -1565,7 +1565,7 @@ gfc_reference_st_label (gfc_st_label * lp, gfc_sl_type type)
else
{
label_type = lp->referenced;
- lp->where = *gfc_current_locus ();
+ lp->where = gfc_current_locus;
}
if (label_type == ST_LABEL_FORMAT && type == ST_LABEL_TARGET)
@@ -1811,7 +1811,7 @@ gfc_new_symbol (const char *name, gfc_namespace * ns)
gfc_clear_attr (&p->attr);
p->ns = ns;
- p->declared_at = *gfc_current_locus ();
+ p->declared_at = gfc_current_locus;
if (strlen (name) > GFC_MAX_SYMBOL_LEN)
gfc_internal_error ("new_symbol(): Symbol name too long");