From: Kaveh R. Ghazi Date: Sat, 19 Jul 2008 16:19:27 +0000 (+0000) Subject: gfortran.h (protected): Remove macro. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9aa433c2945d1f8d62961452bcd4e07f509815a8;p=gcc.git gfortran.h (protected): Remove macro. * gfortran.h (protected): Remove macro. * dump-parse-tree.c (show_attr): Avoid C++ keywords. * expr.c (gfc_check_pointer_assign): Likewise. * interface.c (compare_parameter_protected): Likewise. * intrinsic.c (enum class, add_sym, add_sym_0, add_sym_1, add_sym_1s, add_sym_1m, add_sym_2, add_sym_2s, add_sym_3, add_sym_3ml, add_sym_3red, add_sym_3s, add_sym_4, add_sym_4s, add_sym_5s): Likewise. * match.c (gfc_match_assignment, gfc_match_pointer_assignment): Likewise. * module.c (mio_symbol_attribute): Likewise. * primary.c (match_variable): Likewise. * resolve.c (resolve_equivalence): Likewise. * symbol.c (check_conflict, gfc_add_protected, gfc_copy_attr): Likewise. * trans-types.c (gfc_get_array_type_bounds): Likewise. From-SVN: r137980 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 845dcf77c71..3f57c876e61 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,22 @@ +2008-07-19 Kaveh R. Ghazi + + * gfortran.h (protected): Remove macro. + * dump-parse-tree.c (show_attr): Avoid C++ keywords. + * expr.c (gfc_check_pointer_assign): Likewise. + * interface.c (compare_parameter_protected): Likewise. + * intrinsic.c (enum class, add_sym, add_sym_0, add_sym_1, + add_sym_1s, add_sym_1m, add_sym_2, add_sym_2s, add_sym_3, + add_sym_3ml, add_sym_3red, add_sym_3s, add_sym_4, add_sym_4s, + add_sym_5s): Likewise. + * match.c (gfc_match_assignment, gfc_match_pointer_assignment): + Likewise. + * module.c (mio_symbol_attribute): Likewise. + * primary.c (match_variable): Likewise. + * resolve.c (resolve_equivalence): Likewise. + * symbol.c (check_conflict, gfc_add_protected, gfc_copy_attr): + Likewise. + * trans-types.c (gfc_get_array_type_bounds): Likewise. + 2008-07-18 Kaveh R. Ghazi * arith.c (eval_type_intrinsic0): Avoid C++ keywords. diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c index 80ff5bcecb7..4ae61c6b0fa 100644 --- a/gcc/fortran/dump-parse-tree.c +++ b/gcc/fortran/dump-parse-tree.c @@ -570,7 +570,7 @@ show_attr (symbol_attribute *attr) fputs (" OPTIONAL", dumpfile); if (attr->pointer) fputs (" POINTER", dumpfile); - if (attr->protected) + if (attr->is_protected) fputs (" PROTECTED", dumpfile); if (attr->value) fputs (" VALUE", dumpfile); diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 12987e6b748..d37950033e9 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3000,7 +3000,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) return FAILURE; } - if (attr.protected && attr.use_assoc) + if (attr.is_protected && attr.use_assoc) { gfc_error ("Pointer assigment target has PROTECTED " "attribute at %L", &rvalue->where); diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 5c6fd92d404..4cc8be2a73a 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -627,8 +627,6 @@ typedef struct ENUM_BITFIELD (save_state) save:2; unsigned data:1, /* Symbol is named in a DATA statement. */ - /* FIXME: This macro is temporary until we convert everything. */ -#define protected is_protected is_protected:1, /* Symbol has been marked as protected. */ use_assoc:1, /* Symbol has been use-associated. */ use_only:1, /* Symbol has been use-associated, with ONLY. */ diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index a20319976bb..147ded0471c 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -1565,7 +1565,7 @@ compare_parameter_protected (gfc_symbol *formal, gfc_expr *actual) if (actual->expr_type != EXPR_VARIABLE) return 1; - if (!actual->symtree->n.sym->attr.protected) + if (!actual->symtree->n.sym->attr.is_protected) return 1; if (!actual->symtree->n.sym->attr.use_assoc) diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c index df412757823..db3237ebe36 100644 --- a/gcc/fortran/intrinsic.c +++ b/gcc/fortran/intrinsic.c @@ -48,7 +48,7 @@ static enum { SZ_NOTHING = 0, SZ_SUBS, SZ_FUNCS, SZ_CONVS } sizing; -enum class +enum klass { NO_CLASS = 0, CLASS_ELEMENTAL, CLASS_INQUIRY, CLASS_TRANSFORMATIONAL }; #define ACTUAL_NO 0 @@ -243,7 +243,7 @@ do_check (gfc_intrinsic_sym *specific, gfc_actual_arglist *arg) ZABS ZCOS ZEXP ZLOG ZSIN ZSQRT. */ static void -add_sym (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, int kind, +add_sym (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, gfc_check_f check, gfc_simplify_f simplify, gfc_resolve_f resolve, ...) { @@ -332,7 +332,7 @@ add_sym (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type 0 arguments. */ static void -add_sym_0 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_0 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (void), gfc_expr *(*simplify) (void), @@ -374,7 +374,7 @@ add_sym_0s (const char *name, gfc_isym_id id, int standard, void (*resolve) (gfc 1 arguments. */ static void -add_sym_1 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_1 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_expr *), gfc_expr *(*simplify) (gfc_expr *), @@ -399,7 +399,7 @@ add_sym_1 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt ty 1 arguments. */ static void -add_sym_1s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, int standard, +add_sym_1s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard, try (*check) (gfc_expr *), gfc_expr *(*simplify) (gfc_expr *), void (*resolve) (gfc_code *), @@ -423,7 +423,7 @@ add_sym_1s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, function. MAX et al take 2 or more arguments. */ static void -add_sym_1m (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_1m (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_actual_arglist *), gfc_expr *(*simplify) (gfc_expr *), @@ -450,7 +450,7 @@ add_sym_1m (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt t 2 arguments. */ static void -add_sym_2 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_2 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *), @@ -477,7 +477,7 @@ add_sym_2 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt ty 2 arguments. */ static void -add_sym_2s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, int standard, +add_sym_2s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *), void (*resolve) (gfc_code *), @@ -503,7 +503,7 @@ add_sym_2s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, 3 arguments. */ static void -add_sym_3 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_3 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *), @@ -532,7 +532,7 @@ add_sym_3 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt ty might have to be reordered. */ static void -add_sym_3ml (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_3ml (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_actual_arglist *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *), @@ -561,7 +561,7 @@ add_sym_3ml (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt their argument also might have to be reordered. */ static void -add_sym_3red (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_3red (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_actual_arglist *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *), @@ -590,7 +590,7 @@ add_sym_3red (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt 3 arguments. */ static void -add_sym_3s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, int standard, +add_sym_3s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *), void (*resolve) (gfc_code *), @@ -618,7 +618,7 @@ add_sym_3s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, 4 arguments. */ static void -add_sym_4 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt type, +add_sym_4 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *, @@ -651,7 +651,7 @@ add_sym_4 (const char *name, gfc_isym_id id, enum class cl, int actual_ok, bt ty 4 arguments. */ static void -add_sym_4s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, int standard, +add_sym_4s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *), @@ -682,7 +682,7 @@ add_sym_4s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, 5 arguments. */ static void -add_sym_5s (const char *name, gfc_isym_id id, enum class cl, bt type, int kind, int standard, +add_sym_5s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard, try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *), gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *, diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index d501d682475..feaa2683f27 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -1287,7 +1287,7 @@ gfc_match_assignment (void) return MATCH_NO; } - if (lvalue->symtree->n.sym->attr.protected + if (lvalue->symtree->n.sym->attr.is_protected && lvalue->symtree->n.sym->attr.use_assoc) { gfc_current_locus = old_loc; @@ -1347,7 +1347,7 @@ gfc_match_pointer_assignment (void) if (m != MATCH_YES) goto cleanup; - if (lvalue->symtree->n.sym->attr.protected + if (lvalue->symtree->n.sym->attr.is_protected && lvalue->symtree->n.sym->attr.use_assoc) { gfc_error ("Assigning to a PROTECTED pointer at %C"); diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 67b09c767e9..9e9e7680f81 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -1741,7 +1741,7 @@ mio_symbol_attribute (symbol_attribute *attr) MIO_NAME (ab_attribute) (AB_OPTIONAL, attr_bits); if (attr->pointer) MIO_NAME (ab_attribute) (AB_POINTER, attr_bits); - if (attr->protected) + if (attr->is_protected) MIO_NAME (ab_attribute) (AB_PROTECTED, attr_bits); if (attr->value) MIO_NAME (ab_attribute) (AB_VALUE, attr_bits); @@ -1836,7 +1836,7 @@ mio_symbol_attribute (symbol_attribute *attr) attr->pointer = 1; break; case AB_PROTECTED: - attr->protected = 1; + attr->is_protected = 1; break; case AB_VALUE: attr->value = 1; diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index c67f2bd1873..1d69d886797 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2739,7 +2739,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag) switch (sym->attr.flavor) { case FL_VARIABLE: - if (sym->attr.protected && sym->attr.use_assoc) + if (sym->attr.is_protected && sym->attr.use_assoc) { gfc_error ("Assigning to PROTECTED variable at %C"); return MATCH_ERROR; diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a1baa9e8d75..0eb78bdc8a5 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -8962,7 +8962,7 @@ resolve_equivalence (gfc_equiv *eq) sym = e->symtree->n.sym; - if (sym->attr.protected) + if (sym->attr.is_protected) cnt_protected++; if (cnt_protected > 0 && cnt_protected != object) { diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index f91ef9157c0..c5d56c7dbcd 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -344,14 +344,14 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) *intent_in = "INTENT(IN)", *intrinsic = "INTRINSIC", *intent_out = "INTENT(OUT)", *intent_inout = "INTENT(INOUT)", *allocatable = "ALLOCATABLE", *elemental = "ELEMENTAL", - *private = "PRIVATE", *recursive = "RECURSIVE", + *privat = "PRIVATE", *recursive = "RECURSIVE", *in_common = "COMMON", *result = "RESULT", *in_namelist = "NAMELIST", - *public = "PUBLIC", *optional = "OPTIONAL", *entry = "ENTRY", + *publik = "PUBLIC", *optional = "OPTIONAL", *entry = "ENTRY", *function = "FUNCTION", *subroutine = "SUBROUTINE", *dimension = "DIMENSION", *in_equivalence = "EQUIVALENCE", *use_assoc = "USE ASSOCIATED", *cray_pointer = "CRAY POINTER", *cray_pointee = "CRAY POINTEE", *data = "DATA", *value = "VALUE", - *volatile_ = "VOLATILE", *protected = "PROTECTED", + *volatile_ = "VOLATILE", *is_protected = "PROTECTED", *is_bind_c = "BIND(C)", *procedure = "PROCEDURE"; static const char *threadprivate = "THREADPRIVATE"; @@ -383,9 +383,9 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) if (attr->optional) a1 = optional; if (attr->access == ACCESS_PRIVATE) - a1 = private; + a1 = privat; if (attr->access == ACCESS_PUBLIC) - a1 = public; + a1 = publik; if (attr->intent != INTENT_UNKNOWN) a1 = intent; @@ -541,9 +541,9 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) goto conflict; } - conf (protected, intrinsic) - conf (protected, external) - conf (protected, in_common) + conf (is_protected, intrinsic) + conf (is_protected, external) + conf (is_protected, in_common) conf (volatile_, intrinsic) conf (volatile_, external) @@ -558,7 +558,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf (procedure, allocatable) conf (procedure, dimension) conf (procedure, intrinsic) - conf (procedure, protected) + conf (procedure, is_protected) conf (procedure, target) conf (procedure, value) conf (procedure, volatile_) @@ -585,7 +585,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf2 (dummy); conf2 (volatile_); conf2 (pointer); - conf2 (protected); + conf2 (is_protected); conf2 (target); conf2 (external); conf2 (intrinsic); @@ -599,7 +599,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) if (attr->access == ACCESS_PUBLIC || attr->access == ACCESS_PRIVATE) { - a2 = attr->access == ACCESS_PUBLIC ? public : private; + a2 = attr->access == ACCESS_PUBLIC ? publik : privat; gfc_error ("%s attribute applied to %s %s at %L", a2, a1, name, where); return FAILURE; @@ -684,7 +684,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where) conf2 (subroutine); conf2 (entry); conf2 (pointer); - conf2 (protected); + conf2 (is_protected); conf2 (target); conf2 (dummy); conf2 (in_common); @@ -976,7 +976,7 @@ gfc_add_protected (symbol_attribute *attr, const char *name, locus *where) if (check_used (attr, name, where)) return FAILURE; - if (attr->protected) + if (attr->is_protected) { if (gfc_notify_std (GFC_STD_LEGACY, "Duplicate PROTECTED attribute specified at %L", @@ -985,7 +985,7 @@ gfc_add_protected (symbol_attribute *attr, const char *name, locus *where) return FAILURE; } - attr->protected = 1; + attr->is_protected = 1; return check_conflict (attr, name, where); } @@ -1582,7 +1582,7 @@ gfc_copy_attr (symbol_attribute *dest, symbol_attribute *src, locus *where) goto fail; if (src->pointer && gfc_add_pointer (dest, where) == FAILURE) goto fail; - if (src->protected && gfc_add_protected (dest, NULL, where) == FAILURE) + if (src->is_protected && gfc_add_protected (dest, NULL, where) == FAILURE) goto fail; if (src->save && gfc_add_save (dest, NULL, where) == FAILURE) goto fail; diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index fa1bf248aec..9fc0dc9a06c 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -1513,7 +1513,7 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, { char name[8 + GFC_RANK_DIGITS + GFC_MAX_SYMBOL_LEN]; tree fat_type, base_type, arraytype, lower, upper, stride, tmp, rtype; - const char *typename; + const char *type_name; int n; base_type = gfc_get_array_descriptor_base (dimen); @@ -1523,11 +1523,11 @@ gfc_get_array_type_bounds (tree etype, int dimen, tree * lbound, if (tmp && TREE_CODE (tmp) == TYPE_DECL) tmp = DECL_NAME (tmp); if (tmp) - typename = IDENTIFIER_POINTER (tmp); + type_name = IDENTIFIER_POINTER (tmp); else - typename = "unknown"; + type_name = "unknown"; sprintf (name, "array" GFC_RANK_PRINTF_FORMAT "_%.*s", dimen, - GFC_MAX_SYMBOL_LEN, typename); + GFC_MAX_SYMBOL_LEN, type_name); TYPE_NAME (fat_type) = get_identifier (name); GFC_DESCRIPTOR_TYPE_P (fat_type) = 1;