summaryrefslogtreecommitdiff
path: root/gcc/fortran/gfc-internals.texi
diff options
context:
space:
mode:
authordomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-30 08:26:38 +0000
committerdomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-30 08:26:38 +0000
commitc557b81edd3c8fcb8f44ca7a2180309917116a17 (patch)
treea54c588fffd2ceebd2ab2fa64e58b480a2adb719 /gcc/fortran/gfc-internals.texi
parentabeda242b99639fa482f3d2ed9557ec8e552fa4a (diff)
downloadgcc-c557b81edd3c8fcb8f44ca7a2180309917116a17.tar.gz
2009-08-30 Daniel Kraft <d@domob.eu>
PR fortran/37425 * dump-parse-tree.c (show_typebound_proc): Renamed from `show_typebound' and accept gfc_typebound_proc and name instead of the symtree, needed for intrinsic operator output. (show_typebound_symtree): New method calling `show_typebound_proc'. (show_f2k_derived): Output type-bound operators also. (show_symbol): Moved output of `Procedure bindings:' label to `show_f2k_derived'. * gfortran.texi (Fortran 2003 status): Mention support of array-constructors with explicit type specification, type-bound procedures/operators, type extension, ABSTRACT types and DEFERRED. Link to Fortran 2003 wiki page. (Fortran 2008 status): Fix typo. Link to Fortran 2008 wiki page. * gfc-internals.texi (Type-bound Procedures): Document the new members/attributes of gfc_expr.value.compcall used for type-bound operators. (Type-bound Operators): New section documenting their internals. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151224 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/gfc-internals.texi')
-rw-r--r--gcc/fortran/gfc-internals.texi48
1 files changed, 47 insertions, 1 deletions
diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi
index 65fc7697dc7..8a55b8f5c8c 100644
--- a/gcc/fortran/gfc-internals.texi
+++ b/gcc/fortran/gfc-internals.texi
@@ -31,7 +31,8 @@
@c @end tex
@copying
-Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
+Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation,
+Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -568,6 +569,7 @@ substring reference as described in the subsection above.
@menu
* Type-bound Procedures:: Type-bound procedures.
+* Type-bound Operators:: Type-bound operators.
@end menu
@@ -652,6 +654,50 @@ expression of type @code{EXPR_COMPCALL} of the same structure as mentioned above
except that its target procedure is of course a @code{SUBROUTINE} and not a
@code{FUNCTION}.
+Expressions that are generated internally (as expansion of a type-bound
+operator call) may also use additional flags and members.
+@code{value.compcall.ignore_pass} signals that even though a @code{PASS}
+attribute may be present the actual argument list should not be updated because
+it already contains the passed-object.
+@code{value.compcall.base_object} overrides, if it is set, the base-object
+(that is normally stored in @code{symtree} and @code{ref} as mentioned above);
+this is needed because type-bound operators can be called on a base-object that
+need not be of type @code{EXPR_VARIABLE} and thus representable in this way.
+Finally, if @code{value.compcall.assign} is set, the call was produced in
+expansion of a type-bound assignment; this means that proper dependency-checking
+needs to be done when relevant.
+
+
+@c Type-bound operators
+@c --------------------
+
+@node Type-bound Operators
+@section Type-bound Operators
+
+Type-bound operators are in fact basically just @code{GENERIC} procedure
+bindings and are represented much in the same way as those (see
+@ref{Type-bound Procedures}).
+
+They come in two flavours:
+User-defined operators (like @code{.MYOPERATOR.})
+are stored in the @code{f2k_derived} namespace's @code{tb_uop_root}
+symtree exactly like ordinary type-bound procedures are stored in
+@code{tb_sym_root}; their symtrees' names are the operator-names (e.g.
+@samp{myoperator} in the example).
+Intrinsic operators on the other hand are stored in the namespace's
+array member @code{tb_op} indexed by the intrinsic operator's enum
+value. Those need not be packed into @code{gfc_symtree} structures and are
+only @code{gfc_typebound_proc} instances.
+
+When an operator call or assignment is found that can not be handled in
+another way (i.e. neither matches an intrinsic nor interface operator
+definition) but that contains a derived-type expression, all type-bound
+operators defined on that derived-type are checked for a match with
+the operator call. If there's indeed a relevant definition, the
+operator call is replaced with an internally generated @code{GENERIC}
+type-bound procedure call to the respective definition and that call is
+further processed.
+
@c ---------------------------------------------------------------------
@c LibGFortran