This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[gfortran] Dump equivalence relationships


Patch below adds equivalence relationships to the output of -fdump-parse-tree.

Tested on i686-linux. Applied to mainline.

Paul

2004-05-22  Pau Brook  <paul@codesourcery.com>

	* dump-parse-tree.c (gfc_show_equiv): New function.
	(gfc_show_namespace): Use it.

Index: dump-parse-tree.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/dump-parse-tree.c,v
retrieving revision 1.4
diff -u -p -r1.4 dump-parse-tree.c
--- a/dump-parse-tree.c	14 May 2004 23:11:46 -0000	1.4
+++ b/dump-parse-tree.c	22 May 2004 15:49:22 -0000
@@ -1384,6 +1384,23 @@ gfc_show_code_node (int level, gfc_code 
 }
 
 
+/* Show and equivalence chain.  */
+
+static void
+gfc_show_equiv (gfc_equiv *eq)
+{
+  show_indent ();
+  gfc_status ("Equivalence: ");
+  while (eq)
+    {
+      gfc_show_expr (eq->expr);
+      eq = eq->eq;
+      if (eq)
+	gfc_status (", ");
+    }
+}
+
+    
 /* Show a freakin' whole namespace.  */
 
 void
@@ -1392,6 +1409,7 @@ gfc_show_namespace (gfc_namespace * ns)
   gfc_interface *intr;
   gfc_namespace *save;
   gfc_intrinsic_op op;
+  gfc_equiv *eq;
   int i;
 
   save = gfc_current_ns;
@@ -1450,6 +1468,9 @@ gfc_show_namespace (gfc_namespace * ns)
 	  gfc_traverse_user_op (ns, show_uop);
 	}
     }
+  
+  for (eq = ns->equiv; eq; eq = eq->next)
+    gfc_show_equiv (eq);
 
   gfc_status_char ('\n');
   gfc_status_char ('\n');


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]