From: Tobias Schlüter Date: Fri, 13 Aug 2004 17:24:09 +0000 (+0000) Subject: gfortran.h: Add comments. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f61394674dcc4035dc9cf4dc4d80ae765eca039;p=gcc.git gfortran.h: Add comments. 2004-08-13 Tobias Schlueter * gfortran.h: Add comments. * parse.c (parse_contained): Fix comment typo. * resolve.c (was_declared): Ditto. * symbol.c: Ditto. From-SVN: r85950 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7e3d5131d81..935b7483630 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2004-08-13 Tobias Schlueter + + * gfortran.h: Add comments. + * parse.c (parse_contained): Fix comment typo. + * resolve.c (was_declared): Ditto. + * symbol.c: Ditto. + 2004-08-11 Paul Brook PR fortran/16917 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index 19a22147758..80cdbbe9163 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -528,7 +528,9 @@ gfc_component; /* Formal argument lists are lists of symbols. */ typedef struct gfc_formal_arglist { + /* Symbol representing the argument at this position in the arglist. */ struct gfc_symbol *sym; + /* Points to the next formal argument. */ struct gfc_formal_arglist *next; } gfc_formal_arglist; @@ -712,18 +714,39 @@ gfc_symtree; typedef struct gfc_namespace { - /* Roots of the red/black symbol trees */ - gfc_symtree *sym_root, *uop_root, *common_root; - + /* Tree containing all the symbols in this namespace. */ + gfc_symtree *sym_root; + /* Tree containing all the user-defined operators in the namespace. */ + gfc_symtree *uop_root; + /* Tree containing all the common blocks. */ + gfc_symtree *common_root; + + /* If set_flag[letter] is set, an implicit type has been set for letter. */ int set_flag[GFC_LETTERS]; - gfc_typespec default_type[GFC_LETTERS]; /* IMPLICIT typespecs */ + /* Keeps track of the implicit types associated with the letters. */ + gfc_typespec default_type[GFC_LETTERS]; + /* If this is a namespace of a procedure, this points to the procedure. */ struct gfc_symbol *proc_name; - gfc_interface *operator[GFC_INTRINSIC_OPS]; - struct gfc_namespace *parent, *contained, *sibling; + /* If this is the namespace of a unit which contains executable + code, this points to it. */ struct gfc_code *code; - gfc_common_head blank_common; + + /* Points to the equivalences set up in this namespace. */ struct gfc_equiv *equiv; + gfc_interface *operator[GFC_INTRINSIC_OPS]; + + /* Points to the parent namespace, i.e. the namespace of a module or + procedure in which the procedure belonging to this namespace is + contained. The parent namespace points to this namespace either + directly via CONTAINED, or indirectly via the chain built by + SIBLING. */ + struct gfc_namespace *parent; + /* CONTAINED points to the first contained namespace. Sibling + namespaces are chained via SIBLING. */ + struct gfc_namespace *contained, *sibling; + + gfc_common_head blank_common; gfc_access default_access, operator_access[GFC_INTRINSIC_OPS]; gfc_st_label *st_labels; @@ -850,6 +873,13 @@ typedef struct gfc_intrinsic_arg gfc_intrinsic_arg; +/* Specifies the various kinds of check functions used to verify the + argument lists of intrinsic functions. fX with X an integer refer + to check functions of intrinsics with X arguments. f1m is used for + the MAX and MIN intrinsics which can have an arbitrary number of + arguments, f3ml is used for the MINLOC and MAXLOC intrinsics as + these have special semantics. */ + typedef union { try (*f1)(struct gfc_expr *); @@ -864,6 +894,9 @@ typedef union } gfc_check_f; +/* Like gfc_check_f, these specify the type of the simplification + function associated with an intrinsic. The fX are just like in + gfc_check_f. cc is used for type conversion functions. */ typedef union { @@ -880,6 +913,10 @@ typedef union } gfc_simplify_f; +/* Again like gfc_check_f, these specify the type of the resolution + function associated with an intrinsic. The fX are juse like in + gfc_check_f. f1m is used for MIN and MAX, s1 is used for abort(). + */ typedef union { diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index 765fd06c5bf..bd74139623d 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -2201,7 +2201,7 @@ parse_contained (int module) gfc_new_block); /* For internal procedures, create/update the symbol in the - * parent namespace */ + parent namespace. */ if (!module) { diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 81df9ef03f8..00d9e3daa63 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -371,7 +371,7 @@ resolve_structure_cons (gfc_expr * expr) /****************** Expression name resolution ******************/ /* Returns 0 if a symbol was not declared with a type or - or attribute declaration statement, nonzero otherwise. */ + attribute declaration statement, nonzero otherwise. */ static int was_declared (gfc_symbol * sym) diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 3159436eeb9..4b6c6e416dc 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -1560,7 +1560,7 @@ done: symbols are kept in a singly linked list so that we can commit or undo the changes at a later time. - A symtree may point to a symbol node outside of it's namespace. In + A symtree may point to a symbol node outside of its namespace. In this case, that symbol has been used as a host associated variable at some previous time. */