This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[gcjx] Patch: FYI: lay out interfaces as well


I'm checking this in on the gcjx branch.

When laying out a class we must also lay out its interfaces.
Otherwise, we can end up referring to an unmapped method.

Tom

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

	* builtins.cc (lay_out_class): Lay out interfaces.

Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.21
diff -u -r1.1.2.21 builtins.cc
--- builtins.cc 9 Mar 2005 02:19:09 -0000 1.1.2.21
+++ builtins.cc 24 Mar 2005 02:07:20 -0000
@@ -554,10 +554,20 @@
 
   tree klass_record = TREE_TYPE (klass_tree);
 
+  // Lay out superclasses and interfaces.
   tree super_record = NULL_TREE;
   if (klass->get_superclass () != NULL)
     super_record = TREE_TYPE (lay_out_class (klass->get_superclass ()));
 
+  std::list<ref_forwarding_type> &ifaces (klass->get_interfaces ());
+  for (std::list<ref_forwarding_type>::const_iterator i = ifaces.begin ();
+       i != ifaces.end ();
+       ++i)
+    {
+      model_class *ik = assert_cast<model_class *> ((*i)->type ());
+      lay_out_class (ik);
+    }
+
   // Ensure all non-static methods have been added.
   std::list<ref_method> methods = klass->get_methods ();
   for (std::list<ref_method>::const_iterator i = methods.begin ();


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