[BC] Patch: FYI: no Miranda methods in BC mode

Tom Tromey tromey@redhat.com
Fri Nov 5 22:59:00 GMT 2004


I'm checking this in on the BC branch.

With indirect dispatch, there is no need to add Miranda methods to the
`methods' table of a class.  In fact, trying to do so can mess things
up, as we may end up with bogus entries.  This occurred while
compiling Eclipse 3.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* class.c (layout_class_methods): Don't add Miranda methods when
	using indirect dispatch.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.180.2.17
diff -u -r1.180.2.17 class.c
--- class.c 5 Nov 2004 19:30:05 -0000 1.180.2.17
+++ class.c 5 Nov 2004 20:19:24 -0000
@@ -2260,7 +2261,8 @@
     dtable_count = integer_zero_node;
 
   type_name = TYPE_NAME (this_class);
-  if (CLASS_ABSTRACT (type_name) || CLASS_INTERFACE (type_name))
+  if (!flag_indirect_dispatch
+      && (CLASS_ABSTRACT (type_name) || CLASS_INTERFACE (type_name)))
     {
       /* An abstract class can have methods which are declared only in
 	 an implemented interface.  These are called "Miranda



More information about the Gcc-patches mailing list