[gfortran, patch, committed] was: Re: [RFC]Make parse-tree-dumping functions available everywhere

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Wed Oct 11 22:24:00 GMT 2006


We seem to have a general consensus among the people working in the  
frontend that having the dumpers available is a good thing, so I've  
committed the attached patch under the obviously correct rule as  
r117646 after testing it on i686-pc-linux.

- Tobi

Paul Thomas <paulthomas2@wanadoo.fr> wrote on Thu, 12 Oct 2006:
> I have been doing this all the time - I thought everybody did it!
>
> Go for it.



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

-------------- next part --------------
2006-10-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

	* gfortran.h (gfc_show_actual_arglist, gfc_show_array_ref,
	gfc_show_array_spec, gfc_show_attr, gfc_show_code,
	gfc_show_components, gfc_show_constructor, gfc_show_equiv,
	gfc_show_expr, gfc_show_namelist, gfc_show_ref, gfc_show_symbol,
	gfc_show_typespec): Add prototypes.
	* dump-parse-tree.c (gfc_show_actual_arglist, gfc_show_array_ref,
	gfc_show_array_spec, gfc_show_attr, gfc_show_code,
	gfc_show_components, gfc_show_constructor, gfc_show_equiv,
	gfc_show_expr, gfc_show_namelist, gfc_show_ref, gfc_show_symbol,
	gfc_show_typespec): Remove 'static' from declaration.

Index: dump-parse-tree.c
===================================================================
--- dump-parse-tree.c	(revision 117643)
+++ dump-parse-tree.c	(working copy)
@@ -37,11 +37,6 @@ Software Foundation, 51 Franklin Street,
 /* Keep track of indentation for symbol tree dumps.  */
 static int show_level = 0;
 
-
-/* Forward declaration because this one needs all, and all need
-   this one.  */
-static void gfc_show_expr (gfc_expr *);
-
 /* Do indentation for a specific level.  */
 
 static inline void
@@ -72,7 +67,7 @@ show_indent (void)
 
 /* Show type-specific information.  */
 
-static void
+void
 gfc_show_typespec (gfc_typespec * ts)
 {
 
@@ -99,7 +94,7 @@ gfc_show_typespec (gfc_typespec * ts)
 
 /* Show an actual argument list.  */
 
-static void
+void
 gfc_show_actual_arglist (gfc_actual_arglist * a)
 {
 
@@ -126,7 +121,7 @@ gfc_show_actual_arglist (gfc_actual_argl
 
 /* Show a gfc_array_spec array specification structure.  */
 
-static void
+void
 gfc_show_array_spec (gfc_array_spec * as)
 {
   const char *c;
@@ -169,7 +164,7 @@ gfc_show_array_spec (gfc_array_spec * as
 
 /* Show a gfc_array_ref array reference structure.  */
 
-static void
+void
 gfc_show_array_ref (gfc_array_ref * ar)
 {
   int i;
@@ -237,7 +232,7 @@ gfc_show_array_ref (gfc_array_ref * ar)
 
 /* Show a list of gfc_ref structures.  */
 
-static void
+void
 gfc_show_ref (gfc_ref * p)
 {
 
@@ -268,7 +263,7 @@ gfc_show_ref (gfc_ref * p)
 
 /* Display a constructor.  Works recursively for array constructors.  */
 
-static void
+void
 gfc_show_constructor (gfc_constructor * c)
 {
 
@@ -301,7 +296,7 @@ gfc_show_constructor (gfc_constructor * 
 
 /* Show an expression.  */
 
-static void
+void
 gfc_show_expr (gfc_expr * p)
 {
   const char *c;
@@ -534,7 +529,7 @@ gfc_show_expr (gfc_expr * p)
 /* Show symbol attributes.  The flavor and intent are followed by
    whatever single bit attributes are present.  */
 
-static void
+void
 gfc_show_attr (symbol_attribute * attr)
 {
 
@@ -599,7 +594,7 @@ gfc_show_attr (symbol_attribute * attr)
 
 /* Show components of a derived type.  */
 
-static void
+void
 gfc_show_components (gfc_symbol * sym)
 {
   gfc_component *c;
@@ -626,7 +621,7 @@ gfc_show_components (gfc_symbol * sym)
    specific interfaces associated with a generic symbol is done within
    that symbol.  */
 
-static void
+void
 gfc_show_symbol (gfc_symbol * sym)
 {
   gfc_formal_arglist *formal;
@@ -790,7 +785,7 @@ static void gfc_show_code_node (int leve
 /* Show a list of code structures.  Mutually recursive with
    gfc_show_code_node().  */
 
-static void
+void
 gfc_show_code (int level, gfc_code * c)
 {
 
@@ -798,7 +793,7 @@ gfc_show_code (int level, gfc_code * c)
     gfc_show_code_node (level, c);
 }
 
-static void
+void
 gfc_show_namelist (gfc_namelist *n)
 {
   for (; n->next; n = n->next)
@@ -1689,7 +1684,7 @@ gfc_show_code_node (int level, gfc_code 
 
 /* Show an equivalence chain.  */
 
-static void
+void
 gfc_show_equiv (gfc_equiv *eq)
 {
   show_indent ();
Index: gfortran.h
===================================================================
--- gfortran.h	(revision 117643)
+++ gfortran.h	(working copy)
@@ -2114,7 +2114,20 @@ void gfc_insert_bbt (void *, void *, com
 void gfc_delete_bbt (void *, void *, compare_fn);
 
 /* dump-parse-tree.c */
+void gfc_show_actual_arglist (gfc_actual_arglist *);
+void gfc_show_array_ref (gfc_array_ref *);
+void gfc_show_array_spec (gfc_array_spec *);
+void gfc_show_attr (symbol_attribute *);
+void gfc_show_code (int, gfc_code *);
+void gfc_show_components (gfc_symbol *);
+void gfc_show_constructor (gfc_constructor *);
+void gfc_show_equiv (gfc_equiv *);
+void gfc_show_expr (gfc_expr *);
+void gfc_show_namelist (gfc_namelist *);
 void gfc_show_namespace (gfc_namespace *);
+void gfc_show_ref (gfc_ref *);
+void gfc_show_symbol (gfc_symbol *);
+void gfc_show_typespec (gfc_typespec *);
 
 /* parse.c */
 try gfc_parse_file (void);


More information about the Fortran mailing list