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]

Patch submission


Hi:

I'd like to submit a patch for egcs-snapshot.  Could this also go into
gcc-3.0 release?  Thanks!

					Mike Yang
					yang@research.att.com

Description
===========

- added class inheritance information to -fdump-translation-unit output
- added access control information to base class as well as member
  fields and member functions.
- added template parameter information to -fdump-translation-unit output

ChangeLog
=========

2001-03-13  Mike Yang  <yang@research.att.com>

	* dump.c (cp_dump_tree): For RECORD_TYPE and UNION_TYPE
          output, add list of base classes and access control
          information.  Add access control information for member
          fields and functions (cases FIELD_DECL: and FUNCTION_DECL:).
          Add template parameter list (case TEMPLATE_DECL:).

	  

Tested platform
===============
linux-i386

Patch
=====
--- dump.c	Tue Mar 13 13:55:23 2001
+++ dump-new.c	Wed Feb 14 16:31:09 2001
@@ -82,13 +82,49 @@ 
 	}
 
       dump_child ("vfld", TYPE_VFIELD (t));
+      {
+	/* inheritance information */
+	int i;
+	int n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
+	tree binfos = TYPE_BINFO_BASETYPES (t);
+	
+	for (i = 0; i < n_baseclasses; ++i)
+	{
+	  tree base_binfo = TREE_VEC_ELT (binfos, i);
+	  dump_child ("base", BINFO_TYPE(base_binfo));
+	  if (TREE_VIA_VIRTUAL (base_binfo)) 
+	    dump_string(di, "virtual");
+	  if (TREE_VIA_PUBLIC(base_binfo))
+	    dump_string(di, "public");
+	  else if (TREE_VIA_PROTECTED(base_binfo))
+	    dump_string (di, "protected");
+	  else
+	    dump_string (di, "private");
+	}
+      }
+      break;
+
+    case FIELD_DECL:
+      if (TREE_PROTECTED(t))
+	dump_string (di, "protected");
+      else if (TREE_PRIVATE(t))
+	dump_string (di, "private");
+      else
+	dump_string (di, "public");
       break;
 
     case FUNCTION_DECL:
       if (!DECL_THUNK_P (t))
 	{
-	  if (DECL_FUNCTION_MEMBER_P (t))
+	  if (DECL_FUNCTION_MEMBER_P (t)) {
 	    dump_string (di, "member");
+	    if (TREE_PROTECTED(t))
+	      dump_string (di, "protected");
+	    else if (TREE_PRIVATE(t))
+	      dump_string (di, "private");
+	    else
+	      dump_string (di, "public");
+	  }
 	  if (DECL_CONSTRUCTOR_P (t))
 	    dump_string (di, "constructor");
 	  if (DECL_DESTRUCTOR_P (t))
@@ -132,6 +168,7 @@ cp_dump_tree (di, t)
       dump_child ("rslt", DECL_TEMPLATE_RESULT (t));
       dump_child ("inst", DECL_TEMPLATE_INSTANTIATIONS (t));
       dump_child ("spcs", DECL_TEMPLATE_SPECIALIZATIONS (t));
+      dump_child ("prms", DECL_TEMPLATE_PARMS (t));
       break;
 
     case OVERLOAD:


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